1 package insights
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 ActionGroupsClient struct {
20 BaseClient
21 }
22
23
24 func NewActionGroupsClient(subscriptionID string) ActionGroupsClient {
25 return NewActionGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
26 }
27
28
29
30 func NewActionGroupsClientWithBaseURI(baseURI string, subscriptionID string) ActionGroupsClient {
31 return ActionGroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
32 }
33
34
35
36
37
38
39 func (client ActionGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource) (result ActionGroupResource, err error) {
40 if tracing.IsEnabled() {
41 ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.CreateOrUpdate")
42 defer func() {
43 sc := -1
44 if result.Response.Response != nil {
45 sc = result.Response.Response.StatusCode
46 }
47 tracing.EndSpan(ctx, sc, err)
48 }()
49 }
50 if err := validation.Validate([]validation.Validation{
51 {TargetValue: resourceGroupName,
52 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
53 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
54 {TargetValue: actionGroup,
55 Constraints: []validation.Constraint{{Target: "actionGroup.ActionGroup", Name: validation.Null, Rule: false,
56 Chain: []validation.Constraint{{Target: "actionGroup.ActionGroup.GroupShortName", Name: validation.Null, Rule: true,
57 Chain: []validation.Constraint{{Target: "actionGroup.ActionGroup.GroupShortName", Name: validation.MaxLength, Rule: 12, Chain: nil}}},
58 {Target: "actionGroup.ActionGroup.Enabled", Name: validation.Null, Rule: true, Chain: nil},
59 }}}},
60 {TargetValue: client.SubscriptionID,
61 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
62 return result, validation.NewError("insights.ActionGroupsClient", "CreateOrUpdate", err.Error())
63 }
64
65 req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, actionGroupName, actionGroup)
66 if err != nil {
67 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "CreateOrUpdate", nil, "Failure preparing request")
68 return
69 }
70
71 resp, err := client.CreateOrUpdateSender(req)
72 if err != nil {
73 result.Response = autorest.Response{Response: resp}
74 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "CreateOrUpdate", resp, "Failure sending request")
75 return
76 }
77
78 result, err = client.CreateOrUpdateResponder(resp)
79 if err != nil {
80 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "CreateOrUpdate", resp, "Failure responding to request")
81 return
82 }
83
84 return
85 }
86
87
88 func (client ActionGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroup ActionGroupResource) (*http.Request, error) {
89 pathParameters := map[string]interface{}{
90 "actionGroupName": autorest.Encode("path", actionGroupName),
91 "resourceGroupName": autorest.Encode("path", resourceGroupName),
92 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
93 }
94
95 const APIVersion = "2019-06-01"
96 queryParameters := map[string]interface{}{
97 "api-version": APIVersion,
98 }
99
100 preparer := autorest.CreatePreparer(
101 autorest.AsContentType("application/json; charset=utf-8"),
102 autorest.AsPut(),
103 autorest.WithBaseURL(client.BaseURI),
104 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", pathParameters),
105 autorest.WithJSON(actionGroup),
106 autorest.WithQueryParameters(queryParameters))
107 return preparer.Prepare((&http.Request{}).WithContext(ctx))
108 }
109
110
111
112 func (client ActionGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
113 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
114 }
115
116
117
118 func (client ActionGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ActionGroupResource, err error) {
119 err = autorest.Respond(
120 resp,
121 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
122 autorest.ByUnmarshallingJSON(&result),
123 autorest.ByClosing())
124 result.Response = autorest.Response{Response: resp}
125 return
126 }
127
128
129
130
131
132 func (client ActionGroupsClient) Delete(ctx context.Context, resourceGroupName string, actionGroupName string) (result autorest.Response, err error) {
133 if tracing.IsEnabled() {
134 ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.Delete")
135 defer func() {
136 sc := -1
137 if result.Response != nil {
138 sc = result.Response.StatusCode
139 }
140 tracing.EndSpan(ctx, sc, err)
141 }()
142 }
143 if err := validation.Validate([]validation.Validation{
144 {TargetValue: resourceGroupName,
145 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
146 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
147 {TargetValue: client.SubscriptionID,
148 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
149 return result, validation.NewError("insights.ActionGroupsClient", "Delete", err.Error())
150 }
151
152 req, err := client.DeletePreparer(ctx, resourceGroupName, actionGroupName)
153 if err != nil {
154 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Delete", nil, "Failure preparing request")
155 return
156 }
157
158 resp, err := client.DeleteSender(req)
159 if err != nil {
160 result.Response = resp
161 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Delete", resp, "Failure sending request")
162 return
163 }
164
165 result, err = client.DeleteResponder(resp)
166 if err != nil {
167 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Delete", resp, "Failure responding to request")
168 return
169 }
170
171 return
172 }
173
174
175 func (client ActionGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, actionGroupName string) (*http.Request, error) {
176 pathParameters := map[string]interface{}{
177 "actionGroupName": autorest.Encode("path", actionGroupName),
178 "resourceGroupName": autorest.Encode("path", resourceGroupName),
179 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
180 }
181
182 const APIVersion = "2019-06-01"
183 queryParameters := map[string]interface{}{
184 "api-version": APIVersion,
185 }
186
187 preparer := autorest.CreatePreparer(
188 autorest.AsDelete(),
189 autorest.WithBaseURL(client.BaseURI),
190 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", pathParameters),
191 autorest.WithQueryParameters(queryParameters))
192 return preparer.Prepare((&http.Request{}).WithContext(ctx))
193 }
194
195
196
197 func (client ActionGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) {
198 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
199 }
200
201
202
203 func (client ActionGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
204 err = autorest.Respond(
205 resp,
206 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
207 autorest.ByClosing())
208 result.Response = resp
209 return
210 }
211
212
213
214
215
216
217
218 func (client ActionGroupsClient) EnableReceiver(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest) (result autorest.Response, err error) {
219 if tracing.IsEnabled() {
220 ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.EnableReceiver")
221 defer func() {
222 sc := -1
223 if result.Response != nil {
224 sc = result.Response.StatusCode
225 }
226 tracing.EndSpan(ctx, sc, err)
227 }()
228 }
229 if err := validation.Validate([]validation.Validation{
230 {TargetValue: resourceGroupName,
231 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
232 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
233 {TargetValue: enableRequest,
234 Constraints: []validation.Constraint{{Target: "enableRequest.ReceiverName", Name: validation.Null, Rule: true, Chain: nil}}},
235 {TargetValue: client.SubscriptionID,
236 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
237 return result, validation.NewError("insights.ActionGroupsClient", "EnableReceiver", err.Error())
238 }
239
240 req, err := client.EnableReceiverPreparer(ctx, resourceGroupName, actionGroupName, enableRequest)
241 if err != nil {
242 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "EnableReceiver", nil, "Failure preparing request")
243 return
244 }
245
246 resp, err := client.EnableReceiverSender(req)
247 if err != nil {
248 result.Response = resp
249 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "EnableReceiver", resp, "Failure sending request")
250 return
251 }
252
253 result, err = client.EnableReceiverResponder(resp)
254 if err != nil {
255 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "EnableReceiver", resp, "Failure responding to request")
256 return
257 }
258
259 return
260 }
261
262
263 func (client ActionGroupsClient) EnableReceiverPreparer(ctx context.Context, resourceGroupName string, actionGroupName string, enableRequest EnableRequest) (*http.Request, error) {
264 pathParameters := map[string]interface{}{
265 "actionGroupName": autorest.Encode("path", actionGroupName),
266 "resourceGroupName": autorest.Encode("path", resourceGroupName),
267 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
268 }
269
270 const APIVersion = "2019-06-01"
271 queryParameters := map[string]interface{}{
272 "api-version": APIVersion,
273 }
274
275 preparer := autorest.CreatePreparer(
276 autorest.AsContentType("application/json; charset=utf-8"),
277 autorest.AsPost(),
278 autorest.WithBaseURL(client.BaseURI),
279 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}/subscribe", pathParameters),
280 autorest.WithJSON(enableRequest),
281 autorest.WithQueryParameters(queryParameters))
282 return preparer.Prepare((&http.Request{}).WithContext(ctx))
283 }
284
285
286
287 func (client ActionGroupsClient) EnableReceiverSender(req *http.Request) (*http.Response, error) {
288 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
289 }
290
291
292
293 func (client ActionGroupsClient) EnableReceiverResponder(resp *http.Response) (result autorest.Response, err error) {
294 err = autorest.Respond(
295 resp,
296 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusConflict),
297 autorest.ByClosing())
298 result.Response = resp
299 return
300 }
301
302
303
304
305
306 func (client ActionGroupsClient) Get(ctx context.Context, resourceGroupName string, actionGroupName string) (result ActionGroupResource, err error) {
307 if tracing.IsEnabled() {
308 ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.Get")
309 defer func() {
310 sc := -1
311 if result.Response.Response != nil {
312 sc = result.Response.Response.StatusCode
313 }
314 tracing.EndSpan(ctx, sc, err)
315 }()
316 }
317 if err := validation.Validate([]validation.Validation{
318 {TargetValue: resourceGroupName,
319 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
320 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
321 {TargetValue: client.SubscriptionID,
322 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
323 return result, validation.NewError("insights.ActionGroupsClient", "Get", err.Error())
324 }
325
326 req, err := client.GetPreparer(ctx, resourceGroupName, actionGroupName)
327 if err != nil {
328 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Get", nil, "Failure preparing request")
329 return
330 }
331
332 resp, err := client.GetSender(req)
333 if err != nil {
334 result.Response = autorest.Response{Response: resp}
335 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Get", resp, "Failure sending request")
336 return
337 }
338
339 result, err = client.GetResponder(resp)
340 if err != nil {
341 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Get", resp, "Failure responding to request")
342 return
343 }
344
345 return
346 }
347
348
349 func (client ActionGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, actionGroupName string) (*http.Request, error) {
350 pathParameters := map[string]interface{}{
351 "actionGroupName": autorest.Encode("path", actionGroupName),
352 "resourceGroupName": autorest.Encode("path", resourceGroupName),
353 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
354 }
355
356 const APIVersion = "2019-06-01"
357 queryParameters := map[string]interface{}{
358 "api-version": APIVersion,
359 }
360
361 preparer := autorest.CreatePreparer(
362 autorest.AsGet(),
363 autorest.WithBaseURL(client.BaseURI),
364 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", pathParameters),
365 autorest.WithQueryParameters(queryParameters))
366 return preparer.Prepare((&http.Request{}).WithContext(ctx))
367 }
368
369
370
371 func (client ActionGroupsClient) GetSender(req *http.Request) (*http.Response, error) {
372 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
373 }
374
375
376
377 func (client ActionGroupsClient) GetResponder(resp *http.Response) (result ActionGroupResource, err error) {
378 err = autorest.Respond(
379 resp,
380 azure.WithErrorUnlessStatusCode(http.StatusOK),
381 autorest.ByUnmarshallingJSON(&result),
382 autorest.ByClosing())
383 result.Response = autorest.Response{Response: resp}
384 return
385 }
386
387
388
389
390 func (client ActionGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ActionGroupList, err error) {
391 if tracing.IsEnabled() {
392 ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.ListByResourceGroup")
393 defer func() {
394 sc := -1
395 if result.Response.Response != nil {
396 sc = result.Response.Response.StatusCode
397 }
398 tracing.EndSpan(ctx, sc, err)
399 }()
400 }
401 if err := validation.Validate([]validation.Validation{
402 {TargetValue: resourceGroupName,
403 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
404 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}},
405 {TargetValue: client.SubscriptionID,
406 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
407 return result, validation.NewError("insights.ActionGroupsClient", "ListByResourceGroup", err.Error())
408 }
409
410 req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
411 if err != nil {
412 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListByResourceGroup", nil, "Failure preparing request")
413 return
414 }
415
416 resp, err := client.ListByResourceGroupSender(req)
417 if err != nil {
418 result.Response = autorest.Response{Response: resp}
419 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListByResourceGroup", resp, "Failure sending request")
420 return
421 }
422
423 result, err = client.ListByResourceGroupResponder(resp)
424 if err != nil {
425 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListByResourceGroup", resp, "Failure responding to request")
426 return
427 }
428
429 return
430 }
431
432
433 func (client ActionGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
434 pathParameters := map[string]interface{}{
435 "resourceGroupName": autorest.Encode("path", resourceGroupName),
436 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
437 }
438
439 const APIVersion = "2019-06-01"
440 queryParameters := map[string]interface{}{
441 "api-version": APIVersion,
442 }
443
444 preparer := autorest.CreatePreparer(
445 autorest.AsGet(),
446 autorest.WithBaseURL(client.BaseURI),
447 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups", pathParameters),
448 autorest.WithQueryParameters(queryParameters))
449 return preparer.Prepare((&http.Request{}).WithContext(ctx))
450 }
451
452
453
454 func (client ActionGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
455 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
456 }
457
458
459
460 func (client ActionGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ActionGroupList, err error) {
461 err = autorest.Respond(
462 resp,
463 azure.WithErrorUnlessStatusCode(http.StatusOK),
464 autorest.ByUnmarshallingJSON(&result),
465 autorest.ByClosing())
466 result.Response = autorest.Response{Response: resp}
467 return
468 }
469
470
471 func (client ActionGroupsClient) ListBySubscriptionID(ctx context.Context) (result ActionGroupList, err error) {
472 if tracing.IsEnabled() {
473 ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.ListBySubscriptionID")
474 defer func() {
475 sc := -1
476 if result.Response.Response != nil {
477 sc = result.Response.Response.StatusCode
478 }
479 tracing.EndSpan(ctx, sc, err)
480 }()
481 }
482 if err := validation.Validate([]validation.Validation{
483 {TargetValue: client.SubscriptionID,
484 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
485 return result, validation.NewError("insights.ActionGroupsClient", "ListBySubscriptionID", err.Error())
486 }
487
488 req, err := client.ListBySubscriptionIDPreparer(ctx)
489 if err != nil {
490 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListBySubscriptionID", nil, "Failure preparing request")
491 return
492 }
493
494 resp, err := client.ListBySubscriptionIDSender(req)
495 if err != nil {
496 result.Response = autorest.Response{Response: resp}
497 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListBySubscriptionID", resp, "Failure sending request")
498 return
499 }
500
501 result, err = client.ListBySubscriptionIDResponder(resp)
502 if err != nil {
503 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "ListBySubscriptionID", resp, "Failure responding to request")
504 return
505 }
506
507 return
508 }
509
510
511 func (client ActionGroupsClient) ListBySubscriptionIDPreparer(ctx context.Context) (*http.Request, error) {
512 pathParameters := map[string]interface{}{
513 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
514 }
515
516 const APIVersion = "2019-06-01"
517 queryParameters := map[string]interface{}{
518 "api-version": APIVersion,
519 }
520
521 preparer := autorest.CreatePreparer(
522 autorest.AsGet(),
523 autorest.WithBaseURL(client.BaseURI),
524 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/microsoft.insights/actionGroups", pathParameters),
525 autorest.WithQueryParameters(queryParameters))
526 return preparer.Prepare((&http.Request{}).WithContext(ctx))
527 }
528
529
530
531 func (client ActionGroupsClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) {
532 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
533 }
534
535
536
537 func (client ActionGroupsClient) ListBySubscriptionIDResponder(resp *http.Response) (result ActionGroupList, err error) {
538 err = autorest.Respond(
539 resp,
540 azure.WithErrorUnlessStatusCode(http.StatusOK),
541 autorest.ByUnmarshallingJSON(&result),
542 autorest.ByClosing())
543 result.Response = autorest.Response{Response: resp}
544 return
545 }
546
547
548
549
550
551
552 func (client ActionGroupsClient) Update(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (result ActionGroupResource, err error) {
553 if tracing.IsEnabled() {
554 ctx = tracing.StartSpan(ctx, fqdn+"/ActionGroupsClient.Update")
555 defer func() {
556 sc := -1
557 if result.Response.Response != nil {
558 sc = result.Response.Response.StatusCode
559 }
560 tracing.EndSpan(ctx, sc, err)
561 }()
562 }
563 if err := validation.Validate([]validation.Validation{
564 {TargetValue: client.SubscriptionID,
565 Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}},
566 {TargetValue: resourceGroupName,
567 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
568 {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil {
569 return result, validation.NewError("insights.ActionGroupsClient", "Update", err.Error())
570 }
571
572 req, err := client.UpdatePreparer(ctx, resourceGroupName, actionGroupName, actionGroupPatch)
573 if err != nil {
574 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", nil, "Failure preparing request")
575 return
576 }
577
578 resp, err := client.UpdateSender(req)
579 if err != nil {
580 result.Response = autorest.Response{Response: resp}
581 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", resp, "Failure sending request")
582 return
583 }
584
585 result, err = client.UpdateResponder(resp)
586 if err != nil {
587 err = autorest.NewErrorWithError(err, "insights.ActionGroupsClient", "Update", resp, "Failure responding to request")
588 return
589 }
590
591 return
592 }
593
594
595 func (client ActionGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, actionGroupName string, actionGroupPatch ActionGroupPatchBody) (*http.Request, error) {
596 pathParameters := map[string]interface{}{
597 "actionGroupName": autorest.Encode("path", actionGroupName),
598 "resourceGroupName": autorest.Encode("path", resourceGroupName),
599 "subscriptionId": autorest.Encode("path", client.SubscriptionID),
600 }
601
602 const APIVersion = "2019-06-01"
603 queryParameters := map[string]interface{}{
604 "api-version": APIVersion,
605 }
606
607 preparer := autorest.CreatePreparer(
608 autorest.AsContentType("application/json; charset=utf-8"),
609 autorest.AsPatch(),
610 autorest.WithBaseURL(client.BaseURI),
611 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}", pathParameters),
612 autorest.WithJSON(actionGroupPatch),
613 autorest.WithQueryParameters(queryParameters))
614 return preparer.Prepare((&http.Request{}).WithContext(ctx))
615 }
616
617
618
619 func (client ActionGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) {
620 return client.Send(req, azure.DoRetryWithRegistration(client.Client))
621 }
622
623
624
625 func (client ActionGroupsClient) UpdateResponder(resp *http.Response) (result ActionGroupResource, err error) {
626 err = autorest.Respond(
627 resp,
628 azure.WithErrorUnlessStatusCode(http.StatusOK),
629 autorest.ByUnmarshallingJSON(&result),
630 autorest.ByClosing())
631 result.Response = autorest.Response{Response: resp}
632 return
633 }
634
View as plain text