-
Notifications
You must be signed in to change notification settings - Fork 26
/
tasklists.go
executable file
·159 lines (139 loc) · 5.06 KB
/
tasklists.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
// Copyright 2022 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 tasklists implements the DocuSign SDK
// category TaskLists.
//
// Your administrator may also have created custom task list templates that can be added to rooms. If your administrator created room templates, those room templates may include task lists for you to use.
//
//
// Service Api documentation may be found at:
// https://developers.docusign.com/docs/rooms-api/reference/TaskLists
// Usage example:
//
// import (
// "github.com/jfcote87/esign"
// "github.com/jfcote87/esign/rooms"
// )
// ...
// tasklistsService := tasklists.New(esignCredential)
package tasklists // import "github.com/jfcote87/esignrooms//tasklists"
import (
"context"
"fmt"
"net/url"
"strings"
"github.com/jfcote87/esign"
"github.com/jfcote87/esign/rooms"
)
// Service implements DocuSign TaskLists API operations
type Service struct {
credential esign.Credential
}
// New initializes a tasklists service using cred to authorize ops.
func New(cred esign.Credential) *Service {
return &Service{credential: cred}
}
// GetTaskListTemplates gets task list templates.
//
// https://developers.docusign.com/docs/rooms-api/reference/tasklists/tasklisttemplates/gettasklisttemplates
//
// SDK Method TaskLists::GetTaskListTemplates
func (s *Service) GetTaskListTemplates() *GetTaskListTemplatesOp {
return &GetTaskListTemplatesOp{
Credential: s.credential,
Method: "GET",
Path: "task_list_templates",
Accept: "application/json",
QueryOpts: make(url.Values),
Version: esign.RoomsV2,
}
}
// GetTaskListTemplatesOp implements DocuSign API SDK TaskLists::GetTaskListTemplates
type GetTaskListTemplatesOp esign.Op
// Do executes the op. A nil context will return error.
func (op *GetTaskListTemplatesOp) Do(ctx context.Context) (*rooms.TaskListTemplateList, error) {
var res *rooms.TaskListTemplateList
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// StartPosition (Optional) The starting zero-based index position from which to start returning values. The default is `0`.
func (op *GetTaskListTemplatesOp) StartPosition(val int) *GetTaskListTemplatesOp {
if op != nil {
op.QueryOpts.Set("startPosition", fmt.Sprintf("%d", val))
}
return op
}
// Count (Optional) The number of results to return. This value must be a number between `1` and `100` (default).
func (op *GetTaskListTemplatesOp) Count(val int) *GetTaskListTemplatesOp {
if op != nil {
op.QueryOpts.Set("count", fmt.Sprintf("%d", val))
}
return op
}
// CreateTaskList applies a task list to a room.
//
// https://developers.docusign.com/docs/rooms-api/reference/tasklists/tasklists/createtasklist
//
// SDK Method TaskLists::CreateTaskList
func (s *Service) CreateTaskList(roomID string, body *rooms.TaskListForCreate) *CreateTaskListOp {
return &CreateTaskListOp{
Credential: s.credential,
Method: "POST",
Path: strings.Join([]string{"rooms", roomID, "task_lists"}, "/"),
Payload: body,
Accept: "application/json-patch+json, application/json, text/json, application/*+json",
QueryOpts: make(url.Values),
Version: esign.RoomsV2,
}
}
// CreateTaskListOp implements DocuSign API SDK TaskLists::CreateTaskList
type CreateTaskListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *CreateTaskListOp) Do(ctx context.Context) (*rooms.TaskList, error) {
var res *rooms.TaskList
return res, ((*esign.Op)(op)).Do(ctx, &res)
}
// DeleteTaskList deletes a task list from a room.
//
// https://developers.docusign.com/docs/rooms-api/reference/tasklists/tasklists/deletetasklist
//
// SDK Method TaskLists::DeleteTaskList
func (s *Service) DeleteTaskList(taskListID string) *DeleteTaskListOp {
return &DeleteTaskListOp{
Credential: s.credential,
Method: "DELETE",
Path: strings.Join([]string{"task_lists", taskListID}, "/"),
QueryOpts: make(url.Values),
Version: esign.RoomsV2,
}
}
// DeleteTaskListOp implements DocuSign API SDK TaskLists::DeleteTaskList
type DeleteTaskListOp esign.Op
// Do executes the op. A nil context will return error.
func (op *DeleteTaskListOp) Do(ctx context.Context) error {
return ((*esign.Op)(op)).Do(ctx, nil)
}
// GetTaskLists gets task lists for a room.
//
// https://developers.docusign.com/docs/rooms-api/reference/tasklists/tasklists/gettasklists
//
// SDK Method TaskLists::GetTaskLists
func (s *Service) GetTaskLists(roomID string) *GetTaskListsOp {
return &GetTaskListsOp{
Credential: s.credential,
Method: "GET",
Path: strings.Join([]string{"rooms", roomID, "task_lists"}, "/"),
Accept: "application/json",
QueryOpts: make(url.Values),
Version: esign.RoomsV2,
}
}
// GetTaskListsOp implements DocuSign API SDK TaskLists::GetTaskLists
type GetTaskListsOp esign.Op
// Do executes the op. A nil context will return error.
func (op *GetTaskListsOp) Do(ctx context.Context) (*rooms.TaskListSummaryList, error) {
var res *rooms.TaskListSummaryList
return res, ((*esign.Op)(op)).Do(ctx, &res)
}