1package network
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/azure"
24	"github.com/Azure/go-autorest/tracing"
25	"net/http"
26)
27
28// DdosProtectionPlansClient is the network Client
29type DdosProtectionPlansClient struct {
30	BaseClient
31}
32
33// NewDdosProtectionPlansClient creates an instance of the DdosProtectionPlansClient client.
34func NewDdosProtectionPlansClient(subscriptionID string) DdosProtectionPlansClient {
35	return NewDdosProtectionPlansClientWithBaseURI(DefaultBaseURI, subscriptionID)
36}
37
38// NewDdosProtectionPlansClientWithBaseURI creates an instance of the DdosProtectionPlansClient client using a custom
39// endpoint.  Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
40// stack).
41func NewDdosProtectionPlansClientWithBaseURI(baseURI string, subscriptionID string) DdosProtectionPlansClient {
42	return DdosProtectionPlansClient{NewWithBaseURI(baseURI, subscriptionID)}
43}
44
45// CreateOrUpdate creates or updates a DDoS protection plan.
46// Parameters:
47// resourceGroupName - the name of the resource group.
48// ddosProtectionPlanName - the name of the DDoS protection plan.
49// parameters - parameters supplied to the create or update operation.
50func (client DdosProtectionPlansClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan) (result DdosProtectionPlansCreateOrUpdateFuture, err error) {
51	if tracing.IsEnabled() {
52		ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.CreateOrUpdate")
53		defer func() {
54			sc := -1
55			if result.Response() != nil {
56				sc = result.Response().StatusCode
57			}
58			tracing.EndSpan(ctx, sc, err)
59		}()
60	}
61	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, ddosProtectionPlanName, parameters)
62	if err != nil {
63		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "CreateOrUpdate", nil, "Failure preparing request")
64		return
65	}
66
67	result, err = client.CreateOrUpdateSender(req)
68	if err != nil {
69		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "CreateOrUpdate", result.Response(), "Failure sending request")
70		return
71	}
72
73	return
74}
75
76// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
77func (client DdosProtectionPlansClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters DdosProtectionPlan) (*http.Request, error) {
78	pathParameters := map[string]interface{}{
79		"ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName),
80		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
81		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
82	}
83
84	const APIVersion = "2020-05-01"
85	queryParameters := map[string]interface{}{
86		"api-version": APIVersion,
87	}
88
89	parameters.ID = nil
90	parameters.Name = nil
91	parameters.Type = nil
92	parameters.Etag = nil
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.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters),
98		autorest.WithJSON(parameters),
99		autorest.WithQueryParameters(queryParameters))
100	return preparer.Prepare((&http.Request{}).WithContext(ctx))
101}
102
103// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
104// http.Response Body if it receives an error.
105func (client DdosProtectionPlansClient) CreateOrUpdateSender(req *http.Request) (future DdosProtectionPlansCreateOrUpdateFuture, err error) {
106	var resp *http.Response
107	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
108	if err != nil {
109		return
110	}
111	future.Future, err = azure.NewFutureFromResponse(resp)
112	return
113}
114
115// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
116// closes the http.Response Body.
117func (client DdosProtectionPlansClient) CreateOrUpdateResponder(resp *http.Response) (result DdosProtectionPlan, err error) {
118	err = autorest.Respond(
119		resp,
120		client.ByInspecting(),
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// Delete deletes the specified DDoS protection plan.
129// Parameters:
130// resourceGroupName - the name of the resource group.
131// ddosProtectionPlanName - the name of the DDoS protection plan.
132func (client DdosProtectionPlansClient) Delete(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (result DdosProtectionPlansDeleteFuture, err error) {
133	if tracing.IsEnabled() {
134		ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.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	req, err := client.DeletePreparer(ctx, resourceGroupName, ddosProtectionPlanName)
144	if err != nil {
145		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Delete", nil, "Failure preparing request")
146		return
147	}
148
149	result, err = client.DeleteSender(req)
150	if err != nil {
151		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Delete", result.Response(), "Failure sending request")
152		return
153	}
154
155	return
156}
157
158// DeletePreparer prepares the Delete request.
159func (client DdosProtectionPlansClient) DeletePreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (*http.Request, error) {
160	pathParameters := map[string]interface{}{
161		"ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName),
162		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
163		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
164	}
165
166	const APIVersion = "2020-05-01"
167	queryParameters := map[string]interface{}{
168		"api-version": APIVersion,
169	}
170
171	preparer := autorest.CreatePreparer(
172		autorest.AsDelete(),
173		autorest.WithBaseURL(client.BaseURI),
174		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters),
175		autorest.WithQueryParameters(queryParameters))
176	return preparer.Prepare((&http.Request{}).WithContext(ctx))
177}
178
179// DeleteSender sends the Delete request. The method will close the
180// http.Response Body if it receives an error.
181func (client DdosProtectionPlansClient) DeleteSender(req *http.Request) (future DdosProtectionPlansDeleteFuture, err error) {
182	var resp *http.Response
183	resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
184	if err != nil {
185		return
186	}
187	future.Future, err = azure.NewFutureFromResponse(resp)
188	return
189}
190
191// DeleteResponder handles the response to the Delete request. The method always
192// closes the http.Response Body.
193func (client DdosProtectionPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
194	err = autorest.Respond(
195		resp,
196		client.ByInspecting(),
197		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
198		autorest.ByClosing())
199	result.Response = resp
200	return
201}
202
203// Get gets information about the specified DDoS protection plan.
204// Parameters:
205// resourceGroupName - the name of the resource group.
206// ddosProtectionPlanName - the name of the DDoS protection plan.
207func (client DdosProtectionPlansClient) Get(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (result DdosProtectionPlan, err error) {
208	if tracing.IsEnabled() {
209		ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.Get")
210		defer func() {
211			sc := -1
212			if result.Response.Response != nil {
213				sc = result.Response.Response.StatusCode
214			}
215			tracing.EndSpan(ctx, sc, err)
216		}()
217	}
218	req, err := client.GetPreparer(ctx, resourceGroupName, ddosProtectionPlanName)
219	if err != nil {
220		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", nil, "Failure preparing request")
221		return
222	}
223
224	resp, err := client.GetSender(req)
225	if err != nil {
226		result.Response = autorest.Response{Response: resp}
227		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", resp, "Failure sending request")
228		return
229	}
230
231	result, err = client.GetResponder(resp)
232	if err != nil {
233		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "Get", resp, "Failure responding to request")
234	}
235
236	return
237}
238
239// GetPreparer prepares the Get request.
240func (client DdosProtectionPlansClient) GetPreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string) (*http.Request, error) {
241	pathParameters := map[string]interface{}{
242		"ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName),
243		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
244		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
245	}
246
247	const APIVersion = "2020-05-01"
248	queryParameters := map[string]interface{}{
249		"api-version": APIVersion,
250	}
251
252	preparer := autorest.CreatePreparer(
253		autorest.AsGet(),
254		autorest.WithBaseURL(client.BaseURI),
255		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters),
256		autorest.WithQueryParameters(queryParameters))
257	return preparer.Prepare((&http.Request{}).WithContext(ctx))
258}
259
260// GetSender sends the Get request. The method will close the
261// http.Response Body if it receives an error.
262func (client DdosProtectionPlansClient) GetSender(req *http.Request) (*http.Response, error) {
263	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
264}
265
266// GetResponder handles the response to the Get request. The method always
267// closes the http.Response Body.
268func (client DdosProtectionPlansClient) GetResponder(resp *http.Response) (result DdosProtectionPlan, err error) {
269	err = autorest.Respond(
270		resp,
271		client.ByInspecting(),
272		azure.WithErrorUnlessStatusCode(http.StatusOK),
273		autorest.ByUnmarshallingJSON(&result),
274		autorest.ByClosing())
275	result.Response = autorest.Response{Response: resp}
276	return
277}
278
279// List gets all DDoS protection plans in a subscription.
280func (client DdosProtectionPlansClient) List(ctx context.Context) (result DdosProtectionPlanListResultPage, err error) {
281	if tracing.IsEnabled() {
282		ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.List")
283		defer func() {
284			sc := -1
285			if result.dpplr.Response.Response != nil {
286				sc = result.dpplr.Response.Response.StatusCode
287			}
288			tracing.EndSpan(ctx, sc, err)
289		}()
290	}
291	result.fn = client.listNextResults
292	req, err := client.ListPreparer(ctx)
293	if err != nil {
294		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", nil, "Failure preparing request")
295		return
296	}
297
298	resp, err := client.ListSender(req)
299	if err != nil {
300		result.dpplr.Response = autorest.Response{Response: resp}
301		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", resp, "Failure sending request")
302		return
303	}
304
305	result.dpplr, err = client.ListResponder(resp)
306	if err != nil {
307		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "List", resp, "Failure responding to request")
308	}
309
310	return
311}
312
313// ListPreparer prepares the List request.
314func (client DdosProtectionPlansClient) ListPreparer(ctx context.Context) (*http.Request, error) {
315	pathParameters := map[string]interface{}{
316		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
317	}
318
319	const APIVersion = "2020-05-01"
320	queryParameters := map[string]interface{}{
321		"api-version": APIVersion,
322	}
323
324	preparer := autorest.CreatePreparer(
325		autorest.AsGet(),
326		autorest.WithBaseURL(client.BaseURI),
327		autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/ddosProtectionPlans", pathParameters),
328		autorest.WithQueryParameters(queryParameters))
329	return preparer.Prepare((&http.Request{}).WithContext(ctx))
330}
331
332// ListSender sends the List request. The method will close the
333// http.Response Body if it receives an error.
334func (client DdosProtectionPlansClient) ListSender(req *http.Request) (*http.Response, error) {
335	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
336}
337
338// ListResponder handles the response to the List request. The method always
339// closes the http.Response Body.
340func (client DdosProtectionPlansClient) ListResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) {
341	err = autorest.Respond(
342		resp,
343		client.ByInspecting(),
344		azure.WithErrorUnlessStatusCode(http.StatusOK),
345		autorest.ByUnmarshallingJSON(&result),
346		autorest.ByClosing())
347	result.Response = autorest.Response{Response: resp}
348	return
349}
350
351// listNextResults retrieves the next set of results, if any.
352func (client DdosProtectionPlansClient) listNextResults(ctx context.Context, lastResults DdosProtectionPlanListResult) (result DdosProtectionPlanListResult, err error) {
353	req, err := lastResults.ddosProtectionPlanListResultPreparer(ctx)
354	if err != nil {
355		return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", nil, "Failure preparing next results request")
356	}
357	if req == nil {
358		return
359	}
360	resp, err := client.ListSender(req)
361	if err != nil {
362		result.Response = autorest.Response{Response: resp}
363		return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", resp, "Failure sending next results request")
364	}
365	result, err = client.ListResponder(resp)
366	if err != nil {
367		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listNextResults", resp, "Failure responding to next results request")
368	}
369	return
370}
371
372// ListComplete enumerates all values, automatically crossing page boundaries as required.
373func (client DdosProtectionPlansClient) ListComplete(ctx context.Context) (result DdosProtectionPlanListResultIterator, err error) {
374	if tracing.IsEnabled() {
375		ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.List")
376		defer func() {
377			sc := -1
378			if result.Response().Response.Response != nil {
379				sc = result.page.Response().Response.Response.StatusCode
380			}
381			tracing.EndSpan(ctx, sc, err)
382		}()
383	}
384	result.page, err = client.List(ctx)
385	return
386}
387
388// ListByResourceGroup gets all the DDoS protection plans in a resource group.
389// Parameters:
390// resourceGroupName - the name of the resource group.
391func (client DdosProtectionPlansClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DdosProtectionPlanListResultPage, err error) {
392	if tracing.IsEnabled() {
393		ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.ListByResourceGroup")
394		defer func() {
395			sc := -1
396			if result.dpplr.Response.Response != nil {
397				sc = result.dpplr.Response.Response.StatusCode
398			}
399			tracing.EndSpan(ctx, sc, err)
400		}()
401	}
402	result.fn = client.listByResourceGroupNextResults
403	req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
404	if err != nil {
405		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", nil, "Failure preparing request")
406		return
407	}
408
409	resp, err := client.ListByResourceGroupSender(req)
410	if err != nil {
411		result.dpplr.Response = autorest.Response{Response: resp}
412		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", resp, "Failure sending request")
413		return
414	}
415
416	result.dpplr, err = client.ListByResourceGroupResponder(resp)
417	if err != nil {
418		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "ListByResourceGroup", resp, "Failure responding to request")
419	}
420
421	return
422}
423
424// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
425func (client DdosProtectionPlansClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
426	pathParameters := map[string]interface{}{
427		"resourceGroupName": autorest.Encode("path", resourceGroupName),
428		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
429	}
430
431	const APIVersion = "2020-05-01"
432	queryParameters := map[string]interface{}{
433		"api-version": APIVersion,
434	}
435
436	preparer := autorest.CreatePreparer(
437		autorest.AsGet(),
438		autorest.WithBaseURL(client.BaseURI),
439		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans", pathParameters),
440		autorest.WithQueryParameters(queryParameters))
441	return preparer.Prepare((&http.Request{}).WithContext(ctx))
442}
443
444// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
445// http.Response Body if it receives an error.
446func (client DdosProtectionPlansClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
447	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
448}
449
450// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
451// closes the http.Response Body.
452func (client DdosProtectionPlansClient) ListByResourceGroupResponder(resp *http.Response) (result DdosProtectionPlanListResult, err error) {
453	err = autorest.Respond(
454		resp,
455		client.ByInspecting(),
456		azure.WithErrorUnlessStatusCode(http.StatusOK),
457		autorest.ByUnmarshallingJSON(&result),
458		autorest.ByClosing())
459	result.Response = autorest.Response{Response: resp}
460	return
461}
462
463// listByResourceGroupNextResults retrieves the next set of results, if any.
464func (client DdosProtectionPlansClient) listByResourceGroupNextResults(ctx context.Context, lastResults DdosProtectionPlanListResult) (result DdosProtectionPlanListResult, err error) {
465	req, err := lastResults.ddosProtectionPlanListResultPreparer(ctx)
466	if err != nil {
467		return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
468	}
469	if req == nil {
470		return
471	}
472	resp, err := client.ListByResourceGroupSender(req)
473	if err != nil {
474		result.Response = autorest.Response{Response: resp}
475		return result, autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
476	}
477	result, err = client.ListByResourceGroupResponder(resp)
478	if err != nil {
479		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
480	}
481	return
482}
483
484// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
485func (client DdosProtectionPlansClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DdosProtectionPlanListResultIterator, err error) {
486	if tracing.IsEnabled() {
487		ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.ListByResourceGroup")
488		defer func() {
489			sc := -1
490			if result.Response().Response.Response != nil {
491				sc = result.page.Response().Response.Response.StatusCode
492			}
493			tracing.EndSpan(ctx, sc, err)
494		}()
495	}
496	result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
497	return
498}
499
500// UpdateTags update a DDoS protection plan tags.
501// Parameters:
502// resourceGroupName - the name of the resource group.
503// ddosProtectionPlanName - the name of the DDoS protection plan.
504// parameters - parameters supplied to the update DDoS protection plan resource tags.
505func (client DdosProtectionPlansClient) UpdateTags(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject) (result DdosProtectionPlan, err error) {
506	if tracing.IsEnabled() {
507		ctx = tracing.StartSpan(ctx, fqdn+"/DdosProtectionPlansClient.UpdateTags")
508		defer func() {
509			sc := -1
510			if result.Response.Response != nil {
511				sc = result.Response.Response.StatusCode
512			}
513			tracing.EndSpan(ctx, sc, err)
514		}()
515	}
516	req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, ddosProtectionPlanName, parameters)
517	if err != nil {
518		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", nil, "Failure preparing request")
519		return
520	}
521
522	resp, err := client.UpdateTagsSender(req)
523	if err != nil {
524		result.Response = autorest.Response{Response: resp}
525		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", resp, "Failure sending request")
526		return
527	}
528
529	result, err = client.UpdateTagsResponder(resp)
530	if err != nil {
531		err = autorest.NewErrorWithError(err, "network.DdosProtectionPlansClient", "UpdateTags", resp, "Failure responding to request")
532	}
533
534	return
535}
536
537// UpdateTagsPreparer prepares the UpdateTags request.
538func (client DdosProtectionPlansClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, ddosProtectionPlanName string, parameters TagsObject) (*http.Request, error) {
539	pathParameters := map[string]interface{}{
540		"ddosProtectionPlanName": autorest.Encode("path", ddosProtectionPlanName),
541		"resourceGroupName":      autorest.Encode("path", resourceGroupName),
542		"subscriptionId":         autorest.Encode("path", client.SubscriptionID),
543	}
544
545	const APIVersion = "2020-05-01"
546	queryParameters := map[string]interface{}{
547		"api-version": APIVersion,
548	}
549
550	preparer := autorest.CreatePreparer(
551		autorest.AsContentType("application/json; charset=utf-8"),
552		autorest.AsPatch(),
553		autorest.WithBaseURL(client.BaseURI),
554		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/ddosProtectionPlans/{ddosProtectionPlanName}", pathParameters),
555		autorest.WithJSON(parameters),
556		autorest.WithQueryParameters(queryParameters))
557	return preparer.Prepare((&http.Request{}).WithContext(ctx))
558}
559
560// UpdateTagsSender sends the UpdateTags request. The method will close the
561// http.Response Body if it receives an error.
562func (client DdosProtectionPlansClient) UpdateTagsSender(req *http.Request) (*http.Response, error) {
563	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
564}
565
566// UpdateTagsResponder handles the response to the UpdateTags request. The method always
567// closes the http.Response Body.
568func (client DdosProtectionPlansClient) UpdateTagsResponder(resp *http.Response) (result DdosProtectionPlan, err error) {
569	err = autorest.Respond(
570		resp,
571		client.ByInspecting(),
572		azure.WithErrorUnlessStatusCode(http.StatusOK),
573		autorest.ByUnmarshallingJSON(&result),
574		autorest.ByClosing())
575	result.Response = autorest.Response{Response: resp}
576	return
577}
578