1package catalog 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 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/date" 14 "github.com/Azure/go-autorest/autorest/to" 15 "github.com/Azure/go-autorest/tracing" 16 "github.com/gofrs/uuid" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/datalake/analytics/2016-11-01-preview/catalog" 22 23// ACL a Data Lake Analytics catalog access control list (ACL) entry. 24type ACL struct { 25 // AceType - READ-ONLY; the access control list (ACL) entry type. UserObj and GroupObj denote the owning user and group, respectively. Possible values include: 'UserObj', 'GroupObj', 'Other', 'User', 'Group' 26 AceType ACLType `json:"aceType,omitempty"` 27 // PrincipalID - READ-ONLY; the Azure AD object ID of the user or group being specified in the access control list (ACL) entry. 28 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 29 // Permission - READ-ONLY; the permission type of the access control list (ACL) entry. Possible values include: 'None', 'Use', 'Create', 'Drop', 'Alter', 'Write', 'All' 30 Permission PermissionType `json:"permission,omitempty"` 31} 32 33// MarshalJSON is the custom marshaler for ACL. 34func (a ACL) MarshalJSON() ([]byte, error) { 35 objectMap := make(map[string]interface{}) 36 return json.Marshal(objectMap) 37} 38 39// ACLCreateOrUpdateParameters the parameters used to create or update an access control list (ACL) entry. 40type ACLCreateOrUpdateParameters struct { 41 // AceType - the access control list (ACL) entry type. UserObj and GroupObj denote the owning user and group, respectively. Possible values include: 'UserObj', 'GroupObj', 'Other', 'User', 'Group' 42 AceType ACLType `json:"aceType,omitempty"` 43 // PrincipalID - the Azure AD object ID of the user or group being specified in the access control list (ACL) entry. 44 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 45 // Permission - the permission type of the access control list (ACL) entry. Possible values include: 'None', 'Use', 'Create', 'Drop', 'Alter', 'Write', 'All' 46 Permission PermissionType `json:"permission,omitempty"` 47} 48 49// ACLDeleteParameters the parameters used to delete an access control list (ACL) entry. 50type ACLDeleteParameters struct { 51 // AceType - the access control list (ACL) entry type. UserObj and GroupObj denote the owning user and group, respectively. Possible values include: 'UserObj', 'GroupObj', 'Other', 'User', 'Group' 52 AceType ACLType `json:"aceType,omitempty"` 53 // PrincipalID - the Azure AD object ID of the user or group being specified in the access control list (ACL) entry. 54 PrincipalID *uuid.UUID `json:"principalId,omitempty"` 55} 56 57// ACLList a Data Lake Analytics catalog access control list (ACL). 58type ACLList struct { 59 autorest.Response `json:"-"` 60 // Value - READ-ONLY; the access control list (ACL). 61 Value *[]ACL `json:"value,omitempty"` 62 // NextLink - the link to the next page of results. 63 NextLink *string `json:"nextLink,omitempty"` 64} 65 66// MarshalJSON is the custom marshaler for ACLList. 67func (al ACLList) MarshalJSON() ([]byte, error) { 68 objectMap := make(map[string]interface{}) 69 if al.NextLink != nil { 70 objectMap["nextLink"] = al.NextLink 71 } 72 return json.Marshal(objectMap) 73} 74 75// ACLListIterator provides access to a complete listing of ACL values. 76type ACLListIterator struct { 77 i int 78 page ACLListPage 79} 80 81// NextWithContext advances to the next value. If there was an error making 82// the request the iterator does not advance and the error is returned. 83func (iter *ACLListIterator) NextWithContext(ctx context.Context) (err error) { 84 if tracing.IsEnabled() { 85 ctx = tracing.StartSpan(ctx, fqdn+"/ACLListIterator.NextWithContext") 86 defer func() { 87 sc := -1 88 if iter.Response().Response.Response != nil { 89 sc = iter.Response().Response.Response.StatusCode 90 } 91 tracing.EndSpan(ctx, sc, err) 92 }() 93 } 94 iter.i++ 95 if iter.i < len(iter.page.Values()) { 96 return nil 97 } 98 err = iter.page.NextWithContext(ctx) 99 if err != nil { 100 iter.i-- 101 return err 102 } 103 iter.i = 0 104 return nil 105} 106 107// Next advances to the next value. If there was an error making 108// the request the iterator does not advance and the error is returned. 109// Deprecated: Use NextWithContext() instead. 110func (iter *ACLListIterator) Next() error { 111 return iter.NextWithContext(context.Background()) 112} 113 114// NotDone returns true if the enumeration should be started or is not yet complete. 115func (iter ACLListIterator) NotDone() bool { 116 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 117} 118 119// Response returns the raw server response from the last page request. 120func (iter ACLListIterator) Response() ACLList { 121 return iter.page.Response() 122} 123 124// Value returns the current value or a zero-initialized value if the 125// iterator has advanced beyond the end of the collection. 126func (iter ACLListIterator) Value() ACL { 127 if !iter.page.NotDone() { 128 return ACL{} 129 } 130 return iter.page.Values()[iter.i] 131} 132 133// Creates a new instance of the ACLListIterator type. 134func NewACLListIterator(page ACLListPage) ACLListIterator { 135 return ACLListIterator{page: page} 136} 137 138// IsEmpty returns true if the ListResult contains no values. 139func (al ACLList) IsEmpty() bool { 140 return al.Value == nil || len(*al.Value) == 0 141} 142 143// hasNextLink returns true if the NextLink is not empty. 144func (al ACLList) hasNextLink() bool { 145 return al.NextLink != nil && len(*al.NextLink) != 0 146} 147 148// aCLListPreparer prepares a request to retrieve the next set of results. 149// It returns nil if no more results exist. 150func (al ACLList) aCLListPreparer(ctx context.Context) (*http.Request, error) { 151 if !al.hasNextLink() { 152 return nil, nil 153 } 154 return autorest.Prepare((&http.Request{}).WithContext(ctx), 155 autorest.AsJSON(), 156 autorest.AsGet(), 157 autorest.WithBaseURL(to.String(al.NextLink))) 158} 159 160// ACLListPage contains a page of ACL values. 161type ACLListPage struct { 162 fn func(context.Context, ACLList) (ACLList, error) 163 al ACLList 164} 165 166// NextWithContext advances to the next page of values. If there was an error making 167// the request the page does not advance and the error is returned. 168func (page *ACLListPage) NextWithContext(ctx context.Context) (err error) { 169 if tracing.IsEnabled() { 170 ctx = tracing.StartSpan(ctx, fqdn+"/ACLListPage.NextWithContext") 171 defer func() { 172 sc := -1 173 if page.Response().Response.Response != nil { 174 sc = page.Response().Response.Response.StatusCode 175 } 176 tracing.EndSpan(ctx, sc, err) 177 }() 178 } 179 for { 180 next, err := page.fn(ctx, page.al) 181 if err != nil { 182 return err 183 } 184 page.al = next 185 if !next.hasNextLink() || !next.IsEmpty() { 186 break 187 } 188 } 189 return nil 190} 191 192// Next advances to the next page of values. If there was an error making 193// the request the page does not advance and the error is returned. 194// Deprecated: Use NextWithContext() instead. 195func (page *ACLListPage) Next() error { 196 return page.NextWithContext(context.Background()) 197} 198 199// NotDone returns true if the page enumeration should be started or is not yet complete. 200func (page ACLListPage) NotDone() bool { 201 return !page.al.IsEmpty() 202} 203 204// Response returns the raw server response from the last page request. 205func (page ACLListPage) Response() ACLList { 206 return page.al 207} 208 209// Values returns the slice of values for the current page or nil if there are no values. 210func (page ACLListPage) Values() []ACL { 211 if page.al.IsEmpty() { 212 return nil 213 } 214 return *page.al.Value 215} 216 217// Creates a new instance of the ACLListPage type. 218func NewACLListPage(cur ACLList, getNextPage func(context.Context, ACLList) (ACLList, error)) ACLListPage { 219 return ACLListPage{ 220 fn: getNextPage, 221 al: cur, 222 } 223} 224 225// DataLakeAnalyticsCatalogCredentialCreateParameters data Lake Analytics catalog credential creation 226// parameters. 227type DataLakeAnalyticsCatalogCredentialCreateParameters struct { 228 // Password - the password for the credential and user with access to the data source. 229 Password *string `json:"password,omitempty"` 230 // URI - the URI identifier for the data source this credential can connect to in the format <hostname>:<port> 231 URI *string `json:"uri,omitempty"` 232 // UserID - the object identifier for the user associated with this credential with access to the data source. 233 UserID *string `json:"userId,omitempty"` 234} 235 236// DataLakeAnalyticsCatalogCredentialDeleteParameters data Lake Analytics catalog credential deletion 237// parameters. 238type DataLakeAnalyticsCatalogCredentialDeleteParameters struct { 239 // Password - the current password for the credential and user with access to the data source. This is required if the requester is not the account owner. 240 Password *string `json:"password,omitempty"` 241} 242 243// DataLakeAnalyticsCatalogCredentialUpdateParameters data Lake Analytics catalog credential update 244// parameters. 245type DataLakeAnalyticsCatalogCredentialUpdateParameters struct { 246 // Password - the current password for the credential and user with access to the data source. This is required if the requester is not the account owner. 247 Password *string `json:"password,omitempty"` 248 // NewPassword - the new password for the credential and user with access to the data source. 249 NewPassword *string `json:"newPassword,omitempty"` 250 // URI - the URI identifier for the data source this credential can connect to in the format <hostname>:<port> 251 URI *string `json:"uri,omitempty"` 252 // UserID - the object identifier for the user associated with this credential with access to the data source. 253 UserID *string `json:"userId,omitempty"` 254} 255 256// DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters data Lake Analytics catalog secret creation and 257// update parameters. This is deprecated and will be removed in the next release. Please use 258// DataLakeAnalyticsCatalogCredentialCreateOrUpdateParameters instead. 259type DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters struct { 260 // Password - the password for the secret to pass in 261 Password *string `json:"password,omitempty"` 262 // URI - the URI identifier for the secret in the format <hostname>:<port> 263 URI *string `json:"uri,omitempty"` 264} 265 266// DdlName a Data Lake Analytics DDL name item. 267type DdlName struct { 268 // FirstPart - the name of the table associated with this database and schema. 269 FirstPart *string `json:"firstPart,omitempty"` 270 // SecondPart - the name of the table associated with this database and schema. 271 SecondPart *string `json:"secondPart,omitempty"` 272 // ThirdPart - the name of the table associated with this database and schema. 273 ThirdPart *string `json:"thirdPart,omitempty"` 274 // Server - the name of the table associated with this database and schema. 275 Server *string `json:"server,omitempty"` 276} 277 278// EntityID a Data Lake Analytics catalog entity identifier object. 279type EntityID struct { 280 // Name - the name of the external table associated with this database, schema and table. 281 Name *DdlName `json:"name,omitempty"` 282 // Version - the version of the external data source. 283 Version *uuid.UUID `json:"version,omitempty"` 284} 285 286// ExternalTable a Data Lake Analytics catalog external table item. 287type ExternalTable struct { 288 // TableName - the name of the table associated with this database and schema. 289 TableName *string `json:"tableName,omitempty"` 290 // DataSource - the data source associated with this external table. 291 DataSource *EntityID `json:"dataSource,omitempty"` 292} 293 294// Item a Data Lake Analytics catalog item. 295type Item struct { 296 // ComputeAccountName - the name of the Data Lake Analytics account. 297 ComputeAccountName *string `json:"computeAccountName,omitempty"` 298 // Version - the version of the catalog item. 299 Version *uuid.UUID `json:"version,omitempty"` 300} 301 302// ItemList a Data Lake Analytics catalog item list. 303type ItemList struct { 304 // NextLink - the link to the next page of results. 305 NextLink *string `json:"nextLink,omitempty"` 306} 307 308// TypeFieldInfo a Data Lake Analytics catalog type field information item. 309type TypeFieldInfo struct { 310 // Name - the name of the field associated with this type. 311 Name *string `json:"name,omitempty"` 312 // Type - the type of the field. 313 Type *string `json:"type,omitempty"` 314} 315 316// USQLAssembly a Data Lake Analytics catalog U-SQL Assembly. 317type USQLAssembly struct { 318 autorest.Response `json:"-"` 319 // DatabaseName - the name of the database. 320 DatabaseName *string `json:"databaseName,omitempty"` 321 // Name - the name of the assembly. 322 Name *string `json:"assemblyName,omitempty"` 323 // ClrName - the name of the CLR. 324 ClrName *string `json:"clrName,omitempty"` 325 // IsVisible - the switch indicating if this assembly is visible or not. 326 IsVisible *bool `json:"isVisible,omitempty"` 327 // IsUserDefined - the switch indicating if this assembly is user defined or not. 328 IsUserDefined *bool `json:"isUserDefined,omitempty"` 329 // Files - the list of files associated with the assembly 330 Files *[]USQLAssemblyFileInfo `json:"files,omitempty"` 331 // Dependencies - the list of dependencies associated with the assembly 332 Dependencies *[]USQLAssemblyDependencyInfo `json:"dependencies,omitempty"` 333 // ComputeAccountName - the name of the Data Lake Analytics account. 334 ComputeAccountName *string `json:"computeAccountName,omitempty"` 335 // Version - the version of the catalog item. 336 Version *uuid.UUID `json:"version,omitempty"` 337} 338 339// USQLAssemblyClr a Data Lake Analytics catalog U-SQL assembly CLR item. 340type USQLAssemblyClr struct { 341 // DatabaseName - the name of the database. 342 DatabaseName *string `json:"databaseName,omitempty"` 343 // Name - the name of the assembly. 344 Name *string `json:"assemblyClrName,omitempty"` 345 // ClrName - the name of the CLR. 346 ClrName *string `json:"clrName,omitempty"` 347 // ComputeAccountName - the name of the Data Lake Analytics account. 348 ComputeAccountName *string `json:"computeAccountName,omitempty"` 349 // Version - the version of the catalog item. 350 Version *uuid.UUID `json:"version,omitempty"` 351} 352 353// USQLAssemblyDependencyInfo a Data Lake Analytics catalog U-SQL dependency information item. 354type USQLAssemblyDependencyInfo struct { 355 // EntityID - the EntityId of the dependency. 356 EntityID *EntityID `json:"entityId,omitempty"` 357} 358 359// USQLAssemblyFileInfo a Data Lake Analytics catalog U-SQL assembly file information item. 360type USQLAssemblyFileInfo struct { 361 // Type - the assembly file type. Possible values include: 'Assembly', 'Resource', 'Nodeploy' 362 Type FileType `json:"type,omitempty"` 363 // OriginalPath - The original path to the assembly file. 364 OriginalPath *string `json:"originalPath,omitempty"` 365 // ContentPath - The content path to the assembly file. 366 ContentPath *string `json:"contentPath,omitempty"` 367} 368 369// USQLAssemblyList a Data Lake Analytics catalog U-SQL assembly CLR item list. 370type USQLAssemblyList struct { 371 autorest.Response `json:"-"` 372 // Value - READ-ONLY; the list of assemblies in the database 373 Value *[]USQLAssemblyClr `json:"value,omitempty"` 374 // NextLink - the link to the next page of results. 375 NextLink *string `json:"nextLink,omitempty"` 376} 377 378// MarshalJSON is the custom marshaler for USQLAssemblyList. 379func (usal USQLAssemblyList) MarshalJSON() ([]byte, error) { 380 objectMap := make(map[string]interface{}) 381 if usal.NextLink != nil { 382 objectMap["nextLink"] = usal.NextLink 383 } 384 return json.Marshal(objectMap) 385} 386 387// USQLAssemblyListIterator provides access to a complete listing of USQLAssemblyClr values. 388type USQLAssemblyListIterator struct { 389 i int 390 page USQLAssemblyListPage 391} 392 393// NextWithContext advances to the next value. If there was an error making 394// the request the iterator does not advance and the error is returned. 395func (iter *USQLAssemblyListIterator) NextWithContext(ctx context.Context) (err error) { 396 if tracing.IsEnabled() { 397 ctx = tracing.StartSpan(ctx, fqdn+"/USQLAssemblyListIterator.NextWithContext") 398 defer func() { 399 sc := -1 400 if iter.Response().Response.Response != nil { 401 sc = iter.Response().Response.Response.StatusCode 402 } 403 tracing.EndSpan(ctx, sc, err) 404 }() 405 } 406 iter.i++ 407 if iter.i < len(iter.page.Values()) { 408 return nil 409 } 410 err = iter.page.NextWithContext(ctx) 411 if err != nil { 412 iter.i-- 413 return err 414 } 415 iter.i = 0 416 return nil 417} 418 419// Next advances to the next value. If there was an error making 420// the request the iterator does not advance and the error is returned. 421// Deprecated: Use NextWithContext() instead. 422func (iter *USQLAssemblyListIterator) Next() error { 423 return iter.NextWithContext(context.Background()) 424} 425 426// NotDone returns true if the enumeration should be started or is not yet complete. 427func (iter USQLAssemblyListIterator) NotDone() bool { 428 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 429} 430 431// Response returns the raw server response from the last page request. 432func (iter USQLAssemblyListIterator) Response() USQLAssemblyList { 433 return iter.page.Response() 434} 435 436// Value returns the current value or a zero-initialized value if the 437// iterator has advanced beyond the end of the collection. 438func (iter USQLAssemblyListIterator) Value() USQLAssemblyClr { 439 if !iter.page.NotDone() { 440 return USQLAssemblyClr{} 441 } 442 return iter.page.Values()[iter.i] 443} 444 445// Creates a new instance of the USQLAssemblyListIterator type. 446func NewUSQLAssemblyListIterator(page USQLAssemblyListPage) USQLAssemblyListIterator { 447 return USQLAssemblyListIterator{page: page} 448} 449 450// IsEmpty returns true if the ListResult contains no values. 451func (usal USQLAssemblyList) IsEmpty() bool { 452 return usal.Value == nil || len(*usal.Value) == 0 453} 454 455// hasNextLink returns true if the NextLink is not empty. 456func (usal USQLAssemblyList) hasNextLink() bool { 457 return usal.NextLink != nil && len(*usal.NextLink) != 0 458} 459 460// uSQLAssemblyListPreparer prepares a request to retrieve the next set of results. 461// It returns nil if no more results exist. 462func (usal USQLAssemblyList) uSQLAssemblyListPreparer(ctx context.Context) (*http.Request, error) { 463 if !usal.hasNextLink() { 464 return nil, nil 465 } 466 return autorest.Prepare((&http.Request{}).WithContext(ctx), 467 autorest.AsJSON(), 468 autorest.AsGet(), 469 autorest.WithBaseURL(to.String(usal.NextLink))) 470} 471 472// USQLAssemblyListPage contains a page of USQLAssemblyClr values. 473type USQLAssemblyListPage struct { 474 fn func(context.Context, USQLAssemblyList) (USQLAssemblyList, error) 475 ual USQLAssemblyList 476} 477 478// NextWithContext advances to the next page of values. If there was an error making 479// the request the page does not advance and the error is returned. 480func (page *USQLAssemblyListPage) NextWithContext(ctx context.Context) (err error) { 481 if tracing.IsEnabled() { 482 ctx = tracing.StartSpan(ctx, fqdn+"/USQLAssemblyListPage.NextWithContext") 483 defer func() { 484 sc := -1 485 if page.Response().Response.Response != nil { 486 sc = page.Response().Response.Response.StatusCode 487 } 488 tracing.EndSpan(ctx, sc, err) 489 }() 490 } 491 for { 492 next, err := page.fn(ctx, page.ual) 493 if err != nil { 494 return err 495 } 496 page.ual = next 497 if !next.hasNextLink() || !next.IsEmpty() { 498 break 499 } 500 } 501 return nil 502} 503 504// Next advances to the next page of values. If there was an error making 505// the request the page does not advance and the error is returned. 506// Deprecated: Use NextWithContext() instead. 507func (page *USQLAssemblyListPage) Next() error { 508 return page.NextWithContext(context.Background()) 509} 510 511// NotDone returns true if the page enumeration should be started or is not yet complete. 512func (page USQLAssemblyListPage) NotDone() bool { 513 return !page.ual.IsEmpty() 514} 515 516// Response returns the raw server response from the last page request. 517func (page USQLAssemblyListPage) Response() USQLAssemblyList { 518 return page.ual 519} 520 521// Values returns the slice of values for the current page or nil if there are no values. 522func (page USQLAssemblyListPage) Values() []USQLAssemblyClr { 523 if page.ual.IsEmpty() { 524 return nil 525 } 526 return *page.ual.Value 527} 528 529// Creates a new instance of the USQLAssemblyListPage type. 530func NewUSQLAssemblyListPage(cur USQLAssemblyList, getNextPage func(context.Context, USQLAssemblyList) (USQLAssemblyList, error)) USQLAssemblyListPage { 531 return USQLAssemblyListPage{ 532 fn: getNextPage, 533 ual: cur, 534 } 535} 536 537// USQLCredential a Data Lake Analytics catalog U-SQL credential item. 538type USQLCredential struct { 539 autorest.Response `json:"-"` 540 // Name - the name of the credential. 541 Name *string `json:"credentialName,omitempty"` 542 // ComputeAccountName - the name of the Data Lake Analytics account. 543 ComputeAccountName *string `json:"computeAccountName,omitempty"` 544 // Version - the version of the catalog item. 545 Version *uuid.UUID `json:"version,omitempty"` 546} 547 548// USQLCredentialList a Data Lake Analytics catalog U-SQL credential item list. 549type USQLCredentialList struct { 550 autorest.Response `json:"-"` 551 // Value - READ-ONLY; the list of credentials in the database 552 Value *[]USQLCredential `json:"value,omitempty"` 553 // NextLink - the link to the next page of results. 554 NextLink *string `json:"nextLink,omitempty"` 555} 556 557// MarshalJSON is the custom marshaler for USQLCredentialList. 558func (uscl USQLCredentialList) MarshalJSON() ([]byte, error) { 559 objectMap := make(map[string]interface{}) 560 if uscl.NextLink != nil { 561 objectMap["nextLink"] = uscl.NextLink 562 } 563 return json.Marshal(objectMap) 564} 565 566// USQLCredentialListIterator provides access to a complete listing of USQLCredential values. 567type USQLCredentialListIterator struct { 568 i int 569 page USQLCredentialListPage 570} 571 572// NextWithContext advances to the next value. If there was an error making 573// the request the iterator does not advance and the error is returned. 574func (iter *USQLCredentialListIterator) NextWithContext(ctx context.Context) (err error) { 575 if tracing.IsEnabled() { 576 ctx = tracing.StartSpan(ctx, fqdn+"/USQLCredentialListIterator.NextWithContext") 577 defer func() { 578 sc := -1 579 if iter.Response().Response.Response != nil { 580 sc = iter.Response().Response.Response.StatusCode 581 } 582 tracing.EndSpan(ctx, sc, err) 583 }() 584 } 585 iter.i++ 586 if iter.i < len(iter.page.Values()) { 587 return nil 588 } 589 err = iter.page.NextWithContext(ctx) 590 if err != nil { 591 iter.i-- 592 return err 593 } 594 iter.i = 0 595 return nil 596} 597 598// Next advances to the next value. If there was an error making 599// the request the iterator does not advance and the error is returned. 600// Deprecated: Use NextWithContext() instead. 601func (iter *USQLCredentialListIterator) Next() error { 602 return iter.NextWithContext(context.Background()) 603} 604 605// NotDone returns true if the enumeration should be started or is not yet complete. 606func (iter USQLCredentialListIterator) NotDone() bool { 607 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 608} 609 610// Response returns the raw server response from the last page request. 611func (iter USQLCredentialListIterator) Response() USQLCredentialList { 612 return iter.page.Response() 613} 614 615// Value returns the current value or a zero-initialized value if the 616// iterator has advanced beyond the end of the collection. 617func (iter USQLCredentialListIterator) Value() USQLCredential { 618 if !iter.page.NotDone() { 619 return USQLCredential{} 620 } 621 return iter.page.Values()[iter.i] 622} 623 624// Creates a new instance of the USQLCredentialListIterator type. 625func NewUSQLCredentialListIterator(page USQLCredentialListPage) USQLCredentialListIterator { 626 return USQLCredentialListIterator{page: page} 627} 628 629// IsEmpty returns true if the ListResult contains no values. 630func (uscl USQLCredentialList) IsEmpty() bool { 631 return uscl.Value == nil || len(*uscl.Value) == 0 632} 633 634// hasNextLink returns true if the NextLink is not empty. 635func (uscl USQLCredentialList) hasNextLink() bool { 636 return uscl.NextLink != nil && len(*uscl.NextLink) != 0 637} 638 639// uSQLCredentialListPreparer prepares a request to retrieve the next set of results. 640// It returns nil if no more results exist. 641func (uscl USQLCredentialList) uSQLCredentialListPreparer(ctx context.Context) (*http.Request, error) { 642 if !uscl.hasNextLink() { 643 return nil, nil 644 } 645 return autorest.Prepare((&http.Request{}).WithContext(ctx), 646 autorest.AsJSON(), 647 autorest.AsGet(), 648 autorest.WithBaseURL(to.String(uscl.NextLink))) 649} 650 651// USQLCredentialListPage contains a page of USQLCredential values. 652type USQLCredentialListPage struct { 653 fn func(context.Context, USQLCredentialList) (USQLCredentialList, error) 654 ucl USQLCredentialList 655} 656 657// NextWithContext advances to the next page of values. If there was an error making 658// the request the page does not advance and the error is returned. 659func (page *USQLCredentialListPage) NextWithContext(ctx context.Context) (err error) { 660 if tracing.IsEnabled() { 661 ctx = tracing.StartSpan(ctx, fqdn+"/USQLCredentialListPage.NextWithContext") 662 defer func() { 663 sc := -1 664 if page.Response().Response.Response != nil { 665 sc = page.Response().Response.Response.StatusCode 666 } 667 tracing.EndSpan(ctx, sc, err) 668 }() 669 } 670 for { 671 next, err := page.fn(ctx, page.ucl) 672 if err != nil { 673 return err 674 } 675 page.ucl = next 676 if !next.hasNextLink() || !next.IsEmpty() { 677 break 678 } 679 } 680 return nil 681} 682 683// Next advances to the next page of values. If there was an error making 684// the request the page does not advance and the error is returned. 685// Deprecated: Use NextWithContext() instead. 686func (page *USQLCredentialListPage) Next() error { 687 return page.NextWithContext(context.Background()) 688} 689 690// NotDone returns true if the page enumeration should be started or is not yet complete. 691func (page USQLCredentialListPage) NotDone() bool { 692 return !page.ucl.IsEmpty() 693} 694 695// Response returns the raw server response from the last page request. 696func (page USQLCredentialListPage) Response() USQLCredentialList { 697 return page.ucl 698} 699 700// Values returns the slice of values for the current page or nil if there are no values. 701func (page USQLCredentialListPage) Values() []USQLCredential { 702 if page.ucl.IsEmpty() { 703 return nil 704 } 705 return *page.ucl.Value 706} 707 708// Creates a new instance of the USQLCredentialListPage type. 709func NewUSQLCredentialListPage(cur USQLCredentialList, getNextPage func(context.Context, USQLCredentialList) (USQLCredentialList, error)) USQLCredentialListPage { 710 return USQLCredentialListPage{ 711 fn: getNextPage, 712 ucl: cur, 713 } 714} 715 716// USQLDatabase a Data Lake Analytics catalog U-SQL database item. 717type USQLDatabase struct { 718 autorest.Response `json:"-"` 719 // Name - the name of the database. 720 Name *string `json:"databaseName,omitempty"` 721 // ComputeAccountName - the name of the Data Lake Analytics account. 722 ComputeAccountName *string `json:"computeAccountName,omitempty"` 723 // Version - the version of the catalog item. 724 Version *uuid.UUID `json:"version,omitempty"` 725} 726 727// USQLDatabaseList a Data Lake Analytics catalog U-SQL database item list. 728type USQLDatabaseList struct { 729 autorest.Response `json:"-"` 730 // Value - READ-ONLY; the list of databases 731 Value *[]USQLDatabase `json:"value,omitempty"` 732 // NextLink - the link to the next page of results. 733 NextLink *string `json:"nextLink,omitempty"` 734} 735 736// MarshalJSON is the custom marshaler for USQLDatabaseList. 737func (usdl USQLDatabaseList) MarshalJSON() ([]byte, error) { 738 objectMap := make(map[string]interface{}) 739 if usdl.NextLink != nil { 740 objectMap["nextLink"] = usdl.NextLink 741 } 742 return json.Marshal(objectMap) 743} 744 745// USQLDatabaseListIterator provides access to a complete listing of USQLDatabase values. 746type USQLDatabaseListIterator struct { 747 i int 748 page USQLDatabaseListPage 749} 750 751// NextWithContext advances to the next value. If there was an error making 752// the request the iterator does not advance and the error is returned. 753func (iter *USQLDatabaseListIterator) NextWithContext(ctx context.Context) (err error) { 754 if tracing.IsEnabled() { 755 ctx = tracing.StartSpan(ctx, fqdn+"/USQLDatabaseListIterator.NextWithContext") 756 defer func() { 757 sc := -1 758 if iter.Response().Response.Response != nil { 759 sc = iter.Response().Response.Response.StatusCode 760 } 761 tracing.EndSpan(ctx, sc, err) 762 }() 763 } 764 iter.i++ 765 if iter.i < len(iter.page.Values()) { 766 return nil 767 } 768 err = iter.page.NextWithContext(ctx) 769 if err != nil { 770 iter.i-- 771 return err 772 } 773 iter.i = 0 774 return nil 775} 776 777// Next advances to the next value. If there was an error making 778// the request the iterator does not advance and the error is returned. 779// Deprecated: Use NextWithContext() instead. 780func (iter *USQLDatabaseListIterator) Next() error { 781 return iter.NextWithContext(context.Background()) 782} 783 784// NotDone returns true if the enumeration should be started or is not yet complete. 785func (iter USQLDatabaseListIterator) NotDone() bool { 786 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 787} 788 789// Response returns the raw server response from the last page request. 790func (iter USQLDatabaseListIterator) Response() USQLDatabaseList { 791 return iter.page.Response() 792} 793 794// Value returns the current value or a zero-initialized value if the 795// iterator has advanced beyond the end of the collection. 796func (iter USQLDatabaseListIterator) Value() USQLDatabase { 797 if !iter.page.NotDone() { 798 return USQLDatabase{} 799 } 800 return iter.page.Values()[iter.i] 801} 802 803// Creates a new instance of the USQLDatabaseListIterator type. 804func NewUSQLDatabaseListIterator(page USQLDatabaseListPage) USQLDatabaseListIterator { 805 return USQLDatabaseListIterator{page: page} 806} 807 808// IsEmpty returns true if the ListResult contains no values. 809func (usdl USQLDatabaseList) IsEmpty() bool { 810 return usdl.Value == nil || len(*usdl.Value) == 0 811} 812 813// hasNextLink returns true if the NextLink is not empty. 814func (usdl USQLDatabaseList) hasNextLink() bool { 815 return usdl.NextLink != nil && len(*usdl.NextLink) != 0 816} 817 818// uSQLDatabaseListPreparer prepares a request to retrieve the next set of results. 819// It returns nil if no more results exist. 820func (usdl USQLDatabaseList) uSQLDatabaseListPreparer(ctx context.Context) (*http.Request, error) { 821 if !usdl.hasNextLink() { 822 return nil, nil 823 } 824 return autorest.Prepare((&http.Request{}).WithContext(ctx), 825 autorest.AsJSON(), 826 autorest.AsGet(), 827 autorest.WithBaseURL(to.String(usdl.NextLink))) 828} 829 830// USQLDatabaseListPage contains a page of USQLDatabase values. 831type USQLDatabaseListPage struct { 832 fn func(context.Context, USQLDatabaseList) (USQLDatabaseList, error) 833 udl USQLDatabaseList 834} 835 836// NextWithContext advances to the next page of values. If there was an error making 837// the request the page does not advance and the error is returned. 838func (page *USQLDatabaseListPage) NextWithContext(ctx context.Context) (err error) { 839 if tracing.IsEnabled() { 840 ctx = tracing.StartSpan(ctx, fqdn+"/USQLDatabaseListPage.NextWithContext") 841 defer func() { 842 sc := -1 843 if page.Response().Response.Response != nil { 844 sc = page.Response().Response.Response.StatusCode 845 } 846 tracing.EndSpan(ctx, sc, err) 847 }() 848 } 849 for { 850 next, err := page.fn(ctx, page.udl) 851 if err != nil { 852 return err 853 } 854 page.udl = next 855 if !next.hasNextLink() || !next.IsEmpty() { 856 break 857 } 858 } 859 return nil 860} 861 862// Next advances to the next page of values. If there was an error making 863// the request the page does not advance and the error is returned. 864// Deprecated: Use NextWithContext() instead. 865func (page *USQLDatabaseListPage) Next() error { 866 return page.NextWithContext(context.Background()) 867} 868 869// NotDone returns true if the page enumeration should be started or is not yet complete. 870func (page USQLDatabaseListPage) NotDone() bool { 871 return !page.udl.IsEmpty() 872} 873 874// Response returns the raw server response from the last page request. 875func (page USQLDatabaseListPage) Response() USQLDatabaseList { 876 return page.udl 877} 878 879// Values returns the slice of values for the current page or nil if there are no values. 880func (page USQLDatabaseListPage) Values() []USQLDatabase { 881 if page.udl.IsEmpty() { 882 return nil 883 } 884 return *page.udl.Value 885} 886 887// Creates a new instance of the USQLDatabaseListPage type. 888func NewUSQLDatabaseListPage(cur USQLDatabaseList, getNextPage func(context.Context, USQLDatabaseList) (USQLDatabaseList, error)) USQLDatabaseListPage { 889 return USQLDatabaseListPage{ 890 fn: getNextPage, 891 udl: cur, 892 } 893} 894 895// USQLDirectedColumn a Data Lake Analytics catalog U-SQL directed column item. 896type USQLDirectedColumn struct { 897 // Name - the name of the index in the table. 898 Name *string `json:"name,omitempty"` 899 // Descending - the switch indicating if the index is descending or not. 900 Descending *bool `json:"descending,omitempty"` 901} 902 903// USQLDistributionInfo a Data Lake Analytics catalog U-SQL distribution information object. 904type USQLDistributionInfo struct { 905 // Type - the type of this distribution. 906 Type *int32 `json:"type,omitempty"` 907 // Keys - the list of directed columns in the distribution 908 Keys *[]USQLDirectedColumn `json:"keys,omitempty"` 909 // Count - the count of indices using this distribution. 910 Count *int32 `json:"count,omitempty"` 911 // DynamicCount - the dynamic count of indices using this distribution. 912 DynamicCount *int32 `json:"dynamicCount,omitempty"` 913} 914 915// USQLExternalDataSource a Data Lake Analytics catalog U-SQL external datasource item. 916type USQLExternalDataSource struct { 917 autorest.Response `json:"-"` 918 // DatabaseName - the name of the database. 919 DatabaseName *string `json:"databaseName,omitempty"` 920 // Name - the name of the external data source. 921 Name *string `json:"externalDataSourceName,omitempty"` 922 // Provider - the name of the provider for the external data source. 923 Provider *string `json:"provider,omitempty"` 924 // ProviderString - the name of the provider string for the external data source. 925 ProviderString *string `json:"providerString,omitempty"` 926 // PushdownTypes - the list of types to push down from the external data source. 927 PushdownTypes *[]string `json:"pushdownTypes,omitempty"` 928 // ComputeAccountName - the name of the Data Lake Analytics account. 929 ComputeAccountName *string `json:"computeAccountName,omitempty"` 930 // Version - the version of the catalog item. 931 Version *uuid.UUID `json:"version,omitempty"` 932} 933 934// USQLExternalDataSourceList a Data Lake Analytics catalog U-SQL external datasource item list. 935type USQLExternalDataSourceList struct { 936 autorest.Response `json:"-"` 937 // Value - READ-ONLY; the list of external data sources in the database 938 Value *[]USQLExternalDataSource `json:"value,omitempty"` 939 // NextLink - the link to the next page of results. 940 NextLink *string `json:"nextLink,omitempty"` 941} 942 943// MarshalJSON is the custom marshaler for USQLExternalDataSourceList. 944func (usedsl USQLExternalDataSourceList) MarshalJSON() ([]byte, error) { 945 objectMap := make(map[string]interface{}) 946 if usedsl.NextLink != nil { 947 objectMap["nextLink"] = usedsl.NextLink 948 } 949 return json.Marshal(objectMap) 950} 951 952// USQLExternalDataSourceListIterator provides access to a complete listing of USQLExternalDataSource 953// values. 954type USQLExternalDataSourceListIterator struct { 955 i int 956 page USQLExternalDataSourceListPage 957} 958 959// NextWithContext advances to the next value. If there was an error making 960// the request the iterator does not advance and the error is returned. 961func (iter *USQLExternalDataSourceListIterator) NextWithContext(ctx context.Context) (err error) { 962 if tracing.IsEnabled() { 963 ctx = tracing.StartSpan(ctx, fqdn+"/USQLExternalDataSourceListIterator.NextWithContext") 964 defer func() { 965 sc := -1 966 if iter.Response().Response.Response != nil { 967 sc = iter.Response().Response.Response.StatusCode 968 } 969 tracing.EndSpan(ctx, sc, err) 970 }() 971 } 972 iter.i++ 973 if iter.i < len(iter.page.Values()) { 974 return nil 975 } 976 err = iter.page.NextWithContext(ctx) 977 if err != nil { 978 iter.i-- 979 return err 980 } 981 iter.i = 0 982 return nil 983} 984 985// Next advances to the next value. If there was an error making 986// the request the iterator does not advance and the error is returned. 987// Deprecated: Use NextWithContext() instead. 988func (iter *USQLExternalDataSourceListIterator) Next() error { 989 return iter.NextWithContext(context.Background()) 990} 991 992// NotDone returns true if the enumeration should be started or is not yet complete. 993func (iter USQLExternalDataSourceListIterator) NotDone() bool { 994 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 995} 996 997// Response returns the raw server response from the last page request. 998func (iter USQLExternalDataSourceListIterator) Response() USQLExternalDataSourceList { 999 return iter.page.Response() 1000} 1001 1002// Value returns the current value or a zero-initialized value if the 1003// iterator has advanced beyond the end of the collection. 1004func (iter USQLExternalDataSourceListIterator) Value() USQLExternalDataSource { 1005 if !iter.page.NotDone() { 1006 return USQLExternalDataSource{} 1007 } 1008 return iter.page.Values()[iter.i] 1009} 1010 1011// Creates a new instance of the USQLExternalDataSourceListIterator type. 1012func NewUSQLExternalDataSourceListIterator(page USQLExternalDataSourceListPage) USQLExternalDataSourceListIterator { 1013 return USQLExternalDataSourceListIterator{page: page} 1014} 1015 1016// IsEmpty returns true if the ListResult contains no values. 1017func (usedsl USQLExternalDataSourceList) IsEmpty() bool { 1018 return usedsl.Value == nil || len(*usedsl.Value) == 0 1019} 1020 1021// hasNextLink returns true if the NextLink is not empty. 1022func (usedsl USQLExternalDataSourceList) hasNextLink() bool { 1023 return usedsl.NextLink != nil && len(*usedsl.NextLink) != 0 1024} 1025 1026// uSQLExternalDataSourceListPreparer prepares a request to retrieve the next set of results. 1027// It returns nil if no more results exist. 1028func (usedsl USQLExternalDataSourceList) uSQLExternalDataSourceListPreparer(ctx context.Context) (*http.Request, error) { 1029 if !usedsl.hasNextLink() { 1030 return nil, nil 1031 } 1032 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1033 autorest.AsJSON(), 1034 autorest.AsGet(), 1035 autorest.WithBaseURL(to.String(usedsl.NextLink))) 1036} 1037 1038// USQLExternalDataSourceListPage contains a page of USQLExternalDataSource values. 1039type USQLExternalDataSourceListPage struct { 1040 fn func(context.Context, USQLExternalDataSourceList) (USQLExternalDataSourceList, error) 1041 uedsl USQLExternalDataSourceList 1042} 1043 1044// NextWithContext advances to the next page of values. If there was an error making 1045// the request the page does not advance and the error is returned. 1046func (page *USQLExternalDataSourceListPage) NextWithContext(ctx context.Context) (err error) { 1047 if tracing.IsEnabled() { 1048 ctx = tracing.StartSpan(ctx, fqdn+"/USQLExternalDataSourceListPage.NextWithContext") 1049 defer func() { 1050 sc := -1 1051 if page.Response().Response.Response != nil { 1052 sc = page.Response().Response.Response.StatusCode 1053 } 1054 tracing.EndSpan(ctx, sc, err) 1055 }() 1056 } 1057 for { 1058 next, err := page.fn(ctx, page.uedsl) 1059 if err != nil { 1060 return err 1061 } 1062 page.uedsl = next 1063 if !next.hasNextLink() || !next.IsEmpty() { 1064 break 1065 } 1066 } 1067 return nil 1068} 1069 1070// Next advances to the next page of values. If there was an error making 1071// the request the page does not advance and the error is returned. 1072// Deprecated: Use NextWithContext() instead. 1073func (page *USQLExternalDataSourceListPage) Next() error { 1074 return page.NextWithContext(context.Background()) 1075} 1076 1077// NotDone returns true if the page enumeration should be started or is not yet complete. 1078func (page USQLExternalDataSourceListPage) NotDone() bool { 1079 return !page.uedsl.IsEmpty() 1080} 1081 1082// Response returns the raw server response from the last page request. 1083func (page USQLExternalDataSourceListPage) Response() USQLExternalDataSourceList { 1084 return page.uedsl 1085} 1086 1087// Values returns the slice of values for the current page or nil if there are no values. 1088func (page USQLExternalDataSourceListPage) Values() []USQLExternalDataSource { 1089 if page.uedsl.IsEmpty() { 1090 return nil 1091 } 1092 return *page.uedsl.Value 1093} 1094 1095// Creates a new instance of the USQLExternalDataSourceListPage type. 1096func NewUSQLExternalDataSourceListPage(cur USQLExternalDataSourceList, getNextPage func(context.Context, USQLExternalDataSourceList) (USQLExternalDataSourceList, error)) USQLExternalDataSourceListPage { 1097 return USQLExternalDataSourceListPage{ 1098 fn: getNextPage, 1099 uedsl: cur, 1100 } 1101} 1102 1103// USQLIndex a Data Lake Analytics catalog U-SQL table index item. 1104type USQLIndex struct { 1105 // Name - the name of the index in the table. 1106 Name *string `json:"name,omitempty"` 1107 // IndexKeys - the list of directed columns in the index 1108 IndexKeys *[]USQLDirectedColumn `json:"indexKeys,omitempty"` 1109 // Columns - the list of columns in the index 1110 Columns *[]string `json:"columns,omitempty"` 1111 // DistributionInfo - the distributions info of the index 1112 DistributionInfo *USQLDistributionInfo `json:"distributionInfo,omitempty"` 1113 // PartitionFunction - partition function ID for the index. 1114 PartitionFunction *uuid.UUID `json:"partitionFunction,omitempty"` 1115 // PartitionKeyList - the list of partition keys in the index 1116 PartitionKeyList *[]string `json:"partitionKeyList,omitempty"` 1117 // StreamNames - the list of full paths to the streams that contain this index in the DataLake account. 1118 StreamNames *[]string `json:"streamNames,omitempty"` 1119 // IsColumnstore - the switch indicating if this index is a columnstore index. 1120 IsColumnstore *bool `json:"isColumnstore,omitempty"` 1121 // IndexID - the ID of this index within the table. 1122 IndexID *int32 `json:"indexId,omitempty"` 1123 // IsUnique - the switch indicating if this index is a unique index. 1124 IsUnique *bool `json:"isUnique,omitempty"` 1125} 1126 1127// USQLPackage a Data Lake Analytics catalog U-SQL package item. 1128type USQLPackage struct { 1129 autorest.Response `json:"-"` 1130 // DatabaseName - the name of the database containing the package. 1131 DatabaseName *string `json:"databaseName,omitempty"` 1132 // SchemaName - the name of the schema associated with this package and database. 1133 SchemaName *string `json:"schemaName,omitempty"` 1134 // Name - the name of the package. 1135 Name *string `json:"packageName,omitempty"` 1136 // Definition - the definition of the package. 1137 Definition *string `json:"definition,omitempty"` 1138 // ComputeAccountName - the name of the Data Lake Analytics account. 1139 ComputeAccountName *string `json:"computeAccountName,omitempty"` 1140 // Version - the version of the catalog item. 1141 Version *uuid.UUID `json:"version,omitempty"` 1142} 1143 1144// USQLPackageList a Data Lake Analytics catalog U-SQL package item list. 1145type USQLPackageList struct { 1146 autorest.Response `json:"-"` 1147 // Value - READ-ONLY; the list of packages in the database and schema combination 1148 Value *[]USQLPackage `json:"value,omitempty"` 1149 // NextLink - the link to the next page of results. 1150 NextLink *string `json:"nextLink,omitempty"` 1151} 1152 1153// MarshalJSON is the custom marshaler for USQLPackageList. 1154func (uspl USQLPackageList) MarshalJSON() ([]byte, error) { 1155 objectMap := make(map[string]interface{}) 1156 if uspl.NextLink != nil { 1157 objectMap["nextLink"] = uspl.NextLink 1158 } 1159 return json.Marshal(objectMap) 1160} 1161 1162// USQLPackageListIterator provides access to a complete listing of USQLPackage values. 1163type USQLPackageListIterator struct { 1164 i int 1165 page USQLPackageListPage 1166} 1167 1168// NextWithContext advances to the next value. If there was an error making 1169// the request the iterator does not advance and the error is returned. 1170func (iter *USQLPackageListIterator) NextWithContext(ctx context.Context) (err error) { 1171 if tracing.IsEnabled() { 1172 ctx = tracing.StartSpan(ctx, fqdn+"/USQLPackageListIterator.NextWithContext") 1173 defer func() { 1174 sc := -1 1175 if iter.Response().Response.Response != nil { 1176 sc = iter.Response().Response.Response.StatusCode 1177 } 1178 tracing.EndSpan(ctx, sc, err) 1179 }() 1180 } 1181 iter.i++ 1182 if iter.i < len(iter.page.Values()) { 1183 return nil 1184 } 1185 err = iter.page.NextWithContext(ctx) 1186 if err != nil { 1187 iter.i-- 1188 return err 1189 } 1190 iter.i = 0 1191 return nil 1192} 1193 1194// Next advances to the next value. If there was an error making 1195// the request the iterator does not advance and the error is returned. 1196// Deprecated: Use NextWithContext() instead. 1197func (iter *USQLPackageListIterator) Next() error { 1198 return iter.NextWithContext(context.Background()) 1199} 1200 1201// NotDone returns true if the enumeration should be started or is not yet complete. 1202func (iter USQLPackageListIterator) NotDone() bool { 1203 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1204} 1205 1206// Response returns the raw server response from the last page request. 1207func (iter USQLPackageListIterator) Response() USQLPackageList { 1208 return iter.page.Response() 1209} 1210 1211// Value returns the current value or a zero-initialized value if the 1212// iterator has advanced beyond the end of the collection. 1213func (iter USQLPackageListIterator) Value() USQLPackage { 1214 if !iter.page.NotDone() { 1215 return USQLPackage{} 1216 } 1217 return iter.page.Values()[iter.i] 1218} 1219 1220// Creates a new instance of the USQLPackageListIterator type. 1221func NewUSQLPackageListIterator(page USQLPackageListPage) USQLPackageListIterator { 1222 return USQLPackageListIterator{page: page} 1223} 1224 1225// IsEmpty returns true if the ListResult contains no values. 1226func (uspl USQLPackageList) IsEmpty() bool { 1227 return uspl.Value == nil || len(*uspl.Value) == 0 1228} 1229 1230// hasNextLink returns true if the NextLink is not empty. 1231func (uspl USQLPackageList) hasNextLink() bool { 1232 return uspl.NextLink != nil && len(*uspl.NextLink) != 0 1233} 1234 1235// uSQLPackageListPreparer prepares a request to retrieve the next set of results. 1236// It returns nil if no more results exist. 1237func (uspl USQLPackageList) uSQLPackageListPreparer(ctx context.Context) (*http.Request, error) { 1238 if !uspl.hasNextLink() { 1239 return nil, nil 1240 } 1241 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1242 autorest.AsJSON(), 1243 autorest.AsGet(), 1244 autorest.WithBaseURL(to.String(uspl.NextLink))) 1245} 1246 1247// USQLPackageListPage contains a page of USQLPackage values. 1248type USQLPackageListPage struct { 1249 fn func(context.Context, USQLPackageList) (USQLPackageList, error) 1250 upl USQLPackageList 1251} 1252 1253// NextWithContext advances to the next page of values. If there was an error making 1254// the request the page does not advance and the error is returned. 1255func (page *USQLPackageListPage) NextWithContext(ctx context.Context) (err error) { 1256 if tracing.IsEnabled() { 1257 ctx = tracing.StartSpan(ctx, fqdn+"/USQLPackageListPage.NextWithContext") 1258 defer func() { 1259 sc := -1 1260 if page.Response().Response.Response != nil { 1261 sc = page.Response().Response.Response.StatusCode 1262 } 1263 tracing.EndSpan(ctx, sc, err) 1264 }() 1265 } 1266 for { 1267 next, err := page.fn(ctx, page.upl) 1268 if err != nil { 1269 return err 1270 } 1271 page.upl = next 1272 if !next.hasNextLink() || !next.IsEmpty() { 1273 break 1274 } 1275 } 1276 return nil 1277} 1278 1279// Next advances to the next page of values. If there was an error making 1280// the request the page does not advance and the error is returned. 1281// Deprecated: Use NextWithContext() instead. 1282func (page *USQLPackageListPage) Next() error { 1283 return page.NextWithContext(context.Background()) 1284} 1285 1286// NotDone returns true if the page enumeration should be started or is not yet complete. 1287func (page USQLPackageListPage) NotDone() bool { 1288 return !page.upl.IsEmpty() 1289} 1290 1291// Response returns the raw server response from the last page request. 1292func (page USQLPackageListPage) Response() USQLPackageList { 1293 return page.upl 1294} 1295 1296// Values returns the slice of values for the current page or nil if there are no values. 1297func (page USQLPackageListPage) Values() []USQLPackage { 1298 if page.upl.IsEmpty() { 1299 return nil 1300 } 1301 return *page.upl.Value 1302} 1303 1304// Creates a new instance of the USQLPackageListPage type. 1305func NewUSQLPackageListPage(cur USQLPackageList, getNextPage func(context.Context, USQLPackageList) (USQLPackageList, error)) USQLPackageListPage { 1306 return USQLPackageListPage{ 1307 fn: getNextPage, 1308 upl: cur, 1309 } 1310} 1311 1312// USQLProcedure a Data Lake Analytics catalog U-SQL procedure item. 1313type USQLProcedure struct { 1314 autorest.Response `json:"-"` 1315 // DatabaseName - the name of the database. 1316 DatabaseName *string `json:"databaseName,omitempty"` 1317 // SchemaName - the name of the schema associated with this procedure and database. 1318 SchemaName *string `json:"schemaName,omitempty"` 1319 // Name - the name of the procedure. 1320 Name *string `json:"procName,omitempty"` 1321 // Definition - the defined query of the procedure. 1322 Definition *string `json:"definition,omitempty"` 1323 // ComputeAccountName - the name of the Data Lake Analytics account. 1324 ComputeAccountName *string `json:"computeAccountName,omitempty"` 1325 // Version - the version of the catalog item. 1326 Version *uuid.UUID `json:"version,omitempty"` 1327} 1328 1329// USQLProcedureList a Data Lake Analytics catalog U-SQL procedure item list. 1330type USQLProcedureList struct { 1331 autorest.Response `json:"-"` 1332 // Value - READ-ONLY; the list of procedure in the database and schema combination 1333 Value *[]USQLProcedure `json:"value,omitempty"` 1334 // NextLink - the link to the next page of results. 1335 NextLink *string `json:"nextLink,omitempty"` 1336} 1337 1338// MarshalJSON is the custom marshaler for USQLProcedureList. 1339func (uspl USQLProcedureList) MarshalJSON() ([]byte, error) { 1340 objectMap := make(map[string]interface{}) 1341 if uspl.NextLink != nil { 1342 objectMap["nextLink"] = uspl.NextLink 1343 } 1344 return json.Marshal(objectMap) 1345} 1346 1347// USQLProcedureListIterator provides access to a complete listing of USQLProcedure values. 1348type USQLProcedureListIterator struct { 1349 i int 1350 page USQLProcedureListPage 1351} 1352 1353// NextWithContext advances to the next value. If there was an error making 1354// the request the iterator does not advance and the error is returned. 1355func (iter *USQLProcedureListIterator) NextWithContext(ctx context.Context) (err error) { 1356 if tracing.IsEnabled() { 1357 ctx = tracing.StartSpan(ctx, fqdn+"/USQLProcedureListIterator.NextWithContext") 1358 defer func() { 1359 sc := -1 1360 if iter.Response().Response.Response != nil { 1361 sc = iter.Response().Response.Response.StatusCode 1362 } 1363 tracing.EndSpan(ctx, sc, err) 1364 }() 1365 } 1366 iter.i++ 1367 if iter.i < len(iter.page.Values()) { 1368 return nil 1369 } 1370 err = iter.page.NextWithContext(ctx) 1371 if err != nil { 1372 iter.i-- 1373 return err 1374 } 1375 iter.i = 0 1376 return nil 1377} 1378 1379// Next advances to the next value. If there was an error making 1380// the request the iterator does not advance and the error is returned. 1381// Deprecated: Use NextWithContext() instead. 1382func (iter *USQLProcedureListIterator) Next() error { 1383 return iter.NextWithContext(context.Background()) 1384} 1385 1386// NotDone returns true if the enumeration should be started or is not yet complete. 1387func (iter USQLProcedureListIterator) NotDone() bool { 1388 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1389} 1390 1391// Response returns the raw server response from the last page request. 1392func (iter USQLProcedureListIterator) Response() USQLProcedureList { 1393 return iter.page.Response() 1394} 1395 1396// Value returns the current value or a zero-initialized value if the 1397// iterator has advanced beyond the end of the collection. 1398func (iter USQLProcedureListIterator) Value() USQLProcedure { 1399 if !iter.page.NotDone() { 1400 return USQLProcedure{} 1401 } 1402 return iter.page.Values()[iter.i] 1403} 1404 1405// Creates a new instance of the USQLProcedureListIterator type. 1406func NewUSQLProcedureListIterator(page USQLProcedureListPage) USQLProcedureListIterator { 1407 return USQLProcedureListIterator{page: page} 1408} 1409 1410// IsEmpty returns true if the ListResult contains no values. 1411func (uspl USQLProcedureList) IsEmpty() bool { 1412 return uspl.Value == nil || len(*uspl.Value) == 0 1413} 1414 1415// hasNextLink returns true if the NextLink is not empty. 1416func (uspl USQLProcedureList) hasNextLink() bool { 1417 return uspl.NextLink != nil && len(*uspl.NextLink) != 0 1418} 1419 1420// uSQLProcedureListPreparer prepares a request to retrieve the next set of results. 1421// It returns nil if no more results exist. 1422func (uspl USQLProcedureList) uSQLProcedureListPreparer(ctx context.Context) (*http.Request, error) { 1423 if !uspl.hasNextLink() { 1424 return nil, nil 1425 } 1426 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1427 autorest.AsJSON(), 1428 autorest.AsGet(), 1429 autorest.WithBaseURL(to.String(uspl.NextLink))) 1430} 1431 1432// USQLProcedureListPage contains a page of USQLProcedure values. 1433type USQLProcedureListPage struct { 1434 fn func(context.Context, USQLProcedureList) (USQLProcedureList, error) 1435 upl USQLProcedureList 1436} 1437 1438// NextWithContext advances to the next page of values. If there was an error making 1439// the request the page does not advance and the error is returned. 1440func (page *USQLProcedureListPage) NextWithContext(ctx context.Context) (err error) { 1441 if tracing.IsEnabled() { 1442 ctx = tracing.StartSpan(ctx, fqdn+"/USQLProcedureListPage.NextWithContext") 1443 defer func() { 1444 sc := -1 1445 if page.Response().Response.Response != nil { 1446 sc = page.Response().Response.Response.StatusCode 1447 } 1448 tracing.EndSpan(ctx, sc, err) 1449 }() 1450 } 1451 for { 1452 next, err := page.fn(ctx, page.upl) 1453 if err != nil { 1454 return err 1455 } 1456 page.upl = next 1457 if !next.hasNextLink() || !next.IsEmpty() { 1458 break 1459 } 1460 } 1461 return nil 1462} 1463 1464// Next advances to the next page of values. If there was an error making 1465// the request the page does not advance and the error is returned. 1466// Deprecated: Use NextWithContext() instead. 1467func (page *USQLProcedureListPage) Next() error { 1468 return page.NextWithContext(context.Background()) 1469} 1470 1471// NotDone returns true if the page enumeration should be started or is not yet complete. 1472func (page USQLProcedureListPage) NotDone() bool { 1473 return !page.upl.IsEmpty() 1474} 1475 1476// Response returns the raw server response from the last page request. 1477func (page USQLProcedureListPage) Response() USQLProcedureList { 1478 return page.upl 1479} 1480 1481// Values returns the slice of values for the current page or nil if there are no values. 1482func (page USQLProcedureListPage) Values() []USQLProcedure { 1483 if page.upl.IsEmpty() { 1484 return nil 1485 } 1486 return *page.upl.Value 1487} 1488 1489// Creates a new instance of the USQLProcedureListPage type. 1490func NewUSQLProcedureListPage(cur USQLProcedureList, getNextPage func(context.Context, USQLProcedureList) (USQLProcedureList, error)) USQLProcedureListPage { 1491 return USQLProcedureListPage{ 1492 fn: getNextPage, 1493 upl: cur, 1494 } 1495} 1496 1497// USQLSchema a Data Lake Analytics catalog U-SQL schema item. 1498type USQLSchema struct { 1499 autorest.Response `json:"-"` 1500 // DatabaseName - the name of the database. 1501 DatabaseName *string `json:"databaseName,omitempty"` 1502 // Name - the name of the schema. 1503 Name *string `json:"schemaName,omitempty"` 1504 // ComputeAccountName - the name of the Data Lake Analytics account. 1505 ComputeAccountName *string `json:"computeAccountName,omitempty"` 1506 // Version - the version of the catalog item. 1507 Version *uuid.UUID `json:"version,omitempty"` 1508} 1509 1510// USQLSchemaList a Data Lake Analytics catalog U-SQL schema item list. 1511type USQLSchemaList struct { 1512 autorest.Response `json:"-"` 1513 // Value - READ-ONLY; the list of schemas in the database 1514 Value *[]USQLSchema `json:"value,omitempty"` 1515 // NextLink - the link to the next page of results. 1516 NextLink *string `json:"nextLink,omitempty"` 1517} 1518 1519// MarshalJSON is the custom marshaler for USQLSchemaList. 1520func (ussl USQLSchemaList) MarshalJSON() ([]byte, error) { 1521 objectMap := make(map[string]interface{}) 1522 if ussl.NextLink != nil { 1523 objectMap["nextLink"] = ussl.NextLink 1524 } 1525 return json.Marshal(objectMap) 1526} 1527 1528// USQLSchemaListIterator provides access to a complete listing of USQLSchema values. 1529type USQLSchemaListIterator struct { 1530 i int 1531 page USQLSchemaListPage 1532} 1533 1534// NextWithContext advances to the next value. If there was an error making 1535// the request the iterator does not advance and the error is returned. 1536func (iter *USQLSchemaListIterator) NextWithContext(ctx context.Context) (err error) { 1537 if tracing.IsEnabled() { 1538 ctx = tracing.StartSpan(ctx, fqdn+"/USQLSchemaListIterator.NextWithContext") 1539 defer func() { 1540 sc := -1 1541 if iter.Response().Response.Response != nil { 1542 sc = iter.Response().Response.Response.StatusCode 1543 } 1544 tracing.EndSpan(ctx, sc, err) 1545 }() 1546 } 1547 iter.i++ 1548 if iter.i < len(iter.page.Values()) { 1549 return nil 1550 } 1551 err = iter.page.NextWithContext(ctx) 1552 if err != nil { 1553 iter.i-- 1554 return err 1555 } 1556 iter.i = 0 1557 return nil 1558} 1559 1560// Next advances to the next value. If there was an error making 1561// the request the iterator does not advance and the error is returned. 1562// Deprecated: Use NextWithContext() instead. 1563func (iter *USQLSchemaListIterator) Next() error { 1564 return iter.NextWithContext(context.Background()) 1565} 1566 1567// NotDone returns true if the enumeration should be started or is not yet complete. 1568func (iter USQLSchemaListIterator) NotDone() bool { 1569 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1570} 1571 1572// Response returns the raw server response from the last page request. 1573func (iter USQLSchemaListIterator) Response() USQLSchemaList { 1574 return iter.page.Response() 1575} 1576 1577// Value returns the current value or a zero-initialized value if the 1578// iterator has advanced beyond the end of the collection. 1579func (iter USQLSchemaListIterator) Value() USQLSchema { 1580 if !iter.page.NotDone() { 1581 return USQLSchema{} 1582 } 1583 return iter.page.Values()[iter.i] 1584} 1585 1586// Creates a new instance of the USQLSchemaListIterator type. 1587func NewUSQLSchemaListIterator(page USQLSchemaListPage) USQLSchemaListIterator { 1588 return USQLSchemaListIterator{page: page} 1589} 1590 1591// IsEmpty returns true if the ListResult contains no values. 1592func (ussl USQLSchemaList) IsEmpty() bool { 1593 return ussl.Value == nil || len(*ussl.Value) == 0 1594} 1595 1596// hasNextLink returns true if the NextLink is not empty. 1597func (ussl USQLSchemaList) hasNextLink() bool { 1598 return ussl.NextLink != nil && len(*ussl.NextLink) != 0 1599} 1600 1601// uSQLSchemaListPreparer prepares a request to retrieve the next set of results. 1602// It returns nil if no more results exist. 1603func (ussl USQLSchemaList) uSQLSchemaListPreparer(ctx context.Context) (*http.Request, error) { 1604 if !ussl.hasNextLink() { 1605 return nil, nil 1606 } 1607 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1608 autorest.AsJSON(), 1609 autorest.AsGet(), 1610 autorest.WithBaseURL(to.String(ussl.NextLink))) 1611} 1612 1613// USQLSchemaListPage contains a page of USQLSchema values. 1614type USQLSchemaListPage struct { 1615 fn func(context.Context, USQLSchemaList) (USQLSchemaList, error) 1616 usl USQLSchemaList 1617} 1618 1619// NextWithContext advances to the next page of values. If there was an error making 1620// the request the page does not advance and the error is returned. 1621func (page *USQLSchemaListPage) NextWithContext(ctx context.Context) (err error) { 1622 if tracing.IsEnabled() { 1623 ctx = tracing.StartSpan(ctx, fqdn+"/USQLSchemaListPage.NextWithContext") 1624 defer func() { 1625 sc := -1 1626 if page.Response().Response.Response != nil { 1627 sc = page.Response().Response.Response.StatusCode 1628 } 1629 tracing.EndSpan(ctx, sc, err) 1630 }() 1631 } 1632 for { 1633 next, err := page.fn(ctx, page.usl) 1634 if err != nil { 1635 return err 1636 } 1637 page.usl = next 1638 if !next.hasNextLink() || !next.IsEmpty() { 1639 break 1640 } 1641 } 1642 return nil 1643} 1644 1645// Next advances to the next page of values. If there was an error making 1646// the request the page does not advance and the error is returned. 1647// Deprecated: Use NextWithContext() instead. 1648func (page *USQLSchemaListPage) Next() error { 1649 return page.NextWithContext(context.Background()) 1650} 1651 1652// NotDone returns true if the page enumeration should be started or is not yet complete. 1653func (page USQLSchemaListPage) NotDone() bool { 1654 return !page.usl.IsEmpty() 1655} 1656 1657// Response returns the raw server response from the last page request. 1658func (page USQLSchemaListPage) Response() USQLSchemaList { 1659 return page.usl 1660} 1661 1662// Values returns the slice of values for the current page or nil if there are no values. 1663func (page USQLSchemaListPage) Values() []USQLSchema { 1664 if page.usl.IsEmpty() { 1665 return nil 1666 } 1667 return *page.usl.Value 1668} 1669 1670// Creates a new instance of the USQLSchemaListPage type. 1671func NewUSQLSchemaListPage(cur USQLSchemaList, getNextPage func(context.Context, USQLSchemaList) (USQLSchemaList, error)) USQLSchemaListPage { 1672 return USQLSchemaListPage{ 1673 fn: getNextPage, 1674 usl: cur, 1675 } 1676} 1677 1678// USQLSecret a Data Lake Analytics catalog U-SQL secret item. 1679type USQLSecret struct { 1680 autorest.Response `json:"-"` 1681 // DatabaseName - the name of the database. 1682 DatabaseName *string `json:"databaseName,omitempty"` 1683 // Name - the name of the secret. 1684 Name *string `json:"secretName,omitempty"` 1685 // CreationTime - the creation time of the credential object. This is the only information returned about a secret from a GET. 1686 CreationTime *date.Time `json:"creationTime,omitempty"` 1687 // URI - the URI identifier for the secret in the format <hostname>:<port> 1688 URI *string `json:"uri,omitempty"` 1689 // Password - the password for the secret to pass in 1690 Password *string `json:"password,omitempty"` 1691 // ComputeAccountName - the name of the Data Lake Analytics account. 1692 ComputeAccountName *string `json:"computeAccountName,omitempty"` 1693 // Version - the version of the catalog item. 1694 Version *uuid.UUID `json:"version,omitempty"` 1695} 1696 1697// USQLTable a Data Lake Analytics catalog U-SQL table item. 1698type USQLTable struct { 1699 autorest.Response `json:"-"` 1700 // DatabaseName - the name of the database. 1701 DatabaseName *string `json:"databaseName,omitempty"` 1702 // SchemaName - the name of the schema associated with this table and database. 1703 SchemaName *string `json:"schemaName,omitempty"` 1704 // Name - the name of the table. 1705 Name *string `json:"tableName,omitempty"` 1706 // ColumnList - the list of columns in this table 1707 ColumnList *[]USQLTableColumn `json:"columnList,omitempty"` 1708 // IndexList - the list of indices in this table 1709 IndexList *[]USQLIndex `json:"indexList,omitempty"` 1710 // PartitionKeyList - the list of partition keys in the table 1711 PartitionKeyList *[]string `json:"partitionKeyList,omitempty"` 1712 // ExternalTable - the external table associated with the table. 1713 ExternalTable *ExternalTable `json:"externalTable,omitempty"` 1714 // DistributionInfo - the distributions info of the table 1715 DistributionInfo *USQLDistributionInfo `json:"distributionInfo,omitempty"` 1716 // ComputeAccountName - the name of the Data Lake Analytics account. 1717 ComputeAccountName *string `json:"computeAccountName,omitempty"` 1718 // Version - the version of the catalog item. 1719 Version *uuid.UUID `json:"version,omitempty"` 1720} 1721 1722// USQLTableColumn a Data Lake Analytics catalog U-SQL table column item. 1723type USQLTableColumn struct { 1724 // Name - the name of the column in the table. 1725 Name *string `json:"name,omitempty"` 1726 // Type - the object type of the specified column (such as System.String). 1727 Type *string `json:"type,omitempty"` 1728} 1729 1730// USQLTableFragment a Data Lake Analytics catalog U-SQL table fragment item. 1731type USQLTableFragment struct { 1732 // ParentID - the parent object Id of the table fragment. The parent could be a table or table partition. 1733 ParentID *uuid.UUID `json:"parentId,omitempty"` 1734 // FragmentID - the version of the catalog item. 1735 FragmentID *uuid.UUID `json:"fragmentId,omitempty"` 1736 // IndexID - the ordinal of the index which contains the table fragment. 1737 IndexID *int32 `json:"indexId,omitempty"` 1738 // Size - the data size of the table fragment in bytes. 1739 Size *int64 `json:"size,omitempty"` 1740 // RowCount - the number of rows in the table fragment. 1741 RowCount *int64 `json:"rowCount,omitempty"` 1742 // CreateDate - the creation time of the table fragment. 1743 CreateDate *date.Time `json:"createDate,omitempty"` 1744 // StreamPath - the relative path for the table fragment location. 1745 StreamPath *string `json:"streamPath,omitempty"` 1746} 1747 1748// USQLTableFragmentList a Data Lake Analytics catalog U-SQL table fragment item list. 1749type USQLTableFragmentList struct { 1750 autorest.Response `json:"-"` 1751 // Value - READ-ONLY; the list of table fragments in the database, schema and table combination 1752 Value *[]USQLTableFragment `json:"value,omitempty"` 1753 // NextLink - the link to the next page of results. 1754 NextLink *string `json:"nextLink,omitempty"` 1755} 1756 1757// MarshalJSON is the custom marshaler for USQLTableFragmentList. 1758func (ustfl USQLTableFragmentList) MarshalJSON() ([]byte, error) { 1759 objectMap := make(map[string]interface{}) 1760 if ustfl.NextLink != nil { 1761 objectMap["nextLink"] = ustfl.NextLink 1762 } 1763 return json.Marshal(objectMap) 1764} 1765 1766// USQLTableFragmentListIterator provides access to a complete listing of USQLTableFragment values. 1767type USQLTableFragmentListIterator struct { 1768 i int 1769 page USQLTableFragmentListPage 1770} 1771 1772// NextWithContext advances to the next value. If there was an error making 1773// the request the iterator does not advance and the error is returned. 1774func (iter *USQLTableFragmentListIterator) NextWithContext(ctx context.Context) (err error) { 1775 if tracing.IsEnabled() { 1776 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableFragmentListIterator.NextWithContext") 1777 defer func() { 1778 sc := -1 1779 if iter.Response().Response.Response != nil { 1780 sc = iter.Response().Response.Response.StatusCode 1781 } 1782 tracing.EndSpan(ctx, sc, err) 1783 }() 1784 } 1785 iter.i++ 1786 if iter.i < len(iter.page.Values()) { 1787 return nil 1788 } 1789 err = iter.page.NextWithContext(ctx) 1790 if err != nil { 1791 iter.i-- 1792 return err 1793 } 1794 iter.i = 0 1795 return nil 1796} 1797 1798// Next advances to the next value. If there was an error making 1799// the request the iterator does not advance and the error is returned. 1800// Deprecated: Use NextWithContext() instead. 1801func (iter *USQLTableFragmentListIterator) Next() error { 1802 return iter.NextWithContext(context.Background()) 1803} 1804 1805// NotDone returns true if the enumeration should be started or is not yet complete. 1806func (iter USQLTableFragmentListIterator) NotDone() bool { 1807 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1808} 1809 1810// Response returns the raw server response from the last page request. 1811func (iter USQLTableFragmentListIterator) Response() USQLTableFragmentList { 1812 return iter.page.Response() 1813} 1814 1815// Value returns the current value or a zero-initialized value if the 1816// iterator has advanced beyond the end of the collection. 1817func (iter USQLTableFragmentListIterator) Value() USQLTableFragment { 1818 if !iter.page.NotDone() { 1819 return USQLTableFragment{} 1820 } 1821 return iter.page.Values()[iter.i] 1822} 1823 1824// Creates a new instance of the USQLTableFragmentListIterator type. 1825func NewUSQLTableFragmentListIterator(page USQLTableFragmentListPage) USQLTableFragmentListIterator { 1826 return USQLTableFragmentListIterator{page: page} 1827} 1828 1829// IsEmpty returns true if the ListResult contains no values. 1830func (ustfl USQLTableFragmentList) IsEmpty() bool { 1831 return ustfl.Value == nil || len(*ustfl.Value) == 0 1832} 1833 1834// hasNextLink returns true if the NextLink is not empty. 1835func (ustfl USQLTableFragmentList) hasNextLink() bool { 1836 return ustfl.NextLink != nil && len(*ustfl.NextLink) != 0 1837} 1838 1839// uSQLTableFragmentListPreparer prepares a request to retrieve the next set of results. 1840// It returns nil if no more results exist. 1841func (ustfl USQLTableFragmentList) uSQLTableFragmentListPreparer(ctx context.Context) (*http.Request, error) { 1842 if !ustfl.hasNextLink() { 1843 return nil, nil 1844 } 1845 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1846 autorest.AsJSON(), 1847 autorest.AsGet(), 1848 autorest.WithBaseURL(to.String(ustfl.NextLink))) 1849} 1850 1851// USQLTableFragmentListPage contains a page of USQLTableFragment values. 1852type USQLTableFragmentListPage struct { 1853 fn func(context.Context, USQLTableFragmentList) (USQLTableFragmentList, error) 1854 utfl USQLTableFragmentList 1855} 1856 1857// NextWithContext advances to the next page of values. If there was an error making 1858// the request the page does not advance and the error is returned. 1859func (page *USQLTableFragmentListPage) NextWithContext(ctx context.Context) (err error) { 1860 if tracing.IsEnabled() { 1861 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableFragmentListPage.NextWithContext") 1862 defer func() { 1863 sc := -1 1864 if page.Response().Response.Response != nil { 1865 sc = page.Response().Response.Response.StatusCode 1866 } 1867 tracing.EndSpan(ctx, sc, err) 1868 }() 1869 } 1870 for { 1871 next, err := page.fn(ctx, page.utfl) 1872 if err != nil { 1873 return err 1874 } 1875 page.utfl = next 1876 if !next.hasNextLink() || !next.IsEmpty() { 1877 break 1878 } 1879 } 1880 return nil 1881} 1882 1883// Next advances to the next page of values. If there was an error making 1884// the request the page does not advance and the error is returned. 1885// Deprecated: Use NextWithContext() instead. 1886func (page *USQLTableFragmentListPage) Next() error { 1887 return page.NextWithContext(context.Background()) 1888} 1889 1890// NotDone returns true if the page enumeration should be started or is not yet complete. 1891func (page USQLTableFragmentListPage) NotDone() bool { 1892 return !page.utfl.IsEmpty() 1893} 1894 1895// Response returns the raw server response from the last page request. 1896func (page USQLTableFragmentListPage) Response() USQLTableFragmentList { 1897 return page.utfl 1898} 1899 1900// Values returns the slice of values for the current page or nil if there are no values. 1901func (page USQLTableFragmentListPage) Values() []USQLTableFragment { 1902 if page.utfl.IsEmpty() { 1903 return nil 1904 } 1905 return *page.utfl.Value 1906} 1907 1908// Creates a new instance of the USQLTableFragmentListPage type. 1909func NewUSQLTableFragmentListPage(cur USQLTableFragmentList, getNextPage func(context.Context, USQLTableFragmentList) (USQLTableFragmentList, error)) USQLTableFragmentListPage { 1910 return USQLTableFragmentListPage{ 1911 fn: getNextPage, 1912 utfl: cur, 1913 } 1914} 1915 1916// USQLTableList a Data Lake Analytics catalog U-SQL table item list. 1917type USQLTableList struct { 1918 autorest.Response `json:"-"` 1919 // Value - READ-ONLY; the list of tables in the database and schema combination 1920 Value *[]USQLTable `json:"value,omitempty"` 1921 // NextLink - the link to the next page of results. 1922 NextLink *string `json:"nextLink,omitempty"` 1923} 1924 1925// MarshalJSON is the custom marshaler for USQLTableList. 1926func (ustl USQLTableList) MarshalJSON() ([]byte, error) { 1927 objectMap := make(map[string]interface{}) 1928 if ustl.NextLink != nil { 1929 objectMap["nextLink"] = ustl.NextLink 1930 } 1931 return json.Marshal(objectMap) 1932} 1933 1934// USQLTableListIterator provides access to a complete listing of USQLTable values. 1935type USQLTableListIterator struct { 1936 i int 1937 page USQLTableListPage 1938} 1939 1940// NextWithContext advances to the next value. If there was an error making 1941// the request the iterator does not advance and the error is returned. 1942func (iter *USQLTableListIterator) NextWithContext(ctx context.Context) (err error) { 1943 if tracing.IsEnabled() { 1944 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableListIterator.NextWithContext") 1945 defer func() { 1946 sc := -1 1947 if iter.Response().Response.Response != nil { 1948 sc = iter.Response().Response.Response.StatusCode 1949 } 1950 tracing.EndSpan(ctx, sc, err) 1951 }() 1952 } 1953 iter.i++ 1954 if iter.i < len(iter.page.Values()) { 1955 return nil 1956 } 1957 err = iter.page.NextWithContext(ctx) 1958 if err != nil { 1959 iter.i-- 1960 return err 1961 } 1962 iter.i = 0 1963 return nil 1964} 1965 1966// Next advances to the next value. If there was an error making 1967// the request the iterator does not advance and the error is returned. 1968// Deprecated: Use NextWithContext() instead. 1969func (iter *USQLTableListIterator) Next() error { 1970 return iter.NextWithContext(context.Background()) 1971} 1972 1973// NotDone returns true if the enumeration should be started or is not yet complete. 1974func (iter USQLTableListIterator) NotDone() bool { 1975 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1976} 1977 1978// Response returns the raw server response from the last page request. 1979func (iter USQLTableListIterator) Response() USQLTableList { 1980 return iter.page.Response() 1981} 1982 1983// Value returns the current value or a zero-initialized value if the 1984// iterator has advanced beyond the end of the collection. 1985func (iter USQLTableListIterator) Value() USQLTable { 1986 if !iter.page.NotDone() { 1987 return USQLTable{} 1988 } 1989 return iter.page.Values()[iter.i] 1990} 1991 1992// Creates a new instance of the USQLTableListIterator type. 1993func NewUSQLTableListIterator(page USQLTableListPage) USQLTableListIterator { 1994 return USQLTableListIterator{page: page} 1995} 1996 1997// IsEmpty returns true if the ListResult contains no values. 1998func (ustl USQLTableList) IsEmpty() bool { 1999 return ustl.Value == nil || len(*ustl.Value) == 0 2000} 2001 2002// hasNextLink returns true if the NextLink is not empty. 2003func (ustl USQLTableList) hasNextLink() bool { 2004 return ustl.NextLink != nil && len(*ustl.NextLink) != 0 2005} 2006 2007// uSQLTableListPreparer prepares a request to retrieve the next set of results. 2008// It returns nil if no more results exist. 2009func (ustl USQLTableList) uSQLTableListPreparer(ctx context.Context) (*http.Request, error) { 2010 if !ustl.hasNextLink() { 2011 return nil, nil 2012 } 2013 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2014 autorest.AsJSON(), 2015 autorest.AsGet(), 2016 autorest.WithBaseURL(to.String(ustl.NextLink))) 2017} 2018 2019// USQLTableListPage contains a page of USQLTable values. 2020type USQLTableListPage struct { 2021 fn func(context.Context, USQLTableList) (USQLTableList, error) 2022 utl USQLTableList 2023} 2024 2025// NextWithContext advances to the next page of values. If there was an error making 2026// the request the page does not advance and the error is returned. 2027func (page *USQLTableListPage) NextWithContext(ctx context.Context) (err error) { 2028 if tracing.IsEnabled() { 2029 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableListPage.NextWithContext") 2030 defer func() { 2031 sc := -1 2032 if page.Response().Response.Response != nil { 2033 sc = page.Response().Response.Response.StatusCode 2034 } 2035 tracing.EndSpan(ctx, sc, err) 2036 }() 2037 } 2038 for { 2039 next, err := page.fn(ctx, page.utl) 2040 if err != nil { 2041 return err 2042 } 2043 page.utl = next 2044 if !next.hasNextLink() || !next.IsEmpty() { 2045 break 2046 } 2047 } 2048 return nil 2049} 2050 2051// Next advances to the next page of values. If there was an error making 2052// the request the page does not advance and the error is returned. 2053// Deprecated: Use NextWithContext() instead. 2054func (page *USQLTableListPage) Next() error { 2055 return page.NextWithContext(context.Background()) 2056} 2057 2058// NotDone returns true if the page enumeration should be started or is not yet complete. 2059func (page USQLTableListPage) NotDone() bool { 2060 return !page.utl.IsEmpty() 2061} 2062 2063// Response returns the raw server response from the last page request. 2064func (page USQLTableListPage) Response() USQLTableList { 2065 return page.utl 2066} 2067 2068// Values returns the slice of values for the current page or nil if there are no values. 2069func (page USQLTableListPage) Values() []USQLTable { 2070 if page.utl.IsEmpty() { 2071 return nil 2072 } 2073 return *page.utl.Value 2074} 2075 2076// Creates a new instance of the USQLTableListPage type. 2077func NewUSQLTableListPage(cur USQLTableList, getNextPage func(context.Context, USQLTableList) (USQLTableList, error)) USQLTableListPage { 2078 return USQLTableListPage{ 2079 fn: getNextPage, 2080 utl: cur, 2081 } 2082} 2083 2084// USQLTablePartition a Data Lake Analytics catalog U-SQL table partition item. 2085type USQLTablePartition struct { 2086 autorest.Response `json:"-"` 2087 // DatabaseName - the name of the database. 2088 DatabaseName *string `json:"databaseName,omitempty"` 2089 // SchemaName - the name of the schema associated with this table partition and database. 2090 SchemaName *string `json:"schemaName,omitempty"` 2091 // Name - the name of the table partition. 2092 Name *string `json:"partitionName,omitempty"` 2093 // ParentName - the Ddl object of the partition's parent. 2094 ParentName *DdlName `json:"parentName,omitempty"` 2095 // IndexID - the index ID for this partition. 2096 IndexID *int32 `json:"indexId,omitempty"` 2097 // Label - the list of labels associated with this partition. 2098 Label *[]string `json:"label,omitempty"` 2099 // CreateDate - the creation time of the partition 2100 CreateDate *date.Time `json:"createDate,omitempty"` 2101 // ComputeAccountName - the name of the Data Lake Analytics account. 2102 ComputeAccountName *string `json:"computeAccountName,omitempty"` 2103 // Version - the version of the catalog item. 2104 Version *uuid.UUID `json:"version,omitempty"` 2105} 2106 2107// USQLTablePartitionList a Data Lake Analytics catalog U-SQL table partition item list. 2108type USQLTablePartitionList struct { 2109 autorest.Response `json:"-"` 2110 // Value - READ-ONLY; the list of table partitions in the database, schema and table combination 2111 Value *[]USQLTablePartition `json:"value,omitempty"` 2112 // NextLink - the link to the next page of results. 2113 NextLink *string `json:"nextLink,omitempty"` 2114} 2115 2116// MarshalJSON is the custom marshaler for USQLTablePartitionList. 2117func (ustpl USQLTablePartitionList) MarshalJSON() ([]byte, error) { 2118 objectMap := make(map[string]interface{}) 2119 if ustpl.NextLink != nil { 2120 objectMap["nextLink"] = ustpl.NextLink 2121 } 2122 return json.Marshal(objectMap) 2123} 2124 2125// USQLTablePartitionListIterator provides access to a complete listing of USQLTablePartition values. 2126type USQLTablePartitionListIterator struct { 2127 i int 2128 page USQLTablePartitionListPage 2129} 2130 2131// NextWithContext advances to the next value. If there was an error making 2132// the request the iterator does not advance and the error is returned. 2133func (iter *USQLTablePartitionListIterator) NextWithContext(ctx context.Context) (err error) { 2134 if tracing.IsEnabled() { 2135 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTablePartitionListIterator.NextWithContext") 2136 defer func() { 2137 sc := -1 2138 if iter.Response().Response.Response != nil { 2139 sc = iter.Response().Response.Response.StatusCode 2140 } 2141 tracing.EndSpan(ctx, sc, err) 2142 }() 2143 } 2144 iter.i++ 2145 if iter.i < len(iter.page.Values()) { 2146 return nil 2147 } 2148 err = iter.page.NextWithContext(ctx) 2149 if err != nil { 2150 iter.i-- 2151 return err 2152 } 2153 iter.i = 0 2154 return nil 2155} 2156 2157// Next advances to the next value. If there was an error making 2158// the request the iterator does not advance and the error is returned. 2159// Deprecated: Use NextWithContext() instead. 2160func (iter *USQLTablePartitionListIterator) Next() error { 2161 return iter.NextWithContext(context.Background()) 2162} 2163 2164// NotDone returns true if the enumeration should be started or is not yet complete. 2165func (iter USQLTablePartitionListIterator) NotDone() bool { 2166 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2167} 2168 2169// Response returns the raw server response from the last page request. 2170func (iter USQLTablePartitionListIterator) Response() USQLTablePartitionList { 2171 return iter.page.Response() 2172} 2173 2174// Value returns the current value or a zero-initialized value if the 2175// iterator has advanced beyond the end of the collection. 2176func (iter USQLTablePartitionListIterator) Value() USQLTablePartition { 2177 if !iter.page.NotDone() { 2178 return USQLTablePartition{} 2179 } 2180 return iter.page.Values()[iter.i] 2181} 2182 2183// Creates a new instance of the USQLTablePartitionListIterator type. 2184func NewUSQLTablePartitionListIterator(page USQLTablePartitionListPage) USQLTablePartitionListIterator { 2185 return USQLTablePartitionListIterator{page: page} 2186} 2187 2188// IsEmpty returns true if the ListResult contains no values. 2189func (ustpl USQLTablePartitionList) IsEmpty() bool { 2190 return ustpl.Value == nil || len(*ustpl.Value) == 0 2191} 2192 2193// hasNextLink returns true if the NextLink is not empty. 2194func (ustpl USQLTablePartitionList) hasNextLink() bool { 2195 return ustpl.NextLink != nil && len(*ustpl.NextLink) != 0 2196} 2197 2198// uSQLTablePartitionListPreparer prepares a request to retrieve the next set of results. 2199// It returns nil if no more results exist. 2200func (ustpl USQLTablePartitionList) uSQLTablePartitionListPreparer(ctx context.Context) (*http.Request, error) { 2201 if !ustpl.hasNextLink() { 2202 return nil, nil 2203 } 2204 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2205 autorest.AsJSON(), 2206 autorest.AsGet(), 2207 autorest.WithBaseURL(to.String(ustpl.NextLink))) 2208} 2209 2210// USQLTablePartitionListPage contains a page of USQLTablePartition values. 2211type USQLTablePartitionListPage struct { 2212 fn func(context.Context, USQLTablePartitionList) (USQLTablePartitionList, error) 2213 utpl USQLTablePartitionList 2214} 2215 2216// NextWithContext advances to the next page of values. If there was an error making 2217// the request the page does not advance and the error is returned. 2218func (page *USQLTablePartitionListPage) NextWithContext(ctx context.Context) (err error) { 2219 if tracing.IsEnabled() { 2220 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTablePartitionListPage.NextWithContext") 2221 defer func() { 2222 sc := -1 2223 if page.Response().Response.Response != nil { 2224 sc = page.Response().Response.Response.StatusCode 2225 } 2226 tracing.EndSpan(ctx, sc, err) 2227 }() 2228 } 2229 for { 2230 next, err := page.fn(ctx, page.utpl) 2231 if err != nil { 2232 return err 2233 } 2234 page.utpl = next 2235 if !next.hasNextLink() || !next.IsEmpty() { 2236 break 2237 } 2238 } 2239 return nil 2240} 2241 2242// Next advances to the next page of values. If there was an error making 2243// the request the page does not advance and the error is returned. 2244// Deprecated: Use NextWithContext() instead. 2245func (page *USQLTablePartitionListPage) Next() error { 2246 return page.NextWithContext(context.Background()) 2247} 2248 2249// NotDone returns true if the page enumeration should be started or is not yet complete. 2250func (page USQLTablePartitionListPage) NotDone() bool { 2251 return !page.utpl.IsEmpty() 2252} 2253 2254// Response returns the raw server response from the last page request. 2255func (page USQLTablePartitionListPage) Response() USQLTablePartitionList { 2256 return page.utpl 2257} 2258 2259// Values returns the slice of values for the current page or nil if there are no values. 2260func (page USQLTablePartitionListPage) Values() []USQLTablePartition { 2261 if page.utpl.IsEmpty() { 2262 return nil 2263 } 2264 return *page.utpl.Value 2265} 2266 2267// Creates a new instance of the USQLTablePartitionListPage type. 2268func NewUSQLTablePartitionListPage(cur USQLTablePartitionList, getNextPage func(context.Context, USQLTablePartitionList) (USQLTablePartitionList, error)) USQLTablePartitionListPage { 2269 return USQLTablePartitionListPage{ 2270 fn: getNextPage, 2271 utpl: cur, 2272 } 2273} 2274 2275// USQLTablePreview a Data Lake Analytics catalog table or partition preview rows item. 2276type USQLTablePreview struct { 2277 autorest.Response `json:"-"` 2278 // TotalRowCount - the total number of rows in the table or partition. 2279 TotalRowCount *int64 `json:"totalRowCount,omitempty"` 2280 // TotalColumnCount - the total number of columns in the table or partition. 2281 TotalColumnCount *int64 `json:"totalColumnCount,omitempty"` 2282 // Rows - the rows of the table or partition preview, where each row is an array of string representations the row's values. Note: Byte arrays will appear as base-64 encoded values, SqlMap and SqlArray objects will appear as escaped JSON objects, and DateTime objects will appear as ISO formatted UTC date-times. 2283 Rows *[][]string `json:"rows,omitempty"` 2284 // Truncated - true if the amount of data in the response is less than expected due to the preview operation's size limitations. This can occur if the requested rows or row counts are too large. 2285 Truncated *bool `json:"truncated,omitempty"` 2286 // Schema - the schema of the table or partition. 2287 Schema *[]USQLTableColumn `json:"schema,omitempty"` 2288} 2289 2290// USQLTableStatistics a Data Lake Analytics catalog U-SQL table statistics item. 2291type USQLTableStatistics struct { 2292 autorest.Response `json:"-"` 2293 // DatabaseName - the name of the database. 2294 DatabaseName *string `json:"databaseName,omitempty"` 2295 // SchemaName - the name of the schema associated with this table and database. 2296 SchemaName *string `json:"schemaName,omitempty"` 2297 // TableName - the name of the table. 2298 TableName *string `json:"tableName,omitempty"` 2299 // Name - the name of the table statistics. 2300 Name *string `json:"statisticsName,omitempty"` 2301 // UserStatName - the name of the user statistics. 2302 UserStatName *string `json:"userStatName,omitempty"` 2303 // StatDataPath - the path to the statistics data. 2304 StatDataPath *string `json:"statDataPath,omitempty"` 2305 // CreateTime - the creation time of the statistics. 2306 CreateTime *date.Time `json:"createTime,omitempty"` 2307 // UpdateTime - the last time the statistics were updated. 2308 UpdateTime *date.Time `json:"updateTime,omitempty"` 2309 // IsUserCreated - the switch indicating if these statistics are user created. 2310 IsUserCreated *bool `json:"isUserCreated,omitempty"` 2311 // IsAutoCreated - the switch indicating if these statistics are automatically created. 2312 IsAutoCreated *bool `json:"isAutoCreated,omitempty"` 2313 // HasFilter - the switch indicating if these statistics have a filter. 2314 HasFilter *bool `json:"hasFilter,omitempty"` 2315 // FilterDefinition - the filter definition for the statistics. 2316 FilterDefinition *string `json:"filterDefinition,omitempty"` 2317 // ColNames - the list of column names associated with these statistics. 2318 ColNames *[]string `json:"colNames,omitempty"` 2319 // ComputeAccountName - the name of the Data Lake Analytics account. 2320 ComputeAccountName *string `json:"computeAccountName,omitempty"` 2321 // Version - the version of the catalog item. 2322 Version *uuid.UUID `json:"version,omitempty"` 2323} 2324 2325// USQLTableStatisticsList a Data Lake Analytics catalog U-SQL table statistics item list. 2326type USQLTableStatisticsList struct { 2327 autorest.Response `json:"-"` 2328 // Value - READ-ONLY; the list of table statistics in the database, schema and table combination 2329 Value *[]USQLTableStatistics `json:"value,omitempty"` 2330 // NextLink - the link to the next page of results. 2331 NextLink *string `json:"nextLink,omitempty"` 2332} 2333 2334// MarshalJSON is the custom marshaler for USQLTableStatisticsList. 2335func (ustsl USQLTableStatisticsList) MarshalJSON() ([]byte, error) { 2336 objectMap := make(map[string]interface{}) 2337 if ustsl.NextLink != nil { 2338 objectMap["nextLink"] = ustsl.NextLink 2339 } 2340 return json.Marshal(objectMap) 2341} 2342 2343// USQLTableStatisticsListIterator provides access to a complete listing of USQLTableStatistics values. 2344type USQLTableStatisticsListIterator struct { 2345 i int 2346 page USQLTableStatisticsListPage 2347} 2348 2349// NextWithContext advances to the next value. If there was an error making 2350// the request the iterator does not advance and the error is returned. 2351func (iter *USQLTableStatisticsListIterator) NextWithContext(ctx context.Context) (err error) { 2352 if tracing.IsEnabled() { 2353 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableStatisticsListIterator.NextWithContext") 2354 defer func() { 2355 sc := -1 2356 if iter.Response().Response.Response != nil { 2357 sc = iter.Response().Response.Response.StatusCode 2358 } 2359 tracing.EndSpan(ctx, sc, err) 2360 }() 2361 } 2362 iter.i++ 2363 if iter.i < len(iter.page.Values()) { 2364 return nil 2365 } 2366 err = iter.page.NextWithContext(ctx) 2367 if err != nil { 2368 iter.i-- 2369 return err 2370 } 2371 iter.i = 0 2372 return nil 2373} 2374 2375// Next advances to the next value. If there was an error making 2376// the request the iterator does not advance and the error is returned. 2377// Deprecated: Use NextWithContext() instead. 2378func (iter *USQLTableStatisticsListIterator) Next() error { 2379 return iter.NextWithContext(context.Background()) 2380} 2381 2382// NotDone returns true if the enumeration should be started or is not yet complete. 2383func (iter USQLTableStatisticsListIterator) NotDone() bool { 2384 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2385} 2386 2387// Response returns the raw server response from the last page request. 2388func (iter USQLTableStatisticsListIterator) Response() USQLTableStatisticsList { 2389 return iter.page.Response() 2390} 2391 2392// Value returns the current value or a zero-initialized value if the 2393// iterator has advanced beyond the end of the collection. 2394func (iter USQLTableStatisticsListIterator) Value() USQLTableStatistics { 2395 if !iter.page.NotDone() { 2396 return USQLTableStatistics{} 2397 } 2398 return iter.page.Values()[iter.i] 2399} 2400 2401// Creates a new instance of the USQLTableStatisticsListIterator type. 2402func NewUSQLTableStatisticsListIterator(page USQLTableStatisticsListPage) USQLTableStatisticsListIterator { 2403 return USQLTableStatisticsListIterator{page: page} 2404} 2405 2406// IsEmpty returns true if the ListResult contains no values. 2407func (ustsl USQLTableStatisticsList) IsEmpty() bool { 2408 return ustsl.Value == nil || len(*ustsl.Value) == 0 2409} 2410 2411// hasNextLink returns true if the NextLink is not empty. 2412func (ustsl USQLTableStatisticsList) hasNextLink() bool { 2413 return ustsl.NextLink != nil && len(*ustsl.NextLink) != 0 2414} 2415 2416// uSQLTableStatisticsListPreparer prepares a request to retrieve the next set of results. 2417// It returns nil if no more results exist. 2418func (ustsl USQLTableStatisticsList) uSQLTableStatisticsListPreparer(ctx context.Context) (*http.Request, error) { 2419 if !ustsl.hasNextLink() { 2420 return nil, nil 2421 } 2422 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2423 autorest.AsJSON(), 2424 autorest.AsGet(), 2425 autorest.WithBaseURL(to.String(ustsl.NextLink))) 2426} 2427 2428// USQLTableStatisticsListPage contains a page of USQLTableStatistics values. 2429type USQLTableStatisticsListPage struct { 2430 fn func(context.Context, USQLTableStatisticsList) (USQLTableStatisticsList, error) 2431 utsl USQLTableStatisticsList 2432} 2433 2434// NextWithContext advances to the next page of values. If there was an error making 2435// the request the page does not advance and the error is returned. 2436func (page *USQLTableStatisticsListPage) NextWithContext(ctx context.Context) (err error) { 2437 if tracing.IsEnabled() { 2438 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableStatisticsListPage.NextWithContext") 2439 defer func() { 2440 sc := -1 2441 if page.Response().Response.Response != nil { 2442 sc = page.Response().Response.Response.StatusCode 2443 } 2444 tracing.EndSpan(ctx, sc, err) 2445 }() 2446 } 2447 for { 2448 next, err := page.fn(ctx, page.utsl) 2449 if err != nil { 2450 return err 2451 } 2452 page.utsl = next 2453 if !next.hasNextLink() || !next.IsEmpty() { 2454 break 2455 } 2456 } 2457 return nil 2458} 2459 2460// Next advances to the next page of values. If there was an error making 2461// the request the page does not advance and the error is returned. 2462// Deprecated: Use NextWithContext() instead. 2463func (page *USQLTableStatisticsListPage) Next() error { 2464 return page.NextWithContext(context.Background()) 2465} 2466 2467// NotDone returns true if the page enumeration should be started or is not yet complete. 2468func (page USQLTableStatisticsListPage) NotDone() bool { 2469 return !page.utsl.IsEmpty() 2470} 2471 2472// Response returns the raw server response from the last page request. 2473func (page USQLTableStatisticsListPage) Response() USQLTableStatisticsList { 2474 return page.utsl 2475} 2476 2477// Values returns the slice of values for the current page or nil if there are no values. 2478func (page USQLTableStatisticsListPage) Values() []USQLTableStatistics { 2479 if page.utsl.IsEmpty() { 2480 return nil 2481 } 2482 return *page.utsl.Value 2483} 2484 2485// Creates a new instance of the USQLTableStatisticsListPage type. 2486func NewUSQLTableStatisticsListPage(cur USQLTableStatisticsList, getNextPage func(context.Context, USQLTableStatisticsList) (USQLTableStatisticsList, error)) USQLTableStatisticsListPage { 2487 return USQLTableStatisticsListPage{ 2488 fn: getNextPage, 2489 utsl: cur, 2490 } 2491} 2492 2493// USQLTableType a Data Lake Analytics catalog U-SQL table type item. 2494type USQLTableType struct { 2495 autorest.Response `json:"-"` 2496 // Columns - READ-ONLY; the type field information associated with this table type. 2497 Columns *[]TypeFieldInfo `json:"columns,omitempty"` 2498 // DatabaseName - the name of the database. 2499 DatabaseName *string `json:"databaseName,omitempty"` 2500 // SchemaName - the name of the schema associated with this table and database. 2501 SchemaName *string `json:"schemaName,omitempty"` 2502 // Name - the name of type for this type. 2503 Name *string `json:"typeName,omitempty"` 2504 // TypeFamily - the type family for this type. 2505 TypeFamily *string `json:"typeFamily,omitempty"` 2506 // CSharpName - the C# name for this type. 2507 CSharpName *string `json:"cSharpName,omitempty"` 2508 // FullCSharpName - the fully qualified C# name for this type. 2509 FullCSharpName *string `json:"fullCSharpName,omitempty"` 2510 // SystemTypeID - the system type ID for this type. 2511 SystemTypeID *int32 `json:"systemTypeId,omitempty"` 2512 // UserTypeID - the user type ID for this type. 2513 UserTypeID *int32 `json:"userTypeId,omitempty"` 2514 // SchemaID - the schema ID for this type. 2515 SchemaID *int32 `json:"schemaId,omitempty"` 2516 // PrincipalID - the principal ID for this type. 2517 PrincipalID *int32 `json:"principalId,omitempty"` 2518 // IsNullable - The switch indicating if this type is nullable. 2519 IsNullable *bool `json:"isNullable,omitempty"` 2520 // IsUserDefined - The switch indicating if this type is user defined. 2521 IsUserDefined *bool `json:"isUserDefined,omitempty"` 2522 // IsAssemblyType - The switch indicating if this type is an assembly type. 2523 IsAssemblyType *bool `json:"isAssemblyType,omitempty"` 2524 // IsTableType - The switch indicating if this type is a table type. 2525 IsTableType *bool `json:"isTableType,omitempty"` 2526 // IsComplexType - The switch indicating if this type is a complex type. 2527 IsComplexType *bool `json:"isComplexType,omitempty"` 2528 // ComputeAccountName - the name of the Data Lake Analytics account. 2529 ComputeAccountName *string `json:"computeAccountName,omitempty"` 2530 // Version - the version of the catalog item. 2531 Version *uuid.UUID `json:"version,omitempty"` 2532} 2533 2534// MarshalJSON is the custom marshaler for USQLTableType. 2535func (ustt USQLTableType) MarshalJSON() ([]byte, error) { 2536 objectMap := make(map[string]interface{}) 2537 if ustt.DatabaseName != nil { 2538 objectMap["databaseName"] = ustt.DatabaseName 2539 } 2540 if ustt.SchemaName != nil { 2541 objectMap["schemaName"] = ustt.SchemaName 2542 } 2543 if ustt.Name != nil { 2544 objectMap["typeName"] = ustt.Name 2545 } 2546 if ustt.TypeFamily != nil { 2547 objectMap["typeFamily"] = ustt.TypeFamily 2548 } 2549 if ustt.CSharpName != nil { 2550 objectMap["cSharpName"] = ustt.CSharpName 2551 } 2552 if ustt.FullCSharpName != nil { 2553 objectMap["fullCSharpName"] = ustt.FullCSharpName 2554 } 2555 if ustt.SystemTypeID != nil { 2556 objectMap["systemTypeId"] = ustt.SystemTypeID 2557 } 2558 if ustt.UserTypeID != nil { 2559 objectMap["userTypeId"] = ustt.UserTypeID 2560 } 2561 if ustt.SchemaID != nil { 2562 objectMap["schemaId"] = ustt.SchemaID 2563 } 2564 if ustt.PrincipalID != nil { 2565 objectMap["principalId"] = ustt.PrincipalID 2566 } 2567 if ustt.IsNullable != nil { 2568 objectMap["isNullable"] = ustt.IsNullable 2569 } 2570 if ustt.IsUserDefined != nil { 2571 objectMap["isUserDefined"] = ustt.IsUserDefined 2572 } 2573 if ustt.IsAssemblyType != nil { 2574 objectMap["isAssemblyType"] = ustt.IsAssemblyType 2575 } 2576 if ustt.IsTableType != nil { 2577 objectMap["isTableType"] = ustt.IsTableType 2578 } 2579 if ustt.IsComplexType != nil { 2580 objectMap["isComplexType"] = ustt.IsComplexType 2581 } 2582 if ustt.ComputeAccountName != nil { 2583 objectMap["computeAccountName"] = ustt.ComputeAccountName 2584 } 2585 if ustt.Version != nil { 2586 objectMap["version"] = ustt.Version 2587 } 2588 return json.Marshal(objectMap) 2589} 2590 2591// USQLTableTypeList a Data Lake Analytics catalog U-SQL table type item list. 2592type USQLTableTypeList struct { 2593 autorest.Response `json:"-"` 2594 // Value - READ-ONLY; the list of table types in the database and schema combination 2595 Value *[]USQLTableType `json:"value,omitempty"` 2596 // NextLink - the link to the next page of results. 2597 NextLink *string `json:"nextLink,omitempty"` 2598} 2599 2600// MarshalJSON is the custom marshaler for USQLTableTypeList. 2601func (usttl USQLTableTypeList) MarshalJSON() ([]byte, error) { 2602 objectMap := make(map[string]interface{}) 2603 if usttl.NextLink != nil { 2604 objectMap["nextLink"] = usttl.NextLink 2605 } 2606 return json.Marshal(objectMap) 2607} 2608 2609// USQLTableTypeListIterator provides access to a complete listing of USQLTableType values. 2610type USQLTableTypeListIterator struct { 2611 i int 2612 page USQLTableTypeListPage 2613} 2614 2615// NextWithContext advances to the next value. If there was an error making 2616// the request the iterator does not advance and the error is returned. 2617func (iter *USQLTableTypeListIterator) NextWithContext(ctx context.Context) (err error) { 2618 if tracing.IsEnabled() { 2619 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableTypeListIterator.NextWithContext") 2620 defer func() { 2621 sc := -1 2622 if iter.Response().Response.Response != nil { 2623 sc = iter.Response().Response.Response.StatusCode 2624 } 2625 tracing.EndSpan(ctx, sc, err) 2626 }() 2627 } 2628 iter.i++ 2629 if iter.i < len(iter.page.Values()) { 2630 return nil 2631 } 2632 err = iter.page.NextWithContext(ctx) 2633 if err != nil { 2634 iter.i-- 2635 return err 2636 } 2637 iter.i = 0 2638 return nil 2639} 2640 2641// Next advances to the next value. If there was an error making 2642// the request the iterator does not advance and the error is returned. 2643// Deprecated: Use NextWithContext() instead. 2644func (iter *USQLTableTypeListIterator) Next() error { 2645 return iter.NextWithContext(context.Background()) 2646} 2647 2648// NotDone returns true if the enumeration should be started or is not yet complete. 2649func (iter USQLTableTypeListIterator) NotDone() bool { 2650 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2651} 2652 2653// Response returns the raw server response from the last page request. 2654func (iter USQLTableTypeListIterator) Response() USQLTableTypeList { 2655 return iter.page.Response() 2656} 2657 2658// Value returns the current value or a zero-initialized value if the 2659// iterator has advanced beyond the end of the collection. 2660func (iter USQLTableTypeListIterator) Value() USQLTableType { 2661 if !iter.page.NotDone() { 2662 return USQLTableType{} 2663 } 2664 return iter.page.Values()[iter.i] 2665} 2666 2667// Creates a new instance of the USQLTableTypeListIterator type. 2668func NewUSQLTableTypeListIterator(page USQLTableTypeListPage) USQLTableTypeListIterator { 2669 return USQLTableTypeListIterator{page: page} 2670} 2671 2672// IsEmpty returns true if the ListResult contains no values. 2673func (usttl USQLTableTypeList) IsEmpty() bool { 2674 return usttl.Value == nil || len(*usttl.Value) == 0 2675} 2676 2677// hasNextLink returns true if the NextLink is not empty. 2678func (usttl USQLTableTypeList) hasNextLink() bool { 2679 return usttl.NextLink != nil && len(*usttl.NextLink) != 0 2680} 2681 2682// uSQLTableTypeListPreparer prepares a request to retrieve the next set of results. 2683// It returns nil if no more results exist. 2684func (usttl USQLTableTypeList) uSQLTableTypeListPreparer(ctx context.Context) (*http.Request, error) { 2685 if !usttl.hasNextLink() { 2686 return nil, nil 2687 } 2688 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2689 autorest.AsJSON(), 2690 autorest.AsGet(), 2691 autorest.WithBaseURL(to.String(usttl.NextLink))) 2692} 2693 2694// USQLTableTypeListPage contains a page of USQLTableType values. 2695type USQLTableTypeListPage struct { 2696 fn func(context.Context, USQLTableTypeList) (USQLTableTypeList, error) 2697 uttl USQLTableTypeList 2698} 2699 2700// NextWithContext advances to the next page of values. If there was an error making 2701// the request the page does not advance and the error is returned. 2702func (page *USQLTableTypeListPage) NextWithContext(ctx context.Context) (err error) { 2703 if tracing.IsEnabled() { 2704 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableTypeListPage.NextWithContext") 2705 defer func() { 2706 sc := -1 2707 if page.Response().Response.Response != nil { 2708 sc = page.Response().Response.Response.StatusCode 2709 } 2710 tracing.EndSpan(ctx, sc, err) 2711 }() 2712 } 2713 for { 2714 next, err := page.fn(ctx, page.uttl) 2715 if err != nil { 2716 return err 2717 } 2718 page.uttl = next 2719 if !next.hasNextLink() || !next.IsEmpty() { 2720 break 2721 } 2722 } 2723 return nil 2724} 2725 2726// Next advances to the next page of values. If there was an error making 2727// the request the page does not advance and the error is returned. 2728// Deprecated: Use NextWithContext() instead. 2729func (page *USQLTableTypeListPage) Next() error { 2730 return page.NextWithContext(context.Background()) 2731} 2732 2733// NotDone returns true if the page enumeration should be started or is not yet complete. 2734func (page USQLTableTypeListPage) NotDone() bool { 2735 return !page.uttl.IsEmpty() 2736} 2737 2738// Response returns the raw server response from the last page request. 2739func (page USQLTableTypeListPage) Response() USQLTableTypeList { 2740 return page.uttl 2741} 2742 2743// Values returns the slice of values for the current page or nil if there are no values. 2744func (page USQLTableTypeListPage) Values() []USQLTableType { 2745 if page.uttl.IsEmpty() { 2746 return nil 2747 } 2748 return *page.uttl.Value 2749} 2750 2751// Creates a new instance of the USQLTableTypeListPage type. 2752func NewUSQLTableTypeListPage(cur USQLTableTypeList, getNextPage func(context.Context, USQLTableTypeList) (USQLTableTypeList, error)) USQLTableTypeListPage { 2753 return USQLTableTypeListPage{ 2754 fn: getNextPage, 2755 uttl: cur, 2756 } 2757} 2758 2759// USQLTableValuedFunction a Data Lake Analytics catalog U-SQL table valued function item. 2760type USQLTableValuedFunction struct { 2761 autorest.Response `json:"-"` 2762 // DatabaseName - the name of the database. 2763 DatabaseName *string `json:"databaseName,omitempty"` 2764 // SchemaName - the name of the schema associated with this database. 2765 SchemaName *string `json:"schemaName,omitempty"` 2766 // Name - the name of the table valued function. 2767 Name *string `json:"tvfName,omitempty"` 2768 // Definition - the definition of the table valued function. 2769 Definition *string `json:"definition,omitempty"` 2770 // ComputeAccountName - the name of the Data Lake Analytics account. 2771 ComputeAccountName *string `json:"computeAccountName,omitempty"` 2772 // Version - the version of the catalog item. 2773 Version *uuid.UUID `json:"version,omitempty"` 2774} 2775 2776// USQLTableValuedFunctionList a Data Lake Analytics catalog U-SQL table valued function item list. 2777type USQLTableValuedFunctionList struct { 2778 autorest.Response `json:"-"` 2779 // Value - READ-ONLY; the list of table valued functions in the database and schema combination 2780 Value *[]USQLTableValuedFunction `json:"value,omitempty"` 2781 // NextLink - the link to the next page of results. 2782 NextLink *string `json:"nextLink,omitempty"` 2783} 2784 2785// MarshalJSON is the custom marshaler for USQLTableValuedFunctionList. 2786func (ustvfl USQLTableValuedFunctionList) MarshalJSON() ([]byte, error) { 2787 objectMap := make(map[string]interface{}) 2788 if ustvfl.NextLink != nil { 2789 objectMap["nextLink"] = ustvfl.NextLink 2790 } 2791 return json.Marshal(objectMap) 2792} 2793 2794// USQLTableValuedFunctionListIterator provides access to a complete listing of USQLTableValuedFunction 2795// values. 2796type USQLTableValuedFunctionListIterator struct { 2797 i int 2798 page USQLTableValuedFunctionListPage 2799} 2800 2801// NextWithContext advances to the next value. If there was an error making 2802// the request the iterator does not advance and the error is returned. 2803func (iter *USQLTableValuedFunctionListIterator) NextWithContext(ctx context.Context) (err error) { 2804 if tracing.IsEnabled() { 2805 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableValuedFunctionListIterator.NextWithContext") 2806 defer func() { 2807 sc := -1 2808 if iter.Response().Response.Response != nil { 2809 sc = iter.Response().Response.Response.StatusCode 2810 } 2811 tracing.EndSpan(ctx, sc, err) 2812 }() 2813 } 2814 iter.i++ 2815 if iter.i < len(iter.page.Values()) { 2816 return nil 2817 } 2818 err = iter.page.NextWithContext(ctx) 2819 if err != nil { 2820 iter.i-- 2821 return err 2822 } 2823 iter.i = 0 2824 return nil 2825} 2826 2827// Next advances to the next value. If there was an error making 2828// the request the iterator does not advance and the error is returned. 2829// Deprecated: Use NextWithContext() instead. 2830func (iter *USQLTableValuedFunctionListIterator) Next() error { 2831 return iter.NextWithContext(context.Background()) 2832} 2833 2834// NotDone returns true if the enumeration should be started or is not yet complete. 2835func (iter USQLTableValuedFunctionListIterator) NotDone() bool { 2836 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2837} 2838 2839// Response returns the raw server response from the last page request. 2840func (iter USQLTableValuedFunctionListIterator) Response() USQLTableValuedFunctionList { 2841 return iter.page.Response() 2842} 2843 2844// Value returns the current value or a zero-initialized value if the 2845// iterator has advanced beyond the end of the collection. 2846func (iter USQLTableValuedFunctionListIterator) Value() USQLTableValuedFunction { 2847 if !iter.page.NotDone() { 2848 return USQLTableValuedFunction{} 2849 } 2850 return iter.page.Values()[iter.i] 2851} 2852 2853// Creates a new instance of the USQLTableValuedFunctionListIterator type. 2854func NewUSQLTableValuedFunctionListIterator(page USQLTableValuedFunctionListPage) USQLTableValuedFunctionListIterator { 2855 return USQLTableValuedFunctionListIterator{page: page} 2856} 2857 2858// IsEmpty returns true if the ListResult contains no values. 2859func (ustvfl USQLTableValuedFunctionList) IsEmpty() bool { 2860 return ustvfl.Value == nil || len(*ustvfl.Value) == 0 2861} 2862 2863// hasNextLink returns true if the NextLink is not empty. 2864func (ustvfl USQLTableValuedFunctionList) hasNextLink() bool { 2865 return ustvfl.NextLink != nil && len(*ustvfl.NextLink) != 0 2866} 2867 2868// uSQLTableValuedFunctionListPreparer prepares a request to retrieve the next set of results. 2869// It returns nil if no more results exist. 2870func (ustvfl USQLTableValuedFunctionList) uSQLTableValuedFunctionListPreparer(ctx context.Context) (*http.Request, error) { 2871 if !ustvfl.hasNextLink() { 2872 return nil, nil 2873 } 2874 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2875 autorest.AsJSON(), 2876 autorest.AsGet(), 2877 autorest.WithBaseURL(to.String(ustvfl.NextLink))) 2878} 2879 2880// USQLTableValuedFunctionListPage contains a page of USQLTableValuedFunction values. 2881type USQLTableValuedFunctionListPage struct { 2882 fn func(context.Context, USQLTableValuedFunctionList) (USQLTableValuedFunctionList, error) 2883 utvfl USQLTableValuedFunctionList 2884} 2885 2886// NextWithContext advances to the next page of values. If there was an error making 2887// the request the page does not advance and the error is returned. 2888func (page *USQLTableValuedFunctionListPage) NextWithContext(ctx context.Context) (err error) { 2889 if tracing.IsEnabled() { 2890 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTableValuedFunctionListPage.NextWithContext") 2891 defer func() { 2892 sc := -1 2893 if page.Response().Response.Response != nil { 2894 sc = page.Response().Response.Response.StatusCode 2895 } 2896 tracing.EndSpan(ctx, sc, err) 2897 }() 2898 } 2899 for { 2900 next, err := page.fn(ctx, page.utvfl) 2901 if err != nil { 2902 return err 2903 } 2904 page.utvfl = next 2905 if !next.hasNextLink() || !next.IsEmpty() { 2906 break 2907 } 2908 } 2909 return nil 2910} 2911 2912// Next advances to the next page of values. If there was an error making 2913// the request the page does not advance and the error is returned. 2914// Deprecated: Use NextWithContext() instead. 2915func (page *USQLTableValuedFunctionListPage) Next() error { 2916 return page.NextWithContext(context.Background()) 2917} 2918 2919// NotDone returns true if the page enumeration should be started or is not yet complete. 2920func (page USQLTableValuedFunctionListPage) NotDone() bool { 2921 return !page.utvfl.IsEmpty() 2922} 2923 2924// Response returns the raw server response from the last page request. 2925func (page USQLTableValuedFunctionListPage) Response() USQLTableValuedFunctionList { 2926 return page.utvfl 2927} 2928 2929// Values returns the slice of values for the current page or nil if there are no values. 2930func (page USQLTableValuedFunctionListPage) Values() []USQLTableValuedFunction { 2931 if page.utvfl.IsEmpty() { 2932 return nil 2933 } 2934 return *page.utvfl.Value 2935} 2936 2937// Creates a new instance of the USQLTableValuedFunctionListPage type. 2938func NewUSQLTableValuedFunctionListPage(cur USQLTableValuedFunctionList, getNextPage func(context.Context, USQLTableValuedFunctionList) (USQLTableValuedFunctionList, error)) USQLTableValuedFunctionListPage { 2939 return USQLTableValuedFunctionListPage{ 2940 fn: getNextPage, 2941 utvfl: cur, 2942 } 2943} 2944 2945// USQLType a Data Lake Analytics catalog U-SQL type item. 2946type USQLType struct { 2947 // DatabaseName - the name of the database. 2948 DatabaseName *string `json:"databaseName,omitempty"` 2949 // SchemaName - the name of the schema associated with this table and database. 2950 SchemaName *string `json:"schemaName,omitempty"` 2951 // Name - the name of type for this type. 2952 Name *string `json:"typeName,omitempty"` 2953 // TypeFamily - the type family for this type. 2954 TypeFamily *string `json:"typeFamily,omitempty"` 2955 // CSharpName - the C# name for this type. 2956 CSharpName *string `json:"cSharpName,omitempty"` 2957 // FullCSharpName - the fully qualified C# name for this type. 2958 FullCSharpName *string `json:"fullCSharpName,omitempty"` 2959 // SystemTypeID - the system type ID for this type. 2960 SystemTypeID *int32 `json:"systemTypeId,omitempty"` 2961 // UserTypeID - the user type ID for this type. 2962 UserTypeID *int32 `json:"userTypeId,omitempty"` 2963 // SchemaID - the schema ID for this type. 2964 SchemaID *int32 `json:"schemaId,omitempty"` 2965 // PrincipalID - the principal ID for this type. 2966 PrincipalID *int32 `json:"principalId,omitempty"` 2967 // IsNullable - The switch indicating if this type is nullable. 2968 IsNullable *bool `json:"isNullable,omitempty"` 2969 // IsUserDefined - The switch indicating if this type is user defined. 2970 IsUserDefined *bool `json:"isUserDefined,omitempty"` 2971 // IsAssemblyType - The switch indicating if this type is an assembly type. 2972 IsAssemblyType *bool `json:"isAssemblyType,omitempty"` 2973 // IsTableType - The switch indicating if this type is a table type. 2974 IsTableType *bool `json:"isTableType,omitempty"` 2975 // IsComplexType - The switch indicating if this type is a complex type. 2976 IsComplexType *bool `json:"isComplexType,omitempty"` 2977 // ComputeAccountName - the name of the Data Lake Analytics account. 2978 ComputeAccountName *string `json:"computeAccountName,omitempty"` 2979 // Version - the version of the catalog item. 2980 Version *uuid.UUID `json:"version,omitempty"` 2981} 2982 2983// USQLTypeList a Data Lake Analytics catalog U-SQL type item list. 2984type USQLTypeList struct { 2985 autorest.Response `json:"-"` 2986 // Value - READ-ONLY; the list of types in the database and schema combination 2987 Value *[]USQLType `json:"value,omitempty"` 2988 // NextLink - the link to the next page of results. 2989 NextLink *string `json:"nextLink,omitempty"` 2990} 2991 2992// MarshalJSON is the custom marshaler for USQLTypeList. 2993func (ustl USQLTypeList) MarshalJSON() ([]byte, error) { 2994 objectMap := make(map[string]interface{}) 2995 if ustl.NextLink != nil { 2996 objectMap["nextLink"] = ustl.NextLink 2997 } 2998 return json.Marshal(objectMap) 2999} 3000 3001// USQLTypeListIterator provides access to a complete listing of USQLType values. 3002type USQLTypeListIterator struct { 3003 i int 3004 page USQLTypeListPage 3005} 3006 3007// NextWithContext advances to the next value. If there was an error making 3008// the request the iterator does not advance and the error is returned. 3009func (iter *USQLTypeListIterator) NextWithContext(ctx context.Context) (err error) { 3010 if tracing.IsEnabled() { 3011 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTypeListIterator.NextWithContext") 3012 defer func() { 3013 sc := -1 3014 if iter.Response().Response.Response != nil { 3015 sc = iter.Response().Response.Response.StatusCode 3016 } 3017 tracing.EndSpan(ctx, sc, err) 3018 }() 3019 } 3020 iter.i++ 3021 if iter.i < len(iter.page.Values()) { 3022 return nil 3023 } 3024 err = iter.page.NextWithContext(ctx) 3025 if err != nil { 3026 iter.i-- 3027 return err 3028 } 3029 iter.i = 0 3030 return nil 3031} 3032 3033// Next advances to the next value. If there was an error making 3034// the request the iterator does not advance and the error is returned. 3035// Deprecated: Use NextWithContext() instead. 3036func (iter *USQLTypeListIterator) Next() error { 3037 return iter.NextWithContext(context.Background()) 3038} 3039 3040// NotDone returns true if the enumeration should be started or is not yet complete. 3041func (iter USQLTypeListIterator) NotDone() bool { 3042 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3043} 3044 3045// Response returns the raw server response from the last page request. 3046func (iter USQLTypeListIterator) Response() USQLTypeList { 3047 return iter.page.Response() 3048} 3049 3050// Value returns the current value or a zero-initialized value if the 3051// iterator has advanced beyond the end of the collection. 3052func (iter USQLTypeListIterator) Value() USQLType { 3053 if !iter.page.NotDone() { 3054 return USQLType{} 3055 } 3056 return iter.page.Values()[iter.i] 3057} 3058 3059// Creates a new instance of the USQLTypeListIterator type. 3060func NewUSQLTypeListIterator(page USQLTypeListPage) USQLTypeListIterator { 3061 return USQLTypeListIterator{page: page} 3062} 3063 3064// IsEmpty returns true if the ListResult contains no values. 3065func (ustl USQLTypeList) IsEmpty() bool { 3066 return ustl.Value == nil || len(*ustl.Value) == 0 3067} 3068 3069// hasNextLink returns true if the NextLink is not empty. 3070func (ustl USQLTypeList) hasNextLink() bool { 3071 return ustl.NextLink != nil && len(*ustl.NextLink) != 0 3072} 3073 3074// uSQLTypeListPreparer prepares a request to retrieve the next set of results. 3075// It returns nil if no more results exist. 3076func (ustl USQLTypeList) uSQLTypeListPreparer(ctx context.Context) (*http.Request, error) { 3077 if !ustl.hasNextLink() { 3078 return nil, nil 3079 } 3080 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3081 autorest.AsJSON(), 3082 autorest.AsGet(), 3083 autorest.WithBaseURL(to.String(ustl.NextLink))) 3084} 3085 3086// USQLTypeListPage contains a page of USQLType values. 3087type USQLTypeListPage struct { 3088 fn func(context.Context, USQLTypeList) (USQLTypeList, error) 3089 utl USQLTypeList 3090} 3091 3092// NextWithContext advances to the next page of values. If there was an error making 3093// the request the page does not advance and the error is returned. 3094func (page *USQLTypeListPage) NextWithContext(ctx context.Context) (err error) { 3095 if tracing.IsEnabled() { 3096 ctx = tracing.StartSpan(ctx, fqdn+"/USQLTypeListPage.NextWithContext") 3097 defer func() { 3098 sc := -1 3099 if page.Response().Response.Response != nil { 3100 sc = page.Response().Response.Response.StatusCode 3101 } 3102 tracing.EndSpan(ctx, sc, err) 3103 }() 3104 } 3105 for { 3106 next, err := page.fn(ctx, page.utl) 3107 if err != nil { 3108 return err 3109 } 3110 page.utl = next 3111 if !next.hasNextLink() || !next.IsEmpty() { 3112 break 3113 } 3114 } 3115 return nil 3116} 3117 3118// Next advances to the next page of values. If there was an error making 3119// the request the page does not advance and the error is returned. 3120// Deprecated: Use NextWithContext() instead. 3121func (page *USQLTypeListPage) Next() error { 3122 return page.NextWithContext(context.Background()) 3123} 3124 3125// NotDone returns true if the page enumeration should be started or is not yet complete. 3126func (page USQLTypeListPage) NotDone() bool { 3127 return !page.utl.IsEmpty() 3128} 3129 3130// Response returns the raw server response from the last page request. 3131func (page USQLTypeListPage) Response() USQLTypeList { 3132 return page.utl 3133} 3134 3135// Values returns the slice of values for the current page or nil if there are no values. 3136func (page USQLTypeListPage) Values() []USQLType { 3137 if page.utl.IsEmpty() { 3138 return nil 3139 } 3140 return *page.utl.Value 3141} 3142 3143// Creates a new instance of the USQLTypeListPage type. 3144func NewUSQLTypeListPage(cur USQLTypeList, getNextPage func(context.Context, USQLTypeList) (USQLTypeList, error)) USQLTypeListPage { 3145 return USQLTypeListPage{ 3146 fn: getNextPage, 3147 utl: cur, 3148 } 3149} 3150 3151// USQLView a Data Lake Analytics catalog U-SQL view item. 3152type USQLView struct { 3153 autorest.Response `json:"-"` 3154 // DatabaseName - the name of the database. 3155 DatabaseName *string `json:"databaseName,omitempty"` 3156 // SchemaName - the name of the schema associated with this view and database. 3157 SchemaName *string `json:"schemaName,omitempty"` 3158 // Name - the name of the view. 3159 Name *string `json:"viewName,omitempty"` 3160 // Definition - the defined query of the view. 3161 Definition *string `json:"definition,omitempty"` 3162 // ComputeAccountName - the name of the Data Lake Analytics account. 3163 ComputeAccountName *string `json:"computeAccountName,omitempty"` 3164 // Version - the version of the catalog item. 3165 Version *uuid.UUID `json:"version,omitempty"` 3166} 3167 3168// USQLViewList a Data Lake Analytics catalog U-SQL view item list. 3169type USQLViewList struct { 3170 autorest.Response `json:"-"` 3171 // Value - READ-ONLY; the list of view in the database and schema combination 3172 Value *[]USQLView `json:"value,omitempty"` 3173 // NextLink - the link to the next page of results. 3174 NextLink *string `json:"nextLink,omitempty"` 3175} 3176 3177// MarshalJSON is the custom marshaler for USQLViewList. 3178func (usvl USQLViewList) MarshalJSON() ([]byte, error) { 3179 objectMap := make(map[string]interface{}) 3180 if usvl.NextLink != nil { 3181 objectMap["nextLink"] = usvl.NextLink 3182 } 3183 return json.Marshal(objectMap) 3184} 3185 3186// USQLViewListIterator provides access to a complete listing of USQLView values. 3187type USQLViewListIterator struct { 3188 i int 3189 page USQLViewListPage 3190} 3191 3192// NextWithContext advances to the next value. If there was an error making 3193// the request the iterator does not advance and the error is returned. 3194func (iter *USQLViewListIterator) NextWithContext(ctx context.Context) (err error) { 3195 if tracing.IsEnabled() { 3196 ctx = tracing.StartSpan(ctx, fqdn+"/USQLViewListIterator.NextWithContext") 3197 defer func() { 3198 sc := -1 3199 if iter.Response().Response.Response != nil { 3200 sc = iter.Response().Response.Response.StatusCode 3201 } 3202 tracing.EndSpan(ctx, sc, err) 3203 }() 3204 } 3205 iter.i++ 3206 if iter.i < len(iter.page.Values()) { 3207 return nil 3208 } 3209 err = iter.page.NextWithContext(ctx) 3210 if err != nil { 3211 iter.i-- 3212 return err 3213 } 3214 iter.i = 0 3215 return nil 3216} 3217 3218// Next advances to the next value. If there was an error making 3219// the request the iterator does not advance and the error is returned. 3220// Deprecated: Use NextWithContext() instead. 3221func (iter *USQLViewListIterator) Next() error { 3222 return iter.NextWithContext(context.Background()) 3223} 3224 3225// NotDone returns true if the enumeration should be started or is not yet complete. 3226func (iter USQLViewListIterator) NotDone() bool { 3227 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3228} 3229 3230// Response returns the raw server response from the last page request. 3231func (iter USQLViewListIterator) Response() USQLViewList { 3232 return iter.page.Response() 3233} 3234 3235// Value returns the current value or a zero-initialized value if the 3236// iterator has advanced beyond the end of the collection. 3237func (iter USQLViewListIterator) Value() USQLView { 3238 if !iter.page.NotDone() { 3239 return USQLView{} 3240 } 3241 return iter.page.Values()[iter.i] 3242} 3243 3244// Creates a new instance of the USQLViewListIterator type. 3245func NewUSQLViewListIterator(page USQLViewListPage) USQLViewListIterator { 3246 return USQLViewListIterator{page: page} 3247} 3248 3249// IsEmpty returns true if the ListResult contains no values. 3250func (usvl USQLViewList) IsEmpty() bool { 3251 return usvl.Value == nil || len(*usvl.Value) == 0 3252} 3253 3254// hasNextLink returns true if the NextLink is not empty. 3255func (usvl USQLViewList) hasNextLink() bool { 3256 return usvl.NextLink != nil && len(*usvl.NextLink) != 0 3257} 3258 3259// uSQLViewListPreparer prepares a request to retrieve the next set of results. 3260// It returns nil if no more results exist. 3261func (usvl USQLViewList) uSQLViewListPreparer(ctx context.Context) (*http.Request, error) { 3262 if !usvl.hasNextLink() { 3263 return nil, nil 3264 } 3265 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3266 autorest.AsJSON(), 3267 autorest.AsGet(), 3268 autorest.WithBaseURL(to.String(usvl.NextLink))) 3269} 3270 3271// USQLViewListPage contains a page of USQLView values. 3272type USQLViewListPage struct { 3273 fn func(context.Context, USQLViewList) (USQLViewList, error) 3274 uvl USQLViewList 3275} 3276 3277// NextWithContext advances to the next page of values. If there was an error making 3278// the request the page does not advance and the error is returned. 3279func (page *USQLViewListPage) NextWithContext(ctx context.Context) (err error) { 3280 if tracing.IsEnabled() { 3281 ctx = tracing.StartSpan(ctx, fqdn+"/USQLViewListPage.NextWithContext") 3282 defer func() { 3283 sc := -1 3284 if page.Response().Response.Response != nil { 3285 sc = page.Response().Response.Response.StatusCode 3286 } 3287 tracing.EndSpan(ctx, sc, err) 3288 }() 3289 } 3290 for { 3291 next, err := page.fn(ctx, page.uvl) 3292 if err != nil { 3293 return err 3294 } 3295 page.uvl = next 3296 if !next.hasNextLink() || !next.IsEmpty() { 3297 break 3298 } 3299 } 3300 return nil 3301} 3302 3303// Next advances to the next page of values. If there was an error making 3304// the request the page does not advance and the error is returned. 3305// Deprecated: Use NextWithContext() instead. 3306func (page *USQLViewListPage) Next() error { 3307 return page.NextWithContext(context.Background()) 3308} 3309 3310// NotDone returns true if the page enumeration should be started or is not yet complete. 3311func (page USQLViewListPage) NotDone() bool { 3312 return !page.uvl.IsEmpty() 3313} 3314 3315// Response returns the raw server response from the last page request. 3316func (page USQLViewListPage) Response() USQLViewList { 3317 return page.uvl 3318} 3319 3320// Values returns the slice of values for the current page or nil if there are no values. 3321func (page USQLViewListPage) Values() []USQLView { 3322 if page.uvl.IsEmpty() { 3323 return nil 3324 } 3325 return *page.uvl.Value 3326} 3327 3328// Creates a new instance of the USQLViewListPage type. 3329func NewUSQLViewListPage(cur USQLViewList, getNextPage func(context.Context, USQLViewList) (USQLViewList, error)) USQLViewListPage { 3330 return USQLViewListPage{ 3331 fn: getNextPage, 3332 uvl: cur, 3333 } 3334} 3335