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