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