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