...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2015-10-01-preview/catalog/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/datalake/analytics/2015-10-01-preview/catalog

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

View as plain text