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
|
// Code generated by msgraph-generate.go DO NOT EDIT.
package msgraph
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"github.com/yaegashi/msgraph.go/jsonx"
)
// BookingAppointmentCancelRequestParameter undocumented
type BookingAppointmentCancelRequestParameter struct {
// CancellationMessage undocumented
CancellationMessage *string `json:"cancellationMessage,omitempty"`
}
// BookingBusinessPublishRequestParameter undocumented
type BookingBusinessPublishRequestParameter struct {
}
// BookingBusinessUnpublishRequestParameter undocumented
type BookingBusinessUnpublishRequestParameter struct {
}
// Appointments returns request builder for BookingAppointment collection
func (b *BookingBusinessRequestBuilder) Appointments() *BookingBusinessAppointmentsCollectionRequestBuilder {
bb := &BookingBusinessAppointmentsCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/appointments"
return bb
}
// BookingBusinessAppointmentsCollectionRequestBuilder is request builder for BookingAppointment collection
type BookingBusinessAppointmentsCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for BookingAppointment collection
func (b *BookingBusinessAppointmentsCollectionRequestBuilder) Request() *BookingBusinessAppointmentsCollectionRequest {
return &BookingBusinessAppointmentsCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for BookingAppointment item
func (b *BookingBusinessAppointmentsCollectionRequestBuilder) ID(id string) *BookingAppointmentRequestBuilder {
bb := &BookingAppointmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// BookingBusinessAppointmentsCollectionRequest is request for BookingAppointment collection
type BookingBusinessAppointmentsCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for BookingAppointment collection
func (r *BookingBusinessAppointmentsCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]BookingAppointment, error) {
req, err := r.NewJSONRequest(method, path, obj)
if err != nil {
return nil, err
}
if ctx != nil {
req = req.WithContext(ctx)
}
res, err := r.client.Do(req)
if err != nil {
return nil, err
}
var values []BookingAppointment
for {
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
errRes := &ErrorResponse{Response: res}
err := jsonx.Unmarshal(b, errRes)
if err != nil {
return nil, fmt.Errorf("%s: %s", res.Status, string(b))
}
return nil, errRes
}
var (
paging Paging
value []BookingAppointment
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for BookingAppointment collection, max N pages
func (r *BookingBusinessAppointmentsCollectionRequest) GetN(ctx context.Context, n int) ([]BookingAppointment, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for BookingAppointment collection
func (r *BookingBusinessAppointmentsCollectionRequest) Get(ctx context.Context) ([]BookingAppointment, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for BookingAppointment collection
func (r *BookingBusinessAppointmentsCollectionRequest) Add(ctx context.Context, reqObj *BookingAppointment) (resObj *BookingAppointment, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// CalendarView returns request builder for BookingAppointment collection
func (b *BookingBusinessRequestBuilder) CalendarView() *BookingBusinessCalendarViewCollectionRequestBuilder {
bb := &BookingBusinessCalendarViewCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/calendarView"
return bb
}
// BookingBusinessCalendarViewCollectionRequestBuilder is request builder for BookingAppointment collection
type BookingBusinessCalendarViewCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for BookingAppointment collection
func (b *BookingBusinessCalendarViewCollectionRequestBuilder) Request() *BookingBusinessCalendarViewCollectionRequest {
return &BookingBusinessCalendarViewCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for BookingAppointment item
func (b *BookingBusinessCalendarViewCollectionRequestBuilder) ID(id string) *BookingAppointmentRequestBuilder {
bb := &BookingAppointmentRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// BookingBusinessCalendarViewCollectionRequest is request for BookingAppointment collection
type BookingBusinessCalendarViewCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for BookingAppointment collection
func (r *BookingBusinessCalendarViewCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]BookingAppointment, error) {
req, err := r.NewJSONRequest(method, path, obj)
if err != nil {
return nil, err
}
if ctx != nil {
req = req.WithContext(ctx)
}
res, err := r.client.Do(req)
if err != nil {
return nil, err
}
var values []BookingAppointment
for {
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
errRes := &ErrorResponse{Response: res}
err := jsonx.Unmarshal(b, errRes)
if err != nil {
return nil, fmt.Errorf("%s: %s", res.Status, string(b))
}
return nil, errRes
}
var (
paging Paging
value []BookingAppointment
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for BookingAppointment collection, max N pages
func (r *BookingBusinessCalendarViewCollectionRequest) GetN(ctx context.Context, n int) ([]BookingAppointment, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for BookingAppointment collection
func (r *BookingBusinessCalendarViewCollectionRequest) Get(ctx context.Context) ([]BookingAppointment, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for BookingAppointment collection
func (r *BookingBusinessCalendarViewCollectionRequest) Add(ctx context.Context, reqObj *BookingAppointment) (resObj *BookingAppointment, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// Customers returns request builder for BookingCustomer collection
func (b *BookingBusinessRequestBuilder) Customers() *BookingBusinessCustomersCollectionRequestBuilder {
bb := &BookingBusinessCustomersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/customers"
return bb
}
// BookingBusinessCustomersCollectionRequestBuilder is request builder for BookingCustomer collection
type BookingBusinessCustomersCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for BookingCustomer collection
func (b *BookingBusinessCustomersCollectionRequestBuilder) Request() *BookingBusinessCustomersCollectionRequest {
return &BookingBusinessCustomersCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for BookingCustomer item
func (b *BookingBusinessCustomersCollectionRequestBuilder) ID(id string) *BookingCustomerRequestBuilder {
bb := &BookingCustomerRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// BookingBusinessCustomersCollectionRequest is request for BookingCustomer collection
type BookingBusinessCustomersCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for BookingCustomer collection
func (r *BookingBusinessCustomersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]BookingCustomer, error) {
req, err := r.NewJSONRequest(method, path, obj)
if err != nil {
return nil, err
}
if ctx != nil {
req = req.WithContext(ctx)
}
res, err := r.client.Do(req)
if err != nil {
return nil, err
}
var values []BookingCustomer
for {
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
errRes := &ErrorResponse{Response: res}
err := jsonx.Unmarshal(b, errRes)
if err != nil {
return nil, fmt.Errorf("%s: %s", res.Status, string(b))
}
return nil, errRes
}
var (
paging Paging
value []BookingCustomer
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for BookingCustomer collection, max N pages
func (r *BookingBusinessCustomersCollectionRequest) GetN(ctx context.Context, n int) ([]BookingCustomer, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for BookingCustomer collection
func (r *BookingBusinessCustomersCollectionRequest) Get(ctx context.Context) ([]BookingCustomer, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for BookingCustomer collection
func (r *BookingBusinessCustomersCollectionRequest) Add(ctx context.Context, reqObj *BookingCustomer) (resObj *BookingCustomer, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// Services returns request builder for BookingService collection
func (b *BookingBusinessRequestBuilder) Services() *BookingBusinessServicesCollectionRequestBuilder {
bb := &BookingBusinessServicesCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/services"
return bb
}
// BookingBusinessServicesCollectionRequestBuilder is request builder for BookingService collection
type BookingBusinessServicesCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for BookingService collection
func (b *BookingBusinessServicesCollectionRequestBuilder) Request() *BookingBusinessServicesCollectionRequest {
return &BookingBusinessServicesCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for BookingService item
func (b *BookingBusinessServicesCollectionRequestBuilder) ID(id string) *BookingServiceRequestBuilder {
bb := &BookingServiceRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// BookingBusinessServicesCollectionRequest is request for BookingService collection
type BookingBusinessServicesCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for BookingService collection
func (r *BookingBusinessServicesCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]BookingService, error) {
req, err := r.NewJSONRequest(method, path, obj)
if err != nil {
return nil, err
}
if ctx != nil {
req = req.WithContext(ctx)
}
res, err := r.client.Do(req)
if err != nil {
return nil, err
}
var values []BookingService
for {
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
errRes := &ErrorResponse{Response: res}
err := jsonx.Unmarshal(b, errRes)
if err != nil {
return nil, fmt.Errorf("%s: %s", res.Status, string(b))
}
return nil, errRes
}
var (
paging Paging
value []BookingService
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for BookingService collection, max N pages
func (r *BookingBusinessServicesCollectionRequest) GetN(ctx context.Context, n int) ([]BookingService, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for BookingService collection
func (r *BookingBusinessServicesCollectionRequest) Get(ctx context.Context) ([]BookingService, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for BookingService collection
func (r *BookingBusinessServicesCollectionRequest) Add(ctx context.Context, reqObj *BookingService) (resObj *BookingService, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
// StaffMembers returns request builder for BookingStaffMember collection
func (b *BookingBusinessRequestBuilder) StaffMembers() *BookingBusinessStaffMembersCollectionRequestBuilder {
bb := &BookingBusinessStaffMembersCollectionRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/staffMembers"
return bb
}
// BookingBusinessStaffMembersCollectionRequestBuilder is request builder for BookingStaffMember collection
type BookingBusinessStaffMembersCollectionRequestBuilder struct{ BaseRequestBuilder }
// Request returns request for BookingStaffMember collection
func (b *BookingBusinessStaffMembersCollectionRequestBuilder) Request() *BookingBusinessStaffMembersCollectionRequest {
return &BookingBusinessStaffMembersCollectionRequest{
BaseRequest: BaseRequest{baseURL: b.baseURL, client: b.client},
}
}
// ID returns request builder for BookingStaffMember item
func (b *BookingBusinessStaffMembersCollectionRequestBuilder) ID(id string) *BookingStaffMemberRequestBuilder {
bb := &BookingStaffMemberRequestBuilder{BaseRequestBuilder: b.BaseRequestBuilder}
bb.baseURL += "/" + id
return bb
}
// BookingBusinessStaffMembersCollectionRequest is request for BookingStaffMember collection
type BookingBusinessStaffMembersCollectionRequest struct{ BaseRequest }
// Paging perfoms paging operation for BookingStaffMember collection
func (r *BookingBusinessStaffMembersCollectionRequest) Paging(ctx context.Context, method, path string, obj interface{}, n int) ([]BookingStaffMember, error) {
req, err := r.NewJSONRequest(method, path, obj)
if err != nil {
return nil, err
}
if ctx != nil {
req = req.WithContext(ctx)
}
res, err := r.client.Do(req)
if err != nil {
return nil, err
}
var values []BookingStaffMember
for {
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
b, _ := ioutil.ReadAll(res.Body)
errRes := &ErrorResponse{Response: res}
err := jsonx.Unmarshal(b, errRes)
if err != nil {
return nil, fmt.Errorf("%s: %s", res.Status, string(b))
}
return nil, errRes
}
var (
paging Paging
value []BookingStaffMember
)
err := jsonx.NewDecoder(res.Body).Decode(&paging)
if err != nil {
return nil, err
}
err = jsonx.Unmarshal(paging.Value, &value)
if err != nil {
return nil, err
}
values = append(values, value...)
if n >= 0 {
n--
}
if n == 0 || len(paging.NextLink) == 0 {
return values, nil
}
req, err = http.NewRequest("GET", paging.NextLink, nil)
if ctx != nil {
req = req.WithContext(ctx)
}
res, err = r.client.Do(req)
if err != nil {
return nil, err
}
}
}
// GetN performs GET request for BookingStaffMember collection, max N pages
func (r *BookingBusinessStaffMembersCollectionRequest) GetN(ctx context.Context, n int) ([]BookingStaffMember, error) {
var query string
if r.query != nil {
query = "?" + r.query.Encode()
}
return r.Paging(ctx, "GET", query, nil, n)
}
// Get performs GET request for BookingStaffMember collection
func (r *BookingBusinessStaffMembersCollectionRequest) Get(ctx context.Context) ([]BookingStaffMember, error) {
return r.GetN(ctx, 0)
}
// Add performs POST request for BookingStaffMember collection
func (r *BookingBusinessStaffMembersCollectionRequest) Add(ctx context.Context, reqObj *BookingStaffMember) (resObj *BookingStaffMember, err error) {
err = r.JSONRequest(ctx, "POST", "", reqObj, &resObj)
return
}
|