...

Source file src/github.com/Azure/azure-sdk-for-go/services/hybriddatamanager/mgmt/2019-06-01/hybriddata/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/hybriddatamanager/mgmt/2019-06-01/hybriddata

     1  package hybriddata
     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/azure"
    14  	"github.com/Azure/go-autorest/autorest/date"
    15  	"github.com/Azure/go-autorest/autorest/to"
    16  	"github.com/Azure/go-autorest/tracing"
    17  	"net/http"
    18  )
    19  
    20  // The package's fully qualified name.
    21  const fqdn = "github.com/Azure/azure-sdk-for-go/services/hybriddatamanager/mgmt/2019-06-01/hybriddata"
    22  
    23  // AvailableProviderOperation class represents provider operation
    24  type AvailableProviderOperation struct {
    25  	// Name - Gets or Sets Name of the operations
    26  	Name *string `json:"name,omitempty"`
    27  	// Display - Gets or sets Display information
    28  	// Contains the localized display information for this particular operation/action
    29  	Display *AvailableProviderOperationDisplay `json:"display,omitempty"`
    30  	// Origin - Gets or sets Origin
    31  	// The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX.
    32  	// Default value is “user,system”
    33  	Origin *string `json:"origin,omitempty"`
    34  	// Properties - Gets or sets Properties
    35  	// Reserved for future use
    36  	Properties interface{} `json:"properties,omitempty"`
    37  }
    38  
    39  // AvailableProviderOperationDisplay contains the localized display information for this particular
    40  // operation / action.
    41  // These value will be used by several clients for
    42  // (1) custom role definitions for RBAC;
    43  // (2) complex query filters for the event service; and (3) audit history / records for management
    44  // operations.
    45  type AvailableProviderOperationDisplay struct {
    46  	// Provider - Gets or sets Provider
    47  	// The localized friendly form of the resource provider name – it is expected to also include the publisher/company responsible.
    48  	// It should use Title Casing and begin with “Microsoft” for 1st party services.
    49  	Provider *string `json:"provider,omitempty"`
    50  	// Resource - Gets or sets Resource
    51  	// The localized friendly form of the resource type related to this action/operation – it should match the public documentation for the resource provider.
    52  	// It should use Title Casing – for examples, please refer to the “name” section.
    53  	Resource *string `json:"resource,omitempty"`
    54  	// Operation - Gets or sets Operation
    55  	// The localized friendly name for the operation, as it should be shown to the user.
    56  	// It should be concise (to fit in drop downs) but clear (i.e. self-documenting). It should use Title Casing and include the entity/resource to which it applies.
    57  	Operation *string `json:"operation,omitempty"`
    58  	// Description - Gets or sets Description
    59  	// The localized friendly description for the operation, as it should be shown to the user.
    60  	// It should be thorough, yet concise – it will be used in tool tips and detailed views.
    61  	Description *string `json:"description,omitempty"`
    62  }
    63  
    64  // AvailableProviderOperations class for set of operations used for discovery of available provider
    65  // operations.
    66  type AvailableProviderOperations struct {
    67  	autorest.Response `json:"-"`
    68  	// Value - List of operations.
    69  	Value *[]AvailableProviderOperation `json:"value,omitempty"`
    70  	// NextLink - Link for the next set of operations.
    71  	NextLink *string `json:"nextLink,omitempty"`
    72  }
    73  
    74  // AvailableProviderOperationsIterator provides access to a complete listing of AvailableProviderOperation
    75  // values.
    76  type AvailableProviderOperationsIterator struct {
    77  	i    int
    78  	page AvailableProviderOperationsPage
    79  }
    80  
    81  // NextWithContext advances to the next value.  If there was an error making
    82  // the request the iterator does not advance and the error is returned.
    83  func (iter *AvailableProviderOperationsIterator) NextWithContext(ctx context.Context) (err error) {
    84  	if tracing.IsEnabled() {
    85  		ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationsIterator.NextWithContext")
    86  		defer func() {
    87  			sc := -1
    88  			if iter.Response().Response.Response != nil {
    89  				sc = iter.Response().Response.Response.StatusCode
    90  			}
    91  			tracing.EndSpan(ctx, sc, err)
    92  		}()
    93  	}
    94  	iter.i++
    95  	if iter.i < len(iter.page.Values()) {
    96  		return nil
    97  	}
    98  	err = iter.page.NextWithContext(ctx)
    99  	if err != nil {
   100  		iter.i--
   101  		return err
   102  	}
   103  	iter.i = 0
   104  	return nil
   105  }
   106  
   107  // Next advances to the next value.  If there was an error making
   108  // the request the iterator does not advance and the error is returned.
   109  // Deprecated: Use NextWithContext() instead.
   110  func (iter *AvailableProviderOperationsIterator) Next() error {
   111  	return iter.NextWithContext(context.Background())
   112  }
   113  
   114  // NotDone returns true if the enumeration should be started or is not yet complete.
   115  func (iter AvailableProviderOperationsIterator) NotDone() bool {
   116  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   117  }
   118  
   119  // Response returns the raw server response from the last page request.
   120  func (iter AvailableProviderOperationsIterator) Response() AvailableProviderOperations {
   121  	return iter.page.Response()
   122  }
   123  
   124  // Value returns the current value or a zero-initialized value if the
   125  // iterator has advanced beyond the end of the collection.
   126  func (iter AvailableProviderOperationsIterator) Value() AvailableProviderOperation {
   127  	if !iter.page.NotDone() {
   128  		return AvailableProviderOperation{}
   129  	}
   130  	return iter.page.Values()[iter.i]
   131  }
   132  
   133  // Creates a new instance of the AvailableProviderOperationsIterator type.
   134  func NewAvailableProviderOperationsIterator(page AvailableProviderOperationsPage) AvailableProviderOperationsIterator {
   135  	return AvailableProviderOperationsIterator{page: page}
   136  }
   137  
   138  // IsEmpty returns true if the ListResult contains no values.
   139  func (apo AvailableProviderOperations) IsEmpty() bool {
   140  	return apo.Value == nil || len(*apo.Value) == 0
   141  }
   142  
   143  // hasNextLink returns true if the NextLink is not empty.
   144  func (apo AvailableProviderOperations) hasNextLink() bool {
   145  	return apo.NextLink != nil && len(*apo.NextLink) != 0
   146  }
   147  
   148  // availableProviderOperationsPreparer prepares a request to retrieve the next set of results.
   149  // It returns nil if no more results exist.
   150  func (apo AvailableProviderOperations) availableProviderOperationsPreparer(ctx context.Context) (*http.Request, error) {
   151  	if !apo.hasNextLink() {
   152  		return nil, nil
   153  	}
   154  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   155  		autorest.AsJSON(),
   156  		autorest.AsGet(),
   157  		autorest.WithBaseURL(to.String(apo.NextLink)))
   158  }
   159  
   160  // AvailableProviderOperationsPage contains a page of AvailableProviderOperation values.
   161  type AvailableProviderOperationsPage struct {
   162  	fn  func(context.Context, AvailableProviderOperations) (AvailableProviderOperations, error)
   163  	apo AvailableProviderOperations
   164  }
   165  
   166  // NextWithContext advances to the next page of values.  If there was an error making
   167  // the request the page does not advance and the error is returned.
   168  func (page *AvailableProviderOperationsPage) NextWithContext(ctx context.Context) (err error) {
   169  	if tracing.IsEnabled() {
   170  		ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationsPage.NextWithContext")
   171  		defer func() {
   172  			sc := -1
   173  			if page.Response().Response.Response != nil {
   174  				sc = page.Response().Response.Response.StatusCode
   175  			}
   176  			tracing.EndSpan(ctx, sc, err)
   177  		}()
   178  	}
   179  	for {
   180  		next, err := page.fn(ctx, page.apo)
   181  		if err != nil {
   182  			return err
   183  		}
   184  		page.apo = next
   185  		if !next.hasNextLink() || !next.IsEmpty() {
   186  			break
   187  		}
   188  	}
   189  	return nil
   190  }
   191  
   192  // Next advances to the next page of values.  If there was an error making
   193  // the request the page does not advance and the error is returned.
   194  // Deprecated: Use NextWithContext() instead.
   195  func (page *AvailableProviderOperationsPage) Next() error {
   196  	return page.NextWithContext(context.Background())
   197  }
   198  
   199  // NotDone returns true if the page enumeration should be started or is not yet complete.
   200  func (page AvailableProviderOperationsPage) NotDone() bool {
   201  	return !page.apo.IsEmpty()
   202  }
   203  
   204  // Response returns the raw server response from the last page request.
   205  func (page AvailableProviderOperationsPage) Response() AvailableProviderOperations {
   206  	return page.apo
   207  }
   208  
   209  // Values returns the slice of values for the current page or nil if there are no values.
   210  func (page AvailableProviderOperationsPage) Values() []AvailableProviderOperation {
   211  	if page.apo.IsEmpty() {
   212  		return nil
   213  	}
   214  	return *page.apo.Value
   215  }
   216  
   217  // Creates a new instance of the AvailableProviderOperationsPage type.
   218  func NewAvailableProviderOperationsPage(cur AvailableProviderOperations, getNextPage func(context.Context, AvailableProviderOperations) (AvailableProviderOperations, error)) AvailableProviderOperationsPage {
   219  	return AvailableProviderOperationsPage{
   220  		fn:  getNextPage,
   221  		apo: cur,
   222  	}
   223  }
   224  
   225  // CustomerSecret the pair of customer secret.
   226  type CustomerSecret struct {
   227  	// KeyIdentifier - The identifier to the data service input object which this secret corresponds to.
   228  	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
   229  	// KeyValue - It contains the encrypted customer secret.
   230  	KeyValue *string `json:"keyValue,omitempty"`
   231  	// Algorithm - The encryption algorithm used to encrypt data. Possible values include: 'SupportedAlgorithmNone', 'SupportedAlgorithmRSA15', 'SupportedAlgorithmRSAOAEP', 'SupportedAlgorithmPlainText'
   232  	Algorithm SupportedAlgorithm `json:"algorithm,omitempty"`
   233  }
   234  
   235  // DataManager the DataManager resource.
   236  type DataManager struct {
   237  	autorest.Response `json:"-"`
   238  	// Etag - Etag of the Resource.
   239  	Etag *string `json:"etag,omitempty"`
   240  	// ID - READ-ONLY; The Resource Id.
   241  	ID *string `json:"id,omitempty"`
   242  	// Name - READ-ONLY; The Resource Name.
   243  	Name *string `json:"name,omitempty"`
   244  	// Type - READ-ONLY; The Resource type.
   245  	Type *string `json:"type,omitempty"`
   246  	// Location - The location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East
   247  	// US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo
   248  	// region is specified on update the request will succeed.
   249  	Location *string `json:"location,omitempty"`
   250  	// Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource
   251  	// (across resource groups).
   252  	Tags map[string]*string `json:"tags"`
   253  	// Sku - The sku type.
   254  	Sku *Sku `json:"sku,omitempty"`
   255  }
   256  
   257  // MarshalJSON is the custom marshaler for DataManager.
   258  func (dm DataManager) MarshalJSON() ([]byte, error) {
   259  	objectMap := make(map[string]interface{})
   260  	if dm.Etag != nil {
   261  		objectMap["etag"] = dm.Etag
   262  	}
   263  	if dm.Location != nil {
   264  		objectMap["location"] = dm.Location
   265  	}
   266  	if dm.Tags != nil {
   267  		objectMap["tags"] = dm.Tags
   268  	}
   269  	if dm.Sku != nil {
   270  		objectMap["sku"] = dm.Sku
   271  	}
   272  	return json.Marshal(objectMap)
   273  }
   274  
   275  // DataManagerList dataManager resources Collection.
   276  type DataManagerList struct {
   277  	autorest.Response `json:"-"`
   278  	// Value - List of data manager resources.
   279  	Value *[]DataManager `json:"value,omitempty"`
   280  	// NextLink - Link for the next set of data stores.
   281  	NextLink *string `json:"nextLink,omitempty"`
   282  }
   283  
   284  // DataManagersCreateFuture an abstraction for monitoring and retrieving the results of a long-running
   285  // operation.
   286  type DataManagersCreateFuture struct {
   287  	azure.FutureAPI
   288  	// Result returns the result of the asynchronous operation.
   289  	// If the operation has not completed it will return an error.
   290  	Result func(DataManagersClient) (DataManager, error)
   291  }
   292  
   293  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   294  func (future *DataManagersCreateFuture) UnmarshalJSON(body []byte) error {
   295  	var azFuture azure.Future
   296  	if err := json.Unmarshal(body, &azFuture); err != nil {
   297  		return err
   298  	}
   299  	future.FutureAPI = &azFuture
   300  	future.Result = future.result
   301  	return nil
   302  }
   303  
   304  // result is the default implementation for DataManagersCreateFuture.Result.
   305  func (future *DataManagersCreateFuture) result(client DataManagersClient) (dm DataManager, err error) {
   306  	var done bool
   307  	done, err = future.DoneWithContext(context.Background(), client)
   308  	if err != nil {
   309  		err = autorest.NewErrorWithError(err, "hybriddata.DataManagersCreateFuture", "Result", future.Response(), "Polling failure")
   310  		return
   311  	}
   312  	if !done {
   313  		dm.Response.Response = future.Response()
   314  		err = azure.NewAsyncOpIncompleteError("hybriddata.DataManagersCreateFuture")
   315  		return
   316  	}
   317  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   318  	if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent {
   319  		dm, err = client.CreateResponder(dm.Response.Response)
   320  		if err != nil {
   321  			err = autorest.NewErrorWithError(err, "hybriddata.DataManagersCreateFuture", "Result", dm.Response.Response, "Failure responding to request")
   322  		}
   323  	}
   324  	return
   325  }
   326  
   327  // DataManagersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
   328  // operation.
   329  type DataManagersDeleteFuture struct {
   330  	azure.FutureAPI
   331  	// Result returns the result of the asynchronous operation.
   332  	// If the operation has not completed it will return an error.
   333  	Result func(DataManagersClient) (autorest.Response, error)
   334  }
   335  
   336  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   337  func (future *DataManagersDeleteFuture) UnmarshalJSON(body []byte) error {
   338  	var azFuture azure.Future
   339  	if err := json.Unmarshal(body, &azFuture); err != nil {
   340  		return err
   341  	}
   342  	future.FutureAPI = &azFuture
   343  	future.Result = future.result
   344  	return nil
   345  }
   346  
   347  // result is the default implementation for DataManagersDeleteFuture.Result.
   348  func (future *DataManagersDeleteFuture) result(client DataManagersClient) (ar autorest.Response, err error) {
   349  	var done bool
   350  	done, err = future.DoneWithContext(context.Background(), client)
   351  	if err != nil {
   352  		err = autorest.NewErrorWithError(err, "hybriddata.DataManagersDeleteFuture", "Result", future.Response(), "Polling failure")
   353  		return
   354  	}
   355  	if !done {
   356  		ar.Response = future.Response()
   357  		err = azure.NewAsyncOpIncompleteError("hybriddata.DataManagersDeleteFuture")
   358  		return
   359  	}
   360  	ar.Response = future.Response()
   361  	return
   362  }
   363  
   364  // DataManagersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
   365  // operation.
   366  type DataManagersUpdateFuture struct {
   367  	azure.FutureAPI
   368  	// Result returns the result of the asynchronous operation.
   369  	// If the operation has not completed it will return an error.
   370  	Result func(DataManagersClient) (DataManager, error)
   371  }
   372  
   373  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   374  func (future *DataManagersUpdateFuture) UnmarshalJSON(body []byte) error {
   375  	var azFuture azure.Future
   376  	if err := json.Unmarshal(body, &azFuture); err != nil {
   377  		return err
   378  	}
   379  	future.FutureAPI = &azFuture
   380  	future.Result = future.result
   381  	return nil
   382  }
   383  
   384  // result is the default implementation for DataManagersUpdateFuture.Result.
   385  func (future *DataManagersUpdateFuture) result(client DataManagersClient) (dm DataManager, err error) {
   386  	var done bool
   387  	done, err = future.DoneWithContext(context.Background(), client)
   388  	if err != nil {
   389  		err = autorest.NewErrorWithError(err, "hybriddata.DataManagersUpdateFuture", "Result", future.Response(), "Polling failure")
   390  		return
   391  	}
   392  	if !done {
   393  		dm.Response.Response = future.Response()
   394  		err = azure.NewAsyncOpIncompleteError("hybriddata.DataManagersUpdateFuture")
   395  		return
   396  	}
   397  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   398  	if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent {
   399  		dm, err = client.UpdateResponder(dm.Response.Response)
   400  		if err != nil {
   401  			err = autorest.NewErrorWithError(err, "hybriddata.DataManagersUpdateFuture", "Result", dm.Response.Response, "Failure responding to request")
   402  		}
   403  	}
   404  	return
   405  }
   406  
   407  // DataManagerUpdateParameter the DataManagerUpdateParameter.
   408  type DataManagerUpdateParameter struct {
   409  	// Sku - The sku type.
   410  	Sku *Sku `json:"sku,omitempty"`
   411  	// Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource
   412  	// (across resource groups).
   413  	Tags map[string]*string `json:"tags"`
   414  }
   415  
   416  // MarshalJSON is the custom marshaler for DataManagerUpdateParameter.
   417  func (dmup DataManagerUpdateParameter) MarshalJSON() ([]byte, error) {
   418  	objectMap := make(map[string]interface{})
   419  	if dmup.Sku != nil {
   420  		objectMap["sku"] = dmup.Sku
   421  	}
   422  	if dmup.Tags != nil {
   423  		objectMap["tags"] = dmup.Tags
   424  	}
   425  	return json.Marshal(objectMap)
   426  }
   427  
   428  // DataService data Service.
   429  type DataService struct {
   430  	autorest.Response `json:"-"`
   431  	// DataServiceProperties - DataService properties.
   432  	*DataServiceProperties `json:"properties,omitempty"`
   433  	// Name - READ-ONLY; Name of the object.
   434  	Name *string `json:"name,omitempty"`
   435  	// ID - READ-ONLY; Id of the object.
   436  	ID *string `json:"id,omitempty"`
   437  	// Type - READ-ONLY; Type of the object.
   438  	Type *string `json:"type,omitempty"`
   439  }
   440  
   441  // MarshalJSON is the custom marshaler for DataService.
   442  func (ds DataService) MarshalJSON() ([]byte, error) {
   443  	objectMap := make(map[string]interface{})
   444  	if ds.DataServiceProperties != nil {
   445  		objectMap["properties"] = ds.DataServiceProperties
   446  	}
   447  	return json.Marshal(objectMap)
   448  }
   449  
   450  // UnmarshalJSON is the custom unmarshaler for DataService struct.
   451  func (ds *DataService) UnmarshalJSON(body []byte) error {
   452  	var m map[string]*json.RawMessage
   453  	err := json.Unmarshal(body, &m)
   454  	if err != nil {
   455  		return err
   456  	}
   457  	for k, v := range m {
   458  		switch k {
   459  		case "properties":
   460  			if v != nil {
   461  				var dataServiceProperties DataServiceProperties
   462  				err = json.Unmarshal(*v, &dataServiceProperties)
   463  				if err != nil {
   464  					return err
   465  				}
   466  				ds.DataServiceProperties = &dataServiceProperties
   467  			}
   468  		case "name":
   469  			if v != nil {
   470  				var name string
   471  				err = json.Unmarshal(*v, &name)
   472  				if err != nil {
   473  					return err
   474  				}
   475  				ds.Name = &name
   476  			}
   477  		case "id":
   478  			if v != nil {
   479  				var ID string
   480  				err = json.Unmarshal(*v, &ID)
   481  				if err != nil {
   482  					return err
   483  				}
   484  				ds.ID = &ID
   485  			}
   486  		case "type":
   487  			if v != nil {
   488  				var typeVar string
   489  				err = json.Unmarshal(*v, &typeVar)
   490  				if err != nil {
   491  					return err
   492  				}
   493  				ds.Type = &typeVar
   494  			}
   495  		}
   496  	}
   497  
   498  	return nil
   499  }
   500  
   501  // DataServiceList data Service Collection.
   502  type DataServiceList struct {
   503  	autorest.Response `json:"-"`
   504  	// Value - List of data services.
   505  	Value *[]DataService `json:"value,omitempty"`
   506  	// NextLink - Link for the next set of data services.
   507  	NextLink *string `json:"nextLink,omitempty"`
   508  }
   509  
   510  // DataServiceListIterator provides access to a complete listing of DataService values.
   511  type DataServiceListIterator struct {
   512  	i    int
   513  	page DataServiceListPage
   514  }
   515  
   516  // NextWithContext advances to the next value.  If there was an error making
   517  // the request the iterator does not advance and the error is returned.
   518  func (iter *DataServiceListIterator) NextWithContext(ctx context.Context) (err error) {
   519  	if tracing.IsEnabled() {
   520  		ctx = tracing.StartSpan(ctx, fqdn+"/DataServiceListIterator.NextWithContext")
   521  		defer func() {
   522  			sc := -1
   523  			if iter.Response().Response.Response != nil {
   524  				sc = iter.Response().Response.Response.StatusCode
   525  			}
   526  			tracing.EndSpan(ctx, sc, err)
   527  		}()
   528  	}
   529  	iter.i++
   530  	if iter.i < len(iter.page.Values()) {
   531  		return nil
   532  	}
   533  	err = iter.page.NextWithContext(ctx)
   534  	if err != nil {
   535  		iter.i--
   536  		return err
   537  	}
   538  	iter.i = 0
   539  	return nil
   540  }
   541  
   542  // Next advances to the next value.  If there was an error making
   543  // the request the iterator does not advance and the error is returned.
   544  // Deprecated: Use NextWithContext() instead.
   545  func (iter *DataServiceListIterator) Next() error {
   546  	return iter.NextWithContext(context.Background())
   547  }
   548  
   549  // NotDone returns true if the enumeration should be started or is not yet complete.
   550  func (iter DataServiceListIterator) NotDone() bool {
   551  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   552  }
   553  
   554  // Response returns the raw server response from the last page request.
   555  func (iter DataServiceListIterator) Response() DataServiceList {
   556  	return iter.page.Response()
   557  }
   558  
   559  // Value returns the current value or a zero-initialized value if the
   560  // iterator has advanced beyond the end of the collection.
   561  func (iter DataServiceListIterator) Value() DataService {
   562  	if !iter.page.NotDone() {
   563  		return DataService{}
   564  	}
   565  	return iter.page.Values()[iter.i]
   566  }
   567  
   568  // Creates a new instance of the DataServiceListIterator type.
   569  func NewDataServiceListIterator(page DataServiceListPage) DataServiceListIterator {
   570  	return DataServiceListIterator{page: page}
   571  }
   572  
   573  // IsEmpty returns true if the ListResult contains no values.
   574  func (dsl DataServiceList) IsEmpty() bool {
   575  	return dsl.Value == nil || len(*dsl.Value) == 0
   576  }
   577  
   578  // hasNextLink returns true if the NextLink is not empty.
   579  func (dsl DataServiceList) hasNextLink() bool {
   580  	return dsl.NextLink != nil && len(*dsl.NextLink) != 0
   581  }
   582  
   583  // dataServiceListPreparer prepares a request to retrieve the next set of results.
   584  // It returns nil if no more results exist.
   585  func (dsl DataServiceList) dataServiceListPreparer(ctx context.Context) (*http.Request, error) {
   586  	if !dsl.hasNextLink() {
   587  		return nil, nil
   588  	}
   589  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   590  		autorest.AsJSON(),
   591  		autorest.AsGet(),
   592  		autorest.WithBaseURL(to.String(dsl.NextLink)))
   593  }
   594  
   595  // DataServiceListPage contains a page of DataService values.
   596  type DataServiceListPage struct {
   597  	fn  func(context.Context, DataServiceList) (DataServiceList, error)
   598  	dsl DataServiceList
   599  }
   600  
   601  // NextWithContext advances to the next page of values.  If there was an error making
   602  // the request the page does not advance and the error is returned.
   603  func (page *DataServiceListPage) NextWithContext(ctx context.Context) (err error) {
   604  	if tracing.IsEnabled() {
   605  		ctx = tracing.StartSpan(ctx, fqdn+"/DataServiceListPage.NextWithContext")
   606  		defer func() {
   607  			sc := -1
   608  			if page.Response().Response.Response != nil {
   609  				sc = page.Response().Response.Response.StatusCode
   610  			}
   611  			tracing.EndSpan(ctx, sc, err)
   612  		}()
   613  	}
   614  	for {
   615  		next, err := page.fn(ctx, page.dsl)
   616  		if err != nil {
   617  			return err
   618  		}
   619  		page.dsl = next
   620  		if !next.hasNextLink() || !next.IsEmpty() {
   621  			break
   622  		}
   623  	}
   624  	return nil
   625  }
   626  
   627  // Next advances to the next page of values.  If there was an error making
   628  // the request the page does not advance and the error is returned.
   629  // Deprecated: Use NextWithContext() instead.
   630  func (page *DataServiceListPage) Next() error {
   631  	return page.NextWithContext(context.Background())
   632  }
   633  
   634  // NotDone returns true if the page enumeration should be started or is not yet complete.
   635  func (page DataServiceListPage) NotDone() bool {
   636  	return !page.dsl.IsEmpty()
   637  }
   638  
   639  // Response returns the raw server response from the last page request.
   640  func (page DataServiceListPage) Response() DataServiceList {
   641  	return page.dsl
   642  }
   643  
   644  // Values returns the slice of values for the current page or nil if there are no values.
   645  func (page DataServiceListPage) Values() []DataService {
   646  	if page.dsl.IsEmpty() {
   647  		return nil
   648  	}
   649  	return *page.dsl.Value
   650  }
   651  
   652  // Creates a new instance of the DataServiceListPage type.
   653  func NewDataServiceListPage(cur DataServiceList, getNextPage func(context.Context, DataServiceList) (DataServiceList, error)) DataServiceListPage {
   654  	return DataServiceListPage{
   655  		fn:  getNextPage,
   656  		dsl: cur,
   657  	}
   658  }
   659  
   660  // DataServiceProperties data Service properties.
   661  type DataServiceProperties struct {
   662  	// State - State of the data service. Possible values include: 'Disabled', 'Enabled', 'Supported'
   663  	State State `json:"state,omitempty"`
   664  	// SupportedDataSinkTypes - Supported data store types which can be used as a sink.
   665  	SupportedDataSinkTypes *[]string `json:"supportedDataSinkTypes,omitempty"`
   666  	// SupportedDataSourceTypes - Supported data store types which can be used as a source.
   667  	SupportedDataSourceTypes *[]string `json:"supportedDataSourceTypes,omitempty"`
   668  }
   669  
   670  // DataStore data store.
   671  type DataStore struct {
   672  	autorest.Response `json:"-"`
   673  	// DataStoreProperties - DataStore properties.
   674  	*DataStoreProperties `json:"properties,omitempty"`
   675  	// Name - READ-ONLY; Name of the object.
   676  	Name *string `json:"name,omitempty"`
   677  	// ID - READ-ONLY; Id of the object.
   678  	ID *string `json:"id,omitempty"`
   679  	// Type - READ-ONLY; Type of the object.
   680  	Type *string `json:"type,omitempty"`
   681  }
   682  
   683  // MarshalJSON is the custom marshaler for DataStore.
   684  func (ds DataStore) MarshalJSON() ([]byte, error) {
   685  	objectMap := make(map[string]interface{})
   686  	if ds.DataStoreProperties != nil {
   687  		objectMap["properties"] = ds.DataStoreProperties
   688  	}
   689  	return json.Marshal(objectMap)
   690  }
   691  
   692  // UnmarshalJSON is the custom unmarshaler for DataStore struct.
   693  func (ds *DataStore) UnmarshalJSON(body []byte) error {
   694  	var m map[string]*json.RawMessage
   695  	err := json.Unmarshal(body, &m)
   696  	if err != nil {
   697  		return err
   698  	}
   699  	for k, v := range m {
   700  		switch k {
   701  		case "properties":
   702  			if v != nil {
   703  				var dataStoreProperties DataStoreProperties
   704  				err = json.Unmarshal(*v, &dataStoreProperties)
   705  				if err != nil {
   706  					return err
   707  				}
   708  				ds.DataStoreProperties = &dataStoreProperties
   709  			}
   710  		case "name":
   711  			if v != nil {
   712  				var name string
   713  				err = json.Unmarshal(*v, &name)
   714  				if err != nil {
   715  					return err
   716  				}
   717  				ds.Name = &name
   718  			}
   719  		case "id":
   720  			if v != nil {
   721  				var ID string
   722  				err = json.Unmarshal(*v, &ID)
   723  				if err != nil {
   724  					return err
   725  				}
   726  				ds.ID = &ID
   727  			}
   728  		case "type":
   729  			if v != nil {
   730  				var typeVar string
   731  				err = json.Unmarshal(*v, &typeVar)
   732  				if err != nil {
   733  					return err
   734  				}
   735  				ds.Type = &typeVar
   736  			}
   737  		}
   738  	}
   739  
   740  	return nil
   741  }
   742  
   743  // DataStoreFilter contains the information about the filters for the DataStore.
   744  type DataStoreFilter struct {
   745  	// DataStoreTypeID - The data store type id.
   746  	DataStoreTypeID *string `json:"dataStoreTypeId,omitempty"`
   747  }
   748  
   749  // DataStoreList data Store Collection.
   750  type DataStoreList struct {
   751  	autorest.Response `json:"-"`
   752  	// Value - List of data stores.
   753  	Value *[]DataStore `json:"value,omitempty"`
   754  	// NextLink - Link for the next set of data stores.
   755  	NextLink *string `json:"nextLink,omitempty"`
   756  }
   757  
   758  // DataStoreListIterator provides access to a complete listing of DataStore values.
   759  type DataStoreListIterator struct {
   760  	i    int
   761  	page DataStoreListPage
   762  }
   763  
   764  // NextWithContext advances to the next value.  If there was an error making
   765  // the request the iterator does not advance and the error is returned.
   766  func (iter *DataStoreListIterator) NextWithContext(ctx context.Context) (err error) {
   767  	if tracing.IsEnabled() {
   768  		ctx = tracing.StartSpan(ctx, fqdn+"/DataStoreListIterator.NextWithContext")
   769  		defer func() {
   770  			sc := -1
   771  			if iter.Response().Response.Response != nil {
   772  				sc = iter.Response().Response.Response.StatusCode
   773  			}
   774  			tracing.EndSpan(ctx, sc, err)
   775  		}()
   776  	}
   777  	iter.i++
   778  	if iter.i < len(iter.page.Values()) {
   779  		return nil
   780  	}
   781  	err = iter.page.NextWithContext(ctx)
   782  	if err != nil {
   783  		iter.i--
   784  		return err
   785  	}
   786  	iter.i = 0
   787  	return nil
   788  }
   789  
   790  // Next advances to the next value.  If there was an error making
   791  // the request the iterator does not advance and the error is returned.
   792  // Deprecated: Use NextWithContext() instead.
   793  func (iter *DataStoreListIterator) Next() error {
   794  	return iter.NextWithContext(context.Background())
   795  }
   796  
   797  // NotDone returns true if the enumeration should be started or is not yet complete.
   798  func (iter DataStoreListIterator) NotDone() bool {
   799  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   800  }
   801  
   802  // Response returns the raw server response from the last page request.
   803  func (iter DataStoreListIterator) Response() DataStoreList {
   804  	return iter.page.Response()
   805  }
   806  
   807  // Value returns the current value or a zero-initialized value if the
   808  // iterator has advanced beyond the end of the collection.
   809  func (iter DataStoreListIterator) Value() DataStore {
   810  	if !iter.page.NotDone() {
   811  		return DataStore{}
   812  	}
   813  	return iter.page.Values()[iter.i]
   814  }
   815  
   816  // Creates a new instance of the DataStoreListIterator type.
   817  func NewDataStoreListIterator(page DataStoreListPage) DataStoreListIterator {
   818  	return DataStoreListIterator{page: page}
   819  }
   820  
   821  // IsEmpty returns true if the ListResult contains no values.
   822  func (dsl DataStoreList) IsEmpty() bool {
   823  	return dsl.Value == nil || len(*dsl.Value) == 0
   824  }
   825  
   826  // hasNextLink returns true if the NextLink is not empty.
   827  func (dsl DataStoreList) hasNextLink() bool {
   828  	return dsl.NextLink != nil && len(*dsl.NextLink) != 0
   829  }
   830  
   831  // dataStoreListPreparer prepares a request to retrieve the next set of results.
   832  // It returns nil if no more results exist.
   833  func (dsl DataStoreList) dataStoreListPreparer(ctx context.Context) (*http.Request, error) {
   834  	if !dsl.hasNextLink() {
   835  		return nil, nil
   836  	}
   837  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   838  		autorest.AsJSON(),
   839  		autorest.AsGet(),
   840  		autorest.WithBaseURL(to.String(dsl.NextLink)))
   841  }
   842  
   843  // DataStoreListPage contains a page of DataStore values.
   844  type DataStoreListPage struct {
   845  	fn  func(context.Context, DataStoreList) (DataStoreList, error)
   846  	dsl DataStoreList
   847  }
   848  
   849  // NextWithContext advances to the next page of values.  If there was an error making
   850  // the request the page does not advance and the error is returned.
   851  func (page *DataStoreListPage) NextWithContext(ctx context.Context) (err error) {
   852  	if tracing.IsEnabled() {
   853  		ctx = tracing.StartSpan(ctx, fqdn+"/DataStoreListPage.NextWithContext")
   854  		defer func() {
   855  			sc := -1
   856  			if page.Response().Response.Response != nil {
   857  				sc = page.Response().Response.Response.StatusCode
   858  			}
   859  			tracing.EndSpan(ctx, sc, err)
   860  		}()
   861  	}
   862  	for {
   863  		next, err := page.fn(ctx, page.dsl)
   864  		if err != nil {
   865  			return err
   866  		}
   867  		page.dsl = next
   868  		if !next.hasNextLink() || !next.IsEmpty() {
   869  			break
   870  		}
   871  	}
   872  	return nil
   873  }
   874  
   875  // Next advances to the next page of values.  If there was an error making
   876  // the request the page does not advance and the error is returned.
   877  // Deprecated: Use NextWithContext() instead.
   878  func (page *DataStoreListPage) Next() error {
   879  	return page.NextWithContext(context.Background())
   880  }
   881  
   882  // NotDone returns true if the page enumeration should be started or is not yet complete.
   883  func (page DataStoreListPage) NotDone() bool {
   884  	return !page.dsl.IsEmpty()
   885  }
   886  
   887  // Response returns the raw server response from the last page request.
   888  func (page DataStoreListPage) Response() DataStoreList {
   889  	return page.dsl
   890  }
   891  
   892  // Values returns the slice of values for the current page or nil if there are no values.
   893  func (page DataStoreListPage) Values() []DataStore {
   894  	if page.dsl.IsEmpty() {
   895  		return nil
   896  	}
   897  	return *page.dsl.Value
   898  }
   899  
   900  // Creates a new instance of the DataStoreListPage type.
   901  func NewDataStoreListPage(cur DataStoreList, getNextPage func(context.Context, DataStoreList) (DataStoreList, error)) DataStoreListPage {
   902  	return DataStoreListPage{
   903  		fn:  getNextPage,
   904  		dsl: cur,
   905  	}
   906  }
   907  
   908  // DataStoreProperties data Store for sources and sinks
   909  type DataStoreProperties struct {
   910  	// RepositoryID - Arm Id for the manager resource to which the data source is associated. This is optional.
   911  	RepositoryID *string `json:"repositoryId,omitempty"`
   912  	// State - State of the data source. Possible values include: 'Disabled', 'Enabled', 'Supported'
   913  	State State `json:"state,omitempty"`
   914  	// ExtendedProperties - A generic json used differently by each data source type.
   915  	ExtendedProperties interface{} `json:"extendedProperties,omitempty"`
   916  	// DataStoreTypeID - The arm id of the data store type.
   917  	DataStoreTypeID *string `json:"dataStoreTypeId,omitempty"`
   918  	// CustomerSecrets - List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys.
   919  	CustomerSecrets *[]CustomerSecret `json:"customerSecrets,omitempty"`
   920  }
   921  
   922  // DataStoresCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
   923  // long-running operation.
   924  type DataStoresCreateOrUpdateFuture struct {
   925  	azure.FutureAPI
   926  	// Result returns the result of the asynchronous operation.
   927  	// If the operation has not completed it will return an error.
   928  	Result func(DataStoresClient) (DataStore, error)
   929  }
   930  
   931  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   932  func (future *DataStoresCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
   933  	var azFuture azure.Future
   934  	if err := json.Unmarshal(body, &azFuture); err != nil {
   935  		return err
   936  	}
   937  	future.FutureAPI = &azFuture
   938  	future.Result = future.result
   939  	return nil
   940  }
   941  
   942  // result is the default implementation for DataStoresCreateOrUpdateFuture.Result.
   943  func (future *DataStoresCreateOrUpdateFuture) result(client DataStoresClient) (ds DataStore, err error) {
   944  	var done bool
   945  	done, err = future.DoneWithContext(context.Background(), client)
   946  	if err != nil {
   947  		err = autorest.NewErrorWithError(err, "hybriddata.DataStoresCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
   948  		return
   949  	}
   950  	if !done {
   951  		ds.Response.Response = future.Response()
   952  		err = azure.NewAsyncOpIncompleteError("hybriddata.DataStoresCreateOrUpdateFuture")
   953  		return
   954  	}
   955  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   956  	if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent {
   957  		ds, err = client.CreateOrUpdateResponder(ds.Response.Response)
   958  		if err != nil {
   959  			err = autorest.NewErrorWithError(err, "hybriddata.DataStoresCreateOrUpdateFuture", "Result", ds.Response.Response, "Failure responding to request")
   960  		}
   961  	}
   962  	return
   963  }
   964  
   965  // DataStoresDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
   966  // operation.
   967  type DataStoresDeleteFuture struct {
   968  	azure.FutureAPI
   969  	// Result returns the result of the asynchronous operation.
   970  	// If the operation has not completed it will return an error.
   971  	Result func(DataStoresClient) (autorest.Response, error)
   972  }
   973  
   974  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   975  func (future *DataStoresDeleteFuture) UnmarshalJSON(body []byte) error {
   976  	var azFuture azure.Future
   977  	if err := json.Unmarshal(body, &azFuture); err != nil {
   978  		return err
   979  	}
   980  	future.FutureAPI = &azFuture
   981  	future.Result = future.result
   982  	return nil
   983  }
   984  
   985  // result is the default implementation for DataStoresDeleteFuture.Result.
   986  func (future *DataStoresDeleteFuture) result(client DataStoresClient) (ar autorest.Response, err error) {
   987  	var done bool
   988  	done, err = future.DoneWithContext(context.Background(), client)
   989  	if err != nil {
   990  		err = autorest.NewErrorWithError(err, "hybriddata.DataStoresDeleteFuture", "Result", future.Response(), "Polling failure")
   991  		return
   992  	}
   993  	if !done {
   994  		ar.Response = future.Response()
   995  		err = azure.NewAsyncOpIncompleteError("hybriddata.DataStoresDeleteFuture")
   996  		return
   997  	}
   998  	ar.Response = future.Response()
   999  	return
  1000  }
  1001  
  1002  // DataStoreType data Store Type.
  1003  type DataStoreType struct {
  1004  	autorest.Response `json:"-"`
  1005  	// DataStoreTypeProperties - DataStoreType properties.
  1006  	*DataStoreTypeProperties `json:"properties,omitempty"`
  1007  	// Name - READ-ONLY; Name of the object.
  1008  	Name *string `json:"name,omitempty"`
  1009  	// ID - READ-ONLY; Id of the object.
  1010  	ID *string `json:"id,omitempty"`
  1011  	// Type - READ-ONLY; Type of the object.
  1012  	Type *string `json:"type,omitempty"`
  1013  }
  1014  
  1015  // MarshalJSON is the custom marshaler for DataStoreType.
  1016  func (dst DataStoreType) MarshalJSON() ([]byte, error) {
  1017  	objectMap := make(map[string]interface{})
  1018  	if dst.DataStoreTypeProperties != nil {
  1019  		objectMap["properties"] = dst.DataStoreTypeProperties
  1020  	}
  1021  	return json.Marshal(objectMap)
  1022  }
  1023  
  1024  // UnmarshalJSON is the custom unmarshaler for DataStoreType struct.
  1025  func (dst *DataStoreType) UnmarshalJSON(body []byte) error {
  1026  	var m map[string]*json.RawMessage
  1027  	err := json.Unmarshal(body, &m)
  1028  	if err != nil {
  1029  		return err
  1030  	}
  1031  	for k, v := range m {
  1032  		switch k {
  1033  		case "properties":
  1034  			if v != nil {
  1035  				var dataStoreTypeProperties DataStoreTypeProperties
  1036  				err = json.Unmarshal(*v, &dataStoreTypeProperties)
  1037  				if err != nil {
  1038  					return err
  1039  				}
  1040  				dst.DataStoreTypeProperties = &dataStoreTypeProperties
  1041  			}
  1042  		case "name":
  1043  			if v != nil {
  1044  				var name string
  1045  				err = json.Unmarshal(*v, &name)
  1046  				if err != nil {
  1047  					return err
  1048  				}
  1049  				dst.Name = &name
  1050  			}
  1051  		case "id":
  1052  			if v != nil {
  1053  				var ID string
  1054  				err = json.Unmarshal(*v, &ID)
  1055  				if err != nil {
  1056  					return err
  1057  				}
  1058  				dst.ID = &ID
  1059  			}
  1060  		case "type":
  1061  			if v != nil {
  1062  				var typeVar string
  1063  				err = json.Unmarshal(*v, &typeVar)
  1064  				if err != nil {
  1065  					return err
  1066  				}
  1067  				dst.Type = &typeVar
  1068  			}
  1069  		}
  1070  	}
  1071  
  1072  	return nil
  1073  }
  1074  
  1075  // DataStoreTypeList data Store Type Collection.
  1076  type DataStoreTypeList struct {
  1077  	autorest.Response `json:"-"`
  1078  	// Value - List of DataStoreType.
  1079  	Value *[]DataStoreType `json:"value,omitempty"`
  1080  	// NextLink - Link for the next set of data store types.
  1081  	NextLink *string `json:"nextLink,omitempty"`
  1082  }
  1083  
  1084  // DataStoreTypeListIterator provides access to a complete listing of DataStoreType values.
  1085  type DataStoreTypeListIterator struct {
  1086  	i    int
  1087  	page DataStoreTypeListPage
  1088  }
  1089  
  1090  // NextWithContext advances to the next value.  If there was an error making
  1091  // the request the iterator does not advance and the error is returned.
  1092  func (iter *DataStoreTypeListIterator) NextWithContext(ctx context.Context) (err error) {
  1093  	if tracing.IsEnabled() {
  1094  		ctx = tracing.StartSpan(ctx, fqdn+"/DataStoreTypeListIterator.NextWithContext")
  1095  		defer func() {
  1096  			sc := -1
  1097  			if iter.Response().Response.Response != nil {
  1098  				sc = iter.Response().Response.Response.StatusCode
  1099  			}
  1100  			tracing.EndSpan(ctx, sc, err)
  1101  		}()
  1102  	}
  1103  	iter.i++
  1104  	if iter.i < len(iter.page.Values()) {
  1105  		return nil
  1106  	}
  1107  	err = iter.page.NextWithContext(ctx)
  1108  	if err != nil {
  1109  		iter.i--
  1110  		return err
  1111  	}
  1112  	iter.i = 0
  1113  	return nil
  1114  }
  1115  
  1116  // Next advances to the next value.  If there was an error making
  1117  // the request the iterator does not advance and the error is returned.
  1118  // Deprecated: Use NextWithContext() instead.
  1119  func (iter *DataStoreTypeListIterator) Next() error {
  1120  	return iter.NextWithContext(context.Background())
  1121  }
  1122  
  1123  // NotDone returns true if the enumeration should be started or is not yet complete.
  1124  func (iter DataStoreTypeListIterator) NotDone() bool {
  1125  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1126  }
  1127  
  1128  // Response returns the raw server response from the last page request.
  1129  func (iter DataStoreTypeListIterator) Response() DataStoreTypeList {
  1130  	return iter.page.Response()
  1131  }
  1132  
  1133  // Value returns the current value or a zero-initialized value if the
  1134  // iterator has advanced beyond the end of the collection.
  1135  func (iter DataStoreTypeListIterator) Value() DataStoreType {
  1136  	if !iter.page.NotDone() {
  1137  		return DataStoreType{}
  1138  	}
  1139  	return iter.page.Values()[iter.i]
  1140  }
  1141  
  1142  // Creates a new instance of the DataStoreTypeListIterator type.
  1143  func NewDataStoreTypeListIterator(page DataStoreTypeListPage) DataStoreTypeListIterator {
  1144  	return DataStoreTypeListIterator{page: page}
  1145  }
  1146  
  1147  // IsEmpty returns true if the ListResult contains no values.
  1148  func (dstl DataStoreTypeList) IsEmpty() bool {
  1149  	return dstl.Value == nil || len(*dstl.Value) == 0
  1150  }
  1151  
  1152  // hasNextLink returns true if the NextLink is not empty.
  1153  func (dstl DataStoreTypeList) hasNextLink() bool {
  1154  	return dstl.NextLink != nil && len(*dstl.NextLink) != 0
  1155  }
  1156  
  1157  // dataStoreTypeListPreparer prepares a request to retrieve the next set of results.
  1158  // It returns nil if no more results exist.
  1159  func (dstl DataStoreTypeList) dataStoreTypeListPreparer(ctx context.Context) (*http.Request, error) {
  1160  	if !dstl.hasNextLink() {
  1161  		return nil, nil
  1162  	}
  1163  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1164  		autorest.AsJSON(),
  1165  		autorest.AsGet(),
  1166  		autorest.WithBaseURL(to.String(dstl.NextLink)))
  1167  }
  1168  
  1169  // DataStoreTypeListPage contains a page of DataStoreType values.
  1170  type DataStoreTypeListPage struct {
  1171  	fn   func(context.Context, DataStoreTypeList) (DataStoreTypeList, error)
  1172  	dstl DataStoreTypeList
  1173  }
  1174  
  1175  // NextWithContext advances to the next page of values.  If there was an error making
  1176  // the request the page does not advance and the error is returned.
  1177  func (page *DataStoreTypeListPage) NextWithContext(ctx context.Context) (err error) {
  1178  	if tracing.IsEnabled() {
  1179  		ctx = tracing.StartSpan(ctx, fqdn+"/DataStoreTypeListPage.NextWithContext")
  1180  		defer func() {
  1181  			sc := -1
  1182  			if page.Response().Response.Response != nil {
  1183  				sc = page.Response().Response.Response.StatusCode
  1184  			}
  1185  			tracing.EndSpan(ctx, sc, err)
  1186  		}()
  1187  	}
  1188  	for {
  1189  		next, err := page.fn(ctx, page.dstl)
  1190  		if err != nil {
  1191  			return err
  1192  		}
  1193  		page.dstl = next
  1194  		if !next.hasNextLink() || !next.IsEmpty() {
  1195  			break
  1196  		}
  1197  	}
  1198  	return nil
  1199  }
  1200  
  1201  // Next advances to the next page of values.  If there was an error making
  1202  // the request the page does not advance and the error is returned.
  1203  // Deprecated: Use NextWithContext() instead.
  1204  func (page *DataStoreTypeListPage) Next() error {
  1205  	return page.NextWithContext(context.Background())
  1206  }
  1207  
  1208  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1209  func (page DataStoreTypeListPage) NotDone() bool {
  1210  	return !page.dstl.IsEmpty()
  1211  }
  1212  
  1213  // Response returns the raw server response from the last page request.
  1214  func (page DataStoreTypeListPage) Response() DataStoreTypeList {
  1215  	return page.dstl
  1216  }
  1217  
  1218  // Values returns the slice of values for the current page or nil if there are no values.
  1219  func (page DataStoreTypeListPage) Values() []DataStoreType {
  1220  	if page.dstl.IsEmpty() {
  1221  		return nil
  1222  	}
  1223  	return *page.dstl.Value
  1224  }
  1225  
  1226  // Creates a new instance of the DataStoreTypeListPage type.
  1227  func NewDataStoreTypeListPage(cur DataStoreTypeList, getNextPage func(context.Context, DataStoreTypeList) (DataStoreTypeList, error)) DataStoreTypeListPage {
  1228  	return DataStoreTypeListPage{
  1229  		fn:   getNextPage,
  1230  		dstl: cur,
  1231  	}
  1232  }
  1233  
  1234  // DataStoreTypeProperties data Store Type properties.
  1235  type DataStoreTypeProperties struct {
  1236  	// RepositoryType - Arm type for the manager resource to which the data source type is associated. This is optional.
  1237  	RepositoryType *string `json:"repositoryType,omitempty"`
  1238  	// State - State of the data store type. Possible values include: 'Disabled', 'Enabled', 'Supported'
  1239  	State State `json:"state,omitempty"`
  1240  	// SupportedDataServicesAsSink - Supported data services where it can be used as a sink.
  1241  	SupportedDataServicesAsSink *[]string `json:"supportedDataServicesAsSink,omitempty"`
  1242  	// SupportedDataServicesAsSource - Supported data services where it can be used as a source.
  1243  	SupportedDataServicesAsSource *[]string `json:"supportedDataServicesAsSource,omitempty"`
  1244  }
  1245  
  1246  // DmsBaseObject base class for all objects under DataManager Service
  1247  type DmsBaseObject struct {
  1248  	// Name - READ-ONLY; Name of the object.
  1249  	Name *string `json:"name,omitempty"`
  1250  	// ID - READ-ONLY; Id of the object.
  1251  	ID *string `json:"id,omitempty"`
  1252  	// Type - READ-ONLY; Type of the object.
  1253  	Type *string `json:"type,omitempty"`
  1254  }
  1255  
  1256  // MarshalJSON is the custom marshaler for DmsBaseObject.
  1257  func (dbo DmsBaseObject) MarshalJSON() ([]byte, error) {
  1258  	objectMap := make(map[string]interface{})
  1259  	return json.Marshal(objectMap)
  1260  }
  1261  
  1262  // Error top level error for the job.
  1263  type Error struct {
  1264  	// Code - Error code that can be used to programmatically identify the error.
  1265  	Code *string `json:"code,omitempty"`
  1266  	// Message - Describes the error in detail and provides debugging information.
  1267  	Message *string `json:"message,omitempty"`
  1268  }
  1269  
  1270  // ErrorDetails error Details
  1271  type ErrorDetails struct {
  1272  	// ErrorMessage - Error message.
  1273  	ErrorMessage *string `json:"errorMessage,omitempty"`
  1274  	// ErrorCode - Error code.
  1275  	ErrorCode *int32 `json:"errorCode,omitempty"`
  1276  	// RecommendedAction - Recommended action for the error.
  1277  	RecommendedAction *string `json:"recommendedAction,omitempty"`
  1278  	// ExceptionMessage - Contains the non localized exception message
  1279  	ExceptionMessage *string `json:"exceptionMessage,omitempty"`
  1280  }
  1281  
  1282  // Job data service job.
  1283  type Job struct {
  1284  	autorest.Response `json:"-"`
  1285  	// Status - Status of the job. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling', 'PartiallySucceeded'
  1286  	Status JobStatus `json:"status,omitempty"`
  1287  	// StartTime - Time at which the job was started in UTC ISO 8601 format.
  1288  	StartTime *date.Time `json:"startTime,omitempty"`
  1289  	// EndTime - Time at which the job ended in UTC ISO 8601 format.
  1290  	EndTime *date.Time `json:"endTime,omitempty"`
  1291  	// JobProperties - Job properties.
  1292  	*JobProperties `json:"properties,omitempty"`
  1293  	// Error - Top level error for the job.
  1294  	Error *Error `json:"error,omitempty"`
  1295  	// Name - READ-ONLY; Name of the object.
  1296  	Name *string `json:"name,omitempty"`
  1297  	// ID - READ-ONLY; Id of the object.
  1298  	ID *string `json:"id,omitempty"`
  1299  	// Type - READ-ONLY; Type of the object.
  1300  	Type *string `json:"type,omitempty"`
  1301  }
  1302  
  1303  // MarshalJSON is the custom marshaler for Job.
  1304  func (j Job) MarshalJSON() ([]byte, error) {
  1305  	objectMap := make(map[string]interface{})
  1306  	if j.Status != "" {
  1307  		objectMap["status"] = j.Status
  1308  	}
  1309  	if j.StartTime != nil {
  1310  		objectMap["startTime"] = j.StartTime
  1311  	}
  1312  	if j.EndTime != nil {
  1313  		objectMap["endTime"] = j.EndTime
  1314  	}
  1315  	if j.JobProperties != nil {
  1316  		objectMap["properties"] = j.JobProperties
  1317  	}
  1318  	if j.Error != nil {
  1319  		objectMap["error"] = j.Error
  1320  	}
  1321  	return json.Marshal(objectMap)
  1322  }
  1323  
  1324  // UnmarshalJSON is the custom unmarshaler for Job struct.
  1325  func (j *Job) UnmarshalJSON(body []byte) error {
  1326  	var m map[string]*json.RawMessage
  1327  	err := json.Unmarshal(body, &m)
  1328  	if err != nil {
  1329  		return err
  1330  	}
  1331  	for k, v := range m {
  1332  		switch k {
  1333  		case "status":
  1334  			if v != nil {
  1335  				var status JobStatus
  1336  				err = json.Unmarshal(*v, &status)
  1337  				if err != nil {
  1338  					return err
  1339  				}
  1340  				j.Status = status
  1341  			}
  1342  		case "startTime":
  1343  			if v != nil {
  1344  				var startTime date.Time
  1345  				err = json.Unmarshal(*v, &startTime)
  1346  				if err != nil {
  1347  					return err
  1348  				}
  1349  				j.StartTime = &startTime
  1350  			}
  1351  		case "endTime":
  1352  			if v != nil {
  1353  				var endTime date.Time
  1354  				err = json.Unmarshal(*v, &endTime)
  1355  				if err != nil {
  1356  					return err
  1357  				}
  1358  				j.EndTime = &endTime
  1359  			}
  1360  		case "properties":
  1361  			if v != nil {
  1362  				var jobProperties JobProperties
  1363  				err = json.Unmarshal(*v, &jobProperties)
  1364  				if err != nil {
  1365  					return err
  1366  				}
  1367  				j.JobProperties = &jobProperties
  1368  			}
  1369  		case "error":
  1370  			if v != nil {
  1371  				var errorVar Error
  1372  				err = json.Unmarshal(*v, &errorVar)
  1373  				if err != nil {
  1374  					return err
  1375  				}
  1376  				j.Error = &errorVar
  1377  			}
  1378  		case "name":
  1379  			if v != nil {
  1380  				var name string
  1381  				err = json.Unmarshal(*v, &name)
  1382  				if err != nil {
  1383  					return err
  1384  				}
  1385  				j.Name = &name
  1386  			}
  1387  		case "id":
  1388  			if v != nil {
  1389  				var ID string
  1390  				err = json.Unmarshal(*v, &ID)
  1391  				if err != nil {
  1392  					return err
  1393  				}
  1394  				j.ID = &ID
  1395  			}
  1396  		case "type":
  1397  			if v != nil {
  1398  				var typeVar string
  1399  				err = json.Unmarshal(*v, &typeVar)
  1400  				if err != nil {
  1401  					return err
  1402  				}
  1403  				j.Type = &typeVar
  1404  			}
  1405  		}
  1406  	}
  1407  
  1408  	return nil
  1409  }
  1410  
  1411  // JobDefinition job Definition.
  1412  type JobDefinition struct {
  1413  	autorest.Response `json:"-"`
  1414  	// JobDefinitionProperties - JobDefinition properties.
  1415  	*JobDefinitionProperties `json:"properties,omitempty"`
  1416  	// Name - READ-ONLY; Name of the object.
  1417  	Name *string `json:"name,omitempty"`
  1418  	// ID - READ-ONLY; Id of the object.
  1419  	ID *string `json:"id,omitempty"`
  1420  	// Type - READ-ONLY; Type of the object.
  1421  	Type *string `json:"type,omitempty"`
  1422  }
  1423  
  1424  // MarshalJSON is the custom marshaler for JobDefinition.
  1425  func (jd JobDefinition) MarshalJSON() ([]byte, error) {
  1426  	objectMap := make(map[string]interface{})
  1427  	if jd.JobDefinitionProperties != nil {
  1428  		objectMap["properties"] = jd.JobDefinitionProperties
  1429  	}
  1430  	return json.Marshal(objectMap)
  1431  }
  1432  
  1433  // UnmarshalJSON is the custom unmarshaler for JobDefinition struct.
  1434  func (jd *JobDefinition) UnmarshalJSON(body []byte) error {
  1435  	var m map[string]*json.RawMessage
  1436  	err := json.Unmarshal(body, &m)
  1437  	if err != nil {
  1438  		return err
  1439  	}
  1440  	for k, v := range m {
  1441  		switch k {
  1442  		case "properties":
  1443  			if v != nil {
  1444  				var jobDefinitionProperties JobDefinitionProperties
  1445  				err = json.Unmarshal(*v, &jobDefinitionProperties)
  1446  				if err != nil {
  1447  					return err
  1448  				}
  1449  				jd.JobDefinitionProperties = &jobDefinitionProperties
  1450  			}
  1451  		case "name":
  1452  			if v != nil {
  1453  				var name string
  1454  				err = json.Unmarshal(*v, &name)
  1455  				if err != nil {
  1456  					return err
  1457  				}
  1458  				jd.Name = &name
  1459  			}
  1460  		case "id":
  1461  			if v != nil {
  1462  				var ID string
  1463  				err = json.Unmarshal(*v, &ID)
  1464  				if err != nil {
  1465  					return err
  1466  				}
  1467  				jd.ID = &ID
  1468  			}
  1469  		case "type":
  1470  			if v != nil {
  1471  				var typeVar string
  1472  				err = json.Unmarshal(*v, &typeVar)
  1473  				if err != nil {
  1474  					return err
  1475  				}
  1476  				jd.Type = &typeVar
  1477  			}
  1478  		}
  1479  	}
  1480  
  1481  	return nil
  1482  }
  1483  
  1484  // JobDefinitionFilter contains the supported job definition filters.
  1485  type JobDefinitionFilter struct {
  1486  	// State - The state of the job definition. Possible values include: 'Disabled', 'Enabled', 'Supported'
  1487  	State State `json:"state,omitempty"`
  1488  	// DataSource - The data source associated with the job definition
  1489  	DataSource *string `json:"dataSource,omitempty"`
  1490  	// LastModified - The last modified date time of the data source.
  1491  	LastModified *date.Time `json:"lastModified,omitempty"`
  1492  }
  1493  
  1494  // JobDefinitionList job Definition Collection.
  1495  type JobDefinitionList struct {
  1496  	autorest.Response `json:"-"`
  1497  	// Value - List of job definitions.
  1498  	Value *[]JobDefinition `json:"value,omitempty"`
  1499  	// NextLink - Link for the next set of job definitions.
  1500  	NextLink *string `json:"nextLink,omitempty"`
  1501  }
  1502  
  1503  // JobDefinitionListIterator provides access to a complete listing of JobDefinition values.
  1504  type JobDefinitionListIterator struct {
  1505  	i    int
  1506  	page JobDefinitionListPage
  1507  }
  1508  
  1509  // NextWithContext advances to the next value.  If there was an error making
  1510  // the request the iterator does not advance and the error is returned.
  1511  func (iter *JobDefinitionListIterator) NextWithContext(ctx context.Context) (err error) {
  1512  	if tracing.IsEnabled() {
  1513  		ctx = tracing.StartSpan(ctx, fqdn+"/JobDefinitionListIterator.NextWithContext")
  1514  		defer func() {
  1515  			sc := -1
  1516  			if iter.Response().Response.Response != nil {
  1517  				sc = iter.Response().Response.Response.StatusCode
  1518  			}
  1519  			tracing.EndSpan(ctx, sc, err)
  1520  		}()
  1521  	}
  1522  	iter.i++
  1523  	if iter.i < len(iter.page.Values()) {
  1524  		return nil
  1525  	}
  1526  	err = iter.page.NextWithContext(ctx)
  1527  	if err != nil {
  1528  		iter.i--
  1529  		return err
  1530  	}
  1531  	iter.i = 0
  1532  	return nil
  1533  }
  1534  
  1535  // Next advances to the next value.  If there was an error making
  1536  // the request the iterator does not advance and the error is returned.
  1537  // Deprecated: Use NextWithContext() instead.
  1538  func (iter *JobDefinitionListIterator) Next() error {
  1539  	return iter.NextWithContext(context.Background())
  1540  }
  1541  
  1542  // NotDone returns true if the enumeration should be started or is not yet complete.
  1543  func (iter JobDefinitionListIterator) NotDone() bool {
  1544  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1545  }
  1546  
  1547  // Response returns the raw server response from the last page request.
  1548  func (iter JobDefinitionListIterator) Response() JobDefinitionList {
  1549  	return iter.page.Response()
  1550  }
  1551  
  1552  // Value returns the current value or a zero-initialized value if the
  1553  // iterator has advanced beyond the end of the collection.
  1554  func (iter JobDefinitionListIterator) Value() JobDefinition {
  1555  	if !iter.page.NotDone() {
  1556  		return JobDefinition{}
  1557  	}
  1558  	return iter.page.Values()[iter.i]
  1559  }
  1560  
  1561  // Creates a new instance of the JobDefinitionListIterator type.
  1562  func NewJobDefinitionListIterator(page JobDefinitionListPage) JobDefinitionListIterator {
  1563  	return JobDefinitionListIterator{page: page}
  1564  }
  1565  
  1566  // IsEmpty returns true if the ListResult contains no values.
  1567  func (jdl JobDefinitionList) IsEmpty() bool {
  1568  	return jdl.Value == nil || len(*jdl.Value) == 0
  1569  }
  1570  
  1571  // hasNextLink returns true if the NextLink is not empty.
  1572  func (jdl JobDefinitionList) hasNextLink() bool {
  1573  	return jdl.NextLink != nil && len(*jdl.NextLink) != 0
  1574  }
  1575  
  1576  // jobDefinitionListPreparer prepares a request to retrieve the next set of results.
  1577  // It returns nil if no more results exist.
  1578  func (jdl JobDefinitionList) jobDefinitionListPreparer(ctx context.Context) (*http.Request, error) {
  1579  	if !jdl.hasNextLink() {
  1580  		return nil, nil
  1581  	}
  1582  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1583  		autorest.AsJSON(),
  1584  		autorest.AsGet(),
  1585  		autorest.WithBaseURL(to.String(jdl.NextLink)))
  1586  }
  1587  
  1588  // JobDefinitionListPage contains a page of JobDefinition values.
  1589  type JobDefinitionListPage struct {
  1590  	fn  func(context.Context, JobDefinitionList) (JobDefinitionList, error)
  1591  	jdl JobDefinitionList
  1592  }
  1593  
  1594  // NextWithContext advances to the next page of values.  If there was an error making
  1595  // the request the page does not advance and the error is returned.
  1596  func (page *JobDefinitionListPage) NextWithContext(ctx context.Context) (err error) {
  1597  	if tracing.IsEnabled() {
  1598  		ctx = tracing.StartSpan(ctx, fqdn+"/JobDefinitionListPage.NextWithContext")
  1599  		defer func() {
  1600  			sc := -1
  1601  			if page.Response().Response.Response != nil {
  1602  				sc = page.Response().Response.Response.StatusCode
  1603  			}
  1604  			tracing.EndSpan(ctx, sc, err)
  1605  		}()
  1606  	}
  1607  	for {
  1608  		next, err := page.fn(ctx, page.jdl)
  1609  		if err != nil {
  1610  			return err
  1611  		}
  1612  		page.jdl = next
  1613  		if !next.hasNextLink() || !next.IsEmpty() {
  1614  			break
  1615  		}
  1616  	}
  1617  	return nil
  1618  }
  1619  
  1620  // Next advances to the next page of values.  If there was an error making
  1621  // the request the page does not advance and the error is returned.
  1622  // Deprecated: Use NextWithContext() instead.
  1623  func (page *JobDefinitionListPage) Next() error {
  1624  	return page.NextWithContext(context.Background())
  1625  }
  1626  
  1627  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1628  func (page JobDefinitionListPage) NotDone() bool {
  1629  	return !page.jdl.IsEmpty()
  1630  }
  1631  
  1632  // Response returns the raw server response from the last page request.
  1633  func (page JobDefinitionListPage) Response() JobDefinitionList {
  1634  	return page.jdl
  1635  }
  1636  
  1637  // Values returns the slice of values for the current page or nil if there are no values.
  1638  func (page JobDefinitionListPage) Values() []JobDefinition {
  1639  	if page.jdl.IsEmpty() {
  1640  		return nil
  1641  	}
  1642  	return *page.jdl.Value
  1643  }
  1644  
  1645  // Creates a new instance of the JobDefinitionListPage type.
  1646  func NewJobDefinitionListPage(cur JobDefinitionList, getNextPage func(context.Context, JobDefinitionList) (JobDefinitionList, error)) JobDefinitionListPage {
  1647  	return JobDefinitionListPage{
  1648  		fn:  getNextPage,
  1649  		jdl: cur,
  1650  	}
  1651  }
  1652  
  1653  // JobDefinitionProperties job Definition
  1654  type JobDefinitionProperties struct {
  1655  	// DataSourceID - Data Source Id associated to the job definition.
  1656  	DataSourceID *string `json:"dataSourceId,omitempty"`
  1657  	// DataSinkID - Data Sink Id associated to the job definition.
  1658  	DataSinkID *string `json:"dataSinkId,omitempty"`
  1659  	// Schedules - Schedule for running the job definition
  1660  	Schedules *[]Schedule `json:"schedules,omitempty"`
  1661  	// State - State of the job definition. Possible values include: 'Disabled', 'Enabled', 'Supported'
  1662  	State State `json:"state,omitempty"`
  1663  	// LastModifiedTime - Last modified time of the job definition.
  1664  	LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"`
  1665  	// RunLocation - This is the preferred geo location for the job to run. Possible values include: 'RunLocationNone', 'RunLocationAustraliaeast', 'RunLocationAustraliasoutheast', 'RunLocationBrazilsouth', 'RunLocationCanadacentral', 'RunLocationCanadaeast', 'RunLocationCentralindia', 'RunLocationCentralus', 'RunLocationEastasia', 'RunLocationEastus', 'RunLocationEastus2', 'RunLocationJapaneast', 'RunLocationJapanwest', 'RunLocationKoreacentral', 'RunLocationKoreasouth', 'RunLocationSoutheastasia', 'RunLocationSouthcentralus', 'RunLocationSouthindia', 'RunLocationNorthcentralus', 'RunLocationNortheurope', 'RunLocationUksouth', 'RunLocationUkwest', 'RunLocationWestcentralus', 'RunLocationWesteurope', 'RunLocationWestindia', 'RunLocationWestus', 'RunLocationWestus2'
  1666  	RunLocation RunLocation `json:"runLocation,omitempty"`
  1667  	// UserConfirmation - Enum to detect if user confirmation is required. If not passed will default to NotRequired. Possible values include: 'NotRequired', 'Required'
  1668  	UserConfirmation UserConfirmation `json:"userConfirmation,omitempty"`
  1669  	// DataServiceInput - A generic json used differently by each data service type.
  1670  	DataServiceInput interface{} `json:"dataServiceInput,omitempty"`
  1671  	// CustomerSecrets - List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys.
  1672  	CustomerSecrets *[]CustomerSecret `json:"customerSecrets,omitempty"`
  1673  }
  1674  
  1675  // JobDefinitionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1676  // long-running operation.
  1677  type JobDefinitionsCreateOrUpdateFuture struct {
  1678  	azure.FutureAPI
  1679  	// Result returns the result of the asynchronous operation.
  1680  	// If the operation has not completed it will return an error.
  1681  	Result func(JobDefinitionsClient) (JobDefinition, error)
  1682  }
  1683  
  1684  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1685  func (future *JobDefinitionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1686  	var azFuture azure.Future
  1687  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1688  		return err
  1689  	}
  1690  	future.FutureAPI = &azFuture
  1691  	future.Result = future.result
  1692  	return nil
  1693  }
  1694  
  1695  // result is the default implementation for JobDefinitionsCreateOrUpdateFuture.Result.
  1696  func (future *JobDefinitionsCreateOrUpdateFuture) result(client JobDefinitionsClient) (jd JobDefinition, err error) {
  1697  	var done bool
  1698  	done, err = future.DoneWithContext(context.Background(), client)
  1699  	if err != nil {
  1700  		err = autorest.NewErrorWithError(err, "hybriddata.JobDefinitionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1701  		return
  1702  	}
  1703  	if !done {
  1704  		jd.Response.Response = future.Response()
  1705  		err = azure.NewAsyncOpIncompleteError("hybriddata.JobDefinitionsCreateOrUpdateFuture")
  1706  		return
  1707  	}
  1708  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1709  	if jd.Response.Response, err = future.GetResult(sender); err == nil && jd.Response.Response.StatusCode != http.StatusNoContent {
  1710  		jd, err = client.CreateOrUpdateResponder(jd.Response.Response)
  1711  		if err != nil {
  1712  			err = autorest.NewErrorWithError(err, "hybriddata.JobDefinitionsCreateOrUpdateFuture", "Result", jd.Response.Response, "Failure responding to request")
  1713  		}
  1714  	}
  1715  	return
  1716  }
  1717  
  1718  // JobDefinitionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  1719  // operation.
  1720  type JobDefinitionsDeleteFuture struct {
  1721  	azure.FutureAPI
  1722  	// Result returns the result of the asynchronous operation.
  1723  	// If the operation has not completed it will return an error.
  1724  	Result func(JobDefinitionsClient) (autorest.Response, error)
  1725  }
  1726  
  1727  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1728  func (future *JobDefinitionsDeleteFuture) UnmarshalJSON(body []byte) error {
  1729  	var azFuture azure.Future
  1730  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1731  		return err
  1732  	}
  1733  	future.FutureAPI = &azFuture
  1734  	future.Result = future.result
  1735  	return nil
  1736  }
  1737  
  1738  // result is the default implementation for JobDefinitionsDeleteFuture.Result.
  1739  func (future *JobDefinitionsDeleteFuture) result(client JobDefinitionsClient) (ar autorest.Response, err error) {
  1740  	var done bool
  1741  	done, err = future.DoneWithContext(context.Background(), client)
  1742  	if err != nil {
  1743  		err = autorest.NewErrorWithError(err, "hybriddata.JobDefinitionsDeleteFuture", "Result", future.Response(), "Polling failure")
  1744  		return
  1745  	}
  1746  	if !done {
  1747  		ar.Response = future.Response()
  1748  		err = azure.NewAsyncOpIncompleteError("hybriddata.JobDefinitionsDeleteFuture")
  1749  		return
  1750  	}
  1751  	ar.Response = future.Response()
  1752  	return
  1753  }
  1754  
  1755  // JobDefinitionsRunFuture an abstraction for monitoring and retrieving the results of a long-running
  1756  // operation.
  1757  type JobDefinitionsRunFuture struct {
  1758  	azure.FutureAPI
  1759  	// Result returns the result of the asynchronous operation.
  1760  	// If the operation has not completed it will return an error.
  1761  	Result func(JobDefinitionsClient) (autorest.Response, error)
  1762  }
  1763  
  1764  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1765  func (future *JobDefinitionsRunFuture) UnmarshalJSON(body []byte) error {
  1766  	var azFuture azure.Future
  1767  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1768  		return err
  1769  	}
  1770  	future.FutureAPI = &azFuture
  1771  	future.Result = future.result
  1772  	return nil
  1773  }
  1774  
  1775  // result is the default implementation for JobDefinitionsRunFuture.Result.
  1776  func (future *JobDefinitionsRunFuture) result(client JobDefinitionsClient) (ar autorest.Response, err error) {
  1777  	var done bool
  1778  	done, err = future.DoneWithContext(context.Background(), client)
  1779  	if err != nil {
  1780  		err = autorest.NewErrorWithError(err, "hybriddata.JobDefinitionsRunFuture", "Result", future.Response(), "Polling failure")
  1781  		return
  1782  	}
  1783  	if !done {
  1784  		ar.Response = future.Response()
  1785  		err = azure.NewAsyncOpIncompleteError("hybriddata.JobDefinitionsRunFuture")
  1786  		return
  1787  	}
  1788  	ar.Response = future.Response()
  1789  	return
  1790  }
  1791  
  1792  // JobDetails job details.
  1793  type JobDetails struct {
  1794  	// JobStages - List of stages that ran in the job
  1795  	JobStages *[]JobStages `json:"jobStages,omitempty"`
  1796  	// JobDefinition - JobDefinition at the time of the run
  1797  	JobDefinition *JobDefinition `json:"jobDefinition,omitempty"`
  1798  	// ErrorDetails - Error details for failure. This is optional.
  1799  	ErrorDetails *[]ErrorDetails `json:"errorDetails,omitempty"`
  1800  	// ItemDetailsLink - Item Details Link to download files or see details
  1801  	ItemDetailsLink *string `json:"itemDetailsLink,omitempty"`
  1802  }
  1803  
  1804  // JobFilter contains the information about the filters for the job.
  1805  type JobFilter struct {
  1806  	// Status - The status of the job. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling', 'PartiallySucceeded'
  1807  	Status JobStatus `json:"status,omitempty"`
  1808  	// StartTime - The start time of the job.
  1809  	StartTime *date.Time `json:"startTime,omitempty"`
  1810  }
  1811  
  1812  // JobList job Collection.
  1813  type JobList struct {
  1814  	autorest.Response `json:"-"`
  1815  	// Value - List of jobs.
  1816  	Value *[]Job `json:"value,omitempty"`
  1817  	// NextLink - Link for the next set of jobs.
  1818  	NextLink *string `json:"nextLink,omitempty"`
  1819  }
  1820  
  1821  // JobListIterator provides access to a complete listing of Job values.
  1822  type JobListIterator struct {
  1823  	i    int
  1824  	page JobListPage
  1825  }
  1826  
  1827  // NextWithContext advances to the next value.  If there was an error making
  1828  // the request the iterator does not advance and the error is returned.
  1829  func (iter *JobListIterator) NextWithContext(ctx context.Context) (err error) {
  1830  	if tracing.IsEnabled() {
  1831  		ctx = tracing.StartSpan(ctx, fqdn+"/JobListIterator.NextWithContext")
  1832  		defer func() {
  1833  			sc := -1
  1834  			if iter.Response().Response.Response != nil {
  1835  				sc = iter.Response().Response.Response.StatusCode
  1836  			}
  1837  			tracing.EndSpan(ctx, sc, err)
  1838  		}()
  1839  	}
  1840  	iter.i++
  1841  	if iter.i < len(iter.page.Values()) {
  1842  		return nil
  1843  	}
  1844  	err = iter.page.NextWithContext(ctx)
  1845  	if err != nil {
  1846  		iter.i--
  1847  		return err
  1848  	}
  1849  	iter.i = 0
  1850  	return nil
  1851  }
  1852  
  1853  // Next advances to the next value.  If there was an error making
  1854  // the request the iterator does not advance and the error is returned.
  1855  // Deprecated: Use NextWithContext() instead.
  1856  func (iter *JobListIterator) Next() error {
  1857  	return iter.NextWithContext(context.Background())
  1858  }
  1859  
  1860  // NotDone returns true if the enumeration should be started or is not yet complete.
  1861  func (iter JobListIterator) NotDone() bool {
  1862  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1863  }
  1864  
  1865  // Response returns the raw server response from the last page request.
  1866  func (iter JobListIterator) Response() JobList {
  1867  	return iter.page.Response()
  1868  }
  1869  
  1870  // Value returns the current value or a zero-initialized value if the
  1871  // iterator has advanced beyond the end of the collection.
  1872  func (iter JobListIterator) Value() Job {
  1873  	if !iter.page.NotDone() {
  1874  		return Job{}
  1875  	}
  1876  	return iter.page.Values()[iter.i]
  1877  }
  1878  
  1879  // Creates a new instance of the JobListIterator type.
  1880  func NewJobListIterator(page JobListPage) JobListIterator {
  1881  	return JobListIterator{page: page}
  1882  }
  1883  
  1884  // IsEmpty returns true if the ListResult contains no values.
  1885  func (jl JobList) IsEmpty() bool {
  1886  	return jl.Value == nil || len(*jl.Value) == 0
  1887  }
  1888  
  1889  // hasNextLink returns true if the NextLink is not empty.
  1890  func (jl JobList) hasNextLink() bool {
  1891  	return jl.NextLink != nil && len(*jl.NextLink) != 0
  1892  }
  1893  
  1894  // jobListPreparer prepares a request to retrieve the next set of results.
  1895  // It returns nil if no more results exist.
  1896  func (jl JobList) jobListPreparer(ctx context.Context) (*http.Request, error) {
  1897  	if !jl.hasNextLink() {
  1898  		return nil, nil
  1899  	}
  1900  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1901  		autorest.AsJSON(),
  1902  		autorest.AsGet(),
  1903  		autorest.WithBaseURL(to.String(jl.NextLink)))
  1904  }
  1905  
  1906  // JobListPage contains a page of Job values.
  1907  type JobListPage struct {
  1908  	fn func(context.Context, JobList) (JobList, error)
  1909  	jl JobList
  1910  }
  1911  
  1912  // NextWithContext advances to the next page of values.  If there was an error making
  1913  // the request the page does not advance and the error is returned.
  1914  func (page *JobListPage) NextWithContext(ctx context.Context) (err error) {
  1915  	if tracing.IsEnabled() {
  1916  		ctx = tracing.StartSpan(ctx, fqdn+"/JobListPage.NextWithContext")
  1917  		defer func() {
  1918  			sc := -1
  1919  			if page.Response().Response.Response != nil {
  1920  				sc = page.Response().Response.Response.StatusCode
  1921  			}
  1922  			tracing.EndSpan(ctx, sc, err)
  1923  		}()
  1924  	}
  1925  	for {
  1926  		next, err := page.fn(ctx, page.jl)
  1927  		if err != nil {
  1928  			return err
  1929  		}
  1930  		page.jl = next
  1931  		if !next.hasNextLink() || !next.IsEmpty() {
  1932  			break
  1933  		}
  1934  	}
  1935  	return nil
  1936  }
  1937  
  1938  // Next advances to the next page of values.  If there was an error making
  1939  // the request the page does not advance and the error is returned.
  1940  // Deprecated: Use NextWithContext() instead.
  1941  func (page *JobListPage) Next() error {
  1942  	return page.NextWithContext(context.Background())
  1943  }
  1944  
  1945  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1946  func (page JobListPage) NotDone() bool {
  1947  	return !page.jl.IsEmpty()
  1948  }
  1949  
  1950  // Response returns the raw server response from the last page request.
  1951  func (page JobListPage) Response() JobList {
  1952  	return page.jl
  1953  }
  1954  
  1955  // Values returns the slice of values for the current page or nil if there are no values.
  1956  func (page JobListPage) Values() []Job {
  1957  	if page.jl.IsEmpty() {
  1958  		return nil
  1959  	}
  1960  	return *page.jl.Value
  1961  }
  1962  
  1963  // Creates a new instance of the JobListPage type.
  1964  func NewJobListPage(cur JobList, getNextPage func(context.Context, JobList) (JobList, error)) JobListPage {
  1965  	return JobListPage{
  1966  		fn: getNextPage,
  1967  		jl: cur,
  1968  	}
  1969  }
  1970  
  1971  // JobProperties job Properties
  1972  type JobProperties struct {
  1973  	// IsCancellable - Describes whether the job is cancellable. Possible values include: 'NotCancellable', 'Cancellable'
  1974  	IsCancellable IsJobCancellable `json:"isCancellable,omitempty"`
  1975  	// BytesProcessed - Number of bytes processed by the job as of now.
  1976  	BytesProcessed *int64 `json:"bytesProcessed,omitempty"`
  1977  	// ItemsProcessed - Number of items processed by the job as of now
  1978  	ItemsProcessed *int64 `json:"itemsProcessed,omitempty"`
  1979  	// TotalBytesToProcess - Number of bytes to be processed by the job in total.
  1980  	TotalBytesToProcess *int64 `json:"totalBytesToProcess,omitempty"`
  1981  	// TotalItemsToProcess - Number of items to be processed by the job in total
  1982  	TotalItemsToProcess *int64 `json:"totalItemsToProcess,omitempty"`
  1983  	// Details - Details of a job run. This field will only be sent for expand details filter.
  1984  	Details *JobDetails `json:"details,omitempty"`
  1985  	// DataSourceName - Name of the data source on which the job was triggered.
  1986  	DataSourceName *string `json:"dataSourceName,omitempty"`
  1987  	// DataSinkName - Name of the data sink on which the job was triggered.
  1988  	DataSinkName *string `json:"dataSinkName,omitempty"`
  1989  }
  1990  
  1991  // JobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running operation.
  1992  type JobsCancelFuture struct {
  1993  	azure.FutureAPI
  1994  	// Result returns the result of the asynchronous operation.
  1995  	// If the operation has not completed it will return an error.
  1996  	Result func(JobsClient) (autorest.Response, error)
  1997  }
  1998  
  1999  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2000  func (future *JobsCancelFuture) UnmarshalJSON(body []byte) error {
  2001  	var azFuture azure.Future
  2002  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2003  		return err
  2004  	}
  2005  	future.FutureAPI = &azFuture
  2006  	future.Result = future.result
  2007  	return nil
  2008  }
  2009  
  2010  // result is the default implementation for JobsCancelFuture.Result.
  2011  func (future *JobsCancelFuture) result(client JobsClient) (ar autorest.Response, err error) {
  2012  	var done bool
  2013  	done, err = future.DoneWithContext(context.Background(), client)
  2014  	if err != nil {
  2015  		err = autorest.NewErrorWithError(err, "hybriddata.JobsCancelFuture", "Result", future.Response(), "Polling failure")
  2016  		return
  2017  	}
  2018  	if !done {
  2019  		ar.Response = future.Response()
  2020  		err = azure.NewAsyncOpIncompleteError("hybriddata.JobsCancelFuture")
  2021  		return
  2022  	}
  2023  	ar.Response = future.Response()
  2024  	return
  2025  }
  2026  
  2027  // JobsResumeFuture an abstraction for monitoring and retrieving the results of a long-running operation.
  2028  type JobsResumeFuture struct {
  2029  	azure.FutureAPI
  2030  	// Result returns the result of the asynchronous operation.
  2031  	// If the operation has not completed it will return an error.
  2032  	Result func(JobsClient) (autorest.Response, error)
  2033  }
  2034  
  2035  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2036  func (future *JobsResumeFuture) UnmarshalJSON(body []byte) error {
  2037  	var azFuture azure.Future
  2038  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2039  		return err
  2040  	}
  2041  	future.FutureAPI = &azFuture
  2042  	future.Result = future.result
  2043  	return nil
  2044  }
  2045  
  2046  // result is the default implementation for JobsResumeFuture.Result.
  2047  func (future *JobsResumeFuture) result(client JobsClient) (ar autorest.Response, err error) {
  2048  	var done bool
  2049  	done, err = future.DoneWithContext(context.Background(), client)
  2050  	if err != nil {
  2051  		err = autorest.NewErrorWithError(err, "hybriddata.JobsResumeFuture", "Result", future.Response(), "Polling failure")
  2052  		return
  2053  	}
  2054  	if !done {
  2055  		ar.Response = future.Response()
  2056  		err = azure.NewAsyncOpIncompleteError("hybriddata.JobsResumeFuture")
  2057  		return
  2058  	}
  2059  	ar.Response = future.Response()
  2060  	return
  2061  }
  2062  
  2063  // JobStages job stages.
  2064  type JobStages struct {
  2065  	// StageName - Name of the job stage.
  2066  	StageName *string `json:"stageName,omitempty"`
  2067  	// StageStatus - Status of the job stage. Possible values include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', 'Cancelled', 'Cancelling', 'PartiallySucceeded'
  2068  	StageStatus JobStatus `json:"stageStatus,omitempty"`
  2069  	// JobStageDetails - Job Stage Details
  2070  	JobStageDetails interface{} `json:"jobStageDetails,omitempty"`
  2071  	// ErrorDetails - Error details for the stage. This is optional
  2072  	ErrorDetails *[]ErrorDetails `json:"errorDetails,omitempty"`
  2073  }
  2074  
  2075  // Key encryption Key.
  2076  type Key struct {
  2077  	// KeyModulus - Modulus of the encryption key.
  2078  	KeyModulus *string `json:"keyModulus,omitempty"`
  2079  	// KeyExponent - Exponent of the encryption key.
  2080  	KeyExponent *string `json:"keyExponent,omitempty"`
  2081  	// EncryptionChunkSizeInBytes - The maximum byte size that can be encrypted by the key. For a key size larger than the size, break into chunks and encrypt each chunk, append each encrypted chunk with : to mark the end of the chunk.
  2082  	EncryptionChunkSizeInBytes *int32 `json:"encryptionChunkSizeInBytes,omitempty"`
  2083  }
  2084  
  2085  // PublicKey public key
  2086  type PublicKey struct {
  2087  	autorest.Response `json:"-"`
  2088  	// PublicKeyProperties - Public key property.
  2089  	*PublicKeyProperties `json:"properties,omitempty"`
  2090  	// Name - READ-ONLY; Name of the object.
  2091  	Name *string `json:"name,omitempty"`
  2092  	// ID - READ-ONLY; Id of the object.
  2093  	ID *string `json:"id,omitempty"`
  2094  	// Type - READ-ONLY; Type of the object.
  2095  	Type *string `json:"type,omitempty"`
  2096  }
  2097  
  2098  // MarshalJSON is the custom marshaler for PublicKey.
  2099  func (pk PublicKey) MarshalJSON() ([]byte, error) {
  2100  	objectMap := make(map[string]interface{})
  2101  	if pk.PublicKeyProperties != nil {
  2102  		objectMap["properties"] = pk.PublicKeyProperties
  2103  	}
  2104  	return json.Marshal(objectMap)
  2105  }
  2106  
  2107  // UnmarshalJSON is the custom unmarshaler for PublicKey struct.
  2108  func (pk *PublicKey) UnmarshalJSON(body []byte) error {
  2109  	var m map[string]*json.RawMessage
  2110  	err := json.Unmarshal(body, &m)
  2111  	if err != nil {
  2112  		return err
  2113  	}
  2114  	for k, v := range m {
  2115  		switch k {
  2116  		case "properties":
  2117  			if v != nil {
  2118  				var publicKeyProperties PublicKeyProperties
  2119  				err = json.Unmarshal(*v, &publicKeyProperties)
  2120  				if err != nil {
  2121  					return err
  2122  				}
  2123  				pk.PublicKeyProperties = &publicKeyProperties
  2124  			}
  2125  		case "name":
  2126  			if v != nil {
  2127  				var name string
  2128  				err = json.Unmarshal(*v, &name)
  2129  				if err != nil {
  2130  					return err
  2131  				}
  2132  				pk.Name = &name
  2133  			}
  2134  		case "id":
  2135  			if v != nil {
  2136  				var ID string
  2137  				err = json.Unmarshal(*v, &ID)
  2138  				if err != nil {
  2139  					return err
  2140  				}
  2141  				pk.ID = &ID
  2142  			}
  2143  		case "type":
  2144  			if v != nil {
  2145  				var typeVar string
  2146  				err = json.Unmarshal(*v, &typeVar)
  2147  				if err != nil {
  2148  					return err
  2149  				}
  2150  				pk.Type = &typeVar
  2151  			}
  2152  		}
  2153  	}
  2154  
  2155  	return nil
  2156  }
  2157  
  2158  // PublicKeyList publicKey Collection
  2159  type PublicKeyList struct {
  2160  	autorest.Response `json:"-"`
  2161  	// Value - List of public keys.
  2162  	Value *[]PublicKey `json:"value,omitempty"`
  2163  	// NextLink - Link for the next set of public keys.
  2164  	NextLink *string `json:"nextLink,omitempty"`
  2165  }
  2166  
  2167  // PublicKeyListIterator provides access to a complete listing of PublicKey values.
  2168  type PublicKeyListIterator struct {
  2169  	i    int
  2170  	page PublicKeyListPage
  2171  }
  2172  
  2173  // NextWithContext advances to the next value.  If there was an error making
  2174  // the request the iterator does not advance and the error is returned.
  2175  func (iter *PublicKeyListIterator) NextWithContext(ctx context.Context) (err error) {
  2176  	if tracing.IsEnabled() {
  2177  		ctx = tracing.StartSpan(ctx, fqdn+"/PublicKeyListIterator.NextWithContext")
  2178  		defer func() {
  2179  			sc := -1
  2180  			if iter.Response().Response.Response != nil {
  2181  				sc = iter.Response().Response.Response.StatusCode
  2182  			}
  2183  			tracing.EndSpan(ctx, sc, err)
  2184  		}()
  2185  	}
  2186  	iter.i++
  2187  	if iter.i < len(iter.page.Values()) {
  2188  		return nil
  2189  	}
  2190  	err = iter.page.NextWithContext(ctx)
  2191  	if err != nil {
  2192  		iter.i--
  2193  		return err
  2194  	}
  2195  	iter.i = 0
  2196  	return nil
  2197  }
  2198  
  2199  // Next advances to the next value.  If there was an error making
  2200  // the request the iterator does not advance and the error is returned.
  2201  // Deprecated: Use NextWithContext() instead.
  2202  func (iter *PublicKeyListIterator) Next() error {
  2203  	return iter.NextWithContext(context.Background())
  2204  }
  2205  
  2206  // NotDone returns true if the enumeration should be started or is not yet complete.
  2207  func (iter PublicKeyListIterator) NotDone() bool {
  2208  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2209  }
  2210  
  2211  // Response returns the raw server response from the last page request.
  2212  func (iter PublicKeyListIterator) Response() PublicKeyList {
  2213  	return iter.page.Response()
  2214  }
  2215  
  2216  // Value returns the current value or a zero-initialized value if the
  2217  // iterator has advanced beyond the end of the collection.
  2218  func (iter PublicKeyListIterator) Value() PublicKey {
  2219  	if !iter.page.NotDone() {
  2220  		return PublicKey{}
  2221  	}
  2222  	return iter.page.Values()[iter.i]
  2223  }
  2224  
  2225  // Creates a new instance of the PublicKeyListIterator type.
  2226  func NewPublicKeyListIterator(page PublicKeyListPage) PublicKeyListIterator {
  2227  	return PublicKeyListIterator{page: page}
  2228  }
  2229  
  2230  // IsEmpty returns true if the ListResult contains no values.
  2231  func (pkl PublicKeyList) IsEmpty() bool {
  2232  	return pkl.Value == nil || len(*pkl.Value) == 0
  2233  }
  2234  
  2235  // hasNextLink returns true if the NextLink is not empty.
  2236  func (pkl PublicKeyList) hasNextLink() bool {
  2237  	return pkl.NextLink != nil && len(*pkl.NextLink) != 0
  2238  }
  2239  
  2240  // publicKeyListPreparer prepares a request to retrieve the next set of results.
  2241  // It returns nil if no more results exist.
  2242  func (pkl PublicKeyList) publicKeyListPreparer(ctx context.Context) (*http.Request, error) {
  2243  	if !pkl.hasNextLink() {
  2244  		return nil, nil
  2245  	}
  2246  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2247  		autorest.AsJSON(),
  2248  		autorest.AsGet(),
  2249  		autorest.WithBaseURL(to.String(pkl.NextLink)))
  2250  }
  2251  
  2252  // PublicKeyListPage contains a page of PublicKey values.
  2253  type PublicKeyListPage struct {
  2254  	fn  func(context.Context, PublicKeyList) (PublicKeyList, error)
  2255  	pkl PublicKeyList
  2256  }
  2257  
  2258  // NextWithContext advances to the next page of values.  If there was an error making
  2259  // the request the page does not advance and the error is returned.
  2260  func (page *PublicKeyListPage) NextWithContext(ctx context.Context) (err error) {
  2261  	if tracing.IsEnabled() {
  2262  		ctx = tracing.StartSpan(ctx, fqdn+"/PublicKeyListPage.NextWithContext")
  2263  		defer func() {
  2264  			sc := -1
  2265  			if page.Response().Response.Response != nil {
  2266  				sc = page.Response().Response.Response.StatusCode
  2267  			}
  2268  			tracing.EndSpan(ctx, sc, err)
  2269  		}()
  2270  	}
  2271  	for {
  2272  		next, err := page.fn(ctx, page.pkl)
  2273  		if err != nil {
  2274  			return err
  2275  		}
  2276  		page.pkl = next
  2277  		if !next.hasNextLink() || !next.IsEmpty() {
  2278  			break
  2279  		}
  2280  	}
  2281  	return nil
  2282  }
  2283  
  2284  // Next advances to the next page of values.  If there was an error making
  2285  // the request the page does not advance and the error is returned.
  2286  // Deprecated: Use NextWithContext() instead.
  2287  func (page *PublicKeyListPage) Next() error {
  2288  	return page.NextWithContext(context.Background())
  2289  }
  2290  
  2291  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2292  func (page PublicKeyListPage) NotDone() bool {
  2293  	return !page.pkl.IsEmpty()
  2294  }
  2295  
  2296  // Response returns the raw server response from the last page request.
  2297  func (page PublicKeyListPage) Response() PublicKeyList {
  2298  	return page.pkl
  2299  }
  2300  
  2301  // Values returns the slice of values for the current page or nil if there are no values.
  2302  func (page PublicKeyListPage) Values() []PublicKey {
  2303  	if page.pkl.IsEmpty() {
  2304  		return nil
  2305  	}
  2306  	return *page.pkl.Value
  2307  }
  2308  
  2309  // Creates a new instance of the PublicKeyListPage type.
  2310  func NewPublicKeyListPage(cur PublicKeyList, getNextPage func(context.Context, PublicKeyList) (PublicKeyList, error)) PublicKeyListPage {
  2311  	return PublicKeyListPage{
  2312  		fn:  getNextPage,
  2313  		pkl: cur,
  2314  	}
  2315  }
  2316  
  2317  // PublicKeyProperties publicKey Properties
  2318  type PublicKeyProperties struct {
  2319  	// DataServiceLevel1Key - Level one public key for encryption
  2320  	DataServiceLevel1Key *Key `json:"dataServiceLevel1Key,omitempty"`
  2321  	// DataServiceLevel2Key - Level two public key for encryption
  2322  	DataServiceLevel2Key *Key `json:"dataServiceLevel2Key,omitempty"`
  2323  }
  2324  
  2325  // Resource model of the Resource.
  2326  type Resource struct {
  2327  	// ID - READ-ONLY; The Resource Id.
  2328  	ID *string `json:"id,omitempty"`
  2329  	// Name - READ-ONLY; The Resource Name.
  2330  	Name *string `json:"name,omitempty"`
  2331  	// Type - READ-ONLY; The Resource type.
  2332  	Type *string `json:"type,omitempty"`
  2333  	// Location - The location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East
  2334  	// US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo
  2335  	// region is specified on update the request will succeed.
  2336  	Location *string `json:"location,omitempty"`
  2337  	// Tags - The list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource
  2338  	// (across resource groups).
  2339  	Tags map[string]*string `json:"tags"`
  2340  	// Sku - The sku type.
  2341  	Sku *Sku `json:"sku,omitempty"`
  2342  }
  2343  
  2344  // MarshalJSON is the custom marshaler for Resource.
  2345  func (r Resource) MarshalJSON() ([]byte, error) {
  2346  	objectMap := make(map[string]interface{})
  2347  	if r.Location != nil {
  2348  		objectMap["location"] = r.Location
  2349  	}
  2350  	if r.Tags != nil {
  2351  		objectMap["tags"] = r.Tags
  2352  	}
  2353  	if r.Sku != nil {
  2354  		objectMap["sku"] = r.Sku
  2355  	}
  2356  	return json.Marshal(objectMap)
  2357  }
  2358  
  2359  // RunParameters run parameters for a job.
  2360  type RunParameters struct {
  2361  	// UserConfirmation - Enum to detect if user confirmation is required. If not passed will default to NotRequired. Possible values include: 'NotRequired', 'Required'
  2362  	UserConfirmation UserConfirmation `json:"userConfirmation,omitempty"`
  2363  	// DataServiceInput - A generic json used differently by each data service type.
  2364  	DataServiceInput interface{} `json:"dataServiceInput,omitempty"`
  2365  	// CustomerSecrets - List of customer secrets containing a key identifier and key value. The key identifier is a way for the specific data source to understand the key. Value contains customer secret encrypted by the encryptionKeys.
  2366  	CustomerSecrets *[]CustomerSecret `json:"customerSecrets,omitempty"`
  2367  }
  2368  
  2369  // Schedule schedule for the job run.
  2370  type Schedule struct {
  2371  	// Name - Name of the schedule.
  2372  	Name *string `json:"name,omitempty"`
  2373  	// PolicyList - A list of repetition intervals in ISO 8601 format.
  2374  	PolicyList *[]string `json:"policyList,omitempty"`
  2375  }
  2376  
  2377  // Sku the sku type.
  2378  type Sku struct {
  2379  	// Name - The sku name. Required for data manager creation, optional for update.
  2380  	Name *string `json:"name,omitempty"`
  2381  	// Tier - The sku tier. This is based on the SKU name.
  2382  	Tier *string `json:"tier,omitempty"`
  2383  }
  2384  

View as plain text