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