forked from jfcote87/esign
-
Notifications
You must be signed in to change notification settings - Fork 0
/
accounts.go
1610 lines (1415 loc) · 56.3 KB
/
accounts.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
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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// 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 accounts implements the DocuSign SDK
// category Accounts.
//
// Use the Account category for various account management tasks including:
//
// * Programmatically creating and deleting accounts.
// * Getting information about an account and its capabilities.
// * Branding the account with custom colors, message text, and more.
// * Account charges.
//
// The Account category also includes end points for listing the recipient names associated with an email address that was used by the account. For example, a single email address is often shared by mulitple members of a family.
//
// Service Api documentation may be found at:
// https://developers.docusign.com/esign-rest-api/reference/Accounts
// Usage example:
//
// import (
// "github.com/ICGGroup/esign"
// "github.com/ICGGroup/esign/v2.1/accounts"
// "github.com/ICGGroup/esign/v2.1/model"
// )
// ...
// accountsService := accounts.New(esignCredential)
package accounts // import "github.com/ICGGroup/esign/v2.1/accounts"
import (
"context"
"fmt"
"io"
"net/url"
"strings"
"github.com/ICGGroup/esign"
"github.com/ICGGroup/esign/v2.1/model"
)
// Service implements DocuSign Accounts Category API operations
type Service struct {
credential esign.Credential
}
// New initializes a accounts service using cred to authorize ops.
func New(cred esign.Credential) *Service {
return &Service{credential: cred}
}
// BrandsCreate creates one or more brand profiles for an account.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/create
//
// SDK Method Accounts::createBrand
func (s *Service) BrandsCreate(brand *model.Brand) *BrandsCreateOp {
return &BrandsCreateOp{
Credential: s.credential,
Method: "POST",
Path: "brands",
Payload: brand,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsCreateOp implements DocuSign API SDK Accounts::createBrand
type BrandsCreateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsCreateOp) Do(ctx context.Context) (*model.BrandsResponse, error) {
var res *model.BrandsResponse
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// BrandsDelete deletes a brand.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/delete
//
// SDK Method Accounts::deleteBrand
func (s *Service) BrandsDelete(brandID string) *BrandsDeleteOp {
return &BrandsDeleteOp{
Credential: s.credential,
Method: "DELETE",
Path: strings.Join([]string{"brands", brandID}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsDeleteOp implements DocuSign API SDK Accounts::deleteBrand
type BrandsDeleteOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsDeleteOp) Do(ctx context.Context) error {
return ((*esign.Op)(op)).Do(ctx, nil)
}
// BrandsDeleteList deletes one or more brand profiles.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/deletelist
//
// SDK Method Accounts::deleteBrands
func (s *Service) BrandsDeleteList(brandsRequest *model.BrandsRequest) *BrandsDeleteListOp {
return &BrandsDeleteListOp{
Credential: s.credential,
Method: "DELETE",
Path: "brands",
Payload: brandsRequest,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsDeleteListOp implements DocuSign API SDK Accounts::deleteBrands
type BrandsDeleteListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsDeleteListOp) Do(ctx context.Context) (*model.BrandsResponse, error) {
var res *model.BrandsResponse
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// BrandsDeleteLogo deletes a brand logo.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/deletelogo
//
// SDK Method Accounts::deleteBrandLogoByType
func (s *Service) BrandsDeleteLogo(brandID string, logoType string) *BrandsDeleteLogoOp {
return &BrandsDeleteLogoOp{
Credential: s.credential,
Method: "DELETE",
Path: strings.Join([]string{"brands", brandID, "logos", logoType}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsDeleteLogoOp implements DocuSign API SDK Accounts::deleteBrandLogoByType
type BrandsDeleteLogoOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsDeleteLogoOp) Do(ctx context.Context) error {
return ((*esign.Op)(op)).Do(ctx, nil)
}
// BrandsGet gets information about a brand.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/get
//
// SDK Method Accounts::getBrand
func (s *Service) BrandsGet(brandID string) *BrandsGetOp {
return &BrandsGetOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"brands", brandID}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsGetOp implements DocuSign API SDK Accounts::getBrand
type BrandsGetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsGetOp) Do(ctx context.Context) (*model.Brand, error) {
var res *model.Brand
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// IncludeExternalReferences when **true**, the landing pages and links associated with the brand are included in the response.
func (op *BrandsGetOp) IncludeExternalReferences() *BrandsGetOp {
if op != nil {
op.QueryOpts.Set("include_external_references", "true")
}
return op
}
// IncludeLogos when **true**, the URIs for the logos associated with the brand are included in the response.
func (op *BrandsGetOp) IncludeLogos() *BrandsGetOp {
if op != nil {
op.QueryOpts.Set("include_logos", "true")
}
return op
}
// BrandsGetExportFile export a brand.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/getexportfile
//
// SDK Method Accounts::getBrandExportFile
func (s *Service) BrandsGetExportFile(brandID string) *BrandsGetExportFileOp {
return &BrandsGetExportFileOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"brands", brandID, "file"}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsGetExportFileOp implements DocuSign API SDK Accounts::getBrandExportFile
type BrandsGetExportFileOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsGetExportFileOp) Do(ctx context.Context) (*esign.Download, error) {
var res *esign.Download
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// BrandsGetLogo gets a brand logo.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/getlogo
//
// SDK Method Accounts::getBrandLogoByType
func (s *Service) BrandsGetLogo(brandID string, logoType string) *BrandsGetLogoOp {
return &BrandsGetLogoOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"brands", brandID, "logos", logoType}, "/"),
Accept: "image/png",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsGetLogoOp implements DocuSign API SDK Accounts::getBrandLogoByType
type BrandsGetLogoOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsGetLogoOp) Do(ctx context.Context) (*esign.Download, error) {
var res *esign.Download
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// BrandsGetResource returns a branding resource file.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/getresource
//
// SDK Method Accounts::getBrandResourcesByContentType
func (s *Service) BrandsGetResource(brandID string, resourceContentType string) *BrandsGetResourceOp {
return &BrandsGetResourceOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"brands", brandID, "resources", resourceContentType}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsGetResourceOp implements DocuSign API SDK Accounts::getBrandResourcesByContentType
type BrandsGetResourceOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsGetResourceOp) Do(ctx context.Context) (*esign.Download, error) {
var res *esign.Download
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Langcode is the ISO 3166-1 alpha-2 codes for the languages that the brand supports.
func (op *BrandsGetResourceOp) Langcode(val string) *BrandsGetResourceOp {
if op != nil {
op.QueryOpts.Set("langcode", val)
}
return op
}
// ReturnMaster specifies which resource file data to return. When **true**, only the master resource file is returned. When **false**, only the elements that you modified are returned.
func (op *BrandsGetResourceOp) ReturnMaster() *BrandsGetResourceOp {
if op != nil {
op.QueryOpts.Set("return_master", "true")
}
return op
}
// BrandsList gets a list of brands.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/list
//
// SDK Method Accounts::listBrands
func (s *Service) BrandsList() *BrandsListOp {
return &BrandsListOp{
Credential: s.credential,
Method: "GET",
Path: "brands",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsListOp implements DocuSign API SDK Accounts::listBrands
type BrandsListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsListOp) Do(ctx context.Context) (*model.BrandsResponse, error) {
var res *model.BrandsResponse
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// ExcludeDistributorBrand when **true**, excludes distributor brand information from the response set.
func (op *BrandsListOp) ExcludeDistributorBrand() *BrandsListOp {
if op != nil {
op.QueryOpts.Set("exclude_distributor_brand", "true")
}
return op
}
// IncludeLogos when **true**, the URIs for the logos associated with the brand are included in the response.
func (op *BrandsListOp) IncludeLogos() *BrandsListOp {
if op != nil {
op.QueryOpts.Set("include_logos", "true")
}
return op
}
// BrandsListResources returns metadata about the branding resources for an account.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/listresources
//
// SDK Method Accounts::getBrandResources
func (s *Service) BrandsListResources(brandID string) *BrandsListResourcesOp {
return &BrandsListResourcesOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"brands", brandID, "resources"}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsListResourcesOp implements DocuSign API SDK Accounts::getBrandResources
type BrandsListResourcesOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsListResourcesOp) Do(ctx context.Context) (*model.BrandResourcesList, error) {
var res *model.BrandResourcesList
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// BrandsUpdate updates an existing brand.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/update
//
// SDK Method Accounts::updateBrand
func (s *Service) BrandsUpdate(brandID string, brand *model.Brand) *BrandsUpdateOp {
return &BrandsUpdateOp{
Credential: s.credential,
Method: "PUT",
Path: strings.Join([]string{"brands", brandID}, "/"),
Payload: brand,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsUpdateOp implements DocuSign API SDK Accounts::updateBrand
type BrandsUpdateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsUpdateOp) Do(ctx context.Context) (*model.Brand, error) {
var res *model.Brand
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// BrandsUpdateLogo updates a brand logo.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/updatelogo
//
// SDK Method Accounts::updateBrandLogoByType
func (s *Service) BrandsUpdateLogo(brandID string, logoType string, logoFileBytes []byte) *BrandsUpdateLogoOp {
return &BrandsUpdateLogoOp{
Credential: s.credential,
Method: "PUT",
Path: strings.Join([]string{"brands", brandID, "logos", logoType}, "/"),
Payload: logoFileBytes,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsUpdateLogoOp implements DocuSign API SDK Accounts::updateBrandLogoByType
type BrandsUpdateLogoOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsUpdateLogoOp) Do(ctx context.Context) error {
return ((*esign.Op)(op)).Do(ctx, nil)
}
// BrandsUpdateResource updates a branding resource file.
// If media is an io.ReadCloser, Do() will close media.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountbrands/updateresource
//
// SDK Method Accounts::updateBrandResourcesByContentType
func (s *Service) BrandsUpdateResource(brandID string, resourceContentType string, media io.Reader, mimeType string) *BrandsUpdateResourceOp {
return &BrandsUpdateResourceOp{
Credential: s.credential,
Method: "PUT",
Path: strings.Join([]string{"brands", brandID, "resources", resourceContentType}, "/"),
Payload: &esign.UploadFile{Reader: media, ContentType: mimeType},
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// BrandsUpdateResourceOp implements DocuSign API SDK Accounts::updateBrandResourcesByContentType
type BrandsUpdateResourceOp esign.Op
// Do executes the op. A nil context will return error.
func (op *BrandsUpdateResourceOp) Do(ctx context.Context) (*model.BrandResources, error) {
var res *model.BrandResources
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// ConsumerDisclosuresGet gets the Electronic Record and Signature Disclosure.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountconsumerdisclosures/get
//
// SDK Method Accounts::getConsumerDisclosure
func (s *Service) ConsumerDisclosuresGet(langCode string) *ConsumerDisclosuresGetOp {
return &ConsumerDisclosuresGetOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"consumer_disclosure", langCode}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// ConsumerDisclosuresGetOp implements DocuSign API SDK Accounts::getConsumerDisclosure
type ConsumerDisclosuresGetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *ConsumerDisclosuresGetOp) Do(ctx context.Context) (*model.ConsumerDisclosure, error) {
var res *model.ConsumerDisclosure
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// ConsumerDisclosuresGetDefault gets the Electronic Record and Signature Disclosure for the account.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountconsumerdisclosures/getdefault
//
// SDK Method Accounts::getConsumerDisclosureDefault
func (s *Service) ConsumerDisclosuresGetDefault() *ConsumerDisclosuresGetDefaultOp {
return &ConsumerDisclosuresGetDefaultOp{
Credential: s.credential,
Method: "GET",
Path: "consumer_disclosure",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// ConsumerDisclosuresGetDefaultOp implements DocuSign API SDK Accounts::getConsumerDisclosureDefault
type ConsumerDisclosuresGetDefaultOp esign.Op
// Do executes the op. A nil context will return error.
func (op *ConsumerDisclosuresGetDefaultOp) Do(ctx context.Context) (*model.ConsumerDisclosure, error) {
var res *model.ConsumerDisclosure
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// LangCode specifies the language used in the response. The supported languages, with the language value shown in parenthesis, are: Arabic (ar), Bulgarian (bg), Czech (cs), Chinese Simplified (zh_CN), Chinese Traditional (zh_TW), Croatian (hr), Danish (da), Dutch (nl), English US (en), English UK (en_GB), Estonian (et), Farsi (fa), Finnish (fi), French (fr), French Canada (fr_CA), German (de), Greek (el), Hebrew (he), Hindi (hi), Hungarian (hu), Bahasa Indonesia (id), Italian (it), Japanese (ja), Korean (ko), Latvian (lv), Lithuanian (lt), Bahasa Melayu (ms), Norwegian (no), Polish (pl), Portuguese (pt), Portuguese Brazil (pt_BR), Romanian (ro), Russian (ru), Serbian (sr), Slovak (sk), Slovenian (sl), Spanish (es),Spanish Latin America (es_MX), Swedish (sv), Thai (th), Turkish (tr), Ukrainian (uk), and Vietnamese (vi).
//
// Additionally, the value can be set to `browser` to automatically detect the browser language being used by the viewer and display the disclosure in that language.
func (op *ConsumerDisclosuresGetDefaultOp) LangCode(val string) *ConsumerDisclosuresGetDefaultOp {
if op != nil {
op.QueryOpts.Set("langCode", val)
}
return op
}
// ConsumerDisclosuresUpdate update Consumer Disclosure.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountconsumerdisclosures/update
//
// SDK Method Accounts::updateConsumerDisclosure
func (s *Service) ConsumerDisclosuresUpdate(langCode string, envelopeConsumerDisclosures *model.ConsumerDisclosure) *ConsumerDisclosuresUpdateOp {
return &ConsumerDisclosuresUpdateOp{
Credential: s.credential,
Method: "PUT",
Path: strings.Join([]string{"consumer_disclosure", langCode}, "/"),
Payload: envelopeConsumerDisclosures,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// ConsumerDisclosuresUpdateOp implements DocuSign API SDK Accounts::updateConsumerDisclosure
type ConsumerDisclosuresUpdateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *ConsumerDisclosuresUpdateOp) Do(ctx context.Context) (*model.ConsumerDisclosure, error) {
var res *model.ConsumerDisclosure
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// IncludeMetadata when set to **true**, the response includes metadata indicating which properties are editable.
func (op *ConsumerDisclosuresUpdateOp) IncludeMetadata(val string) *ConsumerDisclosuresUpdateOp {
if op != nil {
op.QueryOpts.Set("include_metadata", val)
}
return op
}
// CustomFieldsCreate creates an acount custom field.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountcustomfields/create
//
// SDK Method Accounts::createCustomField
func (s *Service) CustomFieldsCreate(customField *model.CustomField) *CustomFieldsCreateOp {
return &CustomFieldsCreateOp{
Credential: s.credential,
Method: "POST",
Path: "custom_fields",
Payload: customField,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// CustomFieldsCreateOp implements DocuSign API SDK Accounts::createCustomField
type CustomFieldsCreateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *CustomFieldsCreateOp) Do(ctx context.Context) (*model.CustomFields, error) {
var res *model.CustomFields
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// ApplyToTemplates set the call query parameter apply_to_templates
func (op *CustomFieldsCreateOp) ApplyToTemplates() *CustomFieldsCreateOp {
if op != nil {
op.QueryOpts.Set("apply_to_templates", "true")
}
return op
}
// CustomFieldsDelete delete an existing account custom field.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountcustomfields/delete
//
// SDK Method Accounts::deleteCustomField
func (s *Service) CustomFieldsDelete(customFieldID string) *CustomFieldsDeleteOp {
return &CustomFieldsDeleteOp{
Credential: s.credential,
Method: "DELETE",
Path: strings.Join([]string{"custom_fields", customFieldID}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// CustomFieldsDeleteOp implements DocuSign API SDK Accounts::deleteCustomField
type CustomFieldsDeleteOp esign.Op
// Do executes the op. A nil context will return error.
func (op *CustomFieldsDeleteOp) Do(ctx context.Context) error {
return ((*esign.Op)(op)).Do(ctx, nil)
}
// ApplyToTemplates set the call query parameter apply_to_templates
func (op *CustomFieldsDeleteOp) ApplyToTemplates() *CustomFieldsDeleteOp {
if op != nil {
op.QueryOpts.Set("apply_to_templates", "true")
}
return op
}
// CustomFieldsList gets a list of custom fields associated with the account.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountcustomfields/list
//
// SDK Method Accounts::listCustomFields
func (s *Service) CustomFieldsList() *CustomFieldsListOp {
return &CustomFieldsListOp{
Credential: s.credential,
Method: "GET",
Path: "custom_fields",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// CustomFieldsListOp implements DocuSign API SDK Accounts::listCustomFields
type CustomFieldsListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *CustomFieldsListOp) Do(ctx context.Context) (*model.CustomFields, error) {
var res *model.CustomFields
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// CustomFieldsUpdate updates an existing account custom field.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountcustomfields/update
//
// SDK Method Accounts::updateCustomField
func (s *Service) CustomFieldsUpdate(customFieldID string, customField *model.CustomField) *CustomFieldsUpdateOp {
return &CustomFieldsUpdateOp{
Credential: s.credential,
Method: "PUT",
Path: strings.Join([]string{"custom_fields", customFieldID}, "/"),
Payload: customField,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// CustomFieldsUpdateOp implements DocuSign API SDK Accounts::updateCustomField
type CustomFieldsUpdateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *CustomFieldsUpdateOp) Do(ctx context.Context) (*model.CustomFields, error) {
var res *model.CustomFields
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// ApplyToTemplates set the call query parameter apply_to_templates
func (op *CustomFieldsUpdateOp) ApplyToTemplates() *CustomFieldsUpdateOp {
if op != nil {
op.QueryOpts.Set("apply_to_templates", "true")
}
return op
}
// PasswordRulesGet get the password rules
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountpasswordrules/get
//
// SDK Method Accounts::getAccountPasswordRules
func (s *Service) PasswordRulesGet() *PasswordRulesGetOp {
return &PasswordRulesGetOp{
Credential: s.credential,
Method: "GET",
Path: "settings/password_rules",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// PasswordRulesGetOp implements DocuSign API SDK Accounts::getAccountPasswordRules
type PasswordRulesGetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *PasswordRulesGetOp) Do(ctx context.Context) (*model.AccountPasswordRules, error) {
var res *model.AccountPasswordRules
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// PasswordRulesGetForUser get membership account password rules
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountpasswordrules/getforuser
//
// SDK Method Accounts::getPasswordRules
func (s *Service) PasswordRulesGetForUser() *PasswordRulesGetForUserOp {
return &PasswordRulesGetForUserOp{
Credential: s.credential,
Method: "GET",
Path: "/v2.1/current_user/password_rules",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// PasswordRulesGetForUserOp implements DocuSign API SDK Accounts::getPasswordRules
type PasswordRulesGetForUserOp esign.Op
// Do executes the op. A nil context will return error.
func (op *PasswordRulesGetForUserOp) Do(ctx context.Context) (*model.UserPasswordRules, error) {
var res *model.UserPasswordRules
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// PasswordRulesUpdate update the password rules
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountpasswordrules/update
//
// SDK Method Accounts::updateAccountPasswordRules
func (s *Service) PasswordRulesUpdate(accountPasswordRules *model.AccountPasswordRules) *PasswordRulesUpdateOp {
return &PasswordRulesUpdateOp{
Credential: s.credential,
Method: "PUT",
Path: "settings/password_rules",
Payload: accountPasswordRules,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// PasswordRulesUpdateOp implements DocuSign API SDK Accounts::updateAccountPasswordRules
type PasswordRulesUpdateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *PasswordRulesUpdateOp) Do(ctx context.Context) (*model.AccountPasswordRules, error) {
var res *model.AccountPasswordRules
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// PermissionProfilesCreate creates a new permission profile for an account.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountpermissionprofiles/create
//
// SDK Method Accounts::createPermissionProfile
func (s *Service) PermissionProfilesCreate(accountPermissionProfiles *model.PermissionProfile) *PermissionProfilesCreateOp {
return &PermissionProfilesCreateOp{
Credential: s.credential,
Method: "POST",
Path: "permission_profiles",
Payload: accountPermissionProfiles,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// PermissionProfilesCreateOp implements DocuSign API SDK Accounts::createPermissionProfile
type PermissionProfilesCreateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *PermissionProfilesCreateOp) Do(ctx context.Context) (*model.PermissionProfile, error) {
var res *model.PermissionProfile
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Include is a comma-separated list of additional properties to return in the response. The only valid value for this request is `metadata`, which returns metadata indicating whether the properties associated with the account permission profile are editable.
func (op *PermissionProfilesCreateOp) Include(val ...string) *PermissionProfilesCreateOp {
if op != nil {
op.QueryOpts.Set("include", strings.Join(val, ","))
}
return op
}
// PermissionProfilesDelete deletes a permission profile from an account.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountpermissionprofiles/delete
//
// SDK Method Accounts::deletePermissionProfile
func (s *Service) PermissionProfilesDelete(permissionProfileID string) *PermissionProfilesDeleteOp {
return &PermissionProfilesDeleteOp{
Credential: s.credential,
Method: "DELETE",
Path: strings.Join([]string{"permission_profiles", permissionProfileID}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// PermissionProfilesDeleteOp implements DocuSign API SDK Accounts::deletePermissionProfile
type PermissionProfilesDeleteOp esign.Op
// Do executes the op. A nil context will return error.
func (op *PermissionProfilesDeleteOp) Do(ctx context.Context) error {
return ((*esign.Op)(op)).Do(ctx, nil)
}
// PermissionProfilesGet returns a permission profile for an account.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountpermissionprofiles/get
//
// SDK Method Accounts::getPermissionProfile
func (s *Service) PermissionProfilesGet(permissionProfileID string) *PermissionProfilesGetOp {
return &PermissionProfilesGetOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"permission_profiles", permissionProfileID}, "/"),
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// PermissionProfilesGetOp implements DocuSign API SDK Accounts::getPermissionProfile
type PermissionProfilesGetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *PermissionProfilesGetOp) Do(ctx context.Context) (*model.PermissionProfile, error) {
var res *model.PermissionProfile
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Include is a comma-separated list of additional properties to return in the response. The only valid value for this request is `metadata`, which returns metadata indicating whether the properties associated with the account permission profile are editable.
func (op *PermissionProfilesGetOp) Include(val ...string) *PermissionProfilesGetOp {
if op != nil {
op.QueryOpts.Set("include", strings.Join(val, ","))
}
return op
}
// PermissionProfilesList gets a list of permission profiles.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountpermissionprofiles/list
//
// SDK Method Accounts::listPermissions
func (s *Service) PermissionProfilesList() *PermissionProfilesListOp {
return &PermissionProfilesListOp{
Credential: s.credential,
Method: "GET",
Path: "permission_profiles",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// PermissionProfilesListOp implements DocuSign API SDK Accounts::listPermissions
type PermissionProfilesListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *PermissionProfilesListOp) Do(ctx context.Context) (*model.PermissionProfileInformation, error) {
var res *model.PermissionProfileInformation
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Include is a comma-separated list of additional properties to return in the response. Valid values are:
//
// - `user_count`: The total number of users associated with the permission profile.
// - `closed_users`: Includes closed users in the `user_count`.
// - `account_management`: The account management settings.
// - `metadata`: Metadata indicating whether the properties associated with the account permission profile are editable.
//
// Example: `user_count,closed_users`
func (op *PermissionProfilesListOp) Include(val string) *PermissionProfilesListOp {
if op != nil {
op.QueryOpts.Set("include", val)
}
return op
}
// PermissionProfilesUpdate updates a permission profile.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountpermissionprofiles/update
//
// SDK Method Accounts::updatePermissionProfile
func (s *Service) PermissionProfilesUpdate(permissionProfileID string, accountPermissionProfiles *model.PermissionProfile) *PermissionProfilesUpdateOp {
return &PermissionProfilesUpdateOp{
Credential: s.credential,
Method: "PUT",
Path: strings.Join([]string{"permission_profiles", permissionProfileID}, "/"),
Payload: accountPermissionProfiles,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// PermissionProfilesUpdateOp implements DocuSign API SDK Accounts::updatePermissionProfile
type PermissionProfilesUpdateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *PermissionProfilesUpdateOp) Do(ctx context.Context) (*model.PermissionProfile, error) {
var res *model.PermissionProfile
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// Include is a comma-separated list of additional properties to return in the response. The only valid value for this request is `metadata`, which returns metadata indicating whether the properties associated with the account permission profile are editable.
func (op *PermissionProfilesUpdateOp) Include(val ...string) *PermissionProfilesUpdateOp {
if op != nil {
op.QueryOpts.Set("include", strings.Join(val, ","))
}
return op
}
// SignatureProvidersList returns Account available signature providers for specified account.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountsignatureproviders/list
//
// SDK Method Accounts::listSignatureProviders
func (s *Service) SignatureProvidersList() *SignatureProvidersListOp {
return &SignatureProvidersListOp{
Credential: s.credential,
Method: "GET",
Path: "signatureProviders",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// SignatureProvidersListOp implements DocuSign API SDK Accounts::listSignatureProviders
type SignatureProvidersListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *SignatureProvidersListOp) Do(ctx context.Context) (*model.AccountSignatureProviders, error) {
var res *model.AccountSignatureProviders
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// TabSettingsGet returns tab settings list for specified account
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accounttabsettings/get
//
// SDK Method Accounts::getAccountTabSettings
func (s *Service) TabSettingsGet() *TabSettingsGetOp {
return &TabSettingsGetOp{
Credential: s.credential,
Method: "GET",
Path: "settings/tabs",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// TabSettingsGetOp implements DocuSign API SDK Accounts::getAccountTabSettings
type TabSettingsGetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *TabSettingsGetOp) Do(ctx context.Context) (*model.TabAccountSettings, error) {
var res *model.TabAccountSettings
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// TabSettingsUpdate modifies tab settings for specified account
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accounttabsettings/update
//
// SDK Method Accounts::updateAccountTabSettings
func (s *Service) TabSettingsUpdate(accountTabSettings *model.TabAccountSettings) *TabSettingsUpdateOp {
return &TabSettingsUpdateOp{
Credential: s.credential,
Method: "PUT",
Path: "settings/tabs",
Payload: accountTabSettings,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// TabSettingsUpdateOp implements DocuSign API SDK Accounts::updateAccountTabSettings
type TabSettingsUpdateOp esign.Op
// Do executes the op. A nil context will return error.
func (op *TabSettingsUpdateOp) Do(ctx context.Context) (*model.TabAccountSettings, error) {
var res *model.TabAccountSettings
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// WatermarksGet get watermark information.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountwatermarks/get
//
// SDK Method Accounts::getWatermark
func (s *Service) WatermarksGet() *WatermarksGetOp {
return &WatermarksGetOp{
Credential: s.credential,
Method: "GET",
Path: "watermark",
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// WatermarksGetOp implements DocuSign API SDK Accounts::getWatermark
type WatermarksGetOp esign.Op
// Do executes the op. A nil context will return error.
func (op *WatermarksGetOp) Do(ctx context.Context) (*model.Watermark, error) {
var res *model.Watermark
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// WatermarksPreview get watermark preview.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountwatermarks/preview
//
// SDK Method Accounts::getWatermarkPreview
func (s *Service) WatermarksPreview(accountWatermarks *model.Watermark) *WatermarksPreviewOp {
return &WatermarksPreviewOp{
Credential: s.credential,
Method: "PUT",
Path: "watermark/preview",
Payload: accountWatermarks,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}
// WatermarksPreviewOp implements DocuSign API SDK Accounts::getWatermarkPreview
type WatermarksPreviewOp esign.Op
// Do executes the op. A nil context will return error.
func (op *WatermarksPreviewOp) Do(ctx context.Context) (*model.Watermark, error) {
var res *model.Watermark
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// WatermarksUpdate update watermark information.
//
// https://developers.docusign.com/esign-rest-api/reference/accounts/accountwatermarks/update
//
// SDK Method Accounts::updateWatermark
func (s *Service) WatermarksUpdate(accountWatermarks *model.Watermark) *WatermarksUpdateOp {
return &WatermarksUpdateOp{
Credential: s.credential,
Method: "PUT",
Path: "watermark",
Payload: accountWatermarks,
QueryOpts: make(url.Values),
Version: esign.VersionV21,
}
}