1 package dtl
2
3
4
5
6
7
8
9 import (
10 "context"
11 "github.com/Azure/go-autorest/autorest"
12 "github.com/Azure/go-autorest/autorest/azure"
13 "github.com/Azure/go-autorest/autorest/validation"
14 "github.com/Azure/go-autorest/tracing"
15 "net/http"
16 )
17
18
19 type SchedulesClient struct {
20 BaseClient
21 }
22
23
24 func NewSchedulesClient(subscriptionID string) SchedulesClient {
25 return NewSchedulesClientWithBaseURI(DefaultBaseURI, subscriptionID)
26 }
27
28
29
30 func NewSchedulesClientWithBaseURI(baseURI string, subscriptionID string) SchedulesClient {
31 return SchedulesClient{NewWithBaseURI(baseURI, subscriptionID)}
32 }
33
34
35
36
37
38
39
40 func (client SchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, schedule Schedule) (result Schedule, err error) {
41 if tracing.IsEnabled() {
42 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.CreateOrUpdate")
43 defer func() {
44 sc := -1
45 if result.Response.Response != nil {
46 sc = result.Response.Response.StatusCode
47 }
48 tracing.EndSpan(ctx, sc, err)
49 }()
50 }
51 if err := validation.Validate([]validation.Validation{
52 {TargetValue: schedule,
53 Constraints: []validation.Constraint{{Target: "schedule.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
54 return result, validation.NewError("dtl.SchedulesClient", "CreateOrUpdate", err.Error())
55 }
56
57 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, labName, name, schedule)
58 if err != nil {
59 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "CreateOrUpdate", nil, "Failure preparing request")
60 return
61 }
62
63 resp, err := client.CreateOrUpdateSender(req)
64 if err != nil {
65 result.Response = autorest.Response{Response: resp}
66 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "CreateOrUpdate", resp, "Failure sending request")
67 return
68 }
69
70 result, err = client.CreateOrUpdateResponder(resp)
71 if err != nil {
72 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "CreateOrUpdate", resp, "Failure responding to request")
73 return
74 }
75
76 return
77 }
78
79
80 func (client SchedulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, labName string, name string, schedule Schedule) (*http.Request, error) {
81 pathParameters := map[string]interface{}{
82 "labName": autorest.Encode("path", labName),
83 "name": autorest.Encode("path", name),
84 "resourceGroupName": autorest.Encode("path", resourceGroupName),
85 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
86 }
87
88 const APIVersion = "2018-09-15"
89 queryParameters := map[string]interface{}{
90 "api-version": APIVersion,
91 }
92
93 preparer := autorest.CreatePreparer(
94 autorest.AsContentType("application/json; charset=utf-8"),
95 autorest.AsPut(),
96 autorest.WithBaseURL(client.BaseURI),
97 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}", pathParameters),
98 autorest.WithJSON(schedule),
99 autorest.WithQueryParameters(queryParameters))
100 return preparer.Prepare((&http.Request{}).WithContext(ctx))
101 }
102
103
104
105 func (client SchedulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
106 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
107 }
108
109
110
111 func (client SchedulesClient) CreateOrUpdateResponder(resp *http.Response) (result Schedule, err error) {
112 err = autorest.Respond(
113 resp,
114 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
115 autorest.ByUnmarshallingJSON(&result),
116 autorest.ByClosing())
117 result.Response = autorest.Response{Response: resp}
118 return
119 }
120
121
122
123
124
125
126 func (client SchedulesClient) Delete(ctx context.Context, resourceGroupName string, labName string, name string) (result autorest.Response, err error) {
127 if tracing.IsEnabled() {
128 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.Delete")
129 defer func() {
130 sc := -1
131 if result.Response != nil {
132 sc = result.Response.StatusCode
133 }
134 tracing.EndSpan(ctx, sc, err)
135 }()
136 }
137 req, err := client.DeletePreparer(ctx, resourceGroupName, labName, name)
138 if err != nil {
139 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Delete", nil, "Failure preparing request")
140 return
141 }
142
143 resp, err := client.DeleteSender(req)
144 if err != nil {
145 result.Response = resp
146 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Delete", resp, "Failure sending request")
147 return
148 }
149
150 result, err = client.DeleteResponder(resp)
151 if err != nil {
152 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Delete", resp, "Failure responding to request")
153 return
154 }
155
156 return
157 }
158
159
160 func (client SchedulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, labName string, name string) (*http.Request, error) {
161 pathParameters := map[string]interface{}{
162 "labName": autorest.Encode("path", labName),
163 "name": autorest.Encode("path", name),
164 "resourceGroupName": autorest.Encode("path", resourceGroupName),
165 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
166 }
167
168 const APIVersion = "2018-09-15"
169 queryParameters := map[string]interface{}{
170 "api-version": APIVersion,
171 }
172
173 preparer := autorest.CreatePreparer(
174 autorest.AsDelete(),
175 autorest.WithBaseURL(client.BaseURI),
176 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}", pathParameters),
177 autorest.WithQueryParameters(queryParameters))
178 return preparer.Prepare((&http.Request{}).WithContext(ctx))
179 }
180
181
182
183 func (client SchedulesClient) DeleteSender(req *http.Request) (*http.Response, error) {
184 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
185 }
186
187
188
189 func (client SchedulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
190 err = autorest.Respond(
191 resp,
192 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
193 autorest.ByClosing())
194 result.Response = resp
195 return
196 }
197
198
199
200
201
202
203 func (client SchedulesClient) Execute(ctx context.Context, resourceGroupName string, labName string, name string) (result SchedulesExecuteFuture, err error) {
204 if tracing.IsEnabled() {
205 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.Execute")
206 defer func() {
207 sc := -1
208 if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
209 sc = result.FutureAPI.Response().StatusCode
210 }
211 tracing.EndSpan(ctx, sc, err)
212 }()
213 }
214 req, err := client.ExecutePreparer(ctx, resourceGroupName, labName, name)
215 if err != nil {
216 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Execute", nil, "Failure preparing request")
217 return
218 }
219
220 result, err = client.ExecuteSender(req)
221 if err != nil {
222 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Execute", result.Response(), "Failure sending request")
223 return
224 }
225
226 return
227 }
228
229
230 func (client SchedulesClient) ExecutePreparer(ctx context.Context, resourceGroupName string, labName string, name string) (*http.Request, error) {
231 pathParameters := map[string]interface{}{
232 "labName": autorest.Encode("path", labName),
233 "name": autorest.Encode("path", name),
234 "resourceGroupName": autorest.Encode("path", resourceGroupName),
235 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
236 }
237
238 const APIVersion = "2018-09-15"
239 queryParameters := map[string]interface{}{
240 "api-version": APIVersion,
241 }
242
243 preparer := autorest.CreatePreparer(
244 autorest.AsPost(),
245 autorest.WithBaseURL(client.BaseURI),
246 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}/execute", pathParameters),
247 autorest.WithQueryParameters(queryParameters))
248 return preparer.Prepare((&http.Request{}).WithContext(ctx))
249 }
250
251
252
253 func (client SchedulesClient) ExecuteSender(req *http.Request) (future SchedulesExecuteFuture, err error) {
254 var resp *http.Response
255 future.FutureAPI = &azure.Future{}
256 resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
257 if err != nil {
258 return
259 }
260 var azf azure.Future
261 azf, err = azure.NewFutureFromResponse(resp)
262 future.FutureAPI = &azf
263 future.Result = future.result
264 return
265 }
266
267
268
269 func (client SchedulesClient) ExecuteResponder(resp *http.Response) (result autorest.Response, err error) {
270 err = autorest.Respond(
271 resp,
272 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
273 autorest.ByClosing())
274 result.Response = resp
275 return
276 }
277
278
279
280
281
282
283
284 func (client SchedulesClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, expand string) (result Schedule, err error) {
285 if tracing.IsEnabled() {
286 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.Get")
287 defer func() {
288 sc := -1
289 if result.Response.Response != nil {
290 sc = result.Response.Response.StatusCode
291 }
292 tracing.EndSpan(ctx, sc, err)
293 }()
294 }
295 req, err := client.GetPreparer(ctx, resourceGroupName, labName, name, expand)
296 if err != nil {
297 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Get", nil, "Failure preparing request")
298 return
299 }
300
301 resp, err := client.GetSender(req)
302 if err != nil {
303 result.Response = autorest.Response{Response: resp}
304 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Get", resp, "Failure sending request")
305 return
306 }
307
308 result, err = client.GetResponder(resp)
309 if err != nil {
310 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Get", resp, "Failure responding to request")
311 return
312 }
313
314 return
315 }
316
317
318 func (client SchedulesClient) GetPreparer(ctx context.Context, resourceGroupName string, labName string, name string, expand string) (*http.Request, error) {
319 pathParameters := map[string]interface{}{
320 "labName": autorest.Encode("path", labName),
321 "name": autorest.Encode("path", name),
322 "resourceGroupName": autorest.Encode("path", resourceGroupName),
323 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
324 }
325
326 const APIVersion = "2018-09-15"
327 queryParameters := map[string]interface{}{
328 "api-version": APIVersion,
329 }
330 if len(expand) > 0 {
331 queryParameters["$expand"] = autorest.Encode("query", expand)
332 }
333
334 preparer := autorest.CreatePreparer(
335 autorest.AsGet(),
336 autorest.WithBaseURL(client.BaseURI),
337 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}", pathParameters),
338 autorest.WithQueryParameters(queryParameters))
339 return preparer.Prepare((&http.Request{}).WithContext(ctx))
340 }
341
342
343
344 func (client SchedulesClient) GetSender(req *http.Request) (*http.Response, error) {
345 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
346 }
347
348
349
350 func (client SchedulesClient) GetResponder(resp *http.Response) (result Schedule, err error) {
351 err = autorest.Respond(
352 resp,
353 azure.WithErrorUnlessStatusCode(http.StatusOK),
354 autorest.ByUnmarshallingJSON(&result),
355 autorest.ByClosing())
356 result.Response = autorest.Response{Response: resp}
357 return
358 }
359
360
361
362
363
364
365
366
367
368 func (client SchedulesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ScheduleListPage, err error) {
369 if tracing.IsEnabled() {
370 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.List")
371 defer func() {
372 sc := -1
373 if result.sl.Response.Response != nil {
374 sc = result.sl.Response.Response.StatusCode
375 }
376 tracing.EndSpan(ctx, sc, err)
377 }()
378 }
379 result.fn = client.listNextResults
380 req, err := client.ListPreparer(ctx, resourceGroupName, labName, expand, filter, top, orderby)
381 if err != nil {
382 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "List", nil, "Failure preparing request")
383 return
384 }
385
386 resp, err := client.ListSender(req)
387 if err != nil {
388 result.sl.Response = autorest.Response{Response: resp}
389 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "List", resp, "Failure sending request")
390 return
391 }
392
393 result.sl, err = client.ListResponder(resp)
394 if err != nil {
395 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "List", resp, "Failure responding to request")
396 return
397 }
398 if result.sl.hasNextLink() && result.sl.IsEmpty() {
399 err = result.NextWithContext(ctx)
400 return
401 }
402
403 return
404 }
405
406
407 func (client SchedulesClient) ListPreparer(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (*http.Request, error) {
408 pathParameters := map[string]interface{}{
409 "labName": autorest.Encode("path", labName),
410 "resourceGroupName": autorest.Encode("path", resourceGroupName),
411 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
412 }
413
414 const APIVersion = "2018-09-15"
415 queryParameters := map[string]interface{}{
416 "api-version": APIVersion,
417 }
418 if len(expand) > 0 {
419 queryParameters["$expand"] = autorest.Encode("query", expand)
420 }
421 if len(filter) > 0 {
422 queryParameters["$filter"] = autorest.Encode("query", filter)
423 }
424 if top != nil {
425 queryParameters["$top"] = autorest.Encode("query", *top)
426 }
427 if len(orderby) > 0 {
428 queryParameters["$orderby"] = autorest.Encode("query", orderby)
429 }
430
431 preparer := autorest.CreatePreparer(
432 autorest.AsGet(),
433 autorest.WithBaseURL(client.BaseURI),
434 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules", pathParameters),
435 autorest.WithQueryParameters(queryParameters))
436 return preparer.Prepare((&http.Request{}).WithContext(ctx))
437 }
438
439
440
441 func (client SchedulesClient) ListSender(req *http.Request) (*http.Response, error) {
442 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
443 }
444
445
446
447 func (client SchedulesClient) ListResponder(resp *http.Response) (result ScheduleList, err error) {
448 err = autorest.Respond(
449 resp,
450 azure.WithErrorUnlessStatusCode(http.StatusOK),
451 autorest.ByUnmarshallingJSON(&result),
452 autorest.ByClosing())
453 result.Response = autorest.Response{Response: resp}
454 return
455 }
456
457
458 func (client SchedulesClient) listNextResults(ctx context.Context, lastResults ScheduleList) (result ScheduleList, err error) {
459 req, err := lastResults.scheduleListPreparer(ctx)
460 if err != nil {
461 return result, autorest.NewErrorWithError(err, "dtl.SchedulesClient", "listNextResults", nil, "Failure preparing next results request")
462 }
463 if req == nil {
464 return
465 }
466 resp, err := client.ListSender(req)
467 if err != nil {
468 result.Response = autorest.Response{Response: resp}
469 return result, autorest.NewErrorWithError(err, "dtl.SchedulesClient", "listNextResults", resp, "Failure sending next results request")
470 }
471 result, err = client.ListResponder(resp)
472 if err != nil {
473 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "listNextResults", resp, "Failure responding to next results request")
474 }
475 return
476 }
477
478
479 func (client SchedulesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ScheduleListIterator, err error) {
480 if tracing.IsEnabled() {
481 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.List")
482 defer func() {
483 sc := -1
484 if result.Response().Response.Response != nil {
485 sc = result.page.Response().Response.Response.StatusCode
486 }
487 tracing.EndSpan(ctx, sc, err)
488 }()
489 }
490 result.page, err = client.List(ctx, resourceGroupName, labName, expand, filter, top, orderby)
491 return
492 }
493
494
495
496
497
498
499 func (client SchedulesClient) ListApplicable(ctx context.Context, resourceGroupName string, labName string, name string) (result ScheduleListPage, err error) {
500 if tracing.IsEnabled() {
501 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.ListApplicable")
502 defer func() {
503 sc := -1
504 if result.sl.Response.Response != nil {
505 sc = result.sl.Response.Response.StatusCode
506 }
507 tracing.EndSpan(ctx, sc, err)
508 }()
509 }
510 result.fn = client.listApplicableNextResults
511 req, err := client.ListApplicablePreparer(ctx, resourceGroupName, labName, name)
512 if err != nil {
513 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "ListApplicable", nil, "Failure preparing request")
514 return
515 }
516
517 resp, err := client.ListApplicableSender(req)
518 if err != nil {
519 result.sl.Response = autorest.Response{Response: resp}
520 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "ListApplicable", resp, "Failure sending request")
521 return
522 }
523
524 result.sl, err = client.ListApplicableResponder(resp)
525 if err != nil {
526 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "ListApplicable", resp, "Failure responding to request")
527 return
528 }
529 if result.sl.hasNextLink() && result.sl.IsEmpty() {
530 err = result.NextWithContext(ctx)
531 return
532 }
533
534 return
535 }
536
537
538 func (client SchedulesClient) ListApplicablePreparer(ctx context.Context, resourceGroupName string, labName string, name string) (*http.Request, error) {
539 pathParameters := map[string]interface{}{
540 "labName": autorest.Encode("path", labName),
541 "name": autorest.Encode("path", name),
542 "resourceGroupName": autorest.Encode("path", resourceGroupName),
543 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
544 }
545
546 const APIVersion = "2018-09-15"
547 queryParameters := map[string]interface{}{
548 "api-version": APIVersion,
549 }
550
551 preparer := autorest.CreatePreparer(
552 autorest.AsPost(),
553 autorest.WithBaseURL(client.BaseURI),
554 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}/listApplicable", pathParameters),
555 autorest.WithQueryParameters(queryParameters))
556 return preparer.Prepare((&http.Request{}).WithContext(ctx))
557 }
558
559
560
561 func (client SchedulesClient) ListApplicableSender(req *http.Request) (*http.Response, error) {
562 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
563 }
564
565
566
567 func (client SchedulesClient) ListApplicableResponder(resp *http.Response) (result ScheduleList, err error) {
568 err = autorest.Respond(
569 resp,
570 azure.WithErrorUnlessStatusCode(http.StatusOK),
571 autorest.ByUnmarshallingJSON(&result),
572 autorest.ByClosing())
573 result.Response = autorest.Response{Response: resp}
574 return
575 }
576
577
578 func (client SchedulesClient) listApplicableNextResults(ctx context.Context, lastResults ScheduleList) (result ScheduleList, err error) {
579 req, err := lastResults.scheduleListPreparer(ctx)
580 if err != nil {
581 return result, autorest.NewErrorWithError(err, "dtl.SchedulesClient", "listApplicableNextResults", nil, "Failure preparing next results request")
582 }
583 if req == nil {
584 return
585 }
586 resp, err := client.ListApplicableSender(req)
587 if err != nil {
588 result.Response = autorest.Response{Response: resp}
589 return result, autorest.NewErrorWithError(err, "dtl.SchedulesClient", "listApplicableNextResults", resp, "Failure sending next results request")
590 }
591 result, err = client.ListApplicableResponder(resp)
592 if err != nil {
593 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "listApplicableNextResults", resp, "Failure responding to next results request")
594 }
595 return
596 }
597
598
599 func (client SchedulesClient) ListApplicableComplete(ctx context.Context, resourceGroupName string, labName string, name string) (result ScheduleListIterator, err error) {
600 if tracing.IsEnabled() {
601 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.ListApplicable")
602 defer func() {
603 sc := -1
604 if result.Response().Response.Response != nil {
605 sc = result.page.Response().Response.Response.StatusCode
606 }
607 tracing.EndSpan(ctx, sc, err)
608 }()
609 }
610 result.page, err = client.ListApplicable(ctx, resourceGroupName, labName, name)
611 return
612 }
613
614
615
616
617
618
619
620 func (client SchedulesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, schedule ScheduleFragment) (result Schedule, err error) {
621 if tracing.IsEnabled() {
622 ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.Update")
623 defer func() {
624 sc := -1
625 if result.Response.Response != nil {
626 sc = result.Response.Response.StatusCode
627 }
628 tracing.EndSpan(ctx, sc, err)
629 }()
630 }
631 req, err := client.UpdatePreparer(ctx, resourceGroupName, labName, name, schedule)
632 if err != nil {
633 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Update", nil, "Failure preparing request")
634 return
635 }
636
637 resp, err := client.UpdateSender(req)
638 if err != nil {
639 result.Response = autorest.Response{Response: resp}
640 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Update", resp, "Failure sending request")
641 return
642 }
643
644 result, err = client.UpdateResponder(resp)
645 if err != nil {
646 err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "Update", resp, "Failure responding to request")
647 return
648 }
649
650 return
651 }
652
653
654 func (client SchedulesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, labName string, name string, schedule ScheduleFragment) (*http.Request, error) {
655 pathParameters := map[string]interface{}{
656 "labName": autorest.Encode("path", labName),
657 "name": autorest.Encode("path", name),
658 "resourceGroupName": autorest.Encode("path", resourceGroupName),
659 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
660 }
661
662 const APIVersion = "2018-09-15"
663 queryParameters := map[string]interface{}{
664 "api-version": APIVersion,
665 }
666
667 preparer := autorest.CreatePreparer(
668 autorest.AsContentType("application/json; charset=utf-8"),
669 autorest.AsPatch(),
670 autorest.WithBaseURL(client.BaseURI),
671 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/schedules/{name}", pathParameters),
672 autorest.WithJSON(schedule),
673 autorest.WithQueryParameters(queryParameters))
674 return preparer.Prepare((&http.Request{}).WithContext(ctx))
675 }
676
677
678
679 func (client SchedulesClient) UpdateSender(req *http.Request) (*http.Response, error) {
680 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
681 }
682
683
684
685 func (client SchedulesClient) UpdateResponder(resp *http.Response) (result Schedule, err error) {
686 err = autorest.Respond(
687 resp,
688 azure.WithErrorUnlessStatusCode(http.StatusOK),
689 autorest.ByUnmarshallingJSON(&result),
690 autorest.ByClosing())
691 result.Response = autorest.Response{Response: resp}
692 return
693 }
694
View as plain text