1package batchai 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 "net/http" 26) 27 28// FileServersClient is the the Azure BatchAI Management API. 29type FileServersClient struct { 30 BaseClient 31} 32 33// NewFileServersClient creates an instance of the FileServersClient client. 34func NewFileServersClient(subscriptionID string) FileServersClient { 35 return NewFileServersClientWithBaseURI(DefaultBaseURI, subscriptionID) 36} 37 38// NewFileServersClientWithBaseURI creates an instance of the FileServersClient client. 39func NewFileServersClientWithBaseURI(baseURI string, subscriptionID string) FileServersClient { 40 return FileServersClient{NewWithBaseURI(baseURI, subscriptionID)} 41} 42 43// Create creates a file server. 44// Parameters: 45// resourceGroupName - name of the resource group to which the resource belongs. 46// fileServerName - the name of the file server within the specified resource group. File server names can only 47// contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be 48// from 1 through 64 characters long. 49// parameters - the parameters to provide for file server creation. 50func (client FileServersClient) Create(ctx context.Context, resourceGroupName string, fileServerName string, parameters FileServerCreateParameters) (result FileServersCreateFuture, err error) { 51 if err := validation.Validate([]validation.Validation{ 52 {TargetValue: resourceGroupName, 53 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, 54 {TargetValue: fileServerName, 55 Constraints: []validation.Constraint{{Target: "fileServerName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 56 {Target: "fileServerName", Name: validation.MinLength, Rule: 1, Chain: nil}, 57 {Target: "fileServerName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, 58 {TargetValue: parameters, 59 Constraints: []validation.Constraint{{Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, 60 {Target: "parameters.FileServerBaseProperties", Name: validation.Null, Rule: false, 61 Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.VMSize", Name: validation.Null, Rule: true, Chain: nil}, 62 {Target: "parameters.FileServerBaseProperties.SSHConfiguration", Name: validation.Null, Rule: true, 63 Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.SSHConfiguration.UserAccountSettings", Name: validation.Null, Rule: true, 64 Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.SSHConfiguration.UserAccountSettings.AdminUserName", Name: validation.Null, Rule: true, Chain: nil}}}, 65 }}, 66 {Target: "parameters.FileServerBaseProperties.DataDisks", Name: validation.Null, Rule: true, 67 Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.DataDisks.DiskSizeInGB", Name: validation.Null, Rule: true, Chain: nil}, 68 {Target: "parameters.FileServerBaseProperties.DataDisks.DiskCount", Name: validation.Null, Rule: true, Chain: nil}, 69 }}, 70 {Target: "parameters.FileServerBaseProperties.Subnet", Name: validation.Null, Rule: false, 71 Chain: []validation.Constraint{{Target: "parameters.FileServerBaseProperties.Subnet.ID", Name: validation.Null, Rule: true, Chain: nil}}}, 72 }}}}}); err != nil { 73 return result, validation.NewError("batchai.FileServersClient", "Create", err.Error()) 74 } 75 76 req, err := client.CreatePreparer(ctx, resourceGroupName, fileServerName, parameters) 77 if err != nil { 78 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "Create", nil, "Failure preparing request") 79 return 80 } 81 82 result, err = client.CreateSender(req) 83 if err != nil { 84 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "Create", result.Response(), "Failure sending request") 85 return 86 } 87 88 return 89} 90 91// CreatePreparer prepares the Create request. 92func (client FileServersClient) CreatePreparer(ctx context.Context, resourceGroupName string, fileServerName string, parameters FileServerCreateParameters) (*http.Request, error) { 93 pathParameters := map[string]interface{}{ 94 "fileServerName": autorest.Encode("path", fileServerName), 95 "resourceGroupName": autorest.Encode("path", resourceGroupName), 96 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 97 } 98 99 const APIVersion = "2017-09-01-preview" 100 queryParameters := map[string]interface{}{ 101 "api-version": APIVersion, 102 } 103 104 preparer := autorest.CreatePreparer( 105 autorest.AsContentType("application/json; charset=utf-8"), 106 autorest.AsPut(), 107 autorest.WithBaseURL(client.BaseURI), 108 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/fileServers/{fileServerName}", pathParameters), 109 autorest.WithJSON(parameters), 110 autorest.WithQueryParameters(queryParameters)) 111 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 112} 113 114// CreateSender sends the Create request. The method will close the 115// http.Response Body if it receives an error. 116func (client FileServersClient) CreateSender(req *http.Request) (future FileServersCreateFuture, err error) { 117 var resp *http.Response 118 resp, err = autorest.SendWithSender(client, req, 119 azure.DoRetryWithRegistration(client.Client)) 120 if err != nil { 121 return 122 } 123 err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) 124 if err != nil { 125 return 126 } 127 future.Future, err = azure.NewFutureFromResponse(resp) 128 return 129} 130 131// CreateResponder handles the response to the Create request. The method always 132// closes the http.Response Body. 133func (client FileServersClient) CreateResponder(resp *http.Response) (result FileServer, err error) { 134 err = autorest.Respond( 135 resp, 136 client.ByInspecting(), 137 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 138 autorest.ByUnmarshallingJSON(&result), 139 autorest.ByClosing()) 140 result.Response = autorest.Response{Response: resp} 141 return 142} 143 144// Delete delete a file Server. 145// Parameters: 146// resourceGroupName - name of the resource group to which the resource belongs. 147// fileServerName - the name of the file server within the specified resource group. File server names can only 148// contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be 149// from 1 through 64 characters long. 150func (client FileServersClient) Delete(ctx context.Context, resourceGroupName string, fileServerName string) (result FileServersDeleteFuture, err error) { 151 if err := validation.Validate([]validation.Validation{ 152 {TargetValue: resourceGroupName, 153 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, 154 {TargetValue: fileServerName, 155 Constraints: []validation.Constraint{{Target: "fileServerName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 156 {Target: "fileServerName", Name: validation.MinLength, Rule: 1, Chain: nil}, 157 {Target: "fileServerName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { 158 return result, validation.NewError("batchai.FileServersClient", "Delete", err.Error()) 159 } 160 161 req, err := client.DeletePreparer(ctx, resourceGroupName, fileServerName) 162 if err != nil { 163 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "Delete", nil, "Failure preparing request") 164 return 165 } 166 167 result, err = client.DeleteSender(req) 168 if err != nil { 169 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "Delete", result.Response(), "Failure sending request") 170 return 171 } 172 173 return 174} 175 176// DeletePreparer prepares the Delete request. 177func (client FileServersClient) DeletePreparer(ctx context.Context, resourceGroupName string, fileServerName string) (*http.Request, error) { 178 pathParameters := map[string]interface{}{ 179 "fileServerName": autorest.Encode("path", fileServerName), 180 "resourceGroupName": autorest.Encode("path", resourceGroupName), 181 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 182 } 183 184 const APIVersion = "2017-09-01-preview" 185 queryParameters := map[string]interface{}{ 186 "api-version": APIVersion, 187 } 188 189 preparer := autorest.CreatePreparer( 190 autorest.AsDelete(), 191 autorest.WithBaseURL(client.BaseURI), 192 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/fileServers/{fileServerName}", pathParameters), 193 autorest.WithQueryParameters(queryParameters)) 194 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 195} 196 197// DeleteSender sends the Delete request. The method will close the 198// http.Response Body if it receives an error. 199func (client FileServersClient) DeleteSender(req *http.Request) (future FileServersDeleteFuture, err error) { 200 var resp *http.Response 201 resp, err = autorest.SendWithSender(client, req, 202 azure.DoRetryWithRegistration(client.Client)) 203 if err != nil { 204 return 205 } 206 err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) 207 if err != nil { 208 return 209 } 210 future.Future, err = azure.NewFutureFromResponse(resp) 211 return 212} 213 214// DeleteResponder handles the response to the Delete request. The method always 215// closes the http.Response Body. 216func (client FileServersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { 217 err = autorest.Respond( 218 resp, 219 client.ByInspecting(), 220 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), 221 autorest.ByClosing()) 222 result.Response = resp 223 return 224} 225 226// Get gets information about the specified Cluster. 227// Parameters: 228// resourceGroupName - name of the resource group to which the resource belongs. 229// fileServerName - the name of the file server within the specified resource group. File server names can only 230// contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must be 231// from 1 through 64 characters long. 232func (client FileServersClient) Get(ctx context.Context, resourceGroupName string, fileServerName string) (result FileServer, err error) { 233 if err := validation.Validate([]validation.Validation{ 234 {TargetValue: resourceGroupName, 235 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, 236 {TargetValue: fileServerName, 237 Constraints: []validation.Constraint{{Target: "fileServerName", Name: validation.MaxLength, Rule: 64, Chain: nil}, 238 {Target: "fileServerName", Name: validation.MinLength, Rule: 1, Chain: nil}, 239 {Target: "fileServerName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { 240 return result, validation.NewError("batchai.FileServersClient", "Get", err.Error()) 241 } 242 243 req, err := client.GetPreparer(ctx, resourceGroupName, fileServerName) 244 if err != nil { 245 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "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, "batchai.FileServersClient", "Get", resp, "Failure sending request") 253 return 254 } 255 256 result, err = client.GetResponder(resp) 257 if err != nil { 258 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "Get", resp, "Failure responding to request") 259 } 260 261 return 262} 263 264// GetPreparer prepares the Get request. 265func (client FileServersClient) GetPreparer(ctx context.Context, resourceGroupName string, fileServerName string) (*http.Request, error) { 266 pathParameters := map[string]interface{}{ 267 "fileServerName": autorest.Encode("path", fileServerName), 268 "resourceGroupName": autorest.Encode("path", resourceGroupName), 269 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 270 } 271 272 const APIVersion = "2017-09-01-preview" 273 queryParameters := map[string]interface{}{ 274 "api-version": APIVersion, 275 } 276 277 preparer := autorest.CreatePreparer( 278 autorest.AsGet(), 279 autorest.WithBaseURL(client.BaseURI), 280 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/fileServers/{fileServerName}", pathParameters), 281 autorest.WithQueryParameters(queryParameters)) 282 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 283} 284 285// GetSender sends the Get request. The method will close the 286// http.Response Body if it receives an error. 287func (client FileServersClient) GetSender(req *http.Request) (*http.Response, error) { 288 return autorest.SendWithSender(client, req, 289 azure.DoRetryWithRegistration(client.Client)) 290} 291 292// GetResponder handles the response to the Get request. The method always 293// closes the http.Response Body. 294func (client FileServersClient) GetResponder(resp *http.Response) (result FileServer, err error) { 295 err = autorest.Respond( 296 resp, 297 client.ByInspecting(), 298 azure.WithErrorUnlessStatusCode(http.StatusOK), 299 autorest.ByUnmarshallingJSON(&result), 300 autorest.ByClosing()) 301 result.Response = autorest.Response{Response: resp} 302 return 303} 304 305// List to list all the file servers available under the given subscription (and across all resource groups within that 306// subscription) 307// Parameters: 308// filter - an OData $filter clause.. Used to filter results that are returned in the GET respnose. 309// selectParameter - an OData $select clause. Used to select the properties to be returned in the GET respnose. 310// maxResults - the maximum number of items to return in the response. A maximum of 1000 files can be returned. 311func (client FileServersClient) List(ctx context.Context, filter string, selectParameter string, maxResults *int32) (result FileServerListResultPage, err error) { 312 if err := validation.Validate([]validation.Validation{ 313 {TargetValue: maxResults, 314 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 315 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, 316 {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 317 }}}}}); err != nil { 318 return result, validation.NewError("batchai.FileServersClient", "List", err.Error()) 319 } 320 321 result.fn = client.listNextResults 322 req, err := client.ListPreparer(ctx, filter, selectParameter, maxResults) 323 if err != nil { 324 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "List", nil, "Failure preparing request") 325 return 326 } 327 328 resp, err := client.ListSender(req) 329 if err != nil { 330 result.fslr.Response = autorest.Response{Response: resp} 331 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "List", resp, "Failure sending request") 332 return 333 } 334 335 result.fslr, err = client.ListResponder(resp) 336 if err != nil { 337 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "List", resp, "Failure responding to request") 338 } 339 340 return 341} 342 343// ListPreparer prepares the List request. 344func (client FileServersClient) ListPreparer(ctx context.Context, filter string, selectParameter string, maxResults *int32) (*http.Request, error) { 345 pathParameters := map[string]interface{}{ 346 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 347 } 348 349 const APIVersion = "2017-09-01-preview" 350 queryParameters := map[string]interface{}{ 351 "api-version": APIVersion, 352 } 353 if len(filter) > 0 { 354 queryParameters["$filter"] = autorest.Encode("query", filter) 355 } 356 if len(selectParameter) > 0 { 357 queryParameters["$select"] = autorest.Encode("query", selectParameter) 358 } 359 if maxResults != nil { 360 queryParameters["maxresults"] = autorest.Encode("query", *maxResults) 361 } else { 362 queryParameters["maxresults"] = autorest.Encode("query", 1000) 363 } 364 365 preparer := autorest.CreatePreparer( 366 autorest.AsGet(), 367 autorest.WithBaseURL(client.BaseURI), 368 autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.BatchAI/fileServers", pathParameters), 369 autorest.WithQueryParameters(queryParameters)) 370 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 371} 372 373// ListSender sends the List request. The method will close the 374// http.Response Body if it receives an error. 375func (client FileServersClient) ListSender(req *http.Request) (*http.Response, error) { 376 return autorest.SendWithSender(client, req, 377 azure.DoRetryWithRegistration(client.Client)) 378} 379 380// ListResponder handles the response to the List request. The method always 381// closes the http.Response Body. 382func (client FileServersClient) ListResponder(resp *http.Response) (result FileServerListResult, err error) { 383 err = autorest.Respond( 384 resp, 385 client.ByInspecting(), 386 azure.WithErrorUnlessStatusCode(http.StatusOK), 387 autorest.ByUnmarshallingJSON(&result), 388 autorest.ByClosing()) 389 result.Response = autorest.Response{Response: resp} 390 return 391} 392 393// listNextResults retrieves the next set of results, if any. 394func (client FileServersClient) listNextResults(lastResults FileServerListResult) (result FileServerListResult, err error) { 395 req, err := lastResults.fileServerListResultPreparer() 396 if err != nil { 397 return result, autorest.NewErrorWithError(err, "batchai.FileServersClient", "listNextResults", nil, "Failure preparing next results request") 398 } 399 if req == nil { 400 return 401 } 402 resp, err := client.ListSender(req) 403 if err != nil { 404 result.Response = autorest.Response{Response: resp} 405 return result, autorest.NewErrorWithError(err, "batchai.FileServersClient", "listNextResults", resp, "Failure sending next results request") 406 } 407 result, err = client.ListResponder(resp) 408 if err != nil { 409 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "listNextResults", resp, "Failure responding to next results request") 410 } 411 return 412} 413 414// ListComplete enumerates all values, automatically crossing page boundaries as required. 415func (client FileServersClient) ListComplete(ctx context.Context, filter string, selectParameter string, maxResults *int32) (result FileServerListResultIterator, err error) { 416 result.page, err = client.List(ctx, filter, selectParameter, maxResults) 417 return 418} 419 420// ListByResourceGroup gets a formatted list of file servers and their properties associated within the specified 421// resource group. 422// Parameters: 423// resourceGroupName - name of the resource group to which the resource belongs. 424// filter - an OData $filter clause.. Used to filter results that are returned in the GET respnose. 425// selectParameter - an OData $select clause. Used to select the properties to be returned in the GET respnose. 426// maxResults - the maximum number of items to return in the response. A maximum of 1000 files can be returned. 427func (client FileServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, maxResults *int32) (result FileServerListResultPage, err error) { 428 if err := validation.Validate([]validation.Validation{ 429 {TargetValue: resourceGroupName, 430 Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}, 431 {TargetValue: maxResults, 432 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 433 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMaximum, Rule: int64(1000), Chain: nil}, 434 {Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 435 }}}}}); err != nil { 436 return result, validation.NewError("batchai.FileServersClient", "ListByResourceGroup", err.Error()) 437 } 438 439 result.fn = client.listByResourceGroupNextResults 440 req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, selectParameter, maxResults) 441 if err != nil { 442 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "ListByResourceGroup", nil, "Failure preparing request") 443 return 444 } 445 446 resp, err := client.ListByResourceGroupSender(req) 447 if err != nil { 448 result.fslr.Response = autorest.Response{Response: resp} 449 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "ListByResourceGroup", resp, "Failure sending request") 450 return 451 } 452 453 result.fslr, err = client.ListByResourceGroupResponder(resp) 454 if err != nil { 455 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "ListByResourceGroup", resp, "Failure responding to request") 456 } 457 458 return 459} 460 461// ListByResourceGroupPreparer prepares the ListByResourceGroup request. 462func (client FileServersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, maxResults *int32) (*http.Request, error) { 463 pathParameters := map[string]interface{}{ 464 "resourceGroupName": autorest.Encode("path", resourceGroupName), 465 "subscriptionId": autorest.Encode("path", client.SubscriptionID), 466 } 467 468 const APIVersion = "2017-09-01-preview" 469 queryParameters := map[string]interface{}{ 470 "api-version": APIVersion, 471 } 472 if len(filter) > 0 { 473 queryParameters["$filter"] = autorest.Encode("query", filter) 474 } 475 if len(selectParameter) > 0 { 476 queryParameters["$select"] = autorest.Encode("query", selectParameter) 477 } 478 if maxResults != nil { 479 queryParameters["maxresults"] = autorest.Encode("query", *maxResults) 480 } else { 481 queryParameters["maxresults"] = autorest.Encode("query", 1000) 482 } 483 484 preparer := autorest.CreatePreparer( 485 autorest.AsGet(), 486 autorest.WithBaseURL(client.BaseURI), 487 autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.BatchAI/fileServers", pathParameters), 488 autorest.WithQueryParameters(queryParameters)) 489 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 490} 491 492// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the 493// http.Response Body if it receives an error. 494func (client FileServersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { 495 return autorest.SendWithSender(client, req, 496 azure.DoRetryWithRegistration(client.Client)) 497} 498 499// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always 500// closes the http.Response Body. 501func (client FileServersClient) ListByResourceGroupResponder(resp *http.Response) (result FileServerListResult, err error) { 502 err = autorest.Respond( 503 resp, 504 client.ByInspecting(), 505 azure.WithErrorUnlessStatusCode(http.StatusOK), 506 autorest.ByUnmarshallingJSON(&result), 507 autorest.ByClosing()) 508 result.Response = autorest.Response{Response: resp} 509 return 510} 511 512// listByResourceGroupNextResults retrieves the next set of results, if any. 513func (client FileServersClient) listByResourceGroupNextResults(lastResults FileServerListResult) (result FileServerListResult, err error) { 514 req, err := lastResults.fileServerListResultPreparer() 515 if err != nil { 516 return result, autorest.NewErrorWithError(err, "batchai.FileServersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") 517 } 518 if req == nil { 519 return 520 } 521 resp, err := client.ListByResourceGroupSender(req) 522 if err != nil { 523 result.Response = autorest.Response{Response: resp} 524 return result, autorest.NewErrorWithError(err, "batchai.FileServersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") 525 } 526 result, err = client.ListByResourceGroupResponder(resp) 527 if err != nil { 528 err = autorest.NewErrorWithError(err, "batchai.FileServersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") 529 } 530 return 531} 532 533// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. 534func (client FileServersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, maxResults *int32) (result FileServerListResultIterator, err error) { 535 result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, selectParameter, maxResults) 536 return 537} 538