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