1package peering
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// ServicesClient is the peering Client
19type ServicesClient struct {
20	BaseClient
21}
22
23// NewServicesClient creates an instance of the ServicesClient client.
24func NewServicesClient(subscriptionID string) ServicesClient {
25	return NewServicesClientWithBaseURI(DefaultBaseURI, subscriptionID)
26}
27
28// NewServicesClientWithBaseURI creates an instance of the ServicesClient client using a custom endpoint.  Use this
29// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
30func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient {
31	return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)}
32}
33
34// CreateOrUpdate creates a new peering service or updates an existing peering with the specified name under the given
35// subscription and resource group.
36// Parameters:
37// resourceGroupName - the name of the resource group.
38// peeringServiceName - the name of the peering service.
39// peeringService - the properties needed to create or update a peering service.
40func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService Service) (result Service, err error) {
41	if tracing.IsEnabled() {
42		ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.CreateOrUpdate")
43		defer func() {
44			sc := -1
45			if result.Response.Response != nil {
46				sc = result.Response.Response.StatusCode
47			}
48			tracing.EndSpan(ctx, sc, err)
49		}()
50	}
51	if err := validation.Validate([]validation.Validation{
52		{TargetValue: peeringService,
53			Constraints: []validation.Constraint{{Target: "peeringService.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
54		return result, validation.NewError("peering.ServicesClient", "CreateOrUpdate", err.Error())
55	}
56
57	req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, peeringServiceName, peeringService)
58	if err != nil {
59		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", nil, "Failure preparing request")
60		return
61	}
62
63	resp, err := client.CreateOrUpdateSender(req)
64	if err != nil {
65		result.Response = autorest.Response{Response: resp}
66		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", resp, "Failure sending request")
67		return
68	}
69
70	result, err = client.CreateOrUpdateResponder(resp)
71	if err != nil {
72		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", resp, "Failure responding to request")
73		return
74	}
75
76	return
77}
78
79// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
80func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService Service) (*http.Request, error) {
81	pathParameters := map[string]interface{}{
82		"peeringServiceName": autorest.Encode("path", peeringServiceName),
83		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
84		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
85	}
86
87	const APIVersion = "2020-01-01-preview"
88	queryParameters := map[string]interface{}{
89		"api-version": APIVersion,
90	}
91
92	preparer := autorest.CreatePreparer(
93		autorest.AsContentType("application/json; charset=utf-8"),
94		autorest.AsPut(),
95		autorest.WithBaseURL(client.BaseURI),
96		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}", pathParameters),
97		autorest.WithJSON(peeringService),
98		autorest.WithQueryParameters(queryParameters))
99	return preparer.Prepare((&http.Request{}).WithContext(ctx))
100}
101
102// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
103// http.Response Body if it receives an error.
104func (client ServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
105	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
106}
107
108// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
109// closes the http.Response Body.
110func (client ServicesClient) CreateOrUpdateResponder(resp *http.Response) (result Service, err error) {
111	err = autorest.Respond(
112		resp,
113		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
114		autorest.ByUnmarshallingJSON(&result),
115		autorest.ByClosing())
116	result.Response = autorest.Response{Response: resp}
117	return
118}
119
120// Delete deletes an existing peering service with the specified name under the given subscription and resource group.
121// Parameters:
122// resourceGroupName - the name of the resource group.
123// peeringServiceName - the name of the peering service.
124func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string) (result autorest.Response, err error) {
125	if tracing.IsEnabled() {
126		ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Delete")
127		defer func() {
128			sc := -1
129			if result.Response != nil {
130				sc = result.Response.StatusCode
131			}
132			tracing.EndSpan(ctx, sc, err)
133		}()
134	}
135	req, err := client.DeletePreparer(ctx, resourceGroupName, peeringServiceName)
136	if err != nil {
137		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", nil, "Failure preparing request")
138		return
139	}
140
141	resp, err := client.DeleteSender(req)
142	if err != nil {
143		result.Response = resp
144		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", resp, "Failure sending request")
145		return
146	}
147
148	result, err = client.DeleteResponder(resp)
149	if err != nil {
150		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", resp, "Failure responding to request")
151		return
152	}
153
154	return
155}
156
157// DeletePreparer prepares the Delete request.
158func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string) (*http.Request, error) {
159	pathParameters := map[string]interface{}{
160		"peeringServiceName": autorest.Encode("path", peeringServiceName),
161		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
162		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
163	}
164
165	const APIVersion = "2020-01-01-preview"
166	queryParameters := map[string]interface{}{
167		"api-version": APIVersion,
168	}
169
170	preparer := autorest.CreatePreparer(
171		autorest.AsDelete(),
172		autorest.WithBaseURL(client.BaseURI),
173		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}", pathParameters),
174		autorest.WithQueryParameters(queryParameters))
175	return preparer.Prepare((&http.Request{}).WithContext(ctx))
176}
177
178// DeleteSender sends the Delete request. The method will close the
179// http.Response Body if it receives an error.
180func (client ServicesClient) DeleteSender(req *http.Request) (*http.Response, error) {
181	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
182}
183
184// DeleteResponder handles the response to the Delete request. The method always
185// closes the http.Response Body.
186func (client ServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
187	err = autorest.Respond(
188		resp,
189		azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
190		autorest.ByClosing())
191	result.Response = resp
192	return
193}
194
195// Get gets an existing peering service with the specified name under the given subscription and resource group.
196// Parameters:
197// resourceGroupName - the name of the resource group.
198// peeringServiceName - the name of the peering.
199func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string) (result Service, err error) {
200	if tracing.IsEnabled() {
201		ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Get")
202		defer func() {
203			sc := -1
204			if result.Response.Response != nil {
205				sc = result.Response.Response.StatusCode
206			}
207			tracing.EndSpan(ctx, sc, err)
208		}()
209	}
210	req, err := client.GetPreparer(ctx, resourceGroupName, peeringServiceName)
211	if err != nil {
212		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", nil, "Failure preparing request")
213		return
214	}
215
216	resp, err := client.GetSender(req)
217	if err != nil {
218		result.Response = autorest.Response{Response: resp}
219		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", resp, "Failure sending request")
220		return
221	}
222
223	result, err = client.GetResponder(resp)
224	if err != nil {
225		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", resp, "Failure responding to request")
226		return
227	}
228
229	return
230}
231
232// GetPreparer prepares the Get request.
233func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, peeringServiceName string) (*http.Request, error) {
234	pathParameters := map[string]interface{}{
235		"peeringServiceName": autorest.Encode("path", peeringServiceName),
236		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
237		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
238	}
239
240	const APIVersion = "2020-01-01-preview"
241	queryParameters := map[string]interface{}{
242		"api-version": APIVersion,
243	}
244
245	preparer := autorest.CreatePreparer(
246		autorest.AsGet(),
247		autorest.WithBaseURL(client.BaseURI),
248		autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}", pathParameters),
249		autorest.WithQueryParameters(queryParameters))
250	return preparer.Prepare((&http.Request{}).WithContext(ctx))
251}
252
253// GetSender sends the Get request. The method will close the
254// http.Response Body if it receives an error.
255func (client ServicesClient) GetSender(req *http.Request) (*http.Response, error) {
256	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
257}
258
259// GetResponder handles the response to the Get request. The method always
260// closes the http.Response Body.
261func (client ServicesClient) GetResponder(resp *http.Response) (result Service, err error) {
262	err = autorest.Respond(
263		resp,
264		azure.WithErrorUnlessStatusCode(http.StatusOK),
265		autorest.ByUnmarshallingJSON(&result),
266		autorest.ByClosing())
267	result.Response = autorest.Response{Response: resp}
268	return
269}
270
271// ListByResourceGroup lists all of the peering services under the given subscription and resource group.
272// Parameters:
273// resourceGroupName - the name of the resource group.
274func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServiceListResultPage, err error) {
275	if tracing.IsEnabled() {
276		ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup")
277		defer func() {
278			sc := -1
279			if result.slr.Response.Response != nil {
280				sc = result.slr.Response.Response.StatusCode
281			}
282			tracing.EndSpan(ctx, sc, err)
283		}()
284	}
285	result.fn = client.listByResourceGroupNextResults
286	req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
287	if err != nil {
288		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListByResourceGroup", nil, "Failure preparing request")
289		return
290	}
291
292	resp, err := client.ListByResourceGroupSender(req)
293	if err != nil {
294		result.slr.Response = autorest.Response{Response: resp}
295		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListByResourceGroup", resp, "Failure sending request")
296		return
297	}
298
299	result.slr, err = client.ListByResourceGroupResponder(resp)
300	if err != nil {
301		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListByResourceGroup", resp, "Failure responding to request")
302		return
303	}
304	if result.slr.hasNextLink() && result.slr.IsEmpty() {
305		err = result.NextWithContext(ctx)
306		return
307	}
308
309	return
310}
311
312// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
313func (client ServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
314	pathParameters := map[string]interface{}{
315		"resourceGroupName": autorest.Encode("path", resourceGroupName),
316		"subscriptionId":    autorest.Encode("path", client.SubscriptionID),
317	}
318
319	const APIVersion = "2020-01-01-preview"
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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices", pathParameters),
328		autorest.WithQueryParameters(queryParameters))
329	return preparer.Prepare((&http.Request{}).WithContext(ctx))
330}
331
332// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
333// http.Response Body if it receives an error.
334func (client ServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
335	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
336}
337
338// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
339// closes the http.Response Body.
340func (client ServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceListResult, err error) {
341	err = autorest.Respond(
342		resp,
343		azure.WithErrorUnlessStatusCode(http.StatusOK),
344		autorest.ByUnmarshallingJSON(&result),
345		autorest.ByClosing())
346	result.Response = autorest.Response{Response: resp}
347	return
348}
349
350// listByResourceGroupNextResults retrieves the next set of results, if any.
351func (client ServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServiceListResult) (result ServiceListResult, err error) {
352	req, err := lastResults.serviceListResultPreparer(ctx)
353	if err != nil {
354		return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
355	}
356	if req == nil {
357		return
358	}
359	resp, err := client.ListByResourceGroupSender(req)
360	if err != nil {
361		result.Response = autorest.Response{Response: resp}
362		return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
363	}
364	result, err = client.ListByResourceGroupResponder(resp)
365	if err != nil {
366		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
367	}
368	return
369}
370
371// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
372func (client ServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ServiceListResultIterator, err error) {
373	if tracing.IsEnabled() {
374		ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup")
375		defer func() {
376			sc := -1
377			if result.Response().Response.Response != nil {
378				sc = result.page.Response().Response.Response.StatusCode
379			}
380			tracing.EndSpan(ctx, sc, err)
381		}()
382	}
383	result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
384	return
385}
386
387// ListBySubscription lists all of the peerings under the given subscription.
388func (client ServicesClient) ListBySubscription(ctx context.Context) (result ServiceListResultPage, err error) {
389	if tracing.IsEnabled() {
390		ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListBySubscription")
391		defer func() {
392			sc := -1
393			if result.slr.Response.Response != nil {
394				sc = result.slr.Response.Response.StatusCode
395			}
396			tracing.EndSpan(ctx, sc, err)
397		}()
398	}
399	result.fn = client.listBySubscriptionNextResults
400	req, err := client.ListBySubscriptionPreparer(ctx)
401	if err != nil {
402		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", nil, "Failure preparing request")
403		return
404	}
405
406	resp, err := client.ListBySubscriptionSender(req)
407	if err != nil {
408		result.slr.Response = autorest.Response{Response: resp}
409		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", resp, "Failure sending request")
410		return
411	}
412
413	result.slr, err = client.ListBySubscriptionResponder(resp)
414	if err != nil {
415		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", resp, "Failure responding to request")
416		return
417	}
418	if result.slr.hasNextLink() && result.slr.IsEmpty() {
419		err = result.NextWithContext(ctx)
420		return
421	}
422
423	return
424}
425
426// ListBySubscriptionPreparer prepares the ListBySubscription request.
427func (client ServicesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) {
428	pathParameters := map[string]interface{}{
429		"subscriptionId": autorest.Encode("path", client.SubscriptionID),
430	}
431
432	const APIVersion = "2020-01-01-preview"
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}/providers/Microsoft.Peering/peeringServices", pathParameters),
441		autorest.WithQueryParameters(queryParameters))
442	return preparer.Prepare((&http.Request{}).WithContext(ctx))
443}
444
445// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
446// http.Response Body if it receives an error.
447func (client ServicesClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
448	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
449}
450
451// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
452// closes the http.Response Body.
453func (client ServicesClient) ListBySubscriptionResponder(resp *http.Response) (result ServiceListResult, err error) {
454	err = autorest.Respond(
455		resp,
456		azure.WithErrorUnlessStatusCode(http.StatusOK),
457		autorest.ByUnmarshallingJSON(&result),
458		autorest.ByClosing())
459	result.Response = autorest.Response{Response: resp}
460	return
461}
462
463// listBySubscriptionNextResults retrieves the next set of results, if any.
464func (client ServicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults ServiceListResult) (result ServiceListResult, err error) {
465	req, err := lastResults.serviceListResultPreparer(ctx)
466	if err != nil {
467		return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request")
468	}
469	if req == nil {
470		return
471	}
472	resp, err := client.ListBySubscriptionSender(req)
473	if err != nil {
474		result.Response = autorest.Response{Response: resp}
475		return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
476	}
477	result, err = client.ListBySubscriptionResponder(resp)
478	if err != nil {
479		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request")
480	}
481	return
482}
483
484// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
485func (client ServicesClient) ListBySubscriptionComplete(ctx context.Context) (result ServiceListResultIterator, err error) {
486	if tracing.IsEnabled() {
487		ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListBySubscription")
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.ListBySubscription(ctx)
497	return
498}
499
500// Update updates tags for a peering service with the specified name under the given subscription and resource group.
501// Parameters:
502// resourceGroupName - the name of the resource group.
503// peeringServiceName - the name of the peering service.
504// tags - the resource tags.
505func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, peeringServiceName string, tags ResourceTags) (result Service, err error) {
506	if tracing.IsEnabled() {
507		ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Update")
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.UpdatePreparer(ctx, resourceGroupName, peeringServiceName, tags)
517	if err != nil {
518		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", nil, "Failure preparing request")
519		return
520	}
521
522	resp, err := client.UpdateSender(req)
523	if err != nil {
524		result.Response = autorest.Response{Response: resp}
525		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", resp, "Failure sending request")
526		return
527	}
528
529	result, err = client.UpdateResponder(resp)
530	if err != nil {
531		err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", resp, "Failure responding to request")
532		return
533	}
534
535	return
536}
537
538// UpdatePreparer prepares the Update request.
539func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, tags ResourceTags) (*http.Request, error) {
540	pathParameters := map[string]interface{}{
541		"peeringServiceName": autorest.Encode("path", peeringServiceName),
542		"resourceGroupName":  autorest.Encode("path", resourceGroupName),
543		"subscriptionId":     autorest.Encode("path", client.SubscriptionID),
544	}
545
546	const APIVersion = "2020-01-01-preview"
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.Peering/peeringServices/{peeringServiceName}", pathParameters),
556		autorest.WithJSON(tags),
557		autorest.WithQueryParameters(queryParameters))
558	return preparer.Prepare((&http.Request{}).WithContext(ctx))
559}
560
561// UpdateSender sends the Update request. The method will close the
562// http.Response Body if it receives an error.
563func (client ServicesClient) UpdateSender(req *http.Request) (*http.Response, error) {
564	return client.Send(req, azure.DoRetryWithRegistration(client.Client))
565}
566
567// UpdateResponder handles the response to the Update request. The method always
568// closes the http.Response Body.
569func (client ServicesClient) UpdateResponder(resp *http.Response) (result Service, err error) {
570	err = autorest.Respond(
571		resp,
572		azure.WithErrorUnlessStatusCode(http.StatusOK),
573		autorest.ByUnmarshallingJSON(&result),
574		autorest.ByClosing())
575	result.Response = autorest.Response{Response: resp}
576	return
577}
578