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