...

Source file src/github.com/Azure/azure-sdk-for-go/services/storsimple8000series/mgmt/2017-06-01/storsimple/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/storsimple8000series/mgmt/2017-06-01/storsimple

     1  package storsimple
     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/storsimple8000series/mgmt/2017-06-01/storsimple"
    22  
    23  // AccessControlRecord the access control record.
    24  type AccessControlRecord struct {
    25  	autorest.Response `json:"-"`
    26  	// AccessControlRecordProperties - The properties of access control record.
    27  	*AccessControlRecordProperties `json:"properties,omitempty"`
    28  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
    29  	ID *string `json:"id,omitempty"`
    30  	// Name - READ-ONLY; The name of the object.
    31  	Name *string `json:"name,omitempty"`
    32  	// Type - READ-ONLY; The hierarchical type of the object.
    33  	Type *string `json:"type,omitempty"`
    34  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
    35  	Kind Kind `json:"kind,omitempty"`
    36  }
    37  
    38  // MarshalJSON is the custom marshaler for AccessControlRecord.
    39  func (acr AccessControlRecord) MarshalJSON() ([]byte, error) {
    40  	objectMap := make(map[string]interface{})
    41  	if acr.AccessControlRecordProperties != nil {
    42  		objectMap["properties"] = acr.AccessControlRecordProperties
    43  	}
    44  	if acr.Kind != "" {
    45  		objectMap["kind"] = acr.Kind
    46  	}
    47  	return json.Marshal(objectMap)
    48  }
    49  
    50  // UnmarshalJSON is the custom unmarshaler for AccessControlRecord struct.
    51  func (acr *AccessControlRecord) UnmarshalJSON(body []byte) error {
    52  	var m map[string]*json.RawMessage
    53  	err := json.Unmarshal(body, &m)
    54  	if err != nil {
    55  		return err
    56  	}
    57  	for k, v := range m {
    58  		switch k {
    59  		case "properties":
    60  			if v != nil {
    61  				var accessControlRecordProperties AccessControlRecordProperties
    62  				err = json.Unmarshal(*v, &accessControlRecordProperties)
    63  				if err != nil {
    64  					return err
    65  				}
    66  				acr.AccessControlRecordProperties = &accessControlRecordProperties
    67  			}
    68  		case "id":
    69  			if v != nil {
    70  				var ID string
    71  				err = json.Unmarshal(*v, &ID)
    72  				if err != nil {
    73  					return err
    74  				}
    75  				acr.ID = &ID
    76  			}
    77  		case "name":
    78  			if v != nil {
    79  				var name string
    80  				err = json.Unmarshal(*v, &name)
    81  				if err != nil {
    82  					return err
    83  				}
    84  				acr.Name = &name
    85  			}
    86  		case "type":
    87  			if v != nil {
    88  				var typeVar string
    89  				err = json.Unmarshal(*v, &typeVar)
    90  				if err != nil {
    91  					return err
    92  				}
    93  				acr.Type = &typeVar
    94  			}
    95  		case "kind":
    96  			if v != nil {
    97  				var kind Kind
    98  				err = json.Unmarshal(*v, &kind)
    99  				if err != nil {
   100  					return err
   101  				}
   102  				acr.Kind = kind
   103  			}
   104  		}
   105  	}
   106  
   107  	return nil
   108  }
   109  
   110  // AccessControlRecordList the collection of access control records.
   111  type AccessControlRecordList struct {
   112  	autorest.Response `json:"-"`
   113  	// Value - The value.
   114  	Value *[]AccessControlRecord `json:"value,omitempty"`
   115  }
   116  
   117  // AccessControlRecordProperties the properties of access control record.
   118  type AccessControlRecordProperties struct {
   119  	// InitiatorName - The iSCSI initiator name (IQN).
   120  	InitiatorName *string `json:"initiatorName,omitempty"`
   121  	// VolumeCount - READ-ONLY; The number of volumes using the access control record.
   122  	VolumeCount *int32 `json:"volumeCount,omitempty"`
   123  }
   124  
   125  // MarshalJSON is the custom marshaler for AccessControlRecordProperties.
   126  func (acrp AccessControlRecordProperties) MarshalJSON() ([]byte, error) {
   127  	objectMap := make(map[string]interface{})
   128  	if acrp.InitiatorName != nil {
   129  		objectMap["initiatorName"] = acrp.InitiatorName
   130  	}
   131  	return json.Marshal(objectMap)
   132  }
   133  
   134  // AccessControlRecordsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
   135  // long-running operation.
   136  type AccessControlRecordsCreateOrUpdateFuture struct {
   137  	azure.FutureAPI
   138  	// Result returns the result of the asynchronous operation.
   139  	// If the operation has not completed it will return an error.
   140  	Result func(AccessControlRecordsClient) (AccessControlRecord, error)
   141  }
   142  
   143  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   144  func (future *AccessControlRecordsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
   145  	var azFuture azure.Future
   146  	if err := json.Unmarshal(body, &azFuture); err != nil {
   147  		return err
   148  	}
   149  	future.FutureAPI = &azFuture
   150  	future.Result = future.result
   151  	return nil
   152  }
   153  
   154  // result is the default implementation for AccessControlRecordsCreateOrUpdateFuture.Result.
   155  func (future *AccessControlRecordsCreateOrUpdateFuture) result(client AccessControlRecordsClient) (acr AccessControlRecord, err error) {
   156  	var done bool
   157  	done, err = future.DoneWithContext(context.Background(), client)
   158  	if err != nil {
   159  		err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
   160  		return
   161  	}
   162  	if !done {
   163  		acr.Response.Response = future.Response()
   164  		err = azure.NewAsyncOpIncompleteError("storsimple.AccessControlRecordsCreateOrUpdateFuture")
   165  		return
   166  	}
   167  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   168  	if acr.Response.Response, err = future.GetResult(sender); err == nil && acr.Response.Response.StatusCode != http.StatusNoContent {
   169  		acr, err = client.CreateOrUpdateResponder(acr.Response.Response)
   170  		if err != nil {
   171  			err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsCreateOrUpdateFuture", "Result", acr.Response.Response, "Failure responding to request")
   172  		}
   173  	}
   174  	return
   175  }
   176  
   177  // AccessControlRecordsDeleteFuture an abstraction for monitoring and retrieving the results of a
   178  // long-running operation.
   179  type AccessControlRecordsDeleteFuture struct {
   180  	azure.FutureAPI
   181  	// Result returns the result of the asynchronous operation.
   182  	// If the operation has not completed it will return an error.
   183  	Result func(AccessControlRecordsClient) (autorest.Response, error)
   184  }
   185  
   186  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   187  func (future *AccessControlRecordsDeleteFuture) UnmarshalJSON(body []byte) error {
   188  	var azFuture azure.Future
   189  	if err := json.Unmarshal(body, &azFuture); err != nil {
   190  		return err
   191  	}
   192  	future.FutureAPI = &azFuture
   193  	future.Result = future.result
   194  	return nil
   195  }
   196  
   197  // result is the default implementation for AccessControlRecordsDeleteFuture.Result.
   198  func (future *AccessControlRecordsDeleteFuture) result(client AccessControlRecordsClient) (ar autorest.Response, err error) {
   199  	var done bool
   200  	done, err = future.DoneWithContext(context.Background(), client)
   201  	if err != nil {
   202  		err = autorest.NewErrorWithError(err, "storsimple.AccessControlRecordsDeleteFuture", "Result", future.Response(), "Polling failure")
   203  		return
   204  	}
   205  	if !done {
   206  		ar.Response = future.Response()
   207  		err = azure.NewAsyncOpIncompleteError("storsimple.AccessControlRecordsDeleteFuture")
   208  		return
   209  	}
   210  	ar.Response = future.Response()
   211  	return
   212  }
   213  
   214  // AcsConfiguration the ACS configuration.
   215  type AcsConfiguration struct {
   216  	// Namespace - The namespace.
   217  	Namespace *string `json:"namespace,omitempty"`
   218  	// Realm - The realm.
   219  	Realm *string `json:"realm,omitempty"`
   220  	// ServiceURL - The service URL.
   221  	ServiceURL *string `json:"serviceUrl,omitempty"`
   222  }
   223  
   224  // Alert the alert.
   225  type Alert struct {
   226  	// AlertProperties - The properties of the alert.
   227  	*AlertProperties `json:"properties,omitempty"`
   228  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
   229  	ID *string `json:"id,omitempty"`
   230  	// Name - READ-ONLY; The name of the object.
   231  	Name *string `json:"name,omitempty"`
   232  	// Type - READ-ONLY; The hierarchical type of the object.
   233  	Type *string `json:"type,omitempty"`
   234  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
   235  	Kind Kind `json:"kind,omitempty"`
   236  }
   237  
   238  // MarshalJSON is the custom marshaler for Alert.
   239  func (a Alert) MarshalJSON() ([]byte, error) {
   240  	objectMap := make(map[string]interface{})
   241  	if a.AlertProperties != nil {
   242  		objectMap["properties"] = a.AlertProperties
   243  	}
   244  	if a.Kind != "" {
   245  		objectMap["kind"] = a.Kind
   246  	}
   247  	return json.Marshal(objectMap)
   248  }
   249  
   250  // UnmarshalJSON is the custom unmarshaler for Alert struct.
   251  func (a *Alert) UnmarshalJSON(body []byte) error {
   252  	var m map[string]*json.RawMessage
   253  	err := json.Unmarshal(body, &m)
   254  	if err != nil {
   255  		return err
   256  	}
   257  	for k, v := range m {
   258  		switch k {
   259  		case "properties":
   260  			if v != nil {
   261  				var alertProperties AlertProperties
   262  				err = json.Unmarshal(*v, &alertProperties)
   263  				if err != nil {
   264  					return err
   265  				}
   266  				a.AlertProperties = &alertProperties
   267  			}
   268  		case "id":
   269  			if v != nil {
   270  				var ID string
   271  				err = json.Unmarshal(*v, &ID)
   272  				if err != nil {
   273  					return err
   274  				}
   275  				a.ID = &ID
   276  			}
   277  		case "name":
   278  			if v != nil {
   279  				var name string
   280  				err = json.Unmarshal(*v, &name)
   281  				if err != nil {
   282  					return err
   283  				}
   284  				a.Name = &name
   285  			}
   286  		case "type":
   287  			if v != nil {
   288  				var typeVar string
   289  				err = json.Unmarshal(*v, &typeVar)
   290  				if err != nil {
   291  					return err
   292  				}
   293  				a.Type = &typeVar
   294  			}
   295  		case "kind":
   296  			if v != nil {
   297  				var kind Kind
   298  				err = json.Unmarshal(*v, &kind)
   299  				if err != nil {
   300  					return err
   301  				}
   302  				a.Kind = kind
   303  			}
   304  		}
   305  	}
   306  
   307  	return nil
   308  }
   309  
   310  // AlertErrorDetails the details of the error for which the alert was raised
   311  type AlertErrorDetails struct {
   312  	// ErrorCode - The error code
   313  	ErrorCode *string `json:"errorCode,omitempty"`
   314  	// ErrorMessage - The error message
   315  	ErrorMessage *string `json:"errorMessage,omitempty"`
   316  	// Occurences - The number of occurrences
   317  	Occurences *int32 `json:"occurences,omitempty"`
   318  }
   319  
   320  // AlertFilter the OData filters to be used for Alert
   321  type AlertFilter struct {
   322  	// Status - Specifies the status of the alerts to be filtered. Only 'Equality' operator is supported for this property. Possible values include: 'Active', 'Cleared'
   323  	Status AlertStatus `json:"status,omitempty"`
   324  	// Severity - Specifies the severity of the alerts to be filtered. Only 'Equality' operator is supported for this property. Possible values include: 'Informational', 'Warning', 'Critical'
   325  	Severity AlertSeverity `json:"severity,omitempty"`
   326  	// SourceType - Specifies the source type of the alerts to be filtered. Only 'Equality' operator is supported for this property. Possible values include: 'AlertSourceTypeResource', 'AlertSourceTypeDevice'
   327  	SourceType AlertSourceType `json:"sourceType,omitempty"`
   328  	// SourceName - Specifies the source name of the alerts to be filtered. Only 'Equality' operator is supported for this property.
   329  	SourceName *string `json:"sourceName,omitempty"`
   330  	// AppearedOnTime - Specifies the appeared time (in UTC) of the alerts to be filtered. Only 'Greater-Than' and 'Lesser-Than' operators are supported for this property.
   331  	AppearedOnTime *date.Time `json:"appearedOnTime,omitempty"`
   332  }
   333  
   334  // AlertList the collection of alerts.
   335  type AlertList struct {
   336  	autorest.Response `json:"-"`
   337  	// Value - The value.
   338  	Value *[]Alert `json:"value,omitempty"`
   339  	// NextLink - The URI of the next page of alerts.
   340  	NextLink *string `json:"nextLink,omitempty"`
   341  }
   342  
   343  // AlertListIterator provides access to a complete listing of Alert values.
   344  type AlertListIterator struct {
   345  	i    int
   346  	page AlertListPage
   347  }
   348  
   349  // NextWithContext advances to the next value.  If there was an error making
   350  // the request the iterator does not advance and the error is returned.
   351  func (iter *AlertListIterator) NextWithContext(ctx context.Context) (err error) {
   352  	if tracing.IsEnabled() {
   353  		ctx = tracing.StartSpan(ctx, fqdn+"/AlertListIterator.NextWithContext")
   354  		defer func() {
   355  			sc := -1
   356  			if iter.Response().Response.Response != nil {
   357  				sc = iter.Response().Response.Response.StatusCode
   358  			}
   359  			tracing.EndSpan(ctx, sc, err)
   360  		}()
   361  	}
   362  	iter.i++
   363  	if iter.i < len(iter.page.Values()) {
   364  		return nil
   365  	}
   366  	err = iter.page.NextWithContext(ctx)
   367  	if err != nil {
   368  		iter.i--
   369  		return err
   370  	}
   371  	iter.i = 0
   372  	return nil
   373  }
   374  
   375  // Next advances to the next value.  If there was an error making
   376  // the request the iterator does not advance and the error is returned.
   377  // Deprecated: Use NextWithContext() instead.
   378  func (iter *AlertListIterator) Next() error {
   379  	return iter.NextWithContext(context.Background())
   380  }
   381  
   382  // NotDone returns true if the enumeration should be started or is not yet complete.
   383  func (iter AlertListIterator) NotDone() bool {
   384  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   385  }
   386  
   387  // Response returns the raw server response from the last page request.
   388  func (iter AlertListIterator) Response() AlertList {
   389  	return iter.page.Response()
   390  }
   391  
   392  // Value returns the current value or a zero-initialized value if the
   393  // iterator has advanced beyond the end of the collection.
   394  func (iter AlertListIterator) Value() Alert {
   395  	if !iter.page.NotDone() {
   396  		return Alert{}
   397  	}
   398  	return iter.page.Values()[iter.i]
   399  }
   400  
   401  // Creates a new instance of the AlertListIterator type.
   402  func NewAlertListIterator(page AlertListPage) AlertListIterator {
   403  	return AlertListIterator{page: page}
   404  }
   405  
   406  // IsEmpty returns true if the ListResult contains no values.
   407  func (al AlertList) IsEmpty() bool {
   408  	return al.Value == nil || len(*al.Value) == 0
   409  }
   410  
   411  // hasNextLink returns true if the NextLink is not empty.
   412  func (al AlertList) hasNextLink() bool {
   413  	return al.NextLink != nil && len(*al.NextLink) != 0
   414  }
   415  
   416  // alertListPreparer prepares a request to retrieve the next set of results.
   417  // It returns nil if no more results exist.
   418  func (al AlertList) alertListPreparer(ctx context.Context) (*http.Request, error) {
   419  	if !al.hasNextLink() {
   420  		return nil, nil
   421  	}
   422  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   423  		autorest.AsJSON(),
   424  		autorest.AsGet(),
   425  		autorest.WithBaseURL(to.String(al.NextLink)))
   426  }
   427  
   428  // AlertListPage contains a page of Alert values.
   429  type AlertListPage struct {
   430  	fn func(context.Context, AlertList) (AlertList, error)
   431  	al AlertList
   432  }
   433  
   434  // NextWithContext advances to the next page of values.  If there was an error making
   435  // the request the page does not advance and the error is returned.
   436  func (page *AlertListPage) NextWithContext(ctx context.Context) (err error) {
   437  	if tracing.IsEnabled() {
   438  		ctx = tracing.StartSpan(ctx, fqdn+"/AlertListPage.NextWithContext")
   439  		defer func() {
   440  			sc := -1
   441  			if page.Response().Response.Response != nil {
   442  				sc = page.Response().Response.Response.StatusCode
   443  			}
   444  			tracing.EndSpan(ctx, sc, err)
   445  		}()
   446  	}
   447  	for {
   448  		next, err := page.fn(ctx, page.al)
   449  		if err != nil {
   450  			return err
   451  		}
   452  		page.al = next
   453  		if !next.hasNextLink() || !next.IsEmpty() {
   454  			break
   455  		}
   456  	}
   457  	return nil
   458  }
   459  
   460  // Next advances to the next page of values.  If there was an error making
   461  // the request the page does not advance and the error is returned.
   462  // Deprecated: Use NextWithContext() instead.
   463  func (page *AlertListPage) Next() error {
   464  	return page.NextWithContext(context.Background())
   465  }
   466  
   467  // NotDone returns true if the page enumeration should be started or is not yet complete.
   468  func (page AlertListPage) NotDone() bool {
   469  	return !page.al.IsEmpty()
   470  }
   471  
   472  // Response returns the raw server response from the last page request.
   473  func (page AlertListPage) Response() AlertList {
   474  	return page.al
   475  }
   476  
   477  // Values returns the slice of values for the current page or nil if there are no values.
   478  func (page AlertListPage) Values() []Alert {
   479  	if page.al.IsEmpty() {
   480  		return nil
   481  	}
   482  	return *page.al.Value
   483  }
   484  
   485  // Creates a new instance of the AlertListPage type.
   486  func NewAlertListPage(cur AlertList, getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage {
   487  	return AlertListPage{
   488  		fn: getNextPage,
   489  		al: cur,
   490  	}
   491  }
   492  
   493  // AlertNotificationProperties the properties of the alert notification settings.
   494  type AlertNotificationProperties struct {
   495  	// EmailNotification - Indicates whether email notification enabled or not. Possible values include: 'Enabled', 'Disabled'
   496  	EmailNotification AlertEmailNotificationStatus `json:"emailNotification,omitempty"`
   497  	// AlertNotificationCulture - The alert notification culture.
   498  	AlertNotificationCulture *string `json:"alertNotificationCulture,omitempty"`
   499  	// NotificationToServiceOwners - The value indicating whether alert notification enabled for admin or not. Possible values include: 'Enabled', 'Disabled'
   500  	NotificationToServiceOwners AlertEmailNotificationStatus `json:"notificationToServiceOwners,omitempty"`
   501  	// AdditionalRecipientEmailList - The alert notification email list.
   502  	AdditionalRecipientEmailList *[]string `json:"additionalRecipientEmailList,omitempty"`
   503  }
   504  
   505  // AlertProperties the properties of alert
   506  type AlertProperties struct {
   507  	// Title - The title of the alert
   508  	Title *string `json:"title,omitempty"`
   509  	// Scope - The scope of the alert. Possible values include: 'AlertScopeResource', 'AlertScopeDevice'
   510  	Scope AlertScope `json:"scope,omitempty"`
   511  	// AlertType - The type of the alert
   512  	AlertType *string `json:"alertType,omitempty"`
   513  	// AppearedAtTime - The UTC time at which the alert was raised
   514  	AppearedAtTime *date.Time `json:"appearedAtTime,omitempty"`
   515  	// AppearedAtSourceTime - The source time at which the alert was raised
   516  	AppearedAtSourceTime *date.Time `json:"appearedAtSourceTime,omitempty"`
   517  	// ClearedAtTime - The UTC time at which the alert was cleared
   518  	ClearedAtTime *date.Time `json:"clearedAtTime,omitempty"`
   519  	// ClearedAtSourceTime - The source time at which the alert was cleared
   520  	ClearedAtSourceTime *date.Time `json:"clearedAtSourceTime,omitempty"`
   521  	// Source - The source at which the alert was raised
   522  	Source *AlertSource `json:"source,omitempty"`
   523  	// Recommendation - The recommended action for the issue raised in the alert
   524  	Recommendation *string `json:"recommendation,omitempty"`
   525  	// ResolutionReason - The reason for resolving the alert
   526  	ResolutionReason *string `json:"resolutionReason,omitempty"`
   527  	// Severity - The severity of the alert. Possible values include: 'Informational', 'Warning', 'Critical'
   528  	Severity AlertSeverity `json:"severity,omitempty"`
   529  	// Status - The current status of the alert. Possible values include: 'Active', 'Cleared'
   530  	Status AlertStatus `json:"status,omitempty"`
   531  	// ErrorDetails - The details of the error for which the alert was raised
   532  	ErrorDetails *AlertErrorDetails `json:"errorDetails,omitempty"`
   533  	// DetailedInformation - More details about the alert
   534  	DetailedInformation map[string]*string `json:"detailedInformation"`
   535  }
   536  
   537  // MarshalJSON is the custom marshaler for AlertProperties.
   538  func (ap AlertProperties) MarshalJSON() ([]byte, error) {
   539  	objectMap := make(map[string]interface{})
   540  	if ap.Title != nil {
   541  		objectMap["title"] = ap.Title
   542  	}
   543  	if ap.Scope != "" {
   544  		objectMap["scope"] = ap.Scope
   545  	}
   546  	if ap.AlertType != nil {
   547  		objectMap["alertType"] = ap.AlertType
   548  	}
   549  	if ap.AppearedAtTime != nil {
   550  		objectMap["appearedAtTime"] = ap.AppearedAtTime
   551  	}
   552  	if ap.AppearedAtSourceTime != nil {
   553  		objectMap["appearedAtSourceTime"] = ap.AppearedAtSourceTime
   554  	}
   555  	if ap.ClearedAtTime != nil {
   556  		objectMap["clearedAtTime"] = ap.ClearedAtTime
   557  	}
   558  	if ap.ClearedAtSourceTime != nil {
   559  		objectMap["clearedAtSourceTime"] = ap.ClearedAtSourceTime
   560  	}
   561  	if ap.Source != nil {
   562  		objectMap["source"] = ap.Source
   563  	}
   564  	if ap.Recommendation != nil {
   565  		objectMap["recommendation"] = ap.Recommendation
   566  	}
   567  	if ap.ResolutionReason != nil {
   568  		objectMap["resolutionReason"] = ap.ResolutionReason
   569  	}
   570  	if ap.Severity != "" {
   571  		objectMap["severity"] = ap.Severity
   572  	}
   573  	if ap.Status != "" {
   574  		objectMap["status"] = ap.Status
   575  	}
   576  	if ap.ErrorDetails != nil {
   577  		objectMap["errorDetails"] = ap.ErrorDetails
   578  	}
   579  	if ap.DetailedInformation != nil {
   580  		objectMap["detailedInformation"] = ap.DetailedInformation
   581  	}
   582  	return json.Marshal(objectMap)
   583  }
   584  
   585  // AlertSettings the alert settings.
   586  type AlertSettings struct {
   587  	autorest.Response `json:"-"`
   588  	// AlertNotificationProperties - The properties of the alert notification settings.
   589  	*AlertNotificationProperties `json:"properties,omitempty"`
   590  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
   591  	ID *string `json:"id,omitempty"`
   592  	// Name - READ-ONLY; The name of the object.
   593  	Name *string `json:"name,omitempty"`
   594  	// Type - READ-ONLY; The hierarchical type of the object.
   595  	Type *string `json:"type,omitempty"`
   596  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
   597  	Kind Kind `json:"kind,omitempty"`
   598  }
   599  
   600  // MarshalJSON is the custom marshaler for AlertSettings.
   601  func (as AlertSettings) MarshalJSON() ([]byte, error) {
   602  	objectMap := make(map[string]interface{})
   603  	if as.AlertNotificationProperties != nil {
   604  		objectMap["properties"] = as.AlertNotificationProperties
   605  	}
   606  	if as.Kind != "" {
   607  		objectMap["kind"] = as.Kind
   608  	}
   609  	return json.Marshal(objectMap)
   610  }
   611  
   612  // UnmarshalJSON is the custom unmarshaler for AlertSettings struct.
   613  func (as *AlertSettings) UnmarshalJSON(body []byte) error {
   614  	var m map[string]*json.RawMessage
   615  	err := json.Unmarshal(body, &m)
   616  	if err != nil {
   617  		return err
   618  	}
   619  	for k, v := range m {
   620  		switch k {
   621  		case "properties":
   622  			if v != nil {
   623  				var alertNotificationProperties AlertNotificationProperties
   624  				err = json.Unmarshal(*v, &alertNotificationProperties)
   625  				if err != nil {
   626  					return err
   627  				}
   628  				as.AlertNotificationProperties = &alertNotificationProperties
   629  			}
   630  		case "id":
   631  			if v != nil {
   632  				var ID string
   633  				err = json.Unmarshal(*v, &ID)
   634  				if err != nil {
   635  					return err
   636  				}
   637  				as.ID = &ID
   638  			}
   639  		case "name":
   640  			if v != nil {
   641  				var name string
   642  				err = json.Unmarshal(*v, &name)
   643  				if err != nil {
   644  					return err
   645  				}
   646  				as.Name = &name
   647  			}
   648  		case "type":
   649  			if v != nil {
   650  				var typeVar string
   651  				err = json.Unmarshal(*v, &typeVar)
   652  				if err != nil {
   653  					return err
   654  				}
   655  				as.Type = &typeVar
   656  			}
   657  		case "kind":
   658  			if v != nil {
   659  				var kind Kind
   660  				err = json.Unmarshal(*v, &kind)
   661  				if err != nil {
   662  					return err
   663  				}
   664  				as.Kind = kind
   665  			}
   666  		}
   667  	}
   668  
   669  	return nil
   670  }
   671  
   672  // AlertSource the source details at which the alert was raised
   673  type AlertSource struct {
   674  	// Name - The name of the source
   675  	Name *string `json:"name,omitempty"`
   676  	// TimeZone - The time zone of the source
   677  	TimeZone *string `json:"timeZone,omitempty"`
   678  	// AlertSourceType - The source type of the alert. Possible values include: 'AlertSourceTypeResource', 'AlertSourceTypeDevice'
   679  	AlertSourceType AlertSourceType `json:"alertSourceType,omitempty"`
   680  }
   681  
   682  // AsymmetricEncryptedSecret represent the secrets intended for encryption with asymmetric key pair.
   683  type AsymmetricEncryptedSecret struct {
   684  	// Value - The value of the secret.
   685  	Value *string `json:"value,omitempty"`
   686  	// EncryptionCertThumbprint - Thumbprint certificate that was used to encrypt "Value". If the value in unencrypted, it will be null.
   687  	EncryptionCertThumbprint *string `json:"encryptionCertThumbprint,omitempty"`
   688  	// EncryptionAlgorithm - The algorithm used to encrypt "Value". Possible values include: 'EncryptionAlgorithmNone', 'EncryptionAlgorithmAES256', 'EncryptionAlgorithmRSAESPKCS1V15'
   689  	EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"`
   690  }
   691  
   692  // AvailableProviderOperation represents available provider operation.
   693  type AvailableProviderOperation struct {
   694  	// Name - The name of the operation being performed on a particular object. Name format: "{resourceProviderNamespace}/{resourceType}/{read|write|delete|action}". Eg. Microsoft.StorSimple/managers/devices/volumeContainers/read, Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action
   695  	Name *string `json:"name,omitempty"`
   696  	// Display - Contains the localized display information for this particular operation/action.
   697  	Display *AvailableProviderOperationDisplay `json:"display,omitempty"`
   698  	// Origin - The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. Default value is "user,system"
   699  	Origin *string `json:"origin,omitempty"`
   700  	// Properties - Reserved for future use.
   701  	Properties interface{} `json:"properties,omitempty"`
   702  }
   703  
   704  // AvailableProviderOperationDisplay contains the localized display information for this particular
   705  // operation/action. These value will be used by several clients for (a) custom role definitions for RBAC,
   706  // (b) complex query filters for the event service and (c) audit history/records for management operations.
   707  type AvailableProviderOperationDisplay struct {
   708  	// Provider - The localized friendly form of the resource provider name - it is expected to also include the publisher/company responsible. It should use Title Casing and begin with 'Microsoft' for 1st party services.
   709  	Provider *string `json:"provider,omitempty"`
   710  	// Resource - The localized friendly form of the resource type related to this action/operation - it should match the public documentation for the resource provider. It should use Title Casing - for examples, please refer to the 'name' section.
   711  	Resource *string `json:"resource,omitempty"`
   712  	// Operation - The localized friendly name for the operation, as it should be shown to the user. 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.
   713  	Operation *string `json:"operation,omitempty"`
   714  	// Description - The localized friendly description for the operation, as it should be shown to the user. It should be thorough, yet concise - it will be used in tool tips and detailed views.
   715  	Description *string `json:"description,omitempty"`
   716  }
   717  
   718  // AvailableProviderOperationList list of available provider operations.
   719  type AvailableProviderOperationList struct {
   720  	autorest.Response `json:"-"`
   721  	// Value - The value.
   722  	Value *[]AvailableProviderOperation `json:"value,omitempty"`
   723  	// NextLink - The NextLink.
   724  	NextLink *string `json:"nextLink,omitempty"`
   725  }
   726  
   727  // AvailableProviderOperationListIterator provides access to a complete listing of
   728  // AvailableProviderOperation values.
   729  type AvailableProviderOperationListIterator struct {
   730  	i    int
   731  	page AvailableProviderOperationListPage
   732  }
   733  
   734  // NextWithContext advances to the next value.  If there was an error making
   735  // the request the iterator does not advance and the error is returned.
   736  func (iter *AvailableProviderOperationListIterator) NextWithContext(ctx context.Context) (err error) {
   737  	if tracing.IsEnabled() {
   738  		ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationListIterator.NextWithContext")
   739  		defer func() {
   740  			sc := -1
   741  			if iter.Response().Response.Response != nil {
   742  				sc = iter.Response().Response.Response.StatusCode
   743  			}
   744  			tracing.EndSpan(ctx, sc, err)
   745  		}()
   746  	}
   747  	iter.i++
   748  	if iter.i < len(iter.page.Values()) {
   749  		return nil
   750  	}
   751  	err = iter.page.NextWithContext(ctx)
   752  	if err != nil {
   753  		iter.i--
   754  		return err
   755  	}
   756  	iter.i = 0
   757  	return nil
   758  }
   759  
   760  // Next advances to the next value.  If there was an error making
   761  // the request the iterator does not advance and the error is returned.
   762  // Deprecated: Use NextWithContext() instead.
   763  func (iter *AvailableProviderOperationListIterator) Next() error {
   764  	return iter.NextWithContext(context.Background())
   765  }
   766  
   767  // NotDone returns true if the enumeration should be started or is not yet complete.
   768  func (iter AvailableProviderOperationListIterator) NotDone() bool {
   769  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   770  }
   771  
   772  // Response returns the raw server response from the last page request.
   773  func (iter AvailableProviderOperationListIterator) Response() AvailableProviderOperationList {
   774  	return iter.page.Response()
   775  }
   776  
   777  // Value returns the current value or a zero-initialized value if the
   778  // iterator has advanced beyond the end of the collection.
   779  func (iter AvailableProviderOperationListIterator) Value() AvailableProviderOperation {
   780  	if !iter.page.NotDone() {
   781  		return AvailableProviderOperation{}
   782  	}
   783  	return iter.page.Values()[iter.i]
   784  }
   785  
   786  // Creates a new instance of the AvailableProviderOperationListIterator type.
   787  func NewAvailableProviderOperationListIterator(page AvailableProviderOperationListPage) AvailableProviderOperationListIterator {
   788  	return AvailableProviderOperationListIterator{page: page}
   789  }
   790  
   791  // IsEmpty returns true if the ListResult contains no values.
   792  func (apol AvailableProviderOperationList) IsEmpty() bool {
   793  	return apol.Value == nil || len(*apol.Value) == 0
   794  }
   795  
   796  // hasNextLink returns true if the NextLink is not empty.
   797  func (apol AvailableProviderOperationList) hasNextLink() bool {
   798  	return apol.NextLink != nil && len(*apol.NextLink) != 0
   799  }
   800  
   801  // availableProviderOperationListPreparer prepares a request to retrieve the next set of results.
   802  // It returns nil if no more results exist.
   803  func (apol AvailableProviderOperationList) availableProviderOperationListPreparer(ctx context.Context) (*http.Request, error) {
   804  	if !apol.hasNextLink() {
   805  		return nil, nil
   806  	}
   807  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   808  		autorest.AsJSON(),
   809  		autorest.AsGet(),
   810  		autorest.WithBaseURL(to.String(apol.NextLink)))
   811  }
   812  
   813  // AvailableProviderOperationListPage contains a page of AvailableProviderOperation values.
   814  type AvailableProviderOperationListPage struct {
   815  	fn   func(context.Context, AvailableProviderOperationList) (AvailableProviderOperationList, error)
   816  	apol AvailableProviderOperationList
   817  }
   818  
   819  // NextWithContext advances to the next page of values.  If there was an error making
   820  // the request the page does not advance and the error is returned.
   821  func (page *AvailableProviderOperationListPage) NextWithContext(ctx context.Context) (err error) {
   822  	if tracing.IsEnabled() {
   823  		ctx = tracing.StartSpan(ctx, fqdn+"/AvailableProviderOperationListPage.NextWithContext")
   824  		defer func() {
   825  			sc := -1
   826  			if page.Response().Response.Response != nil {
   827  				sc = page.Response().Response.Response.StatusCode
   828  			}
   829  			tracing.EndSpan(ctx, sc, err)
   830  		}()
   831  	}
   832  	for {
   833  		next, err := page.fn(ctx, page.apol)
   834  		if err != nil {
   835  			return err
   836  		}
   837  		page.apol = next
   838  		if !next.hasNextLink() || !next.IsEmpty() {
   839  			break
   840  		}
   841  	}
   842  	return nil
   843  }
   844  
   845  // Next advances to the next page of values.  If there was an error making
   846  // the request the page does not advance and the error is returned.
   847  // Deprecated: Use NextWithContext() instead.
   848  func (page *AvailableProviderOperationListPage) Next() error {
   849  	return page.NextWithContext(context.Background())
   850  }
   851  
   852  // NotDone returns true if the page enumeration should be started or is not yet complete.
   853  func (page AvailableProviderOperationListPage) NotDone() bool {
   854  	return !page.apol.IsEmpty()
   855  }
   856  
   857  // Response returns the raw server response from the last page request.
   858  func (page AvailableProviderOperationListPage) Response() AvailableProviderOperationList {
   859  	return page.apol
   860  }
   861  
   862  // Values returns the slice of values for the current page or nil if there are no values.
   863  func (page AvailableProviderOperationListPage) Values() []AvailableProviderOperation {
   864  	if page.apol.IsEmpty() {
   865  		return nil
   866  	}
   867  	return *page.apol.Value
   868  }
   869  
   870  // Creates a new instance of the AvailableProviderOperationListPage type.
   871  func NewAvailableProviderOperationListPage(cur AvailableProviderOperationList, getNextPage func(context.Context, AvailableProviderOperationList) (AvailableProviderOperationList, error)) AvailableProviderOperationListPage {
   872  	return AvailableProviderOperationListPage{
   873  		fn:   getNextPage,
   874  		apol: cur,
   875  	}
   876  }
   877  
   878  // Backup the backup.
   879  type Backup struct {
   880  	// BackupProperties - The properties of the backup.
   881  	*BackupProperties `json:"properties,omitempty"`
   882  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
   883  	ID *string `json:"id,omitempty"`
   884  	// Name - READ-ONLY; The name of the object.
   885  	Name *string `json:"name,omitempty"`
   886  	// Type - READ-ONLY; The hierarchical type of the object.
   887  	Type *string `json:"type,omitempty"`
   888  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
   889  	Kind Kind `json:"kind,omitempty"`
   890  }
   891  
   892  // MarshalJSON is the custom marshaler for Backup.
   893  func (b Backup) MarshalJSON() ([]byte, error) {
   894  	objectMap := make(map[string]interface{})
   895  	if b.BackupProperties != nil {
   896  		objectMap["properties"] = b.BackupProperties
   897  	}
   898  	if b.Kind != "" {
   899  		objectMap["kind"] = b.Kind
   900  	}
   901  	return json.Marshal(objectMap)
   902  }
   903  
   904  // UnmarshalJSON is the custom unmarshaler for Backup struct.
   905  func (b *Backup) UnmarshalJSON(body []byte) error {
   906  	var m map[string]*json.RawMessage
   907  	err := json.Unmarshal(body, &m)
   908  	if err != nil {
   909  		return err
   910  	}
   911  	for k, v := range m {
   912  		switch k {
   913  		case "properties":
   914  			if v != nil {
   915  				var backupProperties BackupProperties
   916  				err = json.Unmarshal(*v, &backupProperties)
   917  				if err != nil {
   918  					return err
   919  				}
   920  				b.BackupProperties = &backupProperties
   921  			}
   922  		case "id":
   923  			if v != nil {
   924  				var ID string
   925  				err = json.Unmarshal(*v, &ID)
   926  				if err != nil {
   927  					return err
   928  				}
   929  				b.ID = &ID
   930  			}
   931  		case "name":
   932  			if v != nil {
   933  				var name string
   934  				err = json.Unmarshal(*v, &name)
   935  				if err != nil {
   936  					return err
   937  				}
   938  				b.Name = &name
   939  			}
   940  		case "type":
   941  			if v != nil {
   942  				var typeVar string
   943  				err = json.Unmarshal(*v, &typeVar)
   944  				if err != nil {
   945  					return err
   946  				}
   947  				b.Type = &typeVar
   948  			}
   949  		case "kind":
   950  			if v != nil {
   951  				var kind Kind
   952  				err = json.Unmarshal(*v, &kind)
   953  				if err != nil {
   954  					return err
   955  				}
   956  				b.Kind = kind
   957  			}
   958  		}
   959  	}
   960  
   961  	return nil
   962  }
   963  
   964  // BackupElement the backup element.
   965  type BackupElement struct {
   966  	// ElementID - The path ID that uniquely identifies the backup element.
   967  	ElementID *string `json:"elementId,omitempty"`
   968  	// ElementName - The name of the backup element.
   969  	ElementName *string `json:"elementName,omitempty"`
   970  	// ElementType - The hierarchical type of the backup element.
   971  	ElementType *string `json:"elementType,omitempty"`
   972  	// SizeInBytes - The size in bytes.
   973  	SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
   974  	// VolumeName - The name of the volume.
   975  	VolumeName *string `json:"volumeName,omitempty"`
   976  	// VolumeContainerID - The path ID of the volume container.
   977  	VolumeContainerID *string `json:"volumeContainerId,omitempty"`
   978  	// VolumeType - The volume type. Possible values include: 'Tiered', 'Archival', 'LocallyPinned'
   979  	VolumeType VolumeType `json:"volumeType,omitempty"`
   980  }
   981  
   982  // BackupFilter the OData filters to be used for backups.
   983  type BackupFilter struct {
   984  	// BackupPolicyID - Specifies the backupPolicyId of the backups to be filtered. Only 'Equality' operator is supported for this property.
   985  	BackupPolicyID *string `json:"backupPolicyId,omitempty"`
   986  	// VolumeID - Specifies the volumeId of the backups to be filtered. Only 'Equality' operator is supported for this property.
   987  	VolumeID *string `json:"volumeId,omitempty"`
   988  	// CreatedTime - Specifies the creation time of the backups to be filtered. Only 'Greater Than or Equal To' and 'Lesser Than or Equal To' operators are supported for this property.
   989  	CreatedTime *date.Time `json:"createdTime,omitempty"`
   990  }
   991  
   992  // BackupList the collection of backups.
   993  type BackupList struct {
   994  	autorest.Response `json:"-"`
   995  	// Value - The value.
   996  	Value *[]Backup `json:"value,omitempty"`
   997  	// NextLink - The NextLink.
   998  	NextLink *string `json:"nextLink,omitempty"`
   999  }
  1000  
  1001  // BackupListIterator provides access to a complete listing of Backup values.
  1002  type BackupListIterator struct {
  1003  	i    int
  1004  	page BackupListPage
  1005  }
  1006  
  1007  // NextWithContext advances to the next value.  If there was an error making
  1008  // the request the iterator does not advance and the error is returned.
  1009  func (iter *BackupListIterator) NextWithContext(ctx context.Context) (err error) {
  1010  	if tracing.IsEnabled() {
  1011  		ctx = tracing.StartSpan(ctx, fqdn+"/BackupListIterator.NextWithContext")
  1012  		defer func() {
  1013  			sc := -1
  1014  			if iter.Response().Response.Response != nil {
  1015  				sc = iter.Response().Response.Response.StatusCode
  1016  			}
  1017  			tracing.EndSpan(ctx, sc, err)
  1018  		}()
  1019  	}
  1020  	iter.i++
  1021  	if iter.i < len(iter.page.Values()) {
  1022  		return nil
  1023  	}
  1024  	err = iter.page.NextWithContext(ctx)
  1025  	if err != nil {
  1026  		iter.i--
  1027  		return err
  1028  	}
  1029  	iter.i = 0
  1030  	return nil
  1031  }
  1032  
  1033  // Next advances to the next value.  If there was an error making
  1034  // the request the iterator does not advance and the error is returned.
  1035  // Deprecated: Use NextWithContext() instead.
  1036  func (iter *BackupListIterator) Next() error {
  1037  	return iter.NextWithContext(context.Background())
  1038  }
  1039  
  1040  // NotDone returns true if the enumeration should be started or is not yet complete.
  1041  func (iter BackupListIterator) NotDone() bool {
  1042  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1043  }
  1044  
  1045  // Response returns the raw server response from the last page request.
  1046  func (iter BackupListIterator) Response() BackupList {
  1047  	return iter.page.Response()
  1048  }
  1049  
  1050  // Value returns the current value or a zero-initialized value if the
  1051  // iterator has advanced beyond the end of the collection.
  1052  func (iter BackupListIterator) Value() Backup {
  1053  	if !iter.page.NotDone() {
  1054  		return Backup{}
  1055  	}
  1056  	return iter.page.Values()[iter.i]
  1057  }
  1058  
  1059  // Creates a new instance of the BackupListIterator type.
  1060  func NewBackupListIterator(page BackupListPage) BackupListIterator {
  1061  	return BackupListIterator{page: page}
  1062  }
  1063  
  1064  // IsEmpty returns true if the ListResult contains no values.
  1065  func (bl BackupList) IsEmpty() bool {
  1066  	return bl.Value == nil || len(*bl.Value) == 0
  1067  }
  1068  
  1069  // hasNextLink returns true if the NextLink is not empty.
  1070  func (bl BackupList) hasNextLink() bool {
  1071  	return bl.NextLink != nil && len(*bl.NextLink) != 0
  1072  }
  1073  
  1074  // backupListPreparer prepares a request to retrieve the next set of results.
  1075  // It returns nil if no more results exist.
  1076  func (bl BackupList) backupListPreparer(ctx context.Context) (*http.Request, error) {
  1077  	if !bl.hasNextLink() {
  1078  		return nil, nil
  1079  	}
  1080  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1081  		autorest.AsJSON(),
  1082  		autorest.AsGet(),
  1083  		autorest.WithBaseURL(to.String(bl.NextLink)))
  1084  }
  1085  
  1086  // BackupListPage contains a page of Backup values.
  1087  type BackupListPage struct {
  1088  	fn func(context.Context, BackupList) (BackupList, error)
  1089  	bl BackupList
  1090  }
  1091  
  1092  // NextWithContext advances to the next page of values.  If there was an error making
  1093  // the request the page does not advance and the error is returned.
  1094  func (page *BackupListPage) NextWithContext(ctx context.Context) (err error) {
  1095  	if tracing.IsEnabled() {
  1096  		ctx = tracing.StartSpan(ctx, fqdn+"/BackupListPage.NextWithContext")
  1097  		defer func() {
  1098  			sc := -1
  1099  			if page.Response().Response.Response != nil {
  1100  				sc = page.Response().Response.Response.StatusCode
  1101  			}
  1102  			tracing.EndSpan(ctx, sc, err)
  1103  		}()
  1104  	}
  1105  	for {
  1106  		next, err := page.fn(ctx, page.bl)
  1107  		if err != nil {
  1108  			return err
  1109  		}
  1110  		page.bl = next
  1111  		if !next.hasNextLink() || !next.IsEmpty() {
  1112  			break
  1113  		}
  1114  	}
  1115  	return nil
  1116  }
  1117  
  1118  // Next advances to the next page of values.  If there was an error making
  1119  // the request the page does not advance and the error is returned.
  1120  // Deprecated: Use NextWithContext() instead.
  1121  func (page *BackupListPage) Next() error {
  1122  	return page.NextWithContext(context.Background())
  1123  }
  1124  
  1125  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1126  func (page BackupListPage) NotDone() bool {
  1127  	return !page.bl.IsEmpty()
  1128  }
  1129  
  1130  // Response returns the raw server response from the last page request.
  1131  func (page BackupListPage) Response() BackupList {
  1132  	return page.bl
  1133  }
  1134  
  1135  // Values returns the slice of values for the current page or nil if there are no values.
  1136  func (page BackupListPage) Values() []Backup {
  1137  	if page.bl.IsEmpty() {
  1138  		return nil
  1139  	}
  1140  	return *page.bl.Value
  1141  }
  1142  
  1143  // Creates a new instance of the BackupListPage type.
  1144  func NewBackupListPage(cur BackupList, getNextPage func(context.Context, BackupList) (BackupList, error)) BackupListPage {
  1145  	return BackupListPage{
  1146  		fn: getNextPage,
  1147  		bl: cur,
  1148  	}
  1149  }
  1150  
  1151  // BackupPoliciesBackupNowFuture an abstraction for monitoring and retrieving the results of a long-running
  1152  // operation.
  1153  type BackupPoliciesBackupNowFuture struct {
  1154  	azure.FutureAPI
  1155  	// Result returns the result of the asynchronous operation.
  1156  	// If the operation has not completed it will return an error.
  1157  	Result func(BackupPoliciesClient) (autorest.Response, error)
  1158  }
  1159  
  1160  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1161  func (future *BackupPoliciesBackupNowFuture) UnmarshalJSON(body []byte) error {
  1162  	var azFuture azure.Future
  1163  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1164  		return err
  1165  	}
  1166  	future.FutureAPI = &azFuture
  1167  	future.Result = future.result
  1168  	return nil
  1169  }
  1170  
  1171  // result is the default implementation for BackupPoliciesBackupNowFuture.Result.
  1172  func (future *BackupPoliciesBackupNowFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) {
  1173  	var done bool
  1174  	done, err = future.DoneWithContext(context.Background(), client)
  1175  	if err != nil {
  1176  		err = autorest.NewErrorWithError(err, "storsimple.BackupPoliciesBackupNowFuture", "Result", future.Response(), "Polling failure")
  1177  		return
  1178  	}
  1179  	if !done {
  1180  		ar.Response = future.Response()
  1181  		err = azure.NewAsyncOpIncompleteError("storsimple.BackupPoliciesBackupNowFuture")
  1182  		return
  1183  	}
  1184  	ar.Response = future.Response()
  1185  	return
  1186  }
  1187  
  1188  // BackupPoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1189  // long-running operation.
  1190  type BackupPoliciesCreateOrUpdateFuture struct {
  1191  	azure.FutureAPI
  1192  	// Result returns the result of the asynchronous operation.
  1193  	// If the operation has not completed it will return an error.
  1194  	Result func(BackupPoliciesClient) (BackupPolicy, error)
  1195  }
  1196  
  1197  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1198  func (future *BackupPoliciesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1199  	var azFuture azure.Future
  1200  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1201  		return err
  1202  	}
  1203  	future.FutureAPI = &azFuture
  1204  	future.Result = future.result
  1205  	return nil
  1206  }
  1207  
  1208  // result is the default implementation for BackupPoliciesCreateOrUpdateFuture.Result.
  1209  func (future *BackupPoliciesCreateOrUpdateFuture) result(client BackupPoliciesClient) (bp BackupPolicy, err error) {
  1210  	var done bool
  1211  	done, err = future.DoneWithContext(context.Background(), client)
  1212  	if err != nil {
  1213  		err = autorest.NewErrorWithError(err, "storsimple.BackupPoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1214  		return
  1215  	}
  1216  	if !done {
  1217  		bp.Response.Response = future.Response()
  1218  		err = azure.NewAsyncOpIncompleteError("storsimple.BackupPoliciesCreateOrUpdateFuture")
  1219  		return
  1220  	}
  1221  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1222  	if bp.Response.Response, err = future.GetResult(sender); err == nil && bp.Response.Response.StatusCode != http.StatusNoContent {
  1223  		bp, err = client.CreateOrUpdateResponder(bp.Response.Response)
  1224  		if err != nil {
  1225  			err = autorest.NewErrorWithError(err, "storsimple.BackupPoliciesCreateOrUpdateFuture", "Result", bp.Response.Response, "Failure responding to request")
  1226  		}
  1227  	}
  1228  	return
  1229  }
  1230  
  1231  // BackupPoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  1232  // operation.
  1233  type BackupPoliciesDeleteFuture struct {
  1234  	azure.FutureAPI
  1235  	// Result returns the result of the asynchronous operation.
  1236  	// If the operation has not completed it will return an error.
  1237  	Result func(BackupPoliciesClient) (autorest.Response, error)
  1238  }
  1239  
  1240  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1241  func (future *BackupPoliciesDeleteFuture) UnmarshalJSON(body []byte) error {
  1242  	var azFuture azure.Future
  1243  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1244  		return err
  1245  	}
  1246  	future.FutureAPI = &azFuture
  1247  	future.Result = future.result
  1248  	return nil
  1249  }
  1250  
  1251  // result is the default implementation for BackupPoliciesDeleteFuture.Result.
  1252  func (future *BackupPoliciesDeleteFuture) result(client BackupPoliciesClient) (ar autorest.Response, err error) {
  1253  	var done bool
  1254  	done, err = future.DoneWithContext(context.Background(), client)
  1255  	if err != nil {
  1256  		err = autorest.NewErrorWithError(err, "storsimple.BackupPoliciesDeleteFuture", "Result", future.Response(), "Polling failure")
  1257  		return
  1258  	}
  1259  	if !done {
  1260  		ar.Response = future.Response()
  1261  		err = azure.NewAsyncOpIncompleteError("storsimple.BackupPoliciesDeleteFuture")
  1262  		return
  1263  	}
  1264  	ar.Response = future.Response()
  1265  	return
  1266  }
  1267  
  1268  // BackupPolicy the backup policy.
  1269  type BackupPolicy struct {
  1270  	autorest.Response `json:"-"`
  1271  	// BackupPolicyProperties - The properties of the backup policy.
  1272  	*BackupPolicyProperties `json:"properties,omitempty"`
  1273  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  1274  	ID *string `json:"id,omitempty"`
  1275  	// Name - READ-ONLY; The name of the object.
  1276  	Name *string `json:"name,omitempty"`
  1277  	// Type - READ-ONLY; The hierarchical type of the object.
  1278  	Type *string `json:"type,omitempty"`
  1279  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  1280  	Kind Kind `json:"kind,omitempty"`
  1281  }
  1282  
  1283  // MarshalJSON is the custom marshaler for BackupPolicy.
  1284  func (bp BackupPolicy) MarshalJSON() ([]byte, error) {
  1285  	objectMap := make(map[string]interface{})
  1286  	if bp.BackupPolicyProperties != nil {
  1287  		objectMap["properties"] = bp.BackupPolicyProperties
  1288  	}
  1289  	if bp.Kind != "" {
  1290  		objectMap["kind"] = bp.Kind
  1291  	}
  1292  	return json.Marshal(objectMap)
  1293  }
  1294  
  1295  // UnmarshalJSON is the custom unmarshaler for BackupPolicy struct.
  1296  func (bp *BackupPolicy) UnmarshalJSON(body []byte) error {
  1297  	var m map[string]*json.RawMessage
  1298  	err := json.Unmarshal(body, &m)
  1299  	if err != nil {
  1300  		return err
  1301  	}
  1302  	for k, v := range m {
  1303  		switch k {
  1304  		case "properties":
  1305  			if v != nil {
  1306  				var backupPolicyProperties BackupPolicyProperties
  1307  				err = json.Unmarshal(*v, &backupPolicyProperties)
  1308  				if err != nil {
  1309  					return err
  1310  				}
  1311  				bp.BackupPolicyProperties = &backupPolicyProperties
  1312  			}
  1313  		case "id":
  1314  			if v != nil {
  1315  				var ID string
  1316  				err = json.Unmarshal(*v, &ID)
  1317  				if err != nil {
  1318  					return err
  1319  				}
  1320  				bp.ID = &ID
  1321  			}
  1322  		case "name":
  1323  			if v != nil {
  1324  				var name string
  1325  				err = json.Unmarshal(*v, &name)
  1326  				if err != nil {
  1327  					return err
  1328  				}
  1329  				bp.Name = &name
  1330  			}
  1331  		case "type":
  1332  			if v != nil {
  1333  				var typeVar string
  1334  				err = json.Unmarshal(*v, &typeVar)
  1335  				if err != nil {
  1336  					return err
  1337  				}
  1338  				bp.Type = &typeVar
  1339  			}
  1340  		case "kind":
  1341  			if v != nil {
  1342  				var kind Kind
  1343  				err = json.Unmarshal(*v, &kind)
  1344  				if err != nil {
  1345  					return err
  1346  				}
  1347  				bp.Kind = kind
  1348  			}
  1349  		}
  1350  	}
  1351  
  1352  	return nil
  1353  }
  1354  
  1355  // BackupPolicyList the collection of backup policies.
  1356  type BackupPolicyList struct {
  1357  	autorest.Response `json:"-"`
  1358  	// Value - The value.
  1359  	Value *[]BackupPolicy `json:"value,omitempty"`
  1360  }
  1361  
  1362  // BackupPolicyProperties the properties of the backup policy.
  1363  type BackupPolicyProperties struct {
  1364  	// VolumeIds - The path IDs of the volumes which are part of the backup policy.
  1365  	VolumeIds *[]string `json:"volumeIds,omitempty"`
  1366  	// NextBackupTime - READ-ONLY; The time of the next backup for the backup policy.
  1367  	NextBackupTime *date.Time `json:"nextBackupTime,omitempty"`
  1368  	// LastBackupTime - READ-ONLY; The time of the last backup for the backup policy.
  1369  	LastBackupTime *date.Time `json:"lastBackupTime,omitempty"`
  1370  	// SchedulesCount - READ-ONLY; The count of schedules the backup policy contains.
  1371  	SchedulesCount *int64 `json:"schedulesCount,omitempty"`
  1372  	// ScheduledBackupStatus - READ-ONLY; Indicates whether at least one of the schedules in the backup policy is active or not. Possible values include: 'ScheduledBackupStatusDisabled', 'ScheduledBackupStatusEnabled'
  1373  	ScheduledBackupStatus ScheduledBackupStatus `json:"scheduledBackupStatus,omitempty"`
  1374  	// BackupPolicyCreationType - READ-ONLY; The backup policy creation type. Indicates whether this was created through SaaS or through StorSimple Snapshot Manager. Possible values include: 'BackupPolicyCreationTypeBySaaS', 'BackupPolicyCreationTypeBySSM'
  1375  	BackupPolicyCreationType BackupPolicyCreationType `json:"backupPolicyCreationType,omitempty"`
  1376  	// SsmHostName - READ-ONLY; If the backup policy was created by StorSimple Snapshot Manager, then this field indicates the hostname of the StorSimple Snapshot Manager.
  1377  	SsmHostName *string `json:"ssmHostName,omitempty"`
  1378  }
  1379  
  1380  // MarshalJSON is the custom marshaler for BackupPolicyProperties.
  1381  func (bpp BackupPolicyProperties) MarshalJSON() ([]byte, error) {
  1382  	objectMap := make(map[string]interface{})
  1383  	if bpp.VolumeIds != nil {
  1384  		objectMap["volumeIds"] = bpp.VolumeIds
  1385  	}
  1386  	return json.Marshal(objectMap)
  1387  }
  1388  
  1389  // BackupProperties the properties of the backup.
  1390  type BackupProperties struct {
  1391  	// CreatedOn - The time when the backup was created.
  1392  	CreatedOn *date.Time `json:"createdOn,omitempty"`
  1393  	// SizeInBytes - The backup size in bytes.
  1394  	SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
  1395  	// BackupType - The type of the backup. Possible values include: 'LocalSnapshot', 'CloudSnapshot'
  1396  	BackupType BackupType `json:"backupType,omitempty"`
  1397  	// BackupJobCreationType - The backup job creation type. Possible values include: 'Adhoc', 'BySchedule', 'BySSM'
  1398  	BackupJobCreationType BackupJobCreationType `json:"backupJobCreationType,omitempty"`
  1399  	// BackupPolicyID - The path ID of the backup policy.
  1400  	BackupPolicyID *string `json:"backupPolicyId,omitempty"`
  1401  	// SsmHostName - The StorSimple Snapshot Manager host name.
  1402  	SsmHostName *string `json:"ssmHostName,omitempty"`
  1403  	// Elements - The backup elements.
  1404  	Elements *[]BackupElement `json:"elements,omitempty"`
  1405  }
  1406  
  1407  // BackupSchedule the backup schedule.
  1408  type BackupSchedule struct {
  1409  	autorest.Response `json:"-"`
  1410  	// BackupScheduleProperties - The properties of the backup schedule.
  1411  	*BackupScheduleProperties `json:"properties,omitempty"`
  1412  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  1413  	ID *string `json:"id,omitempty"`
  1414  	// Name - READ-ONLY; The name of the object.
  1415  	Name *string `json:"name,omitempty"`
  1416  	// Type - READ-ONLY; The hierarchical type of the object.
  1417  	Type *string `json:"type,omitempty"`
  1418  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  1419  	Kind Kind `json:"kind,omitempty"`
  1420  }
  1421  
  1422  // MarshalJSON is the custom marshaler for BackupSchedule.
  1423  func (bs BackupSchedule) MarshalJSON() ([]byte, error) {
  1424  	objectMap := make(map[string]interface{})
  1425  	if bs.BackupScheduleProperties != nil {
  1426  		objectMap["properties"] = bs.BackupScheduleProperties
  1427  	}
  1428  	if bs.Kind != "" {
  1429  		objectMap["kind"] = bs.Kind
  1430  	}
  1431  	return json.Marshal(objectMap)
  1432  }
  1433  
  1434  // UnmarshalJSON is the custom unmarshaler for BackupSchedule struct.
  1435  func (bs *BackupSchedule) UnmarshalJSON(body []byte) error {
  1436  	var m map[string]*json.RawMessage
  1437  	err := json.Unmarshal(body, &m)
  1438  	if err != nil {
  1439  		return err
  1440  	}
  1441  	for k, v := range m {
  1442  		switch k {
  1443  		case "properties":
  1444  			if v != nil {
  1445  				var backupScheduleProperties BackupScheduleProperties
  1446  				err = json.Unmarshal(*v, &backupScheduleProperties)
  1447  				if err != nil {
  1448  					return err
  1449  				}
  1450  				bs.BackupScheduleProperties = &backupScheduleProperties
  1451  			}
  1452  		case "id":
  1453  			if v != nil {
  1454  				var ID string
  1455  				err = json.Unmarshal(*v, &ID)
  1456  				if err != nil {
  1457  					return err
  1458  				}
  1459  				bs.ID = &ID
  1460  			}
  1461  		case "name":
  1462  			if v != nil {
  1463  				var name string
  1464  				err = json.Unmarshal(*v, &name)
  1465  				if err != nil {
  1466  					return err
  1467  				}
  1468  				bs.Name = &name
  1469  			}
  1470  		case "type":
  1471  			if v != nil {
  1472  				var typeVar string
  1473  				err = json.Unmarshal(*v, &typeVar)
  1474  				if err != nil {
  1475  					return err
  1476  				}
  1477  				bs.Type = &typeVar
  1478  			}
  1479  		case "kind":
  1480  			if v != nil {
  1481  				var kind Kind
  1482  				err = json.Unmarshal(*v, &kind)
  1483  				if err != nil {
  1484  					return err
  1485  				}
  1486  				bs.Kind = kind
  1487  			}
  1488  		}
  1489  	}
  1490  
  1491  	return nil
  1492  }
  1493  
  1494  // BackupScheduleList the backup schedule list.
  1495  type BackupScheduleList struct {
  1496  	autorest.Response `json:"-"`
  1497  	// Value - The value.
  1498  	Value *[]BackupSchedule `json:"value,omitempty"`
  1499  }
  1500  
  1501  // BackupScheduleProperties the properties of the backup schedule.
  1502  type BackupScheduleProperties struct {
  1503  	// ScheduleRecurrence - The schedule recurrence.
  1504  	ScheduleRecurrence *ScheduleRecurrence `json:"scheduleRecurrence,omitempty"`
  1505  	// BackupType - The type of backup which needs to be taken. Possible values include: 'LocalSnapshot', 'CloudSnapshot'
  1506  	BackupType BackupType `json:"backupType,omitempty"`
  1507  	// RetentionCount - The number of backups to be retained.
  1508  	RetentionCount *int64 `json:"retentionCount,omitempty"`
  1509  	// StartTime - The start time of the schedule.
  1510  	StartTime *date.Time `json:"startTime,omitempty"`
  1511  	// ScheduleStatus - The schedule status. Possible values include: 'ScheduleStatusEnabled', 'ScheduleStatusDisabled'
  1512  	ScheduleStatus ScheduleStatus `json:"scheduleStatus,omitempty"`
  1513  	// LastSuccessfulRun - READ-ONLY; The last successful backup run which was triggered for the schedule.
  1514  	LastSuccessfulRun *date.Time `json:"lastSuccessfulRun,omitempty"`
  1515  }
  1516  
  1517  // MarshalJSON is the custom marshaler for BackupScheduleProperties.
  1518  func (bsp BackupScheduleProperties) MarshalJSON() ([]byte, error) {
  1519  	objectMap := make(map[string]interface{})
  1520  	if bsp.ScheduleRecurrence != nil {
  1521  		objectMap["scheduleRecurrence"] = bsp.ScheduleRecurrence
  1522  	}
  1523  	if bsp.BackupType != "" {
  1524  		objectMap["backupType"] = bsp.BackupType
  1525  	}
  1526  	if bsp.RetentionCount != nil {
  1527  		objectMap["retentionCount"] = bsp.RetentionCount
  1528  	}
  1529  	if bsp.StartTime != nil {
  1530  		objectMap["startTime"] = bsp.StartTime
  1531  	}
  1532  	if bsp.ScheduleStatus != "" {
  1533  		objectMap["scheduleStatus"] = bsp.ScheduleStatus
  1534  	}
  1535  	return json.Marshal(objectMap)
  1536  }
  1537  
  1538  // BackupSchedulesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1539  // long-running operation.
  1540  type BackupSchedulesCreateOrUpdateFuture struct {
  1541  	azure.FutureAPI
  1542  	// Result returns the result of the asynchronous operation.
  1543  	// If the operation has not completed it will return an error.
  1544  	Result func(BackupSchedulesClient) (BackupSchedule, error)
  1545  }
  1546  
  1547  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1548  func (future *BackupSchedulesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1549  	var azFuture azure.Future
  1550  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1551  		return err
  1552  	}
  1553  	future.FutureAPI = &azFuture
  1554  	future.Result = future.result
  1555  	return nil
  1556  }
  1557  
  1558  // result is the default implementation for BackupSchedulesCreateOrUpdateFuture.Result.
  1559  func (future *BackupSchedulesCreateOrUpdateFuture) result(client BackupSchedulesClient) (bs BackupSchedule, err error) {
  1560  	var done bool
  1561  	done, err = future.DoneWithContext(context.Background(), client)
  1562  	if err != nil {
  1563  		err = autorest.NewErrorWithError(err, "storsimple.BackupSchedulesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1564  		return
  1565  	}
  1566  	if !done {
  1567  		bs.Response.Response = future.Response()
  1568  		err = azure.NewAsyncOpIncompleteError("storsimple.BackupSchedulesCreateOrUpdateFuture")
  1569  		return
  1570  	}
  1571  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1572  	if bs.Response.Response, err = future.GetResult(sender); err == nil && bs.Response.Response.StatusCode != http.StatusNoContent {
  1573  		bs, err = client.CreateOrUpdateResponder(bs.Response.Response)
  1574  		if err != nil {
  1575  			err = autorest.NewErrorWithError(err, "storsimple.BackupSchedulesCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request")
  1576  		}
  1577  	}
  1578  	return
  1579  }
  1580  
  1581  // BackupSchedulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  1582  // operation.
  1583  type BackupSchedulesDeleteFuture struct {
  1584  	azure.FutureAPI
  1585  	// Result returns the result of the asynchronous operation.
  1586  	// If the operation has not completed it will return an error.
  1587  	Result func(BackupSchedulesClient) (autorest.Response, error)
  1588  }
  1589  
  1590  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1591  func (future *BackupSchedulesDeleteFuture) UnmarshalJSON(body []byte) error {
  1592  	var azFuture azure.Future
  1593  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1594  		return err
  1595  	}
  1596  	future.FutureAPI = &azFuture
  1597  	future.Result = future.result
  1598  	return nil
  1599  }
  1600  
  1601  // result is the default implementation for BackupSchedulesDeleteFuture.Result.
  1602  func (future *BackupSchedulesDeleteFuture) result(client BackupSchedulesClient) (ar autorest.Response, err error) {
  1603  	var done bool
  1604  	done, err = future.DoneWithContext(context.Background(), client)
  1605  	if err != nil {
  1606  		err = autorest.NewErrorWithError(err, "storsimple.BackupSchedulesDeleteFuture", "Result", future.Response(), "Polling failure")
  1607  		return
  1608  	}
  1609  	if !done {
  1610  		ar.Response = future.Response()
  1611  		err = azure.NewAsyncOpIncompleteError("storsimple.BackupSchedulesDeleteFuture")
  1612  		return
  1613  	}
  1614  	ar.Response = future.Response()
  1615  	return
  1616  }
  1617  
  1618  // BackupsCloneFuture an abstraction for monitoring and retrieving the results of a long-running operation.
  1619  type BackupsCloneFuture struct {
  1620  	azure.FutureAPI
  1621  	// Result returns the result of the asynchronous operation.
  1622  	// If the operation has not completed it will return an error.
  1623  	Result func(BackupsClient) (autorest.Response, error)
  1624  }
  1625  
  1626  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1627  func (future *BackupsCloneFuture) UnmarshalJSON(body []byte) error {
  1628  	var azFuture azure.Future
  1629  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1630  		return err
  1631  	}
  1632  	future.FutureAPI = &azFuture
  1633  	future.Result = future.result
  1634  	return nil
  1635  }
  1636  
  1637  // result is the default implementation for BackupsCloneFuture.Result.
  1638  func (future *BackupsCloneFuture) result(client BackupsClient) (ar autorest.Response, err error) {
  1639  	var done bool
  1640  	done, err = future.DoneWithContext(context.Background(), client)
  1641  	if err != nil {
  1642  		err = autorest.NewErrorWithError(err, "storsimple.BackupsCloneFuture", "Result", future.Response(), "Polling failure")
  1643  		return
  1644  	}
  1645  	if !done {
  1646  		ar.Response = future.Response()
  1647  		err = azure.NewAsyncOpIncompleteError("storsimple.BackupsCloneFuture")
  1648  		return
  1649  	}
  1650  	ar.Response = future.Response()
  1651  	return
  1652  }
  1653  
  1654  // BackupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  1655  // operation.
  1656  type BackupsDeleteFuture struct {
  1657  	azure.FutureAPI
  1658  	// Result returns the result of the asynchronous operation.
  1659  	// If the operation has not completed it will return an error.
  1660  	Result func(BackupsClient) (autorest.Response, error)
  1661  }
  1662  
  1663  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1664  func (future *BackupsDeleteFuture) UnmarshalJSON(body []byte) error {
  1665  	var azFuture azure.Future
  1666  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1667  		return err
  1668  	}
  1669  	future.FutureAPI = &azFuture
  1670  	future.Result = future.result
  1671  	return nil
  1672  }
  1673  
  1674  // result is the default implementation for BackupsDeleteFuture.Result.
  1675  func (future *BackupsDeleteFuture) result(client BackupsClient) (ar autorest.Response, err error) {
  1676  	var done bool
  1677  	done, err = future.DoneWithContext(context.Background(), client)
  1678  	if err != nil {
  1679  		err = autorest.NewErrorWithError(err, "storsimple.BackupsDeleteFuture", "Result", future.Response(), "Polling failure")
  1680  		return
  1681  	}
  1682  	if !done {
  1683  		ar.Response = future.Response()
  1684  		err = azure.NewAsyncOpIncompleteError("storsimple.BackupsDeleteFuture")
  1685  		return
  1686  	}
  1687  	ar.Response = future.Response()
  1688  	return
  1689  }
  1690  
  1691  // BackupsRestoreFuture an abstraction for monitoring and retrieving the results of a long-running
  1692  // operation.
  1693  type BackupsRestoreFuture struct {
  1694  	azure.FutureAPI
  1695  	// Result returns the result of the asynchronous operation.
  1696  	// If the operation has not completed it will return an error.
  1697  	Result func(BackupsClient) (autorest.Response, error)
  1698  }
  1699  
  1700  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1701  func (future *BackupsRestoreFuture) UnmarshalJSON(body []byte) error {
  1702  	var azFuture azure.Future
  1703  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1704  		return err
  1705  	}
  1706  	future.FutureAPI = &azFuture
  1707  	future.Result = future.result
  1708  	return nil
  1709  }
  1710  
  1711  // result is the default implementation for BackupsRestoreFuture.Result.
  1712  func (future *BackupsRestoreFuture) result(client BackupsClient) (ar autorest.Response, err error) {
  1713  	var done bool
  1714  	done, err = future.DoneWithContext(context.Background(), client)
  1715  	if err != nil {
  1716  		err = autorest.NewErrorWithError(err, "storsimple.BackupsRestoreFuture", "Result", future.Response(), "Polling failure")
  1717  		return
  1718  	}
  1719  	if !done {
  1720  		ar.Response = future.Response()
  1721  		err = azure.NewAsyncOpIncompleteError("storsimple.BackupsRestoreFuture")
  1722  		return
  1723  	}
  1724  	ar.Response = future.Response()
  1725  	return
  1726  }
  1727  
  1728  // BandwidthRateSettingProperties the properties of the bandwidth setting.
  1729  type BandwidthRateSettingProperties struct {
  1730  	// Schedules - The schedules.
  1731  	Schedules *[]BandwidthSchedule `json:"schedules,omitempty"`
  1732  	// VolumeCount - READ-ONLY; The number of volumes that uses the bandwidth setting.
  1733  	VolumeCount *int32 `json:"volumeCount,omitempty"`
  1734  }
  1735  
  1736  // MarshalJSON is the custom marshaler for BandwidthRateSettingProperties.
  1737  func (brsp BandwidthRateSettingProperties) MarshalJSON() ([]byte, error) {
  1738  	objectMap := make(map[string]interface{})
  1739  	if brsp.Schedules != nil {
  1740  		objectMap["schedules"] = brsp.Schedules
  1741  	}
  1742  	return json.Marshal(objectMap)
  1743  }
  1744  
  1745  // BandwidthSchedule the schedule for bandwidth setting.
  1746  type BandwidthSchedule struct {
  1747  	// Start - The start time of the schedule.
  1748  	Start *Time `json:"start,omitempty"`
  1749  	// Stop - The stop time of the schedule.
  1750  	Stop *Time `json:"stop,omitempty"`
  1751  	// RateInMbps - The rate in Mbps.
  1752  	RateInMbps *int32 `json:"rateInMbps,omitempty"`
  1753  	// Days - The days of the week when this schedule is applicable.
  1754  	Days *[]DayOfWeek `json:"days,omitempty"`
  1755  }
  1756  
  1757  // BandwidthSetting the bandwidth setting.
  1758  type BandwidthSetting struct {
  1759  	autorest.Response `json:"-"`
  1760  	// BandwidthRateSettingProperties - The properties of the bandwidth setting.
  1761  	*BandwidthRateSettingProperties `json:"properties,omitempty"`
  1762  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  1763  	ID *string `json:"id,omitempty"`
  1764  	// Name - READ-ONLY; The name of the object.
  1765  	Name *string `json:"name,omitempty"`
  1766  	// Type - READ-ONLY; The hierarchical type of the object.
  1767  	Type *string `json:"type,omitempty"`
  1768  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  1769  	Kind Kind `json:"kind,omitempty"`
  1770  }
  1771  
  1772  // MarshalJSON is the custom marshaler for BandwidthSetting.
  1773  func (bs BandwidthSetting) MarshalJSON() ([]byte, error) {
  1774  	objectMap := make(map[string]interface{})
  1775  	if bs.BandwidthRateSettingProperties != nil {
  1776  		objectMap["properties"] = bs.BandwidthRateSettingProperties
  1777  	}
  1778  	if bs.Kind != "" {
  1779  		objectMap["kind"] = bs.Kind
  1780  	}
  1781  	return json.Marshal(objectMap)
  1782  }
  1783  
  1784  // UnmarshalJSON is the custom unmarshaler for BandwidthSetting struct.
  1785  func (bs *BandwidthSetting) UnmarshalJSON(body []byte) error {
  1786  	var m map[string]*json.RawMessage
  1787  	err := json.Unmarshal(body, &m)
  1788  	if err != nil {
  1789  		return err
  1790  	}
  1791  	for k, v := range m {
  1792  		switch k {
  1793  		case "properties":
  1794  			if v != nil {
  1795  				var bandwidthRateSettingProperties BandwidthRateSettingProperties
  1796  				err = json.Unmarshal(*v, &bandwidthRateSettingProperties)
  1797  				if err != nil {
  1798  					return err
  1799  				}
  1800  				bs.BandwidthRateSettingProperties = &bandwidthRateSettingProperties
  1801  			}
  1802  		case "id":
  1803  			if v != nil {
  1804  				var ID string
  1805  				err = json.Unmarshal(*v, &ID)
  1806  				if err != nil {
  1807  					return err
  1808  				}
  1809  				bs.ID = &ID
  1810  			}
  1811  		case "name":
  1812  			if v != nil {
  1813  				var name string
  1814  				err = json.Unmarshal(*v, &name)
  1815  				if err != nil {
  1816  					return err
  1817  				}
  1818  				bs.Name = &name
  1819  			}
  1820  		case "type":
  1821  			if v != nil {
  1822  				var typeVar string
  1823  				err = json.Unmarshal(*v, &typeVar)
  1824  				if err != nil {
  1825  					return err
  1826  				}
  1827  				bs.Type = &typeVar
  1828  			}
  1829  		case "kind":
  1830  			if v != nil {
  1831  				var kind Kind
  1832  				err = json.Unmarshal(*v, &kind)
  1833  				if err != nil {
  1834  					return err
  1835  				}
  1836  				bs.Kind = kind
  1837  			}
  1838  		}
  1839  	}
  1840  
  1841  	return nil
  1842  }
  1843  
  1844  // BandwidthSettingList the collection of bandwidth setting entities.
  1845  type BandwidthSettingList struct {
  1846  	autorest.Response `json:"-"`
  1847  	// Value - The value.
  1848  	Value *[]BandwidthSetting `json:"value,omitempty"`
  1849  }
  1850  
  1851  // BandwidthSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1852  // long-running operation.
  1853  type BandwidthSettingsCreateOrUpdateFuture struct {
  1854  	azure.FutureAPI
  1855  	// Result returns the result of the asynchronous operation.
  1856  	// If the operation has not completed it will return an error.
  1857  	Result func(BandwidthSettingsClient) (BandwidthSetting, error)
  1858  }
  1859  
  1860  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1861  func (future *BandwidthSettingsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1862  	var azFuture azure.Future
  1863  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1864  		return err
  1865  	}
  1866  	future.FutureAPI = &azFuture
  1867  	future.Result = future.result
  1868  	return nil
  1869  }
  1870  
  1871  // result is the default implementation for BandwidthSettingsCreateOrUpdateFuture.Result.
  1872  func (future *BandwidthSettingsCreateOrUpdateFuture) result(client BandwidthSettingsClient) (bs BandwidthSetting, err error) {
  1873  	var done bool
  1874  	done, err = future.DoneWithContext(context.Background(), client)
  1875  	if err != nil {
  1876  		err = autorest.NewErrorWithError(err, "storsimple.BandwidthSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1877  		return
  1878  	}
  1879  	if !done {
  1880  		bs.Response.Response = future.Response()
  1881  		err = azure.NewAsyncOpIncompleteError("storsimple.BandwidthSettingsCreateOrUpdateFuture")
  1882  		return
  1883  	}
  1884  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1885  	if bs.Response.Response, err = future.GetResult(sender); err == nil && bs.Response.Response.StatusCode != http.StatusNoContent {
  1886  		bs, err = client.CreateOrUpdateResponder(bs.Response.Response)
  1887  		if err != nil {
  1888  			err = autorest.NewErrorWithError(err, "storsimple.BandwidthSettingsCreateOrUpdateFuture", "Result", bs.Response.Response, "Failure responding to request")
  1889  		}
  1890  	}
  1891  	return
  1892  }
  1893  
  1894  // BandwidthSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  1895  // operation.
  1896  type BandwidthSettingsDeleteFuture struct {
  1897  	azure.FutureAPI
  1898  	// Result returns the result of the asynchronous operation.
  1899  	// If the operation has not completed it will return an error.
  1900  	Result func(BandwidthSettingsClient) (autorest.Response, error)
  1901  }
  1902  
  1903  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1904  func (future *BandwidthSettingsDeleteFuture) UnmarshalJSON(body []byte) error {
  1905  	var azFuture azure.Future
  1906  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1907  		return err
  1908  	}
  1909  	future.FutureAPI = &azFuture
  1910  	future.Result = future.result
  1911  	return nil
  1912  }
  1913  
  1914  // result is the default implementation for BandwidthSettingsDeleteFuture.Result.
  1915  func (future *BandwidthSettingsDeleteFuture) result(client BandwidthSettingsClient) (ar autorest.Response, err error) {
  1916  	var done bool
  1917  	done, err = future.DoneWithContext(context.Background(), client)
  1918  	if err != nil {
  1919  		err = autorest.NewErrorWithError(err, "storsimple.BandwidthSettingsDeleteFuture", "Result", future.Response(), "Polling failure")
  1920  		return
  1921  	}
  1922  	if !done {
  1923  		ar.Response = future.Response()
  1924  		err = azure.NewAsyncOpIncompleteError("storsimple.BandwidthSettingsDeleteFuture")
  1925  		return
  1926  	}
  1927  	ar.Response = future.Response()
  1928  	return
  1929  }
  1930  
  1931  // BaseModel represents the base class for all other ARM object models
  1932  type BaseModel struct {
  1933  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  1934  	ID *string `json:"id,omitempty"`
  1935  	// Name - READ-ONLY; The name of the object.
  1936  	Name *string `json:"name,omitempty"`
  1937  	// Type - READ-ONLY; The hierarchical type of the object.
  1938  	Type *string `json:"type,omitempty"`
  1939  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  1940  	Kind Kind `json:"kind,omitempty"`
  1941  }
  1942  
  1943  // MarshalJSON is the custom marshaler for BaseModel.
  1944  func (bm BaseModel) MarshalJSON() ([]byte, error) {
  1945  	objectMap := make(map[string]interface{})
  1946  	if bm.Kind != "" {
  1947  		objectMap["kind"] = bm.Kind
  1948  	}
  1949  	return json.Marshal(objectMap)
  1950  }
  1951  
  1952  // ChapSettings the Challenge-Handshake Authentication Protocol (CHAP) settings.
  1953  type ChapSettings struct {
  1954  	// InitiatorUser - The CHAP initiator user.
  1955  	InitiatorUser *string `json:"initiatorUser,omitempty"`
  1956  	// InitiatorSecret - The CHAP initiator secret.
  1957  	InitiatorSecret *AsymmetricEncryptedSecret `json:"initiatorSecret,omitempty"`
  1958  	// TargetUser - The CHAP target user.
  1959  	TargetUser *string `json:"targetUser,omitempty"`
  1960  	// TargetSecret - The target secret.
  1961  	TargetSecret *AsymmetricEncryptedSecret `json:"targetSecret,omitempty"`
  1962  }
  1963  
  1964  // ClearAlertRequest the request for clearing the alert
  1965  type ClearAlertRequest struct {
  1966  	// ResolutionMessage - The resolution message while clearing the alert
  1967  	ResolutionMessage *string `json:"resolutionMessage,omitempty"`
  1968  	// Alerts - The list of alert IDs to be cleared
  1969  	Alerts *[]string `json:"alerts,omitempty"`
  1970  }
  1971  
  1972  // CloneRequest the clone job request.
  1973  type CloneRequest struct {
  1974  	// TargetDeviceID - The path ID of the device which will act as the clone target.
  1975  	TargetDeviceID *string `json:"targetDeviceId,omitempty"`
  1976  	// TargetVolumeName - The name of the new volume which will be created and the backup will be cloned into.
  1977  	TargetVolumeName *string `json:"targetVolumeName,omitempty"`
  1978  	// TargetAccessControlRecordIds - The list of path IDs of the access control records to be associated to the new cloned volume.
  1979  	TargetAccessControlRecordIds *[]string `json:"targetAccessControlRecordIds,omitempty"`
  1980  	// BackupElement - The backup element that is cloned.
  1981  	BackupElement *BackupElement `json:"backupElement,omitempty"`
  1982  }
  1983  
  1984  // CloudAppliance the cloud appliance.
  1985  type CloudAppliance struct {
  1986  	// Name - The name.
  1987  	Name *string `json:"name,omitempty"`
  1988  	// VnetName - The name of the virtual network.
  1989  	VnetName *string `json:"vnetName,omitempty"`
  1990  	// VnetRegion - The virtual network region.
  1991  	VnetRegion *string `json:"vnetRegion,omitempty"`
  1992  	// IsVnetDNSConfigured - Indicates whether virtual network used is configured with DNS or not.
  1993  	IsVnetDNSConfigured *bool `json:"isVnetDnsConfigured,omitempty"`
  1994  	// IsVnetExpressConfigured - Indicates whether virtual network used is configured with express route or not.
  1995  	IsVnetExpressConfigured *bool `json:"isVnetExpressConfigured,omitempty"`
  1996  	// SubnetName - The name of the subnet.
  1997  	SubnetName *string `json:"subnetName,omitempty"`
  1998  	// StorageAccountName - The name of the storage account.
  1999  	StorageAccountName *string `json:"storageAccountName,omitempty"`
  2000  	// StorageAccountType - The type of the storage account.
  2001  	StorageAccountType *string `json:"storageAccountType,omitempty"`
  2002  	// VMType - The type of the virtual machine.
  2003  	VMType *string `json:"vmType,omitempty"`
  2004  	// VMImageName - The name of the virtual machine image.
  2005  	VMImageName *string `json:"vmImageName,omitempty"`
  2006  	// ModelNumber - The model number.
  2007  	ModelNumber *string `json:"modelNumber,omitempty"`
  2008  }
  2009  
  2010  // CloudApplianceConfiguration the cloud appliance configuration
  2011  type CloudApplianceConfiguration struct {
  2012  	// CloudApplianceConfigurationProperties - The properties.
  2013  	*CloudApplianceConfigurationProperties `json:"properties,omitempty"`
  2014  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  2015  	ID *string `json:"id,omitempty"`
  2016  	// Name - READ-ONLY; The name of the object.
  2017  	Name *string `json:"name,omitempty"`
  2018  	// Type - READ-ONLY; The hierarchical type of the object.
  2019  	Type *string `json:"type,omitempty"`
  2020  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  2021  	Kind Kind `json:"kind,omitempty"`
  2022  }
  2023  
  2024  // MarshalJSON is the custom marshaler for CloudApplianceConfiguration.
  2025  func (cac CloudApplianceConfiguration) MarshalJSON() ([]byte, error) {
  2026  	objectMap := make(map[string]interface{})
  2027  	if cac.CloudApplianceConfigurationProperties != nil {
  2028  		objectMap["properties"] = cac.CloudApplianceConfigurationProperties
  2029  	}
  2030  	if cac.Kind != "" {
  2031  		objectMap["kind"] = cac.Kind
  2032  	}
  2033  	return json.Marshal(objectMap)
  2034  }
  2035  
  2036  // UnmarshalJSON is the custom unmarshaler for CloudApplianceConfiguration struct.
  2037  func (cac *CloudApplianceConfiguration) UnmarshalJSON(body []byte) error {
  2038  	var m map[string]*json.RawMessage
  2039  	err := json.Unmarshal(body, &m)
  2040  	if err != nil {
  2041  		return err
  2042  	}
  2043  	for k, v := range m {
  2044  		switch k {
  2045  		case "properties":
  2046  			if v != nil {
  2047  				var cloudApplianceConfigurationProperties CloudApplianceConfigurationProperties
  2048  				err = json.Unmarshal(*v, &cloudApplianceConfigurationProperties)
  2049  				if err != nil {
  2050  					return err
  2051  				}
  2052  				cac.CloudApplianceConfigurationProperties = &cloudApplianceConfigurationProperties
  2053  			}
  2054  		case "id":
  2055  			if v != nil {
  2056  				var ID string
  2057  				err = json.Unmarshal(*v, &ID)
  2058  				if err != nil {
  2059  					return err
  2060  				}
  2061  				cac.ID = &ID
  2062  			}
  2063  		case "name":
  2064  			if v != nil {
  2065  				var name string
  2066  				err = json.Unmarshal(*v, &name)
  2067  				if err != nil {
  2068  					return err
  2069  				}
  2070  				cac.Name = &name
  2071  			}
  2072  		case "type":
  2073  			if v != nil {
  2074  				var typeVar string
  2075  				err = json.Unmarshal(*v, &typeVar)
  2076  				if err != nil {
  2077  					return err
  2078  				}
  2079  				cac.Type = &typeVar
  2080  			}
  2081  		case "kind":
  2082  			if v != nil {
  2083  				var kind Kind
  2084  				err = json.Unmarshal(*v, &kind)
  2085  				if err != nil {
  2086  					return err
  2087  				}
  2088  				cac.Kind = kind
  2089  			}
  2090  		}
  2091  	}
  2092  
  2093  	return nil
  2094  }
  2095  
  2096  // CloudApplianceConfigurationList the cloud appliance configuration list
  2097  type CloudApplianceConfigurationList struct {
  2098  	autorest.Response `json:"-"`
  2099  	// Value - The value.
  2100  	Value *[]CloudApplianceConfiguration `json:"value,omitempty"`
  2101  }
  2102  
  2103  // CloudApplianceConfigurationProperties the properties of cloud appliance configuration.
  2104  type CloudApplianceConfigurationProperties struct {
  2105  	// ModelNumber - The model number.
  2106  	ModelNumber *string `json:"modelNumber,omitempty"`
  2107  	// CloudPlatform - The cloud platform.
  2108  	CloudPlatform *string `json:"cloudPlatform,omitempty"`
  2109  	// AcsConfiguration - The ACS configuration.
  2110  	AcsConfiguration *AcsConfiguration `json:"acsConfiguration,omitempty"`
  2111  	// SupportedStorageAccountTypes - The supported storage account types.
  2112  	SupportedStorageAccountTypes *[]string `json:"supportedStorageAccountTypes,omitempty"`
  2113  	// SupportedRegions - The supported regions.
  2114  	SupportedRegions *[]string `json:"supportedRegions,omitempty"`
  2115  	// SupportedVMTypes - The supported virtual machine types.
  2116  	SupportedVMTypes *[]string `json:"supportedVmTypes,omitempty"`
  2117  	// SupportedVMImages - The supported virtual machine images.
  2118  	SupportedVMImages *[]VMImage `json:"supportedVmImages,omitempty"`
  2119  }
  2120  
  2121  // CloudApplianceSettings the cloud appliance settings.
  2122  type CloudApplianceSettings struct {
  2123  	// ServiceDataEncryptionKey - The service data encryption key (encrypted with DAK).
  2124  	ServiceDataEncryptionKey *AsymmetricEncryptedSecret `json:"serviceDataEncryptionKey,omitempty"`
  2125  	// ChannelIntegrityKey - The channel integrity key (encrypted with DAK).
  2126  	ChannelIntegrityKey *AsymmetricEncryptedSecret `json:"channelIntegrityKey,omitempty"`
  2127  }
  2128  
  2129  // CloudAppliancesProvisionFuture an abstraction for monitoring and retrieving the results of a
  2130  // long-running operation.
  2131  type CloudAppliancesProvisionFuture struct {
  2132  	azure.FutureAPI
  2133  	// Result returns the result of the asynchronous operation.
  2134  	// If the operation has not completed it will return an error.
  2135  	Result func(CloudAppliancesClient) (autorest.Response, error)
  2136  }
  2137  
  2138  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2139  func (future *CloudAppliancesProvisionFuture) UnmarshalJSON(body []byte) error {
  2140  	var azFuture azure.Future
  2141  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2142  		return err
  2143  	}
  2144  	future.FutureAPI = &azFuture
  2145  	future.Result = future.result
  2146  	return nil
  2147  }
  2148  
  2149  // result is the default implementation for CloudAppliancesProvisionFuture.Result.
  2150  func (future *CloudAppliancesProvisionFuture) result(client CloudAppliancesClient) (ar autorest.Response, err error) {
  2151  	var done bool
  2152  	done, err = future.DoneWithContext(context.Background(), client)
  2153  	if err != nil {
  2154  		err = autorest.NewErrorWithError(err, "storsimple.CloudAppliancesProvisionFuture", "Result", future.Response(), "Polling failure")
  2155  		return
  2156  	}
  2157  	if !done {
  2158  		ar.Response = future.Response()
  2159  		err = azure.NewAsyncOpIncompleteError("storsimple.CloudAppliancesProvisionFuture")
  2160  		return
  2161  	}
  2162  	ar.Response = future.Response()
  2163  	return
  2164  }
  2165  
  2166  // ConfigureDeviceRequest the mandatory device configuration request.
  2167  type ConfigureDeviceRequest struct {
  2168  	// ConfigureDeviceRequestProperties - The properties of the configure device request.
  2169  	*ConfigureDeviceRequestProperties `json:"properties,omitempty"`
  2170  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  2171  	ID *string `json:"id,omitempty"`
  2172  	// Name - READ-ONLY; The name of the object.
  2173  	Name *string `json:"name,omitempty"`
  2174  	// Type - READ-ONLY; The hierarchical type of the object.
  2175  	Type *string `json:"type,omitempty"`
  2176  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  2177  	Kind Kind `json:"kind,omitempty"`
  2178  }
  2179  
  2180  // MarshalJSON is the custom marshaler for ConfigureDeviceRequest.
  2181  func (cdr ConfigureDeviceRequest) MarshalJSON() ([]byte, error) {
  2182  	objectMap := make(map[string]interface{})
  2183  	if cdr.ConfigureDeviceRequestProperties != nil {
  2184  		objectMap["properties"] = cdr.ConfigureDeviceRequestProperties
  2185  	}
  2186  	if cdr.Kind != "" {
  2187  		objectMap["kind"] = cdr.Kind
  2188  	}
  2189  	return json.Marshal(objectMap)
  2190  }
  2191  
  2192  // UnmarshalJSON is the custom unmarshaler for ConfigureDeviceRequest struct.
  2193  func (cdr *ConfigureDeviceRequest) UnmarshalJSON(body []byte) error {
  2194  	var m map[string]*json.RawMessage
  2195  	err := json.Unmarshal(body, &m)
  2196  	if err != nil {
  2197  		return err
  2198  	}
  2199  	for k, v := range m {
  2200  		switch k {
  2201  		case "properties":
  2202  			if v != nil {
  2203  				var configureDeviceRequestProperties ConfigureDeviceRequestProperties
  2204  				err = json.Unmarshal(*v, &configureDeviceRequestProperties)
  2205  				if err != nil {
  2206  					return err
  2207  				}
  2208  				cdr.ConfigureDeviceRequestProperties = &configureDeviceRequestProperties
  2209  			}
  2210  		case "id":
  2211  			if v != nil {
  2212  				var ID string
  2213  				err = json.Unmarshal(*v, &ID)
  2214  				if err != nil {
  2215  					return err
  2216  				}
  2217  				cdr.ID = &ID
  2218  			}
  2219  		case "name":
  2220  			if v != nil {
  2221  				var name string
  2222  				err = json.Unmarshal(*v, &name)
  2223  				if err != nil {
  2224  					return err
  2225  				}
  2226  				cdr.Name = &name
  2227  			}
  2228  		case "type":
  2229  			if v != nil {
  2230  				var typeVar string
  2231  				err = json.Unmarshal(*v, &typeVar)
  2232  				if err != nil {
  2233  					return err
  2234  				}
  2235  				cdr.Type = &typeVar
  2236  			}
  2237  		case "kind":
  2238  			if v != nil {
  2239  				var kind Kind
  2240  				err = json.Unmarshal(*v, &kind)
  2241  				if err != nil {
  2242  					return err
  2243  				}
  2244  				cdr.Kind = kind
  2245  			}
  2246  		}
  2247  	}
  2248  
  2249  	return nil
  2250  }
  2251  
  2252  // ConfigureDeviceRequestProperties the properties of the configure device request.
  2253  type ConfigureDeviceRequestProperties struct {
  2254  	// FriendlyName - The friendly name for the device.
  2255  	FriendlyName *string `json:"friendlyName,omitempty"`
  2256  	// CurrentDeviceName - The current name of the device.
  2257  	CurrentDeviceName *string `json:"currentDeviceName,omitempty"`
  2258  	// TimeZone - The device time zone. For eg: "Pacific Standard Time"
  2259  	TimeZone *string `json:"timeZone,omitempty"`
  2260  	// DNSSettings - The secondary DNS Settings of the device.
  2261  	DNSSettings *SecondaryDNSSettings `json:"dnsSettings,omitempty"`
  2262  	// NetworkInterfaceData0Settings - The 'Data 0' network interface card settings.
  2263  	NetworkInterfaceData0Settings *NetworkInterfaceData0Settings `json:"networkInterfaceData0Settings,omitempty"`
  2264  }
  2265  
  2266  // ControllerPowerStateChangeRequest the controller power state change request.
  2267  type ControllerPowerStateChangeRequest struct {
  2268  	// ControllerPowerStateChangeRequestProperties - The properties of the controller power state change request.
  2269  	*ControllerPowerStateChangeRequestProperties `json:"properties,omitempty"`
  2270  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  2271  	ID *string `json:"id,omitempty"`
  2272  	// Name - READ-ONLY; The name of the object.
  2273  	Name *string `json:"name,omitempty"`
  2274  	// Type - READ-ONLY; The hierarchical type of the object.
  2275  	Type *string `json:"type,omitempty"`
  2276  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  2277  	Kind Kind `json:"kind,omitempty"`
  2278  }
  2279  
  2280  // MarshalJSON is the custom marshaler for ControllerPowerStateChangeRequest.
  2281  func (cpscr ControllerPowerStateChangeRequest) MarshalJSON() ([]byte, error) {
  2282  	objectMap := make(map[string]interface{})
  2283  	if cpscr.ControllerPowerStateChangeRequestProperties != nil {
  2284  		objectMap["properties"] = cpscr.ControllerPowerStateChangeRequestProperties
  2285  	}
  2286  	if cpscr.Kind != "" {
  2287  		objectMap["kind"] = cpscr.Kind
  2288  	}
  2289  	return json.Marshal(objectMap)
  2290  }
  2291  
  2292  // UnmarshalJSON is the custom unmarshaler for ControllerPowerStateChangeRequest struct.
  2293  func (cpscr *ControllerPowerStateChangeRequest) UnmarshalJSON(body []byte) error {
  2294  	var m map[string]*json.RawMessage
  2295  	err := json.Unmarshal(body, &m)
  2296  	if err != nil {
  2297  		return err
  2298  	}
  2299  	for k, v := range m {
  2300  		switch k {
  2301  		case "properties":
  2302  			if v != nil {
  2303  				var controllerPowerStateChangeRequestProperties ControllerPowerStateChangeRequestProperties
  2304  				err = json.Unmarshal(*v, &controllerPowerStateChangeRequestProperties)
  2305  				if err != nil {
  2306  					return err
  2307  				}
  2308  				cpscr.ControllerPowerStateChangeRequestProperties = &controllerPowerStateChangeRequestProperties
  2309  			}
  2310  		case "id":
  2311  			if v != nil {
  2312  				var ID string
  2313  				err = json.Unmarshal(*v, &ID)
  2314  				if err != nil {
  2315  					return err
  2316  				}
  2317  				cpscr.ID = &ID
  2318  			}
  2319  		case "name":
  2320  			if v != nil {
  2321  				var name string
  2322  				err = json.Unmarshal(*v, &name)
  2323  				if err != nil {
  2324  					return err
  2325  				}
  2326  				cpscr.Name = &name
  2327  			}
  2328  		case "type":
  2329  			if v != nil {
  2330  				var typeVar string
  2331  				err = json.Unmarshal(*v, &typeVar)
  2332  				if err != nil {
  2333  					return err
  2334  				}
  2335  				cpscr.Type = &typeVar
  2336  			}
  2337  		case "kind":
  2338  			if v != nil {
  2339  				var kind Kind
  2340  				err = json.Unmarshal(*v, &kind)
  2341  				if err != nil {
  2342  					return err
  2343  				}
  2344  				cpscr.Kind = kind
  2345  			}
  2346  		}
  2347  	}
  2348  
  2349  	return nil
  2350  }
  2351  
  2352  // ControllerPowerStateChangeRequestProperties the properties of the controller power state change request.
  2353  type ControllerPowerStateChangeRequestProperties struct {
  2354  	// Action - The power state that the request is expecting for the controller of the device. Possible values include: 'Start', 'Restart', 'Shutdown'
  2355  	Action ControllerPowerStateAction `json:"action,omitempty"`
  2356  	// ActiveController - The active controller that the request is expecting on the device. Possible values include: 'ControllerIDUnknown', 'ControllerIDNone', 'ControllerIDController0', 'ControllerIDController1'
  2357  	ActiveController ControllerID `json:"activeController,omitempty"`
  2358  	// Controller0State - The controller 0's status that the request is expecting on the device. Possible values include: 'ControllerStatusNotPresent', 'ControllerStatusPoweredOff', 'ControllerStatusOk', 'ControllerStatusRecovering', 'ControllerStatusWarning', 'ControllerStatusFailure'
  2359  	Controller0State ControllerStatus `json:"controller0State,omitempty"`
  2360  	// Controller1State - The controller 1's status that the request is expecting on the device. Possible values include: 'ControllerStatusNotPresent', 'ControllerStatusPoweredOff', 'ControllerStatusOk', 'ControllerStatusRecovering', 'ControllerStatusWarning', 'ControllerStatusFailure'
  2361  	Controller1State ControllerStatus `json:"controller1State,omitempty"`
  2362  }
  2363  
  2364  // DataStatistics the additional details related to the data related statistics of a job. Currently
  2365  // applicable only for Backup, Clone and Restore jobs.
  2366  type DataStatistics struct {
  2367  	// TotalData - The total bytes of data to be processed, as part of the job.
  2368  	TotalData *int64 `json:"totalData,omitempty"`
  2369  	// ProcessedData - The number of bytes of data processed till now, as part of the job.
  2370  	ProcessedData *int64 `json:"processedData,omitempty"`
  2371  	// CloudData - The number of bytes of data written to cloud, as part of the job.
  2372  	CloudData *int64 `json:"cloudData,omitempty"`
  2373  	// Throughput - The average throughput of data processed(bytes/sec), as part of the job.
  2374  	Throughput *int64 `json:"throughput,omitempty"`
  2375  }
  2376  
  2377  // Device the StorSimple device.
  2378  type Device struct {
  2379  	autorest.Response `json:"-"`
  2380  	// DeviceProperties - The properties of the StorSimple device.
  2381  	*DeviceProperties `json:"properties,omitempty"`
  2382  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  2383  	ID *string `json:"id,omitempty"`
  2384  	// Name - READ-ONLY; The name of the object.
  2385  	Name *string `json:"name,omitempty"`
  2386  	// Type - READ-ONLY; The hierarchical type of the object.
  2387  	Type *string `json:"type,omitempty"`
  2388  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  2389  	Kind Kind `json:"kind,omitempty"`
  2390  }
  2391  
  2392  // MarshalJSON is the custom marshaler for Device.
  2393  func (d Device) MarshalJSON() ([]byte, error) {
  2394  	objectMap := make(map[string]interface{})
  2395  	if d.DeviceProperties != nil {
  2396  		objectMap["properties"] = d.DeviceProperties
  2397  	}
  2398  	if d.Kind != "" {
  2399  		objectMap["kind"] = d.Kind
  2400  	}
  2401  	return json.Marshal(objectMap)
  2402  }
  2403  
  2404  // UnmarshalJSON is the custom unmarshaler for Device struct.
  2405  func (d *Device) UnmarshalJSON(body []byte) error {
  2406  	var m map[string]*json.RawMessage
  2407  	err := json.Unmarshal(body, &m)
  2408  	if err != nil {
  2409  		return err
  2410  	}
  2411  	for k, v := range m {
  2412  		switch k {
  2413  		case "properties":
  2414  			if v != nil {
  2415  				var deviceProperties DeviceProperties
  2416  				err = json.Unmarshal(*v, &deviceProperties)
  2417  				if err != nil {
  2418  					return err
  2419  				}
  2420  				d.DeviceProperties = &deviceProperties
  2421  			}
  2422  		case "id":
  2423  			if v != nil {
  2424  				var ID string
  2425  				err = json.Unmarshal(*v, &ID)
  2426  				if err != nil {
  2427  					return err
  2428  				}
  2429  				d.ID = &ID
  2430  			}
  2431  		case "name":
  2432  			if v != nil {
  2433  				var name string
  2434  				err = json.Unmarshal(*v, &name)
  2435  				if err != nil {
  2436  					return err
  2437  				}
  2438  				d.Name = &name
  2439  			}
  2440  		case "type":
  2441  			if v != nil {
  2442  				var typeVar string
  2443  				err = json.Unmarshal(*v, &typeVar)
  2444  				if err != nil {
  2445  					return err
  2446  				}
  2447  				d.Type = &typeVar
  2448  			}
  2449  		case "kind":
  2450  			if v != nil {
  2451  				var kind Kind
  2452  				err = json.Unmarshal(*v, &kind)
  2453  				if err != nil {
  2454  					return err
  2455  				}
  2456  				d.Kind = kind
  2457  			}
  2458  		}
  2459  	}
  2460  
  2461  	return nil
  2462  }
  2463  
  2464  // DeviceDetails the additional device details regarding the end point count and volume container count.
  2465  type DeviceDetails struct {
  2466  	// EndpointCount - The total number of endpoints that are currently on the device ( i.e. number of volumes).
  2467  	EndpointCount *int32 `json:"endpointCount,omitempty"`
  2468  	// VolumeContainerCount - The total number of volume containers on the device.
  2469  	VolumeContainerCount *int32 `json:"volumeContainerCount,omitempty"`
  2470  }
  2471  
  2472  // DeviceList the collection of devices.
  2473  type DeviceList struct {
  2474  	autorest.Response `json:"-"`
  2475  	// Value - The value.
  2476  	Value *[]Device `json:"value,omitempty"`
  2477  }
  2478  
  2479  // DevicePatch the device patch.
  2480  type DevicePatch struct {
  2481  	// DevicePatchProperties - The properties of the device patch.
  2482  	*DevicePatchProperties `json:"properties,omitempty"`
  2483  }
  2484  
  2485  // MarshalJSON is the custom marshaler for DevicePatch.
  2486  func (dp DevicePatch) MarshalJSON() ([]byte, error) {
  2487  	objectMap := make(map[string]interface{})
  2488  	if dp.DevicePatchProperties != nil {
  2489  		objectMap["properties"] = dp.DevicePatchProperties
  2490  	}
  2491  	return json.Marshal(objectMap)
  2492  }
  2493  
  2494  // UnmarshalJSON is the custom unmarshaler for DevicePatch struct.
  2495  func (dp *DevicePatch) UnmarshalJSON(body []byte) error {
  2496  	var m map[string]*json.RawMessage
  2497  	err := json.Unmarshal(body, &m)
  2498  	if err != nil {
  2499  		return err
  2500  	}
  2501  	for k, v := range m {
  2502  		switch k {
  2503  		case "properties":
  2504  			if v != nil {
  2505  				var devicePatchProperties DevicePatchProperties
  2506  				err = json.Unmarshal(*v, &devicePatchProperties)
  2507  				if err != nil {
  2508  					return err
  2509  				}
  2510  				dp.DevicePatchProperties = &devicePatchProperties
  2511  			}
  2512  		}
  2513  	}
  2514  
  2515  	return nil
  2516  }
  2517  
  2518  // DevicePatchProperties the properties of the device patch.
  2519  type DevicePatchProperties struct {
  2520  	// DeviceDescription - Short description given for the device
  2521  	DeviceDescription *string `json:"deviceDescription,omitempty"`
  2522  }
  2523  
  2524  // DeviceProperties the properties of the StorSimple device.
  2525  type DeviceProperties struct {
  2526  	// FriendlyName - The friendly name of the device.
  2527  	FriendlyName *string `json:"friendlyName,omitempty"`
  2528  	// ActivationTime - The UTC time at which the device was activated
  2529  	ActivationTime *date.Time `json:"activationTime,omitempty"`
  2530  	// Culture - The language culture setting on the device. For eg: "en-US"
  2531  	Culture *string `json:"culture,omitempty"`
  2532  	// DeviceDescription - The device description.
  2533  	DeviceDescription *string `json:"deviceDescription,omitempty"`
  2534  	// DeviceSoftwareVersion - The version number of the software running on the device.
  2535  	DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"`
  2536  	// FriendlySoftwareName - The friendly name of the software running on the device.
  2537  	FriendlySoftwareName *string `json:"friendlySoftwareName,omitempty"`
  2538  	// DeviceConfigurationStatus - The current configuration status of the device. Possible values include: 'Complete', 'Pending'
  2539  	DeviceConfigurationStatus DeviceConfigurationStatus `json:"deviceConfigurationStatus,omitempty"`
  2540  	// TargetIqn - The target IQN.
  2541  	TargetIqn *string `json:"targetIqn,omitempty"`
  2542  	// ModelDescription - The device model.
  2543  	ModelDescription *string `json:"modelDescription,omitempty"`
  2544  	// Status - The current status of the device. Possible values include: 'Unknown', 'Online', 'Offline', 'Deactivated', 'RequiresAttention', 'MaintenanceMode', 'Creating', 'Provisioning', 'Deactivating', 'Deleted', 'ReadyToSetup'
  2545  	Status DeviceStatus `json:"status,omitempty"`
  2546  	// SerialNumber - The serial number.
  2547  	SerialNumber *string `json:"serialNumber,omitempty"`
  2548  	// DeviceType - The type of the device. Possible values include: 'DeviceTypeInvalid', 'DeviceTypeSeries8000VirtualAppliance', 'DeviceTypeSeries8000PhysicalAppliance'
  2549  	DeviceType DeviceType `json:"deviceType,omitempty"`
  2550  	// ActiveController - The identifier of the active controller of the device. Possible values include: 'ControllerIDUnknown', 'ControllerIDNone', 'ControllerIDController0', 'ControllerIDController1'
  2551  	ActiveController ControllerID `json:"activeController,omitempty"`
  2552  	// FriendlySoftwareVersion - The device friendly software version.
  2553  	FriendlySoftwareVersion *string `json:"friendlySoftwareVersion,omitempty"`
  2554  	// AvailableLocalStorageInBytes - The storage in bytes that is available locally on the device.
  2555  	AvailableLocalStorageInBytes *int64 `json:"availableLocalStorageInBytes,omitempty"`
  2556  	// AvailableTieredStorageInBytes - The storage in bytes that is available on the device for tiered volumes.
  2557  	AvailableTieredStorageInBytes *int64 `json:"availableTieredStorageInBytes,omitempty"`
  2558  	// ProvisionedTieredStorageInBytes - The storage in bytes that has been provisioned on the device for tiered volumes.
  2559  	ProvisionedTieredStorageInBytes *int64 `json:"provisionedTieredStorageInBytes,omitempty"`
  2560  	// ProvisionedLocalStorageInBytes - The storage in bytes used for locally pinned volumes on the device (including additional local reservation).
  2561  	ProvisionedLocalStorageInBytes *int64 `json:"provisionedLocalStorageInBytes,omitempty"`
  2562  	// ProvisionedVolumeSizeInBytes - Total capacity in bytes of tiered and locally pinned volumes on the device
  2563  	ProvisionedVolumeSizeInBytes *int64 `json:"provisionedVolumeSizeInBytes,omitempty"`
  2564  	// UsingStorageInBytes - The storage in bytes that is currently being used on the device, including both local and cloud.
  2565  	UsingStorageInBytes *int64 `json:"usingStorageInBytes,omitempty"`
  2566  	// TotalTieredStorageInBytes - The total tiered storage available on the device in bytes.
  2567  	TotalTieredStorageInBytes *int64 `json:"totalTieredStorageInBytes,omitempty"`
  2568  	// AgentGroupVersion - The device agent group version.
  2569  	AgentGroupVersion *int32 `json:"agentGroupVersion,omitempty"`
  2570  	// NetworkInterfaceCardCount - The number of network interface cards
  2571  	NetworkInterfaceCardCount *int32 `json:"networkInterfaceCardCount,omitempty"`
  2572  	// DeviceLocation - The location of the virtual appliance.
  2573  	DeviceLocation *string `json:"deviceLocation,omitempty"`
  2574  	// VirtualMachineAPIType - READ-ONLY; The virtual machine API type. Possible values include: 'Classic', 'Arm'
  2575  	VirtualMachineAPIType VirtualMachineAPIType `json:"virtualMachineApiType,omitempty"`
  2576  	// Details - The additional device details regarding the end point count and volume container count.
  2577  	Details *DeviceDetails `json:"details,omitempty"`
  2578  	// RolloverDetails - The additional device details for the service data encryption key rollover.
  2579  	RolloverDetails *DeviceRolloverDetails `json:"rolloverDetails,omitempty"`
  2580  }
  2581  
  2582  // MarshalJSON is the custom marshaler for DeviceProperties.
  2583  func (dp DeviceProperties) MarshalJSON() ([]byte, error) {
  2584  	objectMap := make(map[string]interface{})
  2585  	if dp.FriendlyName != nil {
  2586  		objectMap["friendlyName"] = dp.FriendlyName
  2587  	}
  2588  	if dp.ActivationTime != nil {
  2589  		objectMap["activationTime"] = dp.ActivationTime
  2590  	}
  2591  	if dp.Culture != nil {
  2592  		objectMap["culture"] = dp.Culture
  2593  	}
  2594  	if dp.DeviceDescription != nil {
  2595  		objectMap["deviceDescription"] = dp.DeviceDescription
  2596  	}
  2597  	if dp.DeviceSoftwareVersion != nil {
  2598  		objectMap["deviceSoftwareVersion"] = dp.DeviceSoftwareVersion
  2599  	}
  2600  	if dp.FriendlySoftwareName != nil {
  2601  		objectMap["friendlySoftwareName"] = dp.FriendlySoftwareName
  2602  	}
  2603  	if dp.DeviceConfigurationStatus != "" {
  2604  		objectMap["deviceConfigurationStatus"] = dp.DeviceConfigurationStatus
  2605  	}
  2606  	if dp.TargetIqn != nil {
  2607  		objectMap["targetIqn"] = dp.TargetIqn
  2608  	}
  2609  	if dp.ModelDescription != nil {
  2610  		objectMap["modelDescription"] = dp.ModelDescription
  2611  	}
  2612  	if dp.Status != "" {
  2613  		objectMap["status"] = dp.Status
  2614  	}
  2615  	if dp.SerialNumber != nil {
  2616  		objectMap["serialNumber"] = dp.SerialNumber
  2617  	}
  2618  	if dp.DeviceType != "" {
  2619  		objectMap["deviceType"] = dp.DeviceType
  2620  	}
  2621  	if dp.ActiveController != "" {
  2622  		objectMap["activeController"] = dp.ActiveController
  2623  	}
  2624  	if dp.FriendlySoftwareVersion != nil {
  2625  		objectMap["friendlySoftwareVersion"] = dp.FriendlySoftwareVersion
  2626  	}
  2627  	if dp.AvailableLocalStorageInBytes != nil {
  2628  		objectMap["availableLocalStorageInBytes"] = dp.AvailableLocalStorageInBytes
  2629  	}
  2630  	if dp.AvailableTieredStorageInBytes != nil {
  2631  		objectMap["availableTieredStorageInBytes"] = dp.AvailableTieredStorageInBytes
  2632  	}
  2633  	if dp.ProvisionedTieredStorageInBytes != nil {
  2634  		objectMap["provisionedTieredStorageInBytes"] = dp.ProvisionedTieredStorageInBytes
  2635  	}
  2636  	if dp.ProvisionedLocalStorageInBytes != nil {
  2637  		objectMap["provisionedLocalStorageInBytes"] = dp.ProvisionedLocalStorageInBytes
  2638  	}
  2639  	if dp.ProvisionedVolumeSizeInBytes != nil {
  2640  		objectMap["provisionedVolumeSizeInBytes"] = dp.ProvisionedVolumeSizeInBytes
  2641  	}
  2642  	if dp.UsingStorageInBytes != nil {
  2643  		objectMap["usingStorageInBytes"] = dp.UsingStorageInBytes
  2644  	}
  2645  	if dp.TotalTieredStorageInBytes != nil {
  2646  		objectMap["totalTieredStorageInBytes"] = dp.TotalTieredStorageInBytes
  2647  	}
  2648  	if dp.AgentGroupVersion != nil {
  2649  		objectMap["agentGroupVersion"] = dp.AgentGroupVersion
  2650  	}
  2651  	if dp.NetworkInterfaceCardCount != nil {
  2652  		objectMap["networkInterfaceCardCount"] = dp.NetworkInterfaceCardCount
  2653  	}
  2654  	if dp.DeviceLocation != nil {
  2655  		objectMap["deviceLocation"] = dp.DeviceLocation
  2656  	}
  2657  	if dp.Details != nil {
  2658  		objectMap["details"] = dp.Details
  2659  	}
  2660  	if dp.RolloverDetails != nil {
  2661  		objectMap["rolloverDetails"] = dp.RolloverDetails
  2662  	}
  2663  	return json.Marshal(objectMap)
  2664  }
  2665  
  2666  // DeviceRolloverDetails the additional device details for the service data encryption key rollover.
  2667  type DeviceRolloverDetails struct {
  2668  	// AuthorizationEligibility - The eligibility status of device for service data encryption key rollover. Possible values include: 'InEligible', 'Eligible'
  2669  	AuthorizationEligibility AuthorizationEligibility `json:"authorizationEligibility,omitempty"`
  2670  	// AuthorizationStatus - The authorization status of the device for service data encryption key rollover. Possible values include: 'AuthorizationStatusDisabled', 'AuthorizationStatusEnabled'
  2671  	AuthorizationStatus AuthorizationStatus `json:"authorizationStatus,omitempty"`
  2672  	// InEligibilityReason - The reason for inEligibility of device, in case it's not eligible for service data encryption key rollover. Possible values include: 'DeviceNotOnline', 'NotSupportedAppliance', 'RolloverPending'
  2673  	InEligibilityReason InEligibilityCategory `json:"inEligibilityReason,omitempty"`
  2674  }
  2675  
  2676  // DevicesConfigureFuture an abstraction for monitoring and retrieving the results of a long-running
  2677  // operation.
  2678  type DevicesConfigureFuture struct {
  2679  	azure.FutureAPI
  2680  	// Result returns the result of the asynchronous operation.
  2681  	// If the operation has not completed it will return an error.
  2682  	Result func(DevicesClient) (autorest.Response, error)
  2683  }
  2684  
  2685  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2686  func (future *DevicesConfigureFuture) UnmarshalJSON(body []byte) error {
  2687  	var azFuture azure.Future
  2688  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2689  		return err
  2690  	}
  2691  	future.FutureAPI = &azFuture
  2692  	future.Result = future.result
  2693  	return nil
  2694  }
  2695  
  2696  // result is the default implementation for DevicesConfigureFuture.Result.
  2697  func (future *DevicesConfigureFuture) result(client DevicesClient) (ar autorest.Response, err error) {
  2698  	var done bool
  2699  	done, err = future.DoneWithContext(context.Background(), client)
  2700  	if err != nil {
  2701  		err = autorest.NewErrorWithError(err, "storsimple.DevicesConfigureFuture", "Result", future.Response(), "Polling failure")
  2702  		return
  2703  	}
  2704  	if !done {
  2705  		ar.Response = future.Response()
  2706  		err = azure.NewAsyncOpIncompleteError("storsimple.DevicesConfigureFuture")
  2707  		return
  2708  	}
  2709  	ar.Response = future.Response()
  2710  	return
  2711  }
  2712  
  2713  // DevicesDeactivateFuture an abstraction for monitoring and retrieving the results of a long-running
  2714  // operation.
  2715  type DevicesDeactivateFuture struct {
  2716  	azure.FutureAPI
  2717  	// Result returns the result of the asynchronous operation.
  2718  	// If the operation has not completed it will return an error.
  2719  	Result func(DevicesClient) (autorest.Response, error)
  2720  }
  2721  
  2722  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2723  func (future *DevicesDeactivateFuture) UnmarshalJSON(body []byte) error {
  2724  	var azFuture azure.Future
  2725  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2726  		return err
  2727  	}
  2728  	future.FutureAPI = &azFuture
  2729  	future.Result = future.result
  2730  	return nil
  2731  }
  2732  
  2733  // result is the default implementation for DevicesDeactivateFuture.Result.
  2734  func (future *DevicesDeactivateFuture) result(client DevicesClient) (ar autorest.Response, err error) {
  2735  	var done bool
  2736  	done, err = future.DoneWithContext(context.Background(), client)
  2737  	if err != nil {
  2738  		err = autorest.NewErrorWithError(err, "storsimple.DevicesDeactivateFuture", "Result", future.Response(), "Polling failure")
  2739  		return
  2740  	}
  2741  	if !done {
  2742  		ar.Response = future.Response()
  2743  		err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDeactivateFuture")
  2744  		return
  2745  	}
  2746  	ar.Response = future.Response()
  2747  	return
  2748  }
  2749  
  2750  // DevicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  2751  // operation.
  2752  type DevicesDeleteFuture struct {
  2753  	azure.FutureAPI
  2754  	// Result returns the result of the asynchronous operation.
  2755  	// If the operation has not completed it will return an error.
  2756  	Result func(DevicesClient) (autorest.Response, error)
  2757  }
  2758  
  2759  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2760  func (future *DevicesDeleteFuture) UnmarshalJSON(body []byte) error {
  2761  	var azFuture azure.Future
  2762  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2763  		return err
  2764  	}
  2765  	future.FutureAPI = &azFuture
  2766  	future.Result = future.result
  2767  	return nil
  2768  }
  2769  
  2770  // result is the default implementation for DevicesDeleteFuture.Result.
  2771  func (future *DevicesDeleteFuture) result(client DevicesClient) (ar autorest.Response, err error) {
  2772  	var done bool
  2773  	done, err = future.DoneWithContext(context.Background(), client)
  2774  	if err != nil {
  2775  		err = autorest.NewErrorWithError(err, "storsimple.DevicesDeleteFuture", "Result", future.Response(), "Polling failure")
  2776  		return
  2777  	}
  2778  	if !done {
  2779  		ar.Response = future.Response()
  2780  		err = azure.NewAsyncOpIncompleteError("storsimple.DevicesDeleteFuture")
  2781  		return
  2782  	}
  2783  	ar.Response = future.Response()
  2784  	return
  2785  }
  2786  
  2787  // DeviceSettingsCreateOrUpdateAlertSettingsFuture an abstraction for monitoring and retrieving the results
  2788  // of a long-running operation.
  2789  type DeviceSettingsCreateOrUpdateAlertSettingsFuture struct {
  2790  	azure.FutureAPI
  2791  	// Result returns the result of the asynchronous operation.
  2792  	// If the operation has not completed it will return an error.
  2793  	Result func(DeviceSettingsClient) (AlertSettings, error)
  2794  }
  2795  
  2796  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2797  func (future *DeviceSettingsCreateOrUpdateAlertSettingsFuture) UnmarshalJSON(body []byte) error {
  2798  	var azFuture azure.Future
  2799  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2800  		return err
  2801  	}
  2802  	future.FutureAPI = &azFuture
  2803  	future.Result = future.result
  2804  	return nil
  2805  }
  2806  
  2807  // result is the default implementation for DeviceSettingsCreateOrUpdateAlertSettingsFuture.Result.
  2808  func (future *DeviceSettingsCreateOrUpdateAlertSettingsFuture) result(client DeviceSettingsClient) (as AlertSettings, err error) {
  2809  	var done bool
  2810  	done, err = future.DoneWithContext(context.Background(), client)
  2811  	if err != nil {
  2812  		err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsCreateOrUpdateAlertSettingsFuture", "Result", future.Response(), "Polling failure")
  2813  		return
  2814  	}
  2815  	if !done {
  2816  		as.Response.Response = future.Response()
  2817  		err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsCreateOrUpdateAlertSettingsFuture")
  2818  		return
  2819  	}
  2820  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2821  	if as.Response.Response, err = future.GetResult(sender); err == nil && as.Response.Response.StatusCode != http.StatusNoContent {
  2822  		as, err = client.CreateOrUpdateAlertSettingsResponder(as.Response.Response)
  2823  		if err != nil {
  2824  			err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsCreateOrUpdateAlertSettingsFuture", "Result", as.Response.Response, "Failure responding to request")
  2825  		}
  2826  	}
  2827  	return
  2828  }
  2829  
  2830  // DeviceSettingsCreateOrUpdateTimeSettingsFuture an abstraction for monitoring and retrieving the results
  2831  // of a long-running operation.
  2832  type DeviceSettingsCreateOrUpdateTimeSettingsFuture struct {
  2833  	azure.FutureAPI
  2834  	// Result returns the result of the asynchronous operation.
  2835  	// If the operation has not completed it will return an error.
  2836  	Result func(DeviceSettingsClient) (TimeSettings, error)
  2837  }
  2838  
  2839  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2840  func (future *DeviceSettingsCreateOrUpdateTimeSettingsFuture) UnmarshalJSON(body []byte) error {
  2841  	var azFuture azure.Future
  2842  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2843  		return err
  2844  	}
  2845  	future.FutureAPI = &azFuture
  2846  	future.Result = future.result
  2847  	return nil
  2848  }
  2849  
  2850  // result is the default implementation for DeviceSettingsCreateOrUpdateTimeSettingsFuture.Result.
  2851  func (future *DeviceSettingsCreateOrUpdateTimeSettingsFuture) result(client DeviceSettingsClient) (ts TimeSettings, err error) {
  2852  	var done bool
  2853  	done, err = future.DoneWithContext(context.Background(), client)
  2854  	if err != nil {
  2855  		err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsCreateOrUpdateTimeSettingsFuture", "Result", future.Response(), "Polling failure")
  2856  		return
  2857  	}
  2858  	if !done {
  2859  		ts.Response.Response = future.Response()
  2860  		err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsCreateOrUpdateTimeSettingsFuture")
  2861  		return
  2862  	}
  2863  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2864  	if ts.Response.Response, err = future.GetResult(sender); err == nil && ts.Response.Response.StatusCode != http.StatusNoContent {
  2865  		ts, err = client.CreateOrUpdateTimeSettingsResponder(ts.Response.Response)
  2866  		if err != nil {
  2867  			err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsCreateOrUpdateTimeSettingsFuture", "Result", ts.Response.Response, "Failure responding to request")
  2868  		}
  2869  	}
  2870  	return
  2871  }
  2872  
  2873  // DeviceSettingsSyncRemotemanagementCertificateFuture an abstraction for monitoring and retrieving the
  2874  // results of a long-running operation.
  2875  type DeviceSettingsSyncRemotemanagementCertificateFuture struct {
  2876  	azure.FutureAPI
  2877  	// Result returns the result of the asynchronous operation.
  2878  	// If the operation has not completed it will return an error.
  2879  	Result func(DeviceSettingsClient) (autorest.Response, error)
  2880  }
  2881  
  2882  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2883  func (future *DeviceSettingsSyncRemotemanagementCertificateFuture) UnmarshalJSON(body []byte) error {
  2884  	var azFuture azure.Future
  2885  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2886  		return err
  2887  	}
  2888  	future.FutureAPI = &azFuture
  2889  	future.Result = future.result
  2890  	return nil
  2891  }
  2892  
  2893  // result is the default implementation for DeviceSettingsSyncRemotemanagementCertificateFuture.Result.
  2894  func (future *DeviceSettingsSyncRemotemanagementCertificateFuture) result(client DeviceSettingsClient) (ar autorest.Response, err error) {
  2895  	var done bool
  2896  	done, err = future.DoneWithContext(context.Background(), client)
  2897  	if err != nil {
  2898  		err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsSyncRemotemanagementCertificateFuture", "Result", future.Response(), "Polling failure")
  2899  		return
  2900  	}
  2901  	if !done {
  2902  		ar.Response = future.Response()
  2903  		err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsSyncRemotemanagementCertificateFuture")
  2904  		return
  2905  	}
  2906  	ar.Response = future.Response()
  2907  	return
  2908  }
  2909  
  2910  // DeviceSettingsUpdateNetworkSettingsFuture an abstraction for monitoring and retrieving the results of a
  2911  // long-running operation.
  2912  type DeviceSettingsUpdateNetworkSettingsFuture struct {
  2913  	azure.FutureAPI
  2914  	// Result returns the result of the asynchronous operation.
  2915  	// If the operation has not completed it will return an error.
  2916  	Result func(DeviceSettingsClient) (NetworkSettings, error)
  2917  }
  2918  
  2919  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2920  func (future *DeviceSettingsUpdateNetworkSettingsFuture) UnmarshalJSON(body []byte) error {
  2921  	var azFuture azure.Future
  2922  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2923  		return err
  2924  	}
  2925  	future.FutureAPI = &azFuture
  2926  	future.Result = future.result
  2927  	return nil
  2928  }
  2929  
  2930  // result is the default implementation for DeviceSettingsUpdateNetworkSettingsFuture.Result.
  2931  func (future *DeviceSettingsUpdateNetworkSettingsFuture) result(client DeviceSettingsClient) (ns NetworkSettings, err error) {
  2932  	var done bool
  2933  	done, err = future.DoneWithContext(context.Background(), client)
  2934  	if err != nil {
  2935  		err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsUpdateNetworkSettingsFuture", "Result", future.Response(), "Polling failure")
  2936  		return
  2937  	}
  2938  	if !done {
  2939  		ns.Response.Response = future.Response()
  2940  		err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsUpdateNetworkSettingsFuture")
  2941  		return
  2942  	}
  2943  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2944  	if ns.Response.Response, err = future.GetResult(sender); err == nil && ns.Response.Response.StatusCode != http.StatusNoContent {
  2945  		ns, err = client.UpdateNetworkSettingsResponder(ns.Response.Response)
  2946  		if err != nil {
  2947  			err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsUpdateNetworkSettingsFuture", "Result", ns.Response.Response, "Failure responding to request")
  2948  		}
  2949  	}
  2950  	return
  2951  }
  2952  
  2953  // DeviceSettingsUpdateSecuritySettingsFuture an abstraction for monitoring and retrieving the results of a
  2954  // long-running operation.
  2955  type DeviceSettingsUpdateSecuritySettingsFuture struct {
  2956  	azure.FutureAPI
  2957  	// Result returns the result of the asynchronous operation.
  2958  	// If the operation has not completed it will return an error.
  2959  	Result func(DeviceSettingsClient) (SecuritySettings, error)
  2960  }
  2961  
  2962  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  2963  func (future *DeviceSettingsUpdateSecuritySettingsFuture) UnmarshalJSON(body []byte) error {
  2964  	var azFuture azure.Future
  2965  	if err := json.Unmarshal(body, &azFuture); err != nil {
  2966  		return err
  2967  	}
  2968  	future.FutureAPI = &azFuture
  2969  	future.Result = future.result
  2970  	return nil
  2971  }
  2972  
  2973  // result is the default implementation for DeviceSettingsUpdateSecuritySettingsFuture.Result.
  2974  func (future *DeviceSettingsUpdateSecuritySettingsFuture) result(client DeviceSettingsClient) (ss SecuritySettings, err error) {
  2975  	var done bool
  2976  	done, err = future.DoneWithContext(context.Background(), client)
  2977  	if err != nil {
  2978  		err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsUpdateSecuritySettingsFuture", "Result", future.Response(), "Polling failure")
  2979  		return
  2980  	}
  2981  	if !done {
  2982  		ss.Response.Response = future.Response()
  2983  		err = azure.NewAsyncOpIncompleteError("storsimple.DeviceSettingsUpdateSecuritySettingsFuture")
  2984  		return
  2985  	}
  2986  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  2987  	if ss.Response.Response, err = future.GetResult(sender); err == nil && ss.Response.Response.StatusCode != http.StatusNoContent {
  2988  		ss, err = client.UpdateSecuritySettingsResponder(ss.Response.Response)
  2989  		if err != nil {
  2990  			err = autorest.NewErrorWithError(err, "storsimple.DeviceSettingsUpdateSecuritySettingsFuture", "Result", ss.Response.Response, "Failure responding to request")
  2991  		}
  2992  	}
  2993  	return
  2994  }
  2995  
  2996  // DevicesFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
  2997  // operation.
  2998  type DevicesFailoverFuture struct {
  2999  	azure.FutureAPI
  3000  	// Result returns the result of the asynchronous operation.
  3001  	// If the operation has not completed it will return an error.
  3002  	Result func(DevicesClient) (autorest.Response, error)
  3003  }
  3004  
  3005  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3006  func (future *DevicesFailoverFuture) UnmarshalJSON(body []byte) error {
  3007  	var azFuture azure.Future
  3008  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3009  		return err
  3010  	}
  3011  	future.FutureAPI = &azFuture
  3012  	future.Result = future.result
  3013  	return nil
  3014  }
  3015  
  3016  // result is the default implementation for DevicesFailoverFuture.Result.
  3017  func (future *DevicesFailoverFuture) result(client DevicesClient) (ar autorest.Response, err error) {
  3018  	var done bool
  3019  	done, err = future.DoneWithContext(context.Background(), client)
  3020  	if err != nil {
  3021  		err = autorest.NewErrorWithError(err, "storsimple.DevicesFailoverFuture", "Result", future.Response(), "Polling failure")
  3022  		return
  3023  	}
  3024  	if !done {
  3025  		ar.Response = future.Response()
  3026  		err = azure.NewAsyncOpIncompleteError("storsimple.DevicesFailoverFuture")
  3027  		return
  3028  	}
  3029  	ar.Response = future.Response()
  3030  	return
  3031  }
  3032  
  3033  // DevicesInstallUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running
  3034  // operation.
  3035  type DevicesInstallUpdatesFuture struct {
  3036  	azure.FutureAPI
  3037  	// Result returns the result of the asynchronous operation.
  3038  	// If the operation has not completed it will return an error.
  3039  	Result func(DevicesClient) (autorest.Response, error)
  3040  }
  3041  
  3042  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3043  func (future *DevicesInstallUpdatesFuture) UnmarshalJSON(body []byte) error {
  3044  	var azFuture azure.Future
  3045  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3046  		return err
  3047  	}
  3048  	future.FutureAPI = &azFuture
  3049  	future.Result = future.result
  3050  	return nil
  3051  }
  3052  
  3053  // result is the default implementation for DevicesInstallUpdatesFuture.Result.
  3054  func (future *DevicesInstallUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) {
  3055  	var done bool
  3056  	done, err = future.DoneWithContext(context.Background(), client)
  3057  	if err != nil {
  3058  		err = autorest.NewErrorWithError(err, "storsimple.DevicesInstallUpdatesFuture", "Result", future.Response(), "Polling failure")
  3059  		return
  3060  	}
  3061  	if !done {
  3062  		ar.Response = future.Response()
  3063  		err = azure.NewAsyncOpIncompleteError("storsimple.DevicesInstallUpdatesFuture")
  3064  		return
  3065  	}
  3066  	ar.Response = future.Response()
  3067  	return
  3068  }
  3069  
  3070  // DevicesScanForUpdatesFuture an abstraction for monitoring and retrieving the results of a long-running
  3071  // operation.
  3072  type DevicesScanForUpdatesFuture struct {
  3073  	azure.FutureAPI
  3074  	// Result returns the result of the asynchronous operation.
  3075  	// If the operation has not completed it will return an error.
  3076  	Result func(DevicesClient) (autorest.Response, error)
  3077  }
  3078  
  3079  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3080  func (future *DevicesScanForUpdatesFuture) UnmarshalJSON(body []byte) error {
  3081  	var azFuture azure.Future
  3082  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3083  		return err
  3084  	}
  3085  	future.FutureAPI = &azFuture
  3086  	future.Result = future.result
  3087  	return nil
  3088  }
  3089  
  3090  // result is the default implementation for DevicesScanForUpdatesFuture.Result.
  3091  func (future *DevicesScanForUpdatesFuture) result(client DevicesClient) (ar autorest.Response, err error) {
  3092  	var done bool
  3093  	done, err = future.DoneWithContext(context.Background(), client)
  3094  	if err != nil {
  3095  		err = autorest.NewErrorWithError(err, "storsimple.DevicesScanForUpdatesFuture", "Result", future.Response(), "Polling failure")
  3096  		return
  3097  	}
  3098  	if !done {
  3099  		ar.Response = future.Response()
  3100  		err = azure.NewAsyncOpIncompleteError("storsimple.DevicesScanForUpdatesFuture")
  3101  		return
  3102  	}
  3103  	ar.Response = future.Response()
  3104  	return
  3105  }
  3106  
  3107  // DimensionFilter the dimension filter.
  3108  type DimensionFilter struct {
  3109  	// Name - Specifies the dimension name. E.g., NetworkInterface. Valid values are the ones specified in the field "dimensions" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property.
  3110  	Name *string `json:"name,omitempty"`
  3111  	// Values - Specifies the dimension value. E.g., Data0. Valid values are the ones returned in the field "dimensions" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property.
  3112  	Values *string `json:"values,omitempty"`
  3113  }
  3114  
  3115  // DNSSettings the DNS(Domain Name Server) settings of a device.
  3116  type DNSSettings struct {
  3117  	// PrimaryDNSServer - The primary IPv4 DNS server for the device
  3118  	PrimaryDNSServer *string `json:"primaryDnsServer,omitempty"`
  3119  	// PrimaryIpv6DNSServer - The primary IPv6 DNS server for the device
  3120  	PrimaryIpv6DNSServer *string `json:"primaryIpv6DnsServer,omitempty"`
  3121  	// SecondaryDNSServers - The secondary IPv4 DNS server for the device
  3122  	SecondaryDNSServers *[]string `json:"secondaryDnsServers,omitempty"`
  3123  	// SecondaryIpv6DNSServers - The secondary IPv6 DNS server for the device
  3124  	SecondaryIpv6DNSServers *[]string `json:"secondaryIpv6DnsServers,omitempty"`
  3125  }
  3126  
  3127  // EncryptionSettings the encryption settings.
  3128  type EncryptionSettings struct {
  3129  	autorest.Response `json:"-"`
  3130  	// EncryptionSettingsProperties - The properties of the encryption settings.
  3131  	*EncryptionSettingsProperties `json:"properties,omitempty"`
  3132  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  3133  	ID *string `json:"id,omitempty"`
  3134  	// Name - READ-ONLY; The name of the object.
  3135  	Name *string `json:"name,omitempty"`
  3136  	// Type - READ-ONLY; The hierarchical type of the object.
  3137  	Type *string `json:"type,omitempty"`
  3138  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  3139  	Kind Kind `json:"kind,omitempty"`
  3140  }
  3141  
  3142  // MarshalJSON is the custom marshaler for EncryptionSettings.
  3143  func (es EncryptionSettings) MarshalJSON() ([]byte, error) {
  3144  	objectMap := make(map[string]interface{})
  3145  	if es.EncryptionSettingsProperties != nil {
  3146  		objectMap["properties"] = es.EncryptionSettingsProperties
  3147  	}
  3148  	if es.Kind != "" {
  3149  		objectMap["kind"] = es.Kind
  3150  	}
  3151  	return json.Marshal(objectMap)
  3152  }
  3153  
  3154  // UnmarshalJSON is the custom unmarshaler for EncryptionSettings struct.
  3155  func (es *EncryptionSettings) UnmarshalJSON(body []byte) error {
  3156  	var m map[string]*json.RawMessage
  3157  	err := json.Unmarshal(body, &m)
  3158  	if err != nil {
  3159  		return err
  3160  	}
  3161  	for k, v := range m {
  3162  		switch k {
  3163  		case "properties":
  3164  			if v != nil {
  3165  				var encryptionSettingsProperties EncryptionSettingsProperties
  3166  				err = json.Unmarshal(*v, &encryptionSettingsProperties)
  3167  				if err != nil {
  3168  					return err
  3169  				}
  3170  				es.EncryptionSettingsProperties = &encryptionSettingsProperties
  3171  			}
  3172  		case "id":
  3173  			if v != nil {
  3174  				var ID string
  3175  				err = json.Unmarshal(*v, &ID)
  3176  				if err != nil {
  3177  					return err
  3178  				}
  3179  				es.ID = &ID
  3180  			}
  3181  		case "name":
  3182  			if v != nil {
  3183  				var name string
  3184  				err = json.Unmarshal(*v, &name)
  3185  				if err != nil {
  3186  					return err
  3187  				}
  3188  				es.Name = &name
  3189  			}
  3190  		case "type":
  3191  			if v != nil {
  3192  				var typeVar string
  3193  				err = json.Unmarshal(*v, &typeVar)
  3194  				if err != nil {
  3195  					return err
  3196  				}
  3197  				es.Type = &typeVar
  3198  			}
  3199  		case "kind":
  3200  			if v != nil {
  3201  				var kind Kind
  3202  				err = json.Unmarshal(*v, &kind)
  3203  				if err != nil {
  3204  					return err
  3205  				}
  3206  				es.Kind = kind
  3207  			}
  3208  		}
  3209  	}
  3210  
  3211  	return nil
  3212  }
  3213  
  3214  // EncryptionSettingsProperties the properties of encryption settings.
  3215  type EncryptionSettingsProperties struct {
  3216  	// EncryptionStatus - The encryption status to indicates if encryption is enabled or not. Possible values include: 'EncryptionStatusEnabled', 'EncryptionStatusDisabled'
  3217  	EncryptionStatus EncryptionStatus `json:"encryptionStatus,omitempty"`
  3218  	// KeyRolloverStatus - The key rollover status to indicates if key rollover is required or not. If secret's encryption has been upgraded, then it requires key rollover. Possible values include: 'Required', 'NotRequired'
  3219  	KeyRolloverStatus KeyRolloverStatus `json:"keyRolloverStatus,omitempty"`
  3220  }
  3221  
  3222  // FailoverRequest the request object for triggering a failover of volume containers, from a source device
  3223  // to a target device.
  3224  type FailoverRequest struct {
  3225  	// TargetDeviceID - The ARM path ID of the device which will act as the failover target.
  3226  	TargetDeviceID *string `json:"targetDeviceId,omitempty"`
  3227  	// VolumeContainers - The list of path IDs of the volume containers which needs to be failed-over to the target device.
  3228  	VolumeContainers *[]string `json:"volumeContainers,omitempty"`
  3229  }
  3230  
  3231  // FailoverSet the failover set on a device.
  3232  type FailoverSet struct {
  3233  	// VolumeContainers - The list of meta data of volume containers, which are part of the failover set.
  3234  	VolumeContainers *[]VolumeContainerFailoverMetadata `json:"volumeContainers,omitempty"`
  3235  	// EligibilityResult - The eligibility result of the failover set, for failover.
  3236  	EligibilityResult *FailoverSetEligibilityResult `json:"eligibilityResult,omitempty"`
  3237  }
  3238  
  3239  // FailoverSetEligibilityResult the eligibility result of failover set, for failover.
  3240  type FailoverSetEligibilityResult struct {
  3241  	// IsEligibleForFailover - Represents if this failover set is eligible for failover or not.
  3242  	IsEligibleForFailover *bool `json:"isEligibleForFailover,omitempty"`
  3243  	// ErrorMessage - The error message, if the failover set is not eligible for failover.
  3244  	ErrorMessage *string `json:"errorMessage,omitempty"`
  3245  }
  3246  
  3247  // FailoverSetsList the list of failover sets.
  3248  type FailoverSetsList struct {
  3249  	autorest.Response `json:"-"`
  3250  	// Value - The list of failover sets.
  3251  	Value *[]FailoverSet `json:"value,omitempty"`
  3252  }
  3253  
  3254  // FailoverTarget represents the eligibility of a device as a failover target device.
  3255  type FailoverTarget struct {
  3256  	// DeviceID - The path ID of the device.
  3257  	DeviceID *string `json:"deviceId,omitempty"`
  3258  	// DeviceStatus - The status of the device. Possible values include: 'Unknown', 'Online', 'Offline', 'Deactivated', 'RequiresAttention', 'MaintenanceMode', 'Creating', 'Provisioning', 'Deactivating', 'Deleted', 'ReadyToSetup'
  3259  	DeviceStatus DeviceStatus `json:"deviceStatus,omitempty"`
  3260  	// ModelDescription - The model number of the device.
  3261  	ModelDescription *string `json:"modelDescription,omitempty"`
  3262  	// DeviceSoftwareVersion - The software version of the device.
  3263  	DeviceSoftwareVersion *string `json:"deviceSoftwareVersion,omitempty"`
  3264  	// DataContainersCount - The count of data containers on the device.
  3265  	DataContainersCount *int32 `json:"dataContainersCount,omitempty"`
  3266  	// VolumesCount - The count of volumes on the device.
  3267  	VolumesCount *int32 `json:"volumesCount,omitempty"`
  3268  	// AvailableLocalStorageInBytes - The amount of free local storage available on the device in bytes.
  3269  	AvailableLocalStorageInBytes *int64 `json:"availableLocalStorageInBytes,omitempty"`
  3270  	// AvailableTieredStorageInBytes - The amount of free tiered storage available for the device in bytes.
  3271  	AvailableTieredStorageInBytes *int64 `json:"availableTieredStorageInBytes,omitempty"`
  3272  	// DeviceLocation - The geo location (applicable only for cloud appliances) of the device.
  3273  	DeviceLocation *string `json:"deviceLocation,omitempty"`
  3274  	// FriendlyDeviceSoftwareVersion - The friendly name for the current version of software on the device.
  3275  	FriendlyDeviceSoftwareVersion *string `json:"friendlyDeviceSoftwareVersion,omitempty"`
  3276  	// EligibilityResult - The eligibility result of the device, as a failover target device.
  3277  	EligibilityResult *TargetEligibilityResult `json:"eligibilityResult,omitempty"`
  3278  }
  3279  
  3280  // FailoverTargetsList the list of all devices in a resource and their eligibility status as a failover
  3281  // target device.
  3282  type FailoverTargetsList struct {
  3283  	autorest.Response `json:"-"`
  3284  	// Value - The list of all the failover targets.
  3285  	Value *[]FailoverTarget `json:"value,omitempty"`
  3286  }
  3287  
  3288  // Feature the feature.
  3289  type Feature struct {
  3290  	// Name - The name of the feature.
  3291  	Name *string `json:"name,omitempty"`
  3292  	// Status - The feature support status. Possible values include: 'NotAvailable', 'UnsupportedDeviceVersion', 'Supported'
  3293  	Status FeatureSupportStatus `json:"status,omitempty"`
  3294  }
  3295  
  3296  // FeatureFilter the OData filter to be used for features.
  3297  type FeatureFilter struct {
  3298  	// DeviceID - Specifies the device ID for which the features are required. Only 'Equality' operator is supported for this property.
  3299  	DeviceID *string `json:"deviceId,omitempty"`
  3300  }
  3301  
  3302  // FeatureList the collections of features.
  3303  type FeatureList struct {
  3304  	autorest.Response `json:"-"`
  3305  	// Value - The value.
  3306  	Value *[]Feature `json:"value,omitempty"`
  3307  }
  3308  
  3309  // HardwareComponent the hardware component.
  3310  type HardwareComponent struct {
  3311  	// ComponentID - The component ID.
  3312  	ComponentID *string `json:"componentId,omitempty"`
  3313  	// DisplayName - The display name of the hardware component.
  3314  	DisplayName *string `json:"displayName,omitempty"`
  3315  	// Status - The status of the hardware component. Possible values include: 'HardwareComponentStatusUnknown', 'HardwareComponentStatusNotPresent', 'HardwareComponentStatusPoweredOff', 'HardwareComponentStatusOk', 'HardwareComponentStatusRecovering', 'HardwareComponentStatusWarning', 'HardwareComponentStatusFailure'
  3316  	Status HardwareComponentStatus `json:"status,omitempty"`
  3317  	// StatusDisplayName - The display name of the status of hardware component.
  3318  	StatusDisplayName *string `json:"statusDisplayName,omitempty"`
  3319  }
  3320  
  3321  // HardwareComponentGroup the hardware component group.
  3322  type HardwareComponentGroup struct {
  3323  	// HardwareComponentGroupProperties - The properties of the hardware component group.
  3324  	*HardwareComponentGroupProperties `json:"properties,omitempty"`
  3325  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  3326  	ID *string `json:"id,omitempty"`
  3327  	// Name - READ-ONLY; The name of the object.
  3328  	Name *string `json:"name,omitempty"`
  3329  	// Type - READ-ONLY; The hierarchical type of the object.
  3330  	Type *string `json:"type,omitempty"`
  3331  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  3332  	Kind Kind `json:"kind,omitempty"`
  3333  }
  3334  
  3335  // MarshalJSON is the custom marshaler for HardwareComponentGroup.
  3336  func (hcg HardwareComponentGroup) MarshalJSON() ([]byte, error) {
  3337  	objectMap := make(map[string]interface{})
  3338  	if hcg.HardwareComponentGroupProperties != nil {
  3339  		objectMap["properties"] = hcg.HardwareComponentGroupProperties
  3340  	}
  3341  	if hcg.Kind != "" {
  3342  		objectMap["kind"] = hcg.Kind
  3343  	}
  3344  	return json.Marshal(objectMap)
  3345  }
  3346  
  3347  // UnmarshalJSON is the custom unmarshaler for HardwareComponentGroup struct.
  3348  func (hcg *HardwareComponentGroup) UnmarshalJSON(body []byte) error {
  3349  	var m map[string]*json.RawMessage
  3350  	err := json.Unmarshal(body, &m)
  3351  	if err != nil {
  3352  		return err
  3353  	}
  3354  	for k, v := range m {
  3355  		switch k {
  3356  		case "properties":
  3357  			if v != nil {
  3358  				var hardwareComponentGroupProperties HardwareComponentGroupProperties
  3359  				err = json.Unmarshal(*v, &hardwareComponentGroupProperties)
  3360  				if err != nil {
  3361  					return err
  3362  				}
  3363  				hcg.HardwareComponentGroupProperties = &hardwareComponentGroupProperties
  3364  			}
  3365  		case "id":
  3366  			if v != nil {
  3367  				var ID string
  3368  				err = json.Unmarshal(*v, &ID)
  3369  				if err != nil {
  3370  					return err
  3371  				}
  3372  				hcg.ID = &ID
  3373  			}
  3374  		case "name":
  3375  			if v != nil {
  3376  				var name string
  3377  				err = json.Unmarshal(*v, &name)
  3378  				if err != nil {
  3379  					return err
  3380  				}
  3381  				hcg.Name = &name
  3382  			}
  3383  		case "type":
  3384  			if v != nil {
  3385  				var typeVar string
  3386  				err = json.Unmarshal(*v, &typeVar)
  3387  				if err != nil {
  3388  					return err
  3389  				}
  3390  				hcg.Type = &typeVar
  3391  			}
  3392  		case "kind":
  3393  			if v != nil {
  3394  				var kind Kind
  3395  				err = json.Unmarshal(*v, &kind)
  3396  				if err != nil {
  3397  					return err
  3398  				}
  3399  				hcg.Kind = kind
  3400  			}
  3401  		}
  3402  	}
  3403  
  3404  	return nil
  3405  }
  3406  
  3407  // HardwareComponentGroupList the collection of hardware component groups.
  3408  type HardwareComponentGroupList struct {
  3409  	autorest.Response `json:"-"`
  3410  	// Value - The value.
  3411  	Value *[]HardwareComponentGroup `json:"value,omitempty"`
  3412  }
  3413  
  3414  // HardwareComponentGroupProperties the properties of hardware component group.
  3415  type HardwareComponentGroupProperties struct {
  3416  	// DisplayName - The display name the hardware component group.
  3417  	DisplayName *string `json:"displayName,omitempty"`
  3418  	// LastUpdatedTime - The last updated time.
  3419  	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
  3420  	// Components - The list of hardware components.
  3421  	Components *[]HardwareComponent `json:"components,omitempty"`
  3422  }
  3423  
  3424  // HardwareComponentGroupsChangeControllerPowerStateFuture an abstraction for monitoring and retrieving the
  3425  // results of a long-running operation.
  3426  type HardwareComponentGroupsChangeControllerPowerStateFuture struct {
  3427  	azure.FutureAPI
  3428  	// Result returns the result of the asynchronous operation.
  3429  	// If the operation has not completed it will return an error.
  3430  	Result func(HardwareComponentGroupsClient) (autorest.Response, error)
  3431  }
  3432  
  3433  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3434  func (future *HardwareComponentGroupsChangeControllerPowerStateFuture) UnmarshalJSON(body []byte) error {
  3435  	var azFuture azure.Future
  3436  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3437  		return err
  3438  	}
  3439  	future.FutureAPI = &azFuture
  3440  	future.Result = future.result
  3441  	return nil
  3442  }
  3443  
  3444  // result is the default implementation for HardwareComponentGroupsChangeControllerPowerStateFuture.Result.
  3445  func (future *HardwareComponentGroupsChangeControllerPowerStateFuture) result(client HardwareComponentGroupsClient) (ar autorest.Response, err error) {
  3446  	var done bool
  3447  	done, err = future.DoneWithContext(context.Background(), client)
  3448  	if err != nil {
  3449  		err = autorest.NewErrorWithError(err, "storsimple.HardwareComponentGroupsChangeControllerPowerStateFuture", "Result", future.Response(), "Polling failure")
  3450  		return
  3451  	}
  3452  	if !done {
  3453  		ar.Response = future.Response()
  3454  		err = azure.NewAsyncOpIncompleteError("storsimple.HardwareComponentGroupsChangeControllerPowerStateFuture")
  3455  		return
  3456  	}
  3457  	ar.Response = future.Response()
  3458  	return
  3459  }
  3460  
  3461  // Job the job.
  3462  type Job struct {
  3463  	autorest.Response `json:"-"`
  3464  	// Status - The current status of the job. Possible values include: 'Running', 'Succeeded', 'Failed', 'Canceled'
  3465  	Status JobStatus `json:"status,omitempty"`
  3466  	// StartTime - The UTC time at which the job was started.
  3467  	StartTime *date.Time `json:"startTime,omitempty"`
  3468  	// EndTime - The UTC time at which the job completed.
  3469  	EndTime *date.Time `json:"endTime,omitempty"`
  3470  	// PercentComplete - The percentage of the job that is already complete.
  3471  	PercentComplete *int32 `json:"percentComplete,omitempty"`
  3472  	// Error - The error details, if any, for the job.
  3473  	Error *JobErrorDetails `json:"error,omitempty"`
  3474  	// JobProperties - The properties of the job.
  3475  	*JobProperties `json:"properties,omitempty"`
  3476  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  3477  	ID *string `json:"id,omitempty"`
  3478  	// Name - READ-ONLY; The name of the object.
  3479  	Name *string `json:"name,omitempty"`
  3480  	// Type - READ-ONLY; The hierarchical type of the object.
  3481  	Type *string `json:"type,omitempty"`
  3482  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  3483  	Kind Kind `json:"kind,omitempty"`
  3484  }
  3485  
  3486  // MarshalJSON is the custom marshaler for Job.
  3487  func (j Job) MarshalJSON() ([]byte, error) {
  3488  	objectMap := make(map[string]interface{})
  3489  	if j.Status != "" {
  3490  		objectMap["status"] = j.Status
  3491  	}
  3492  	if j.StartTime != nil {
  3493  		objectMap["startTime"] = j.StartTime
  3494  	}
  3495  	if j.EndTime != nil {
  3496  		objectMap["endTime"] = j.EndTime
  3497  	}
  3498  	if j.PercentComplete != nil {
  3499  		objectMap["percentComplete"] = j.PercentComplete
  3500  	}
  3501  	if j.Error != nil {
  3502  		objectMap["error"] = j.Error
  3503  	}
  3504  	if j.JobProperties != nil {
  3505  		objectMap["properties"] = j.JobProperties
  3506  	}
  3507  	if j.Kind != "" {
  3508  		objectMap["kind"] = j.Kind
  3509  	}
  3510  	return json.Marshal(objectMap)
  3511  }
  3512  
  3513  // UnmarshalJSON is the custom unmarshaler for Job struct.
  3514  func (j *Job) UnmarshalJSON(body []byte) error {
  3515  	var m map[string]*json.RawMessage
  3516  	err := json.Unmarshal(body, &m)
  3517  	if err != nil {
  3518  		return err
  3519  	}
  3520  	for k, v := range m {
  3521  		switch k {
  3522  		case "status":
  3523  			if v != nil {
  3524  				var status JobStatus
  3525  				err = json.Unmarshal(*v, &status)
  3526  				if err != nil {
  3527  					return err
  3528  				}
  3529  				j.Status = status
  3530  			}
  3531  		case "startTime":
  3532  			if v != nil {
  3533  				var startTime date.Time
  3534  				err = json.Unmarshal(*v, &startTime)
  3535  				if err != nil {
  3536  					return err
  3537  				}
  3538  				j.StartTime = &startTime
  3539  			}
  3540  		case "endTime":
  3541  			if v != nil {
  3542  				var endTime date.Time
  3543  				err = json.Unmarshal(*v, &endTime)
  3544  				if err != nil {
  3545  					return err
  3546  				}
  3547  				j.EndTime = &endTime
  3548  			}
  3549  		case "percentComplete":
  3550  			if v != nil {
  3551  				var percentComplete int32
  3552  				err = json.Unmarshal(*v, &percentComplete)
  3553  				if err != nil {
  3554  					return err
  3555  				}
  3556  				j.PercentComplete = &percentComplete
  3557  			}
  3558  		case "error":
  3559  			if v != nil {
  3560  				var errorVar JobErrorDetails
  3561  				err = json.Unmarshal(*v, &errorVar)
  3562  				if err != nil {
  3563  					return err
  3564  				}
  3565  				j.Error = &errorVar
  3566  			}
  3567  		case "properties":
  3568  			if v != nil {
  3569  				var jobProperties JobProperties
  3570  				err = json.Unmarshal(*v, &jobProperties)
  3571  				if err != nil {
  3572  					return err
  3573  				}
  3574  				j.JobProperties = &jobProperties
  3575  			}
  3576  		case "id":
  3577  			if v != nil {
  3578  				var ID string
  3579  				err = json.Unmarshal(*v, &ID)
  3580  				if err != nil {
  3581  					return err
  3582  				}
  3583  				j.ID = &ID
  3584  			}
  3585  		case "name":
  3586  			if v != nil {
  3587  				var name string
  3588  				err = json.Unmarshal(*v, &name)
  3589  				if err != nil {
  3590  					return err
  3591  				}
  3592  				j.Name = &name
  3593  			}
  3594  		case "type":
  3595  			if v != nil {
  3596  				var typeVar string
  3597  				err = json.Unmarshal(*v, &typeVar)
  3598  				if err != nil {
  3599  					return err
  3600  				}
  3601  				j.Type = &typeVar
  3602  			}
  3603  		case "kind":
  3604  			if v != nil {
  3605  				var kind Kind
  3606  				err = json.Unmarshal(*v, &kind)
  3607  				if err != nil {
  3608  					return err
  3609  				}
  3610  				j.Kind = kind
  3611  			}
  3612  		}
  3613  	}
  3614  
  3615  	return nil
  3616  }
  3617  
  3618  // JobErrorDetails the job error details. Contains list of job error items.
  3619  type JobErrorDetails struct {
  3620  	// ErrorDetails - The error details.
  3621  	ErrorDetails *[]JobErrorItem `json:"errorDetails,omitempty"`
  3622  	// Code - The error code intended for programmatic access.
  3623  	Code *string `json:"code,omitempty"`
  3624  	// Message - The error message intended to describe the error in detail.
  3625  	Message *string `json:"message,omitempty"`
  3626  }
  3627  
  3628  // JobErrorItem the job error items.
  3629  type JobErrorItem struct {
  3630  	// Recommendations - The recommended actions.
  3631  	Recommendations *[]string `json:"recommendations,omitempty"`
  3632  	// Code - The error code intended for programmatic access.
  3633  	Code *string `json:"code,omitempty"`
  3634  	// Message - The error message intended to describe the error in detail.
  3635  	Message *string `json:"message,omitempty"`
  3636  }
  3637  
  3638  // JobFilter the OData filter to be used for jobs.
  3639  type JobFilter struct {
  3640  	// Status - Specifies the status of the jobs to be filtered. For e.g., "Running", "Succeeded", "Failed" or "Canceled". Only 'Equality' operator is supported for this property.
  3641  	Status *string `json:"status,omitempty"`
  3642  	// JobType - Specifies the type of the jobs to be filtered. For e.g., "ScheduledBackup", "ManualBackup", "RestoreBackup", "CloneVolume", "FailoverVolumeContainers", "CreateLocallyPinnedVolume", "ModifyVolume", "InstallUpdates", "SupportPackageLogs", or "CreateCloudAppliance". Only 'Equality' operator can be used for this property.
  3643  	JobType *string `json:"jobType,omitempty"`
  3644  	// StartTime - Specifies the start time of the jobs to be filtered.  Only 'Greater Than or Equal To' and 'Lesser Than or Equal To' operators are supported for this property.
  3645  	StartTime *date.Time `json:"startTime,omitempty"`
  3646  }
  3647  
  3648  // JobList the collection of jobs.
  3649  type JobList struct {
  3650  	autorest.Response `json:"-"`
  3651  	// Value - The value.
  3652  	Value *[]Job `json:"value,omitempty"`
  3653  	// NextLink - The NextLink.
  3654  	NextLink *string `json:"nextLink,omitempty"`
  3655  }
  3656  
  3657  // JobListIterator provides access to a complete listing of Job values.
  3658  type JobListIterator struct {
  3659  	i    int
  3660  	page JobListPage
  3661  }
  3662  
  3663  // NextWithContext advances to the next value.  If there was an error making
  3664  // the request the iterator does not advance and the error is returned.
  3665  func (iter *JobListIterator) NextWithContext(ctx context.Context) (err error) {
  3666  	if tracing.IsEnabled() {
  3667  		ctx = tracing.StartSpan(ctx, fqdn+"/JobListIterator.NextWithContext")
  3668  		defer func() {
  3669  			sc := -1
  3670  			if iter.Response().Response.Response != nil {
  3671  				sc = iter.Response().Response.Response.StatusCode
  3672  			}
  3673  			tracing.EndSpan(ctx, sc, err)
  3674  		}()
  3675  	}
  3676  	iter.i++
  3677  	if iter.i < len(iter.page.Values()) {
  3678  		return nil
  3679  	}
  3680  	err = iter.page.NextWithContext(ctx)
  3681  	if err != nil {
  3682  		iter.i--
  3683  		return err
  3684  	}
  3685  	iter.i = 0
  3686  	return nil
  3687  }
  3688  
  3689  // Next advances to the next value.  If there was an error making
  3690  // the request the iterator does not advance and the error is returned.
  3691  // Deprecated: Use NextWithContext() instead.
  3692  func (iter *JobListIterator) Next() error {
  3693  	return iter.NextWithContext(context.Background())
  3694  }
  3695  
  3696  // NotDone returns true if the enumeration should be started or is not yet complete.
  3697  func (iter JobListIterator) NotDone() bool {
  3698  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  3699  }
  3700  
  3701  // Response returns the raw server response from the last page request.
  3702  func (iter JobListIterator) Response() JobList {
  3703  	return iter.page.Response()
  3704  }
  3705  
  3706  // Value returns the current value or a zero-initialized value if the
  3707  // iterator has advanced beyond the end of the collection.
  3708  func (iter JobListIterator) Value() Job {
  3709  	if !iter.page.NotDone() {
  3710  		return Job{}
  3711  	}
  3712  	return iter.page.Values()[iter.i]
  3713  }
  3714  
  3715  // Creates a new instance of the JobListIterator type.
  3716  func NewJobListIterator(page JobListPage) JobListIterator {
  3717  	return JobListIterator{page: page}
  3718  }
  3719  
  3720  // IsEmpty returns true if the ListResult contains no values.
  3721  func (jl JobList) IsEmpty() bool {
  3722  	return jl.Value == nil || len(*jl.Value) == 0
  3723  }
  3724  
  3725  // hasNextLink returns true if the NextLink is not empty.
  3726  func (jl JobList) hasNextLink() bool {
  3727  	return jl.NextLink != nil && len(*jl.NextLink) != 0
  3728  }
  3729  
  3730  // jobListPreparer prepares a request to retrieve the next set of results.
  3731  // It returns nil if no more results exist.
  3732  func (jl JobList) jobListPreparer(ctx context.Context) (*http.Request, error) {
  3733  	if !jl.hasNextLink() {
  3734  		return nil, nil
  3735  	}
  3736  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  3737  		autorest.AsJSON(),
  3738  		autorest.AsGet(),
  3739  		autorest.WithBaseURL(to.String(jl.NextLink)))
  3740  }
  3741  
  3742  // JobListPage contains a page of Job values.
  3743  type JobListPage struct {
  3744  	fn func(context.Context, JobList) (JobList, error)
  3745  	jl JobList
  3746  }
  3747  
  3748  // NextWithContext advances to the next page of values.  If there was an error making
  3749  // the request the page does not advance and the error is returned.
  3750  func (page *JobListPage) NextWithContext(ctx context.Context) (err error) {
  3751  	if tracing.IsEnabled() {
  3752  		ctx = tracing.StartSpan(ctx, fqdn+"/JobListPage.NextWithContext")
  3753  		defer func() {
  3754  			sc := -1
  3755  			if page.Response().Response.Response != nil {
  3756  				sc = page.Response().Response.Response.StatusCode
  3757  			}
  3758  			tracing.EndSpan(ctx, sc, err)
  3759  		}()
  3760  	}
  3761  	for {
  3762  		next, err := page.fn(ctx, page.jl)
  3763  		if err != nil {
  3764  			return err
  3765  		}
  3766  		page.jl = next
  3767  		if !next.hasNextLink() || !next.IsEmpty() {
  3768  			break
  3769  		}
  3770  	}
  3771  	return nil
  3772  }
  3773  
  3774  // Next advances to the next page of values.  If there was an error making
  3775  // the request the page does not advance and the error is returned.
  3776  // Deprecated: Use NextWithContext() instead.
  3777  func (page *JobListPage) Next() error {
  3778  	return page.NextWithContext(context.Background())
  3779  }
  3780  
  3781  // NotDone returns true if the page enumeration should be started or is not yet complete.
  3782  func (page JobListPage) NotDone() bool {
  3783  	return !page.jl.IsEmpty()
  3784  }
  3785  
  3786  // Response returns the raw server response from the last page request.
  3787  func (page JobListPage) Response() JobList {
  3788  	return page.jl
  3789  }
  3790  
  3791  // Values returns the slice of values for the current page or nil if there are no values.
  3792  func (page JobListPage) Values() []Job {
  3793  	if page.jl.IsEmpty() {
  3794  		return nil
  3795  	}
  3796  	return *page.jl.Value
  3797  }
  3798  
  3799  // Creates a new instance of the JobListPage type.
  3800  func NewJobListPage(cur JobList, getNextPage func(context.Context, JobList) (JobList, error)) JobListPage {
  3801  	return JobListPage{
  3802  		fn: getNextPage,
  3803  		jl: cur,
  3804  	}
  3805  }
  3806  
  3807  // JobProperties the properties of the job.
  3808  type JobProperties struct {
  3809  	// JobType - The type of the job. Possible values include: 'ScheduledBackup', 'ManualBackup', 'RestoreBackup', 'CloneVolume', 'FailoverVolumeContainers', 'CreateLocallyPinnedVolume', 'ModifyVolume', 'InstallUpdates', 'SupportPackageLogs', 'CreateCloudAppliance'
  3810  	JobType JobType `json:"jobType,omitempty"`
  3811  	// DataStats - The data statistics properties of the job.
  3812  	DataStats *DataStatistics `json:"dataStats,omitempty"`
  3813  	// EntityLabel - The entity identifier for which the job ran.
  3814  	EntityLabel *string `json:"entityLabel,omitempty"`
  3815  	// EntityType - The entity type for which the job ran.
  3816  	EntityType *string `json:"entityType,omitempty"`
  3817  	// JobStages - The job stages.
  3818  	JobStages *[]JobStage `json:"jobStages,omitempty"`
  3819  	// DeviceID - The device ID in which the job ran.
  3820  	DeviceID *string `json:"deviceId,omitempty"`
  3821  	// IsCancellable - Represents whether the job is cancellable or not.
  3822  	IsCancellable *bool `json:"isCancellable,omitempty"`
  3823  	// BackupType - The backup type (CloudSnapshot | LocalSnapshot). Applicable only for backup jobs. Possible values include: 'LocalSnapshot', 'CloudSnapshot'
  3824  	BackupType BackupType `json:"backupType,omitempty"`
  3825  	// SourceDeviceID - The source device ID of the failover job.
  3826  	SourceDeviceID *string `json:"sourceDeviceId,omitempty"`
  3827  	// BackupPointInTime - The time of the backup used for the failover.
  3828  	BackupPointInTime *date.Time `json:"backupPointInTime,omitempty"`
  3829  }
  3830  
  3831  // JobsCancelFuture an abstraction for monitoring and retrieving the results of a long-running operation.
  3832  type JobsCancelFuture struct {
  3833  	azure.FutureAPI
  3834  	// Result returns the result of the asynchronous operation.
  3835  	// If the operation has not completed it will return an error.
  3836  	Result func(JobsClient) (autorest.Response, error)
  3837  }
  3838  
  3839  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  3840  func (future *JobsCancelFuture) UnmarshalJSON(body []byte) error {
  3841  	var azFuture azure.Future
  3842  	if err := json.Unmarshal(body, &azFuture); err != nil {
  3843  		return err
  3844  	}
  3845  	future.FutureAPI = &azFuture
  3846  	future.Result = future.result
  3847  	return nil
  3848  }
  3849  
  3850  // result is the default implementation for JobsCancelFuture.Result.
  3851  func (future *JobsCancelFuture) result(client JobsClient) (ar autorest.Response, err error) {
  3852  	var done bool
  3853  	done, err = future.DoneWithContext(context.Background(), client)
  3854  	if err != nil {
  3855  		err = autorest.NewErrorWithError(err, "storsimple.JobsCancelFuture", "Result", future.Response(), "Polling failure")
  3856  		return
  3857  	}
  3858  	if !done {
  3859  		ar.Response = future.Response()
  3860  		err = azure.NewAsyncOpIncompleteError("storsimple.JobsCancelFuture")
  3861  		return
  3862  	}
  3863  	ar.Response = future.Response()
  3864  	return
  3865  }
  3866  
  3867  // JobStage the details about the specific stage of a job.
  3868  type JobStage struct {
  3869  	// Message - The message of the job stage.
  3870  	Message *string `json:"message,omitempty"`
  3871  	// StageStatus - The stage status. Possible values include: 'Running', 'Succeeded', 'Failed', 'Canceled'
  3872  	StageStatus JobStatus `json:"stageStatus,omitempty"`
  3873  	// Detail - The details of the stage.
  3874  	Detail *string `json:"detail,omitempty"`
  3875  	// ErrorCode - The error code of the stage if any.
  3876  	ErrorCode *string `json:"errorCode,omitempty"`
  3877  }
  3878  
  3879  // Key the key.
  3880  type Key struct {
  3881  	autorest.Response `json:"-"`
  3882  	// ActivationKey - The activation key for the device.
  3883  	ActivationKey *string `json:"activationKey,omitempty"`
  3884  }
  3885  
  3886  // ListFailoverTargetsRequest the request object for fetching the list of failover targets (eligible
  3887  // devices for failover).
  3888  type ListFailoverTargetsRequest struct {
  3889  	// VolumeContainers - The list of path IDs of the volume containers that needs to be failed-over, for which we want to fetch the eligible targets.
  3890  	VolumeContainers *[]string `json:"volumeContainers,omitempty"`
  3891  }
  3892  
  3893  // Manager the StorSimple Manager.
  3894  type Manager struct {
  3895  	autorest.Response `json:"-"`
  3896  	// ManagerProperties - The properties of the StorSimple Manager.
  3897  	*ManagerProperties `json:"properties,omitempty"`
  3898  	// Etag - The etag of the manager.
  3899  	Etag *string `json:"etag,omitempty"`
  3900  	// ID - READ-ONLY; The resource ID.
  3901  	ID *string `json:"id,omitempty"`
  3902  	// Name - READ-ONLY; The resource name.
  3903  	Name *string `json:"name,omitempty"`
  3904  	// Type - READ-ONLY; The resource type.
  3905  	Type *string `json:"type,omitempty"`
  3906  	// Location - The geo location of the resource.
  3907  	Location *string `json:"location,omitempty"`
  3908  	// Tags - The tags attached to the resource.
  3909  	Tags map[string]*string `json:"tags"`
  3910  }
  3911  
  3912  // MarshalJSON is the custom marshaler for Manager.
  3913  func (mVar Manager) MarshalJSON() ([]byte, error) {
  3914  	objectMap := make(map[string]interface{})
  3915  	if mVar.ManagerProperties != nil {
  3916  		objectMap["properties"] = mVar.ManagerProperties
  3917  	}
  3918  	if mVar.Etag != nil {
  3919  		objectMap["etag"] = mVar.Etag
  3920  	}
  3921  	if mVar.Location != nil {
  3922  		objectMap["location"] = mVar.Location
  3923  	}
  3924  	if mVar.Tags != nil {
  3925  		objectMap["tags"] = mVar.Tags
  3926  	}
  3927  	return json.Marshal(objectMap)
  3928  }
  3929  
  3930  // UnmarshalJSON is the custom unmarshaler for Manager struct.
  3931  func (mVar *Manager) UnmarshalJSON(body []byte) error {
  3932  	var m map[string]*json.RawMessage
  3933  	err := json.Unmarshal(body, &m)
  3934  	if err != nil {
  3935  		return err
  3936  	}
  3937  	for k, v := range m {
  3938  		switch k {
  3939  		case "properties":
  3940  			if v != nil {
  3941  				var managerProperties ManagerProperties
  3942  				err = json.Unmarshal(*v, &managerProperties)
  3943  				if err != nil {
  3944  					return err
  3945  				}
  3946  				mVar.ManagerProperties = &managerProperties
  3947  			}
  3948  		case "etag":
  3949  			if v != nil {
  3950  				var etag string
  3951  				err = json.Unmarshal(*v, &etag)
  3952  				if err != nil {
  3953  					return err
  3954  				}
  3955  				mVar.Etag = &etag
  3956  			}
  3957  		case "id":
  3958  			if v != nil {
  3959  				var ID string
  3960  				err = json.Unmarshal(*v, &ID)
  3961  				if err != nil {
  3962  					return err
  3963  				}
  3964  				mVar.ID = &ID
  3965  			}
  3966  		case "name":
  3967  			if v != nil {
  3968  				var name string
  3969  				err = json.Unmarshal(*v, &name)
  3970  				if err != nil {
  3971  					return err
  3972  				}
  3973  				mVar.Name = &name
  3974  			}
  3975  		case "type":
  3976  			if v != nil {
  3977  				var typeVar string
  3978  				err = json.Unmarshal(*v, &typeVar)
  3979  				if err != nil {
  3980  					return err
  3981  				}
  3982  				mVar.Type = &typeVar
  3983  			}
  3984  		case "location":
  3985  			if v != nil {
  3986  				var location string
  3987  				err = json.Unmarshal(*v, &location)
  3988  				if err != nil {
  3989  					return err
  3990  				}
  3991  				mVar.Location = &location
  3992  			}
  3993  		case "tags":
  3994  			if v != nil {
  3995  				var tags map[string]*string
  3996  				err = json.Unmarshal(*v, &tags)
  3997  				if err != nil {
  3998  					return err
  3999  				}
  4000  				mVar.Tags = tags
  4001  			}
  4002  		}
  4003  	}
  4004  
  4005  	return nil
  4006  }
  4007  
  4008  // ManagerExtendedInfo the extended info of the manager.
  4009  type ManagerExtendedInfo struct {
  4010  	autorest.Response `json:"-"`
  4011  	// ManagerExtendedInfoProperties - The extended info properties.
  4012  	*ManagerExtendedInfoProperties `json:"properties,omitempty"`
  4013  	// Etag - The etag of the resource.
  4014  	Etag *string `json:"etag,omitempty"`
  4015  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  4016  	ID *string `json:"id,omitempty"`
  4017  	// Name - READ-ONLY; The name of the object.
  4018  	Name *string `json:"name,omitempty"`
  4019  	// Type - READ-ONLY; The hierarchical type of the object.
  4020  	Type *string `json:"type,omitempty"`
  4021  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  4022  	Kind Kind `json:"kind,omitempty"`
  4023  }
  4024  
  4025  // MarshalJSON is the custom marshaler for ManagerExtendedInfo.
  4026  func (mei ManagerExtendedInfo) MarshalJSON() ([]byte, error) {
  4027  	objectMap := make(map[string]interface{})
  4028  	if mei.ManagerExtendedInfoProperties != nil {
  4029  		objectMap["properties"] = mei.ManagerExtendedInfoProperties
  4030  	}
  4031  	if mei.Etag != nil {
  4032  		objectMap["etag"] = mei.Etag
  4033  	}
  4034  	if mei.Kind != "" {
  4035  		objectMap["kind"] = mei.Kind
  4036  	}
  4037  	return json.Marshal(objectMap)
  4038  }
  4039  
  4040  // UnmarshalJSON is the custom unmarshaler for ManagerExtendedInfo struct.
  4041  func (mei *ManagerExtendedInfo) UnmarshalJSON(body []byte) error {
  4042  	var m map[string]*json.RawMessage
  4043  	err := json.Unmarshal(body, &m)
  4044  	if err != nil {
  4045  		return err
  4046  	}
  4047  	for k, v := range m {
  4048  		switch k {
  4049  		case "properties":
  4050  			if v != nil {
  4051  				var managerExtendedInfoProperties ManagerExtendedInfoProperties
  4052  				err = json.Unmarshal(*v, &managerExtendedInfoProperties)
  4053  				if err != nil {
  4054  					return err
  4055  				}
  4056  				mei.ManagerExtendedInfoProperties = &managerExtendedInfoProperties
  4057  			}
  4058  		case "etag":
  4059  			if v != nil {
  4060  				var etag string
  4061  				err = json.Unmarshal(*v, &etag)
  4062  				if err != nil {
  4063  					return err
  4064  				}
  4065  				mei.Etag = &etag
  4066  			}
  4067  		case "id":
  4068  			if v != nil {
  4069  				var ID string
  4070  				err = json.Unmarshal(*v, &ID)
  4071  				if err != nil {
  4072  					return err
  4073  				}
  4074  				mei.ID = &ID
  4075  			}
  4076  		case "name":
  4077  			if v != nil {
  4078  				var name string
  4079  				err = json.Unmarshal(*v, &name)
  4080  				if err != nil {
  4081  					return err
  4082  				}
  4083  				mei.Name = &name
  4084  			}
  4085  		case "type":
  4086  			if v != nil {
  4087  				var typeVar string
  4088  				err = json.Unmarshal(*v, &typeVar)
  4089  				if err != nil {
  4090  					return err
  4091  				}
  4092  				mei.Type = &typeVar
  4093  			}
  4094  		case "kind":
  4095  			if v != nil {
  4096  				var kind Kind
  4097  				err = json.Unmarshal(*v, &kind)
  4098  				if err != nil {
  4099  					return err
  4100  				}
  4101  				mei.Kind = kind
  4102  			}
  4103  		}
  4104  	}
  4105  
  4106  	return nil
  4107  }
  4108  
  4109  // ManagerExtendedInfoProperties the properties of the manager extended info.
  4110  type ManagerExtendedInfoProperties struct {
  4111  	// Version - The version of the extended info being persisted.
  4112  	Version *string `json:"version,omitempty"`
  4113  	// IntegrityKey - Represents the CIK of the resource.
  4114  	IntegrityKey *string `json:"integrityKey,omitempty"`
  4115  	// EncryptionKey - Represents the CEK of the resource.
  4116  	EncryptionKey *string `json:"encryptionKey,omitempty"`
  4117  	// EncryptionKeyThumbprint - Represents the Cert thumbprint that was used to encrypt the CEK.
  4118  	EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"`
  4119  	// PortalCertificateThumbprint - Represents the portal thumbprint which can be used optionally to encrypt the entire data before storing it.
  4120  	PortalCertificateThumbprint *string `json:"portalCertificateThumbprint,omitempty"`
  4121  	// Algorithm - Represents the encryption algorithm used to encrypt the keys. None - if Key is saved in plain text format. Algorithm name - if key is encrypted
  4122  	Algorithm *string `json:"algorithm,omitempty"`
  4123  }
  4124  
  4125  // ManagerIntrinsicSettings intrinsic settings which refers to the type of the StorSimple Manager.
  4126  type ManagerIntrinsicSettings struct {
  4127  	// Type - The type of StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1'
  4128  	Type ManagerType `json:"type,omitempty"`
  4129  }
  4130  
  4131  // ManagerList the list of StorSimple Managers.
  4132  type ManagerList struct {
  4133  	autorest.Response `json:"-"`
  4134  	// Value - The list of StorSimple managers.
  4135  	Value *[]Manager `json:"value,omitempty"`
  4136  }
  4137  
  4138  // ManagerPatch the StorSimple Manager patch.
  4139  type ManagerPatch struct {
  4140  	// Tags - The tags attached to the Manager.
  4141  	Tags map[string]*string `json:"tags"`
  4142  }
  4143  
  4144  // MarshalJSON is the custom marshaler for ManagerPatch.
  4145  func (mp ManagerPatch) MarshalJSON() ([]byte, error) {
  4146  	objectMap := make(map[string]interface{})
  4147  	if mp.Tags != nil {
  4148  		objectMap["tags"] = mp.Tags
  4149  	}
  4150  	return json.Marshal(objectMap)
  4151  }
  4152  
  4153  // ManagerProperties the properties of the StorSimple Manager.
  4154  type ManagerProperties struct {
  4155  	// CisIntrinsicSettings - Represents the type of StorSimple Manager.
  4156  	CisIntrinsicSettings *ManagerIntrinsicSettings `json:"cisIntrinsicSettings,omitempty"`
  4157  	// Sku - Specifies the Sku.
  4158  	Sku *ManagerSku `json:"sku,omitempty"`
  4159  	// ProvisioningState - Specifies the state of the resource as it is getting provisioned. Value of "Succeeded" means the Manager was successfully created.
  4160  	ProvisioningState *string `json:"provisioningState,omitempty"`
  4161  }
  4162  
  4163  // ManagerSku the Sku.
  4164  type ManagerSku struct {
  4165  	// Name - Refers to the sku name which should be "Standard"
  4166  	Name *string `json:"name,omitempty"`
  4167  }
  4168  
  4169  // MetricAvailablity the metric availability.
  4170  type MetricAvailablity struct {
  4171  	// TimeGrain - The aggregation interval for the metric.
  4172  	TimeGrain *string `json:"timeGrain,omitempty"`
  4173  	// Retention - The retention period for the metric at the specified timegrain.
  4174  	Retention *string `json:"retention,omitempty"`
  4175  }
  4176  
  4177  // MetricData the metric data.
  4178  type MetricData struct {
  4179  	// TimeStamp - The time stamp of the metric data.
  4180  	TimeStamp *date.Time `json:"timeStamp,omitempty"`
  4181  	// Sum - The sum of all samples at the time stamp.
  4182  	Sum *float64 `json:"sum,omitempty"`
  4183  	// Count - The count of all samples at the time stamp.
  4184  	Count *int32 `json:"count,omitempty"`
  4185  	// Average - The average of all samples at the time stamp.
  4186  	Average *float64 `json:"average,omitempty"`
  4187  	// Minimum - The minimum of all samples at the time stamp.
  4188  	Minimum *float64 `json:"minimum,omitempty"`
  4189  	// Maximum - The maximum of all samples at the time stamp.
  4190  	Maximum *float64 `json:"maximum,omitempty"`
  4191  }
  4192  
  4193  // MetricDefinition the monitoring metric definition.
  4194  type MetricDefinition struct {
  4195  	// Name - The metric name.
  4196  	Name *MetricName `json:"name,omitempty"`
  4197  	// Unit - The metric unit. Possible values include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds'
  4198  	Unit MetricUnit `json:"unit,omitempty"`
  4199  	// PrimaryAggregationType - The metric aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeLast', 'MetricAggregationTypeMaximum', 'MetricAggregationTypeMinimum', 'MetricAggregationTypeNone', 'MetricAggregationTypeTotal'
  4200  	PrimaryAggregationType MetricAggregationType `json:"primaryAggregationType,omitempty"`
  4201  	// ResourceID - The metric source ID.
  4202  	ResourceID *string `json:"resourceId,omitempty"`
  4203  	// MetricAvailabilities - The available metric granularities.
  4204  	MetricAvailabilities *[]MetricAvailablity `json:"metricAvailabilities,omitempty"`
  4205  	// Dimensions - The available metric dimensions.
  4206  	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
  4207  	// Category - The category of the metric.
  4208  	Category *string `json:"category,omitempty"`
  4209  	// Type - The metric definition type.
  4210  	Type *string `json:"type,omitempty"`
  4211  }
  4212  
  4213  // MetricDefinitionList the list of metric definitions.
  4214  type MetricDefinitionList struct {
  4215  	autorest.Response `json:"-"`
  4216  	// Value - The list of metric definitions.
  4217  	Value *[]MetricDefinition `json:"value,omitempty"`
  4218  }
  4219  
  4220  // MetricDimension the metric dimension. It indicates the source of the metric.
  4221  type MetricDimension struct {
  4222  	// Name - The metric dimension name.
  4223  	Name *string `json:"name,omitempty"`
  4224  	// Value - The metric dimension values.
  4225  	Value *string `json:"value,omitempty"`
  4226  }
  4227  
  4228  // MetricFilter the OData filters to be used for metrics.
  4229  type MetricFilter struct {
  4230  	// Name - Specifies the metric name filter specifying the name of the metric to be filtered on. Only 'Equality' operator is supported for this property.
  4231  	Name *MetricNameFilter `json:"name,omitempty"`
  4232  	// StartTime - Specifies the start time of the time range to be queried. Only 'Greater Than Or Equal To' operator is supported for this property.
  4233  	StartTime *date.Time `json:"startTime,omitempty"`
  4234  	// EndTime - Specifies the end time of the time range to be queried. Only 'Less Than Or Equal To' operator is supported for this property.
  4235  	EndTime *date.Time `json:"endTime,omitempty"`
  4236  	// TimeGrain - Specifies the time granularity of the metrics to be returned. E.g., "P1D". Valid values are the ones returned as the field "timeGrain" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property.
  4237  	TimeGrain *string `json:"timeGrain,omitempty"`
  4238  	// Category - Specifies the category of the metrics to be filtered. E.g., "CapacityUtilization". Valid values are the ones returned as the field "category" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property.
  4239  	Category *string `json:"category,omitempty"`
  4240  	// Dimensions - Specifies the source(the dimension) of the metrics to be filtered. Only 'Equality' operator is supported for this property.
  4241  	Dimensions *DimensionFilter `json:"dimensions,omitempty"`
  4242  }
  4243  
  4244  // MetricList the metric list.
  4245  type MetricList struct {
  4246  	autorest.Response `json:"-"`
  4247  	// Value - The value.
  4248  	Value *[]Metrics `json:"value,omitempty"`
  4249  }
  4250  
  4251  // MetricName the metric name.
  4252  type MetricName struct {
  4253  	// Value - The metric name.
  4254  	Value *string `json:"value,omitempty"`
  4255  	// LocalizedValue - The localized metric name.
  4256  	LocalizedValue *string `json:"localizedValue,omitempty"`
  4257  }
  4258  
  4259  // MetricNameFilter the metric name filter, specifying the name of the metric to be filtered on.
  4260  type MetricNameFilter struct {
  4261  	// Value - Specifies the metric name to be filtered on. E.g., CloudStorageUsed. Valid values are the ones returned in the field "name" in the ListMetricDefinitions call. Only 'Equality' operator is supported for this property.
  4262  	Value *string `json:"value,omitempty"`
  4263  }
  4264  
  4265  // Metrics the monitoring metric.
  4266  type Metrics struct {
  4267  	// ResourceID - The ID of metric source.
  4268  	ResourceID *string `json:"resourceId,omitempty"`
  4269  	// StartTime - The start time of the metric data.
  4270  	StartTime *date.Time `json:"startTime,omitempty"`
  4271  	// EndTime - The end time of the metric data.
  4272  	EndTime *date.Time `json:"endTime,omitempty"`
  4273  	// TimeGrain - The time granularity of the metric data.
  4274  	TimeGrain *string `json:"timeGrain,omitempty"`
  4275  	// PrimaryAggregation - The metric aggregation type. Possible values include: 'MetricAggregationTypeAverage', 'MetricAggregationTypeLast', 'MetricAggregationTypeMaximum', 'MetricAggregationTypeMinimum', 'MetricAggregationTypeNone', 'MetricAggregationTypeTotal'
  4276  	PrimaryAggregation MetricAggregationType `json:"primaryAggregation,omitempty"`
  4277  	// Name - The name of the metric.
  4278  	Name *MetricName `json:"name,omitempty"`
  4279  	// Dimensions - The metric dimensions.
  4280  	Dimensions *[]MetricDimension `json:"dimensions,omitempty"`
  4281  	// Unit - The unit of the metric data. Possible values include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds'
  4282  	Unit MetricUnit `json:"unit,omitempty"`
  4283  	// Type - The type of the metric data.
  4284  	Type *string `json:"type,omitempty"`
  4285  	// Values - The list of the metric data.
  4286  	Values *[]MetricData `json:"values,omitempty"`
  4287  }
  4288  
  4289  // NetworkAdapterList the collection of network adapters on the device.
  4290  type NetworkAdapterList struct {
  4291  	// Value - The value.
  4292  	Value *[]NetworkAdapters `json:"value,omitempty"`
  4293  }
  4294  
  4295  // NetworkAdapters represents the network adapter on device.
  4296  type NetworkAdapters struct {
  4297  	// InterfaceID - The ID of the network adapter. Possible values include: 'NetInterfaceIDInvalid', 'NetInterfaceIDData0', 'NetInterfaceIDData1', 'NetInterfaceIDData2', 'NetInterfaceIDData3', 'NetInterfaceIDData4', 'NetInterfaceIDData5'
  4298  	InterfaceID NetInterfaceID `json:"interfaceId,omitempty"`
  4299  	// NetInterfaceStatus - Value indicating status of network adapter. Possible values include: 'NetInterfaceStatusEnabled', 'NetInterfaceStatusDisabled'
  4300  	NetInterfaceStatus NetInterfaceStatus `json:"netInterfaceStatus,omitempty"`
  4301  	// IsDefault - Value indicating whether this instance is default.
  4302  	IsDefault *bool `json:"isDefault,omitempty"`
  4303  	// IscsiAndCloudStatus - Value indicating cloud and ISCSI status of network adapter. Possible values include: 'ISCSIAndCloudStatusDisabled', 'ISCSIAndCloudStatusIscsiEnabled', 'ISCSIAndCloudStatusCloudEnabled', 'ISCSIAndCloudStatusIscsiAndCloudEnabled'
  4304  	IscsiAndCloudStatus ISCSIAndCloudStatus `json:"iscsiAndCloudStatus,omitempty"`
  4305  	// Speed - The speed of the network adapter.
  4306  	Speed *int64 `json:"speed,omitempty"`
  4307  	// Mode - The mode of network adapter, either IPv4, IPv6 or both. Possible values include: 'NetworkModeInvalid', 'NetworkModeIPV4', 'NetworkModeIPV6', 'NetworkModeBOTH'
  4308  	Mode NetworkMode `json:"mode,omitempty"`
  4309  	// NicIpv4Settings - The IPv4 configuration of the network adapter.
  4310  	NicIpv4Settings *NicIPv4 `json:"nicIpv4Settings,omitempty"`
  4311  	// NicIpv6Settings - The IPv6 configuration of the network adapter.
  4312  	NicIpv6Settings *NicIPv6 `json:"nicIpv6Settings,omitempty"`
  4313  }
  4314  
  4315  // NetworkInterfaceData0Settings the 'Data 0' network interface card settings.
  4316  type NetworkInterfaceData0Settings struct {
  4317  	// ControllerZeroIP - The controller 0's IPv4 address.
  4318  	ControllerZeroIP *string `json:"controllerZeroIp,omitempty"`
  4319  	// ControllerOneIP - The controller 1's IPv4 address.
  4320  	ControllerOneIP *string `json:"controllerOneIp,omitempty"`
  4321  }
  4322  
  4323  // NetworkSettings represents the network settings of a device.
  4324  type NetworkSettings struct {
  4325  	autorest.Response `json:"-"`
  4326  	// NetworkSettingsProperties - The properties of network settings of a device.
  4327  	*NetworkSettingsProperties `json:"properties,omitempty"`
  4328  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  4329  	ID *string `json:"id,omitempty"`
  4330  	// Name - READ-ONLY; The name of the object.
  4331  	Name *string `json:"name,omitempty"`
  4332  	// Type - READ-ONLY; The hierarchical type of the object.
  4333  	Type *string `json:"type,omitempty"`
  4334  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  4335  	Kind Kind `json:"kind,omitempty"`
  4336  }
  4337  
  4338  // MarshalJSON is the custom marshaler for NetworkSettings.
  4339  func (ns NetworkSettings) MarshalJSON() ([]byte, error) {
  4340  	objectMap := make(map[string]interface{})
  4341  	if ns.NetworkSettingsProperties != nil {
  4342  		objectMap["properties"] = ns.NetworkSettingsProperties
  4343  	}
  4344  	if ns.Kind != "" {
  4345  		objectMap["kind"] = ns.Kind
  4346  	}
  4347  	return json.Marshal(objectMap)
  4348  }
  4349  
  4350  // UnmarshalJSON is the custom unmarshaler for NetworkSettings struct.
  4351  func (ns *NetworkSettings) UnmarshalJSON(body []byte) error {
  4352  	var m map[string]*json.RawMessage
  4353  	err := json.Unmarshal(body, &m)
  4354  	if err != nil {
  4355  		return err
  4356  	}
  4357  	for k, v := range m {
  4358  		switch k {
  4359  		case "properties":
  4360  			if v != nil {
  4361  				var networkSettingsProperties NetworkSettingsProperties
  4362  				err = json.Unmarshal(*v, &networkSettingsProperties)
  4363  				if err != nil {
  4364  					return err
  4365  				}
  4366  				ns.NetworkSettingsProperties = &networkSettingsProperties
  4367  			}
  4368  		case "id":
  4369  			if v != nil {
  4370  				var ID string
  4371  				err = json.Unmarshal(*v, &ID)
  4372  				if err != nil {
  4373  					return err
  4374  				}
  4375  				ns.ID = &ID
  4376  			}
  4377  		case "name":
  4378  			if v != nil {
  4379  				var name string
  4380  				err = json.Unmarshal(*v, &name)
  4381  				if err != nil {
  4382  					return err
  4383  				}
  4384  				ns.Name = &name
  4385  			}
  4386  		case "type":
  4387  			if v != nil {
  4388  				var typeVar string
  4389  				err = json.Unmarshal(*v, &typeVar)
  4390  				if err != nil {
  4391  					return err
  4392  				}
  4393  				ns.Type = &typeVar
  4394  			}
  4395  		case "kind":
  4396  			if v != nil {
  4397  				var kind Kind
  4398  				err = json.Unmarshal(*v, &kind)
  4399  				if err != nil {
  4400  					return err
  4401  				}
  4402  				ns.Kind = kind
  4403  			}
  4404  		}
  4405  	}
  4406  
  4407  	return nil
  4408  }
  4409  
  4410  // NetworkSettingsPatch represents the patch request for the network settings of a device.
  4411  type NetworkSettingsPatch struct {
  4412  	// NetworkSettingsPatchProperties - The properties of the network settings patch.
  4413  	*NetworkSettingsPatchProperties `json:"properties,omitempty"`
  4414  }
  4415  
  4416  // MarshalJSON is the custom marshaler for NetworkSettingsPatch.
  4417  func (nsp NetworkSettingsPatch) MarshalJSON() ([]byte, error) {
  4418  	objectMap := make(map[string]interface{})
  4419  	if nsp.NetworkSettingsPatchProperties != nil {
  4420  		objectMap["properties"] = nsp.NetworkSettingsPatchProperties
  4421  	}
  4422  	return json.Marshal(objectMap)
  4423  }
  4424  
  4425  // UnmarshalJSON is the custom unmarshaler for NetworkSettingsPatch struct.
  4426  func (nsp *NetworkSettingsPatch) UnmarshalJSON(body []byte) error {
  4427  	var m map[string]*json.RawMessage
  4428  	err := json.Unmarshal(body, &m)
  4429  	if err != nil {
  4430  		return err
  4431  	}
  4432  	for k, v := range m {
  4433  		switch k {
  4434  		case "properties":
  4435  			if v != nil {
  4436  				var networkSettingsPatchProperties NetworkSettingsPatchProperties
  4437  				err = json.Unmarshal(*v, &networkSettingsPatchProperties)
  4438  				if err != nil {
  4439  					return err
  4440  				}
  4441  				nsp.NetworkSettingsPatchProperties = &networkSettingsPatchProperties
  4442  			}
  4443  		}
  4444  	}
  4445  
  4446  	return nil
  4447  }
  4448  
  4449  // NetworkSettingsPatchProperties the properties of the network settings patch.
  4450  type NetworkSettingsPatchProperties struct {
  4451  	// DNSSettings - The DNS (Domain Name System) settings of device.
  4452  	DNSSettings *DNSSettings `json:"dnsSettings,omitempty"`
  4453  	// NetworkAdapters - The network adapter list of device.
  4454  	NetworkAdapters *NetworkAdapterList `json:"networkAdapters,omitempty"`
  4455  }
  4456  
  4457  // NetworkSettingsProperties the properties of the network settings of device.
  4458  type NetworkSettingsProperties struct {
  4459  	// DNSSettings - The DNS (Domain Name System) settings of device.
  4460  	DNSSettings *DNSSettings `json:"dnsSettings,omitempty"`
  4461  	// NetworkAdapters - The network adapter list of device.
  4462  	NetworkAdapters *NetworkAdapterList `json:"networkAdapters,omitempty"`
  4463  	// WebproxySettings - The webproxy settings of device.
  4464  	WebproxySettings *WebproxySettings `json:"webproxySettings,omitempty"`
  4465  }
  4466  
  4467  // NicIPv4 details related to the IPv4 address configuration.
  4468  type NicIPv4 struct {
  4469  	// Ipv4Address - The IPv4 address of the network adapter.
  4470  	Ipv4Address *string `json:"ipv4Address,omitempty"`
  4471  	// Ipv4Netmask - The IPv4 netmask of the network adapter.
  4472  	Ipv4Netmask *string `json:"ipv4Netmask,omitempty"`
  4473  	// Ipv4Gateway - The IPv4 gateway of the network adapter.
  4474  	Ipv4Gateway *string `json:"ipv4Gateway,omitempty"`
  4475  	// Controller0Ipv4Address - The IPv4 address of Controller0.
  4476  	Controller0Ipv4Address *string `json:"controller0Ipv4Address,omitempty"`
  4477  	// Controller1Ipv4Address - The IPv4 address of Controller1.
  4478  	Controller1Ipv4Address *string `json:"controller1Ipv4Address,omitempty"`
  4479  }
  4480  
  4481  // NicIPv6 details related to the IPv6 address configuration.
  4482  type NicIPv6 struct {
  4483  	// Ipv6Address - The IPv6 address of the network adapter.
  4484  	Ipv6Address *string `json:"ipv6Address,omitempty"`
  4485  	// Ipv6Prefix - The IPv6 prefix of the network adapter.
  4486  	Ipv6Prefix *string `json:"ipv6Prefix,omitempty"`
  4487  	// Ipv6Gateway - The IPv6 gateway of the network adapter.
  4488  	Ipv6Gateway *string `json:"ipv6Gateway,omitempty"`
  4489  	// Controller0Ipv6Address - The IPv6 address of Controller0.
  4490  	Controller0Ipv6Address *string `json:"controller0Ipv6Address,omitempty"`
  4491  	// Controller1Ipv6Address - The IPv6 address of Controller1.
  4492  	Controller1Ipv6Address *string `json:"controller1Ipv6Address,omitempty"`
  4493  }
  4494  
  4495  // PublicKey the public key.
  4496  type PublicKey struct {
  4497  	autorest.Response `json:"-"`
  4498  	// Key - The key.
  4499  	Key *string `json:"key,omitempty"`
  4500  }
  4501  
  4502  // RemoteManagementSettings the settings for remote management of a device.
  4503  type RemoteManagementSettings struct {
  4504  	// RemoteManagementMode - The remote management mode. Possible values include: 'RemoteManagementModeConfigurationUnknown', 'RemoteManagementModeConfigurationDisabled', 'RemoteManagementModeConfigurationHTTPSEnabled', 'RemoteManagementModeConfigurationHTTPSAndHTTPEnabled'
  4505  	RemoteManagementMode RemoteManagementModeConfiguration `json:"remoteManagementMode,omitempty"`
  4506  	// RemoteManagementCertificate - The remote management certificates.
  4507  	RemoteManagementCertificate *string `json:"remoteManagementCertificate,omitempty"`
  4508  }
  4509  
  4510  // RemoteManagementSettingsPatch the settings for updating remote management mode of the device.
  4511  type RemoteManagementSettingsPatch struct {
  4512  	// RemoteManagementMode - The remote management mode. Possible values include: 'RemoteManagementModeConfigurationUnknown', 'RemoteManagementModeConfigurationDisabled', 'RemoteManagementModeConfigurationHTTPSEnabled', 'RemoteManagementModeConfigurationHTTPSAndHTTPEnabled'
  4513  	RemoteManagementMode RemoteManagementModeConfiguration `json:"remoteManagementMode,omitempty"`
  4514  }
  4515  
  4516  // Resource the Azure Resource.
  4517  type Resource struct {
  4518  	// ID - READ-ONLY; The resource ID.
  4519  	ID *string `json:"id,omitempty"`
  4520  	// Name - READ-ONLY; The resource name.
  4521  	Name *string `json:"name,omitempty"`
  4522  	// Type - READ-ONLY; The resource type.
  4523  	Type *string `json:"type,omitempty"`
  4524  	// Location - The geo location of the resource.
  4525  	Location *string `json:"location,omitempty"`
  4526  	// Tags - The tags attached to the resource.
  4527  	Tags map[string]*string `json:"tags"`
  4528  }
  4529  
  4530  // MarshalJSON is the custom marshaler for Resource.
  4531  func (r Resource) MarshalJSON() ([]byte, error) {
  4532  	objectMap := make(map[string]interface{})
  4533  	if r.Location != nil {
  4534  		objectMap["location"] = r.Location
  4535  	}
  4536  	if r.Tags != nil {
  4537  		objectMap["tags"] = r.Tags
  4538  	}
  4539  	return json.Marshal(objectMap)
  4540  }
  4541  
  4542  // ScheduleRecurrence the schedule recurrence.
  4543  type ScheduleRecurrence struct {
  4544  	// RecurrenceType - The recurrence type. Possible values include: 'Minutes', 'Hourly', 'Daily', 'Weekly'
  4545  	RecurrenceType RecurrenceType `json:"recurrenceType,omitempty"`
  4546  	// RecurrenceValue - The recurrence value.
  4547  	RecurrenceValue *int32 `json:"recurrenceValue,omitempty"`
  4548  	// WeeklyDaysList - The week days list. Applicable only for schedules of recurrence type 'weekly'.
  4549  	WeeklyDaysList *[]DayOfWeek `json:"weeklyDaysList,omitempty"`
  4550  }
  4551  
  4552  // SecondaryDNSSettings the secondary DNS settings.
  4553  type SecondaryDNSSettings struct {
  4554  	// SecondaryDNSServers - The list of secondary DNS Server IP addresses.
  4555  	SecondaryDNSServers *[]string `json:"secondaryDnsServers,omitempty"`
  4556  }
  4557  
  4558  // SecuritySettings the security settings of a device.
  4559  type SecuritySettings struct {
  4560  	autorest.Response `json:"-"`
  4561  	// SecuritySettingsProperties - The properties of the security settings of a device.
  4562  	*SecuritySettingsProperties `json:"properties,omitempty"`
  4563  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  4564  	ID *string `json:"id,omitempty"`
  4565  	// Name - READ-ONLY; The name of the object.
  4566  	Name *string `json:"name,omitempty"`
  4567  	// Type - READ-ONLY; The hierarchical type of the object.
  4568  	Type *string `json:"type,omitempty"`
  4569  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  4570  	Kind Kind `json:"kind,omitempty"`
  4571  }
  4572  
  4573  // MarshalJSON is the custom marshaler for SecuritySettings.
  4574  func (ss SecuritySettings) MarshalJSON() ([]byte, error) {
  4575  	objectMap := make(map[string]interface{})
  4576  	if ss.SecuritySettingsProperties != nil {
  4577  		objectMap["properties"] = ss.SecuritySettingsProperties
  4578  	}
  4579  	if ss.Kind != "" {
  4580  		objectMap["kind"] = ss.Kind
  4581  	}
  4582  	return json.Marshal(objectMap)
  4583  }
  4584  
  4585  // UnmarshalJSON is the custom unmarshaler for SecuritySettings struct.
  4586  func (ss *SecuritySettings) UnmarshalJSON(body []byte) error {
  4587  	var m map[string]*json.RawMessage
  4588  	err := json.Unmarshal(body, &m)
  4589  	if err != nil {
  4590  		return err
  4591  	}
  4592  	for k, v := range m {
  4593  		switch k {
  4594  		case "properties":
  4595  			if v != nil {
  4596  				var securitySettingsProperties SecuritySettingsProperties
  4597  				err = json.Unmarshal(*v, &securitySettingsProperties)
  4598  				if err != nil {
  4599  					return err
  4600  				}
  4601  				ss.SecuritySettingsProperties = &securitySettingsProperties
  4602  			}
  4603  		case "id":
  4604  			if v != nil {
  4605  				var ID string
  4606  				err = json.Unmarshal(*v, &ID)
  4607  				if err != nil {
  4608  					return err
  4609  				}
  4610  				ss.ID = &ID
  4611  			}
  4612  		case "name":
  4613  			if v != nil {
  4614  				var name string
  4615  				err = json.Unmarshal(*v, &name)
  4616  				if err != nil {
  4617  					return err
  4618  				}
  4619  				ss.Name = &name
  4620  			}
  4621  		case "type":
  4622  			if v != nil {
  4623  				var typeVar string
  4624  				err = json.Unmarshal(*v, &typeVar)
  4625  				if err != nil {
  4626  					return err
  4627  				}
  4628  				ss.Type = &typeVar
  4629  			}
  4630  		case "kind":
  4631  			if v != nil {
  4632  				var kind Kind
  4633  				err = json.Unmarshal(*v, &kind)
  4634  				if err != nil {
  4635  					return err
  4636  				}
  4637  				ss.Kind = kind
  4638  			}
  4639  		}
  4640  	}
  4641  
  4642  	return nil
  4643  }
  4644  
  4645  // SecuritySettingsPatch represents the patch request for the security settings of a device.
  4646  type SecuritySettingsPatch struct {
  4647  	// SecuritySettingsPatchProperties - The properties of the security settings patch.
  4648  	*SecuritySettingsPatchProperties `json:"properties,omitempty"`
  4649  }
  4650  
  4651  // MarshalJSON is the custom marshaler for SecuritySettingsPatch.
  4652  func (ssp SecuritySettingsPatch) MarshalJSON() ([]byte, error) {
  4653  	objectMap := make(map[string]interface{})
  4654  	if ssp.SecuritySettingsPatchProperties != nil {
  4655  		objectMap["properties"] = ssp.SecuritySettingsPatchProperties
  4656  	}
  4657  	return json.Marshal(objectMap)
  4658  }
  4659  
  4660  // UnmarshalJSON is the custom unmarshaler for SecuritySettingsPatch struct.
  4661  func (ssp *SecuritySettingsPatch) UnmarshalJSON(body []byte) error {
  4662  	var m map[string]*json.RawMessage
  4663  	err := json.Unmarshal(body, &m)
  4664  	if err != nil {
  4665  		return err
  4666  	}
  4667  	for k, v := range m {
  4668  		switch k {
  4669  		case "properties":
  4670  			if v != nil {
  4671  				var securitySettingsPatchProperties SecuritySettingsPatchProperties
  4672  				err = json.Unmarshal(*v, &securitySettingsPatchProperties)
  4673  				if err != nil {
  4674  					return err
  4675  				}
  4676  				ssp.SecuritySettingsPatchProperties = &securitySettingsPatchProperties
  4677  			}
  4678  		}
  4679  	}
  4680  
  4681  	return nil
  4682  }
  4683  
  4684  // SecuritySettingsPatchProperties the properties of the security settings patch.
  4685  type SecuritySettingsPatchProperties struct {
  4686  	// RemoteManagementSettings - The remote management settings.
  4687  	RemoteManagementSettings *RemoteManagementSettingsPatch `json:"remoteManagementSettings,omitempty"`
  4688  	// DeviceAdminPassword - The device administrator password.
  4689  	DeviceAdminPassword *AsymmetricEncryptedSecret `json:"deviceAdminPassword,omitempty"`
  4690  	// SnapshotPassword - The snapshot manager password.
  4691  	SnapshotPassword *AsymmetricEncryptedSecret `json:"snapshotPassword,omitempty"`
  4692  	// ChapSettings - The device CHAP and reverse-CHAP settings.
  4693  	ChapSettings *ChapSettings `json:"chapSettings,omitempty"`
  4694  	// CloudApplianceSettings - The cloud appliance settings.
  4695  	CloudApplianceSettings *CloudApplianceSettings `json:"cloudApplianceSettings,omitempty"`
  4696  }
  4697  
  4698  // SecuritySettingsProperties the properties of security settings of a device.
  4699  type SecuritySettingsProperties struct {
  4700  	// RemoteManagementSettings - The settings for remote management of a device.
  4701  	RemoteManagementSettings *RemoteManagementSettings `json:"remoteManagementSettings,omitempty"`
  4702  	// ChapSettings - The Challenge-Handshake Authentication Protocol (CHAP) settings.
  4703  	ChapSettings *ChapSettings `json:"chapSettings,omitempty"`
  4704  }
  4705  
  4706  // SendTestAlertEmailRequest the request for sending test alert email
  4707  type SendTestAlertEmailRequest struct {
  4708  	// EmailList - The list of email IDs to send the test alert email
  4709  	EmailList *[]string `json:"emailList,omitempty"`
  4710  }
  4711  
  4712  // StorageAccountCredential the storage account credential.
  4713  type StorageAccountCredential struct {
  4714  	autorest.Response `json:"-"`
  4715  	// StorageAccountCredentialProperties - The storage account credential properties.
  4716  	*StorageAccountCredentialProperties `json:"properties,omitempty"`
  4717  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  4718  	ID *string `json:"id,omitempty"`
  4719  	// Name - READ-ONLY; The name of the object.
  4720  	Name *string `json:"name,omitempty"`
  4721  	// Type - READ-ONLY; The hierarchical type of the object.
  4722  	Type *string `json:"type,omitempty"`
  4723  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  4724  	Kind Kind `json:"kind,omitempty"`
  4725  }
  4726  
  4727  // MarshalJSON is the custom marshaler for StorageAccountCredential.
  4728  func (sac StorageAccountCredential) MarshalJSON() ([]byte, error) {
  4729  	objectMap := make(map[string]interface{})
  4730  	if sac.StorageAccountCredentialProperties != nil {
  4731  		objectMap["properties"] = sac.StorageAccountCredentialProperties
  4732  	}
  4733  	if sac.Kind != "" {
  4734  		objectMap["kind"] = sac.Kind
  4735  	}
  4736  	return json.Marshal(objectMap)
  4737  }
  4738  
  4739  // UnmarshalJSON is the custom unmarshaler for StorageAccountCredential struct.
  4740  func (sac *StorageAccountCredential) UnmarshalJSON(body []byte) error {
  4741  	var m map[string]*json.RawMessage
  4742  	err := json.Unmarshal(body, &m)
  4743  	if err != nil {
  4744  		return err
  4745  	}
  4746  	for k, v := range m {
  4747  		switch k {
  4748  		case "properties":
  4749  			if v != nil {
  4750  				var storageAccountCredentialProperties StorageAccountCredentialProperties
  4751  				err = json.Unmarshal(*v, &storageAccountCredentialProperties)
  4752  				if err != nil {
  4753  					return err
  4754  				}
  4755  				sac.StorageAccountCredentialProperties = &storageAccountCredentialProperties
  4756  			}
  4757  		case "id":
  4758  			if v != nil {
  4759  				var ID string
  4760  				err = json.Unmarshal(*v, &ID)
  4761  				if err != nil {
  4762  					return err
  4763  				}
  4764  				sac.ID = &ID
  4765  			}
  4766  		case "name":
  4767  			if v != nil {
  4768  				var name string
  4769  				err = json.Unmarshal(*v, &name)
  4770  				if err != nil {
  4771  					return err
  4772  				}
  4773  				sac.Name = &name
  4774  			}
  4775  		case "type":
  4776  			if v != nil {
  4777  				var typeVar string
  4778  				err = json.Unmarshal(*v, &typeVar)
  4779  				if err != nil {
  4780  					return err
  4781  				}
  4782  				sac.Type = &typeVar
  4783  			}
  4784  		case "kind":
  4785  			if v != nil {
  4786  				var kind Kind
  4787  				err = json.Unmarshal(*v, &kind)
  4788  				if err != nil {
  4789  					return err
  4790  				}
  4791  				sac.Kind = kind
  4792  			}
  4793  		}
  4794  	}
  4795  
  4796  	return nil
  4797  }
  4798  
  4799  // StorageAccountCredentialList the collection of storage account credential entities.
  4800  type StorageAccountCredentialList struct {
  4801  	autorest.Response `json:"-"`
  4802  	// Value - The value.
  4803  	Value *[]StorageAccountCredential `json:"value,omitempty"`
  4804  }
  4805  
  4806  // StorageAccountCredentialProperties the storage account credential properties.
  4807  type StorageAccountCredentialProperties struct {
  4808  	// EndPoint - The storage endpoint
  4809  	EndPoint *string `json:"endPoint,omitempty"`
  4810  	// SslStatus - Signifies whether SSL needs to be enabled or not. Possible values include: 'SslStatusEnabled', 'SslStatusDisabled'
  4811  	SslStatus SslStatus `json:"sslStatus,omitempty"`
  4812  	// AccessKey - The details of the storage account password.
  4813  	AccessKey *AsymmetricEncryptedSecret `json:"accessKey,omitempty"`
  4814  	// VolumesCount - READ-ONLY; The count of volumes using this storage account credential.
  4815  	VolumesCount *int32 `json:"volumesCount,omitempty"`
  4816  }
  4817  
  4818  // MarshalJSON is the custom marshaler for StorageAccountCredentialProperties.
  4819  func (sacp StorageAccountCredentialProperties) MarshalJSON() ([]byte, error) {
  4820  	objectMap := make(map[string]interface{})
  4821  	if sacp.EndPoint != nil {
  4822  		objectMap["endPoint"] = sacp.EndPoint
  4823  	}
  4824  	if sacp.SslStatus != "" {
  4825  		objectMap["sslStatus"] = sacp.SslStatus
  4826  	}
  4827  	if sacp.AccessKey != nil {
  4828  		objectMap["accessKey"] = sacp.AccessKey
  4829  	}
  4830  	return json.Marshal(objectMap)
  4831  }
  4832  
  4833  // StorageAccountCredentialsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
  4834  // of a long-running operation.
  4835  type StorageAccountCredentialsCreateOrUpdateFuture struct {
  4836  	azure.FutureAPI
  4837  	// Result returns the result of the asynchronous operation.
  4838  	// If the operation has not completed it will return an error.
  4839  	Result func(StorageAccountCredentialsClient) (StorageAccountCredential, error)
  4840  }
  4841  
  4842  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4843  func (future *StorageAccountCredentialsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  4844  	var azFuture azure.Future
  4845  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4846  		return err
  4847  	}
  4848  	future.FutureAPI = &azFuture
  4849  	future.Result = future.result
  4850  	return nil
  4851  }
  4852  
  4853  // result is the default implementation for StorageAccountCredentialsCreateOrUpdateFuture.Result.
  4854  func (future *StorageAccountCredentialsCreateOrUpdateFuture) result(client StorageAccountCredentialsClient) (sac StorageAccountCredential, err error) {
  4855  	var done bool
  4856  	done, err = future.DoneWithContext(context.Background(), client)
  4857  	if err != nil {
  4858  		err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  4859  		return
  4860  	}
  4861  	if !done {
  4862  		sac.Response.Response = future.Response()
  4863  		err = azure.NewAsyncOpIncompleteError("storsimple.StorageAccountCredentialsCreateOrUpdateFuture")
  4864  		return
  4865  	}
  4866  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  4867  	if sac.Response.Response, err = future.GetResult(sender); err == nil && sac.Response.Response.StatusCode != http.StatusNoContent {
  4868  		sac, err = client.CreateOrUpdateResponder(sac.Response.Response)
  4869  		if err != nil {
  4870  			err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsCreateOrUpdateFuture", "Result", sac.Response.Response, "Failure responding to request")
  4871  		}
  4872  	}
  4873  	return
  4874  }
  4875  
  4876  // StorageAccountCredentialsDeleteFuture an abstraction for monitoring and retrieving the results of a
  4877  // long-running operation.
  4878  type StorageAccountCredentialsDeleteFuture struct {
  4879  	azure.FutureAPI
  4880  	// Result returns the result of the asynchronous operation.
  4881  	// If the operation has not completed it will return an error.
  4882  	Result func(StorageAccountCredentialsClient) (autorest.Response, error)
  4883  }
  4884  
  4885  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  4886  func (future *StorageAccountCredentialsDeleteFuture) UnmarshalJSON(body []byte) error {
  4887  	var azFuture azure.Future
  4888  	if err := json.Unmarshal(body, &azFuture); err != nil {
  4889  		return err
  4890  	}
  4891  	future.FutureAPI = &azFuture
  4892  	future.Result = future.result
  4893  	return nil
  4894  }
  4895  
  4896  // result is the default implementation for StorageAccountCredentialsDeleteFuture.Result.
  4897  func (future *StorageAccountCredentialsDeleteFuture) result(client StorageAccountCredentialsClient) (ar autorest.Response, err error) {
  4898  	var done bool
  4899  	done, err = future.DoneWithContext(context.Background(), client)
  4900  	if err != nil {
  4901  		err = autorest.NewErrorWithError(err, "storsimple.StorageAccountCredentialsDeleteFuture", "Result", future.Response(), "Polling failure")
  4902  		return
  4903  	}
  4904  	if !done {
  4905  		ar.Response = future.Response()
  4906  		err = azure.NewAsyncOpIncompleteError("storsimple.StorageAccountCredentialsDeleteFuture")
  4907  		return
  4908  	}
  4909  	ar.Response = future.Response()
  4910  	return
  4911  }
  4912  
  4913  // SymmetricEncryptedSecret represents the secrets encrypted using Symmetric Encryption Key.
  4914  type SymmetricEncryptedSecret struct {
  4915  	autorest.Response `json:"-"`
  4916  	// Value - The value of the secret itself. If the secret is in plaintext or null then EncryptionAlgorithm will be none.
  4917  	Value *string `json:"value,omitempty"`
  4918  	// ValueCertificateThumbprint - The thumbprint of the cert that was used to encrypt "Value".
  4919  	ValueCertificateThumbprint *string `json:"valueCertificateThumbprint,omitempty"`
  4920  	// EncryptionAlgorithm - The algorithm used to encrypt the "Value". Possible values include: 'EncryptionAlgorithmNone', 'EncryptionAlgorithmAES256', 'EncryptionAlgorithmRSAESPKCS1V15'
  4921  	EncryptionAlgorithm EncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"`
  4922  }
  4923  
  4924  // TargetEligibilityErrorMessage the error/warning message due to which the device is ineligible as a
  4925  // failover target device.
  4926  type TargetEligibilityErrorMessage struct {
  4927  	// Message - The localized error message stating the reason why the device is not eligible as a target device.
  4928  	Message *string `json:"message,omitempty"`
  4929  	// Resolution - The localized resolution message for the error.
  4930  	Resolution *string `json:"resolution,omitempty"`
  4931  	// ResultCode - The result code for the error, due to which the device does not qualify as a failover target device. Possible values include: 'TargetAndSourceCannotBeSameError', 'TargetIsNotOnlineError', 'TargetSourceIncompatibleVersionError', 'LocalToTieredVolumesConversionWarning', 'TargetInsufficientCapacityError', 'TargetInsufficientLocalVolumeMemoryError', 'TargetInsufficientTieredVolumeMemoryError'
  4932  	ResultCode TargetEligibilityResultCode `json:"resultCode,omitempty"`
  4933  }
  4934  
  4935  // TargetEligibilityResult the eligibility result of device, as a failover target device.
  4936  type TargetEligibilityResult struct {
  4937  	// EligibilityStatus - The eligibility status of device, as a failover target device. Possible values include: 'TargetEligibilityStatusNotEligible', 'TargetEligibilityStatusEligible'
  4938  	EligibilityStatus TargetEligibilityStatus `json:"eligibilityStatus,omitempty"`
  4939  	// Messages - The list of error messages, if a device does not qualify as a failover target device.
  4940  	Messages *[]TargetEligibilityErrorMessage `json:"messages,omitempty"`
  4941  }
  4942  
  4943  // Time the time.
  4944  type Time struct {
  4945  	// Hours - The hour.
  4946  	Hours *int32 `json:"hours,omitempty"`
  4947  	// Minutes - The minute.
  4948  	Minutes *int32 `json:"minutes,omitempty"`
  4949  	// Seconds - The second.
  4950  	Seconds *int32 `json:"seconds,omitempty"`
  4951  }
  4952  
  4953  // TimeSettings the time settings of a device.
  4954  type TimeSettings struct {
  4955  	autorest.Response `json:"-"`
  4956  	// TimeSettingsProperties - The properties of the time settings of a device.
  4957  	*TimeSettingsProperties `json:"properties,omitempty"`
  4958  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  4959  	ID *string `json:"id,omitempty"`
  4960  	// Name - READ-ONLY; The name of the object.
  4961  	Name *string `json:"name,omitempty"`
  4962  	// Type - READ-ONLY; The hierarchical type of the object.
  4963  	Type *string `json:"type,omitempty"`
  4964  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  4965  	Kind Kind `json:"kind,omitempty"`
  4966  }
  4967  
  4968  // MarshalJSON is the custom marshaler for TimeSettings.
  4969  func (ts TimeSettings) MarshalJSON() ([]byte, error) {
  4970  	objectMap := make(map[string]interface{})
  4971  	if ts.TimeSettingsProperties != nil {
  4972  		objectMap["properties"] = ts.TimeSettingsProperties
  4973  	}
  4974  	if ts.Kind != "" {
  4975  		objectMap["kind"] = ts.Kind
  4976  	}
  4977  	return json.Marshal(objectMap)
  4978  }
  4979  
  4980  // UnmarshalJSON is the custom unmarshaler for TimeSettings struct.
  4981  func (ts *TimeSettings) UnmarshalJSON(body []byte) error {
  4982  	var m map[string]*json.RawMessage
  4983  	err := json.Unmarshal(body, &m)
  4984  	if err != nil {
  4985  		return err
  4986  	}
  4987  	for k, v := range m {
  4988  		switch k {
  4989  		case "properties":
  4990  			if v != nil {
  4991  				var timeSettingsProperties TimeSettingsProperties
  4992  				err = json.Unmarshal(*v, &timeSettingsProperties)
  4993  				if err != nil {
  4994  					return err
  4995  				}
  4996  				ts.TimeSettingsProperties = &timeSettingsProperties
  4997  			}
  4998  		case "id":
  4999  			if v != nil {
  5000  				var ID string
  5001  				err = json.Unmarshal(*v, &ID)
  5002  				if err != nil {
  5003  					return err
  5004  				}
  5005  				ts.ID = &ID
  5006  			}
  5007  		case "name":
  5008  			if v != nil {
  5009  				var name string
  5010  				err = json.Unmarshal(*v, &name)
  5011  				if err != nil {
  5012  					return err
  5013  				}
  5014  				ts.Name = &name
  5015  			}
  5016  		case "type":
  5017  			if v != nil {
  5018  				var typeVar string
  5019  				err = json.Unmarshal(*v, &typeVar)
  5020  				if err != nil {
  5021  					return err
  5022  				}
  5023  				ts.Type = &typeVar
  5024  			}
  5025  		case "kind":
  5026  			if v != nil {
  5027  				var kind Kind
  5028  				err = json.Unmarshal(*v, &kind)
  5029  				if err != nil {
  5030  					return err
  5031  				}
  5032  				ts.Kind = kind
  5033  			}
  5034  		}
  5035  	}
  5036  
  5037  	return nil
  5038  }
  5039  
  5040  // TimeSettingsProperties the properties of time settings of a device.
  5041  type TimeSettingsProperties struct {
  5042  	// TimeZone - The timezone of device, like '(UTC -06:00) Central America'
  5043  	TimeZone *string `json:"timeZone,omitempty"`
  5044  	// PrimaryTimeServer - The primary Network Time Protocol (NTP) server name, like 'time.windows.com'.
  5045  	PrimaryTimeServer *string `json:"primaryTimeServer,omitempty"`
  5046  	// SecondaryTimeServer - The secondary Network Time Protocol (NTP) server name, like 'time.contoso.com'. It's optional.
  5047  	SecondaryTimeServer *[]string `json:"secondaryTimeServer,omitempty"`
  5048  }
  5049  
  5050  // Updates the updates profile of a device.
  5051  type Updates struct {
  5052  	autorest.Response `json:"-"`
  5053  	// UpdatesProperties - The properties of the updates profile.
  5054  	*UpdatesProperties `json:"properties,omitempty"`
  5055  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  5056  	ID *string `json:"id,omitempty"`
  5057  	// Name - READ-ONLY; The name of the object.
  5058  	Name *string `json:"name,omitempty"`
  5059  	// Type - READ-ONLY; The hierarchical type of the object.
  5060  	Type *string `json:"type,omitempty"`
  5061  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  5062  	Kind Kind `json:"kind,omitempty"`
  5063  }
  5064  
  5065  // MarshalJSON is the custom marshaler for Updates.
  5066  func (u Updates) MarshalJSON() ([]byte, error) {
  5067  	objectMap := make(map[string]interface{})
  5068  	if u.UpdatesProperties != nil {
  5069  		objectMap["properties"] = u.UpdatesProperties
  5070  	}
  5071  	if u.Kind != "" {
  5072  		objectMap["kind"] = u.Kind
  5073  	}
  5074  	return json.Marshal(objectMap)
  5075  }
  5076  
  5077  // UnmarshalJSON is the custom unmarshaler for Updates struct.
  5078  func (u *Updates) UnmarshalJSON(body []byte) error {
  5079  	var m map[string]*json.RawMessage
  5080  	err := json.Unmarshal(body, &m)
  5081  	if err != nil {
  5082  		return err
  5083  	}
  5084  	for k, v := range m {
  5085  		switch k {
  5086  		case "properties":
  5087  			if v != nil {
  5088  				var updatesProperties UpdatesProperties
  5089  				err = json.Unmarshal(*v, &updatesProperties)
  5090  				if err != nil {
  5091  					return err
  5092  				}
  5093  				u.UpdatesProperties = &updatesProperties
  5094  			}
  5095  		case "id":
  5096  			if v != nil {
  5097  				var ID string
  5098  				err = json.Unmarshal(*v, &ID)
  5099  				if err != nil {
  5100  					return err
  5101  				}
  5102  				u.ID = &ID
  5103  			}
  5104  		case "name":
  5105  			if v != nil {
  5106  				var name string
  5107  				err = json.Unmarshal(*v, &name)
  5108  				if err != nil {
  5109  					return err
  5110  				}
  5111  				u.Name = &name
  5112  			}
  5113  		case "type":
  5114  			if v != nil {
  5115  				var typeVar string
  5116  				err = json.Unmarshal(*v, &typeVar)
  5117  				if err != nil {
  5118  					return err
  5119  				}
  5120  				u.Type = &typeVar
  5121  			}
  5122  		case "kind":
  5123  			if v != nil {
  5124  				var kind Kind
  5125  				err = json.Unmarshal(*v, &kind)
  5126  				if err != nil {
  5127  					return err
  5128  				}
  5129  				u.Kind = kind
  5130  			}
  5131  		}
  5132  	}
  5133  
  5134  	return nil
  5135  }
  5136  
  5137  // UpdatesProperties the properties of the updates profile.
  5138  type UpdatesProperties struct {
  5139  	// RegularUpdatesAvailable - Set to 'true' if regular updates are available for the device.
  5140  	RegularUpdatesAvailable *bool `json:"regularUpdatesAvailable,omitempty"`
  5141  	// MaintenanceModeUpdatesAvailable - Set to 'true' if maintenance mode update available.
  5142  	MaintenanceModeUpdatesAvailable *bool `json:"maintenanceModeUpdatesAvailable,omitempty"`
  5143  	// IsUpdateInProgress - Indicates whether an update is in progress or not.
  5144  	IsUpdateInProgress *bool `json:"isUpdateInProgress,omitempty"`
  5145  	// LastUpdatedTime - The time when the last update was completed.
  5146  	LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"`
  5147  }
  5148  
  5149  // VMImage the virtual machine image.
  5150  type VMImage struct {
  5151  	// Name - The name.
  5152  	Name *string `json:"name,omitempty"`
  5153  	// Version - The version.
  5154  	Version *string `json:"version,omitempty"`
  5155  	// Offer - The offer.
  5156  	Offer *string `json:"offer,omitempty"`
  5157  	// Publisher - The publisher.
  5158  	Publisher *string `json:"publisher,omitempty"`
  5159  	// Sku - The SKU.
  5160  	Sku *string `json:"sku,omitempty"`
  5161  }
  5162  
  5163  // Volume the volume.
  5164  type Volume struct {
  5165  	autorest.Response `json:"-"`
  5166  	// VolumeProperties - The properties of the volume.
  5167  	*VolumeProperties `json:"properties,omitempty"`
  5168  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  5169  	ID *string `json:"id,omitempty"`
  5170  	// Name - READ-ONLY; The name of the object.
  5171  	Name *string `json:"name,omitempty"`
  5172  	// Type - READ-ONLY; The hierarchical type of the object.
  5173  	Type *string `json:"type,omitempty"`
  5174  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  5175  	Kind Kind `json:"kind,omitempty"`
  5176  }
  5177  
  5178  // MarshalJSON is the custom marshaler for Volume.
  5179  func (vVar Volume) MarshalJSON() ([]byte, error) {
  5180  	objectMap := make(map[string]interface{})
  5181  	if vVar.VolumeProperties != nil {
  5182  		objectMap["properties"] = vVar.VolumeProperties
  5183  	}
  5184  	if vVar.Kind != "" {
  5185  		objectMap["kind"] = vVar.Kind
  5186  	}
  5187  	return json.Marshal(objectMap)
  5188  }
  5189  
  5190  // UnmarshalJSON is the custom unmarshaler for Volume struct.
  5191  func (vVar *Volume) UnmarshalJSON(body []byte) error {
  5192  	var m map[string]*json.RawMessage
  5193  	err := json.Unmarshal(body, &m)
  5194  	if err != nil {
  5195  		return err
  5196  	}
  5197  	for k, v := range m {
  5198  		switch k {
  5199  		case "properties":
  5200  			if v != nil {
  5201  				var volumeProperties VolumeProperties
  5202  				err = json.Unmarshal(*v, &volumeProperties)
  5203  				if err != nil {
  5204  					return err
  5205  				}
  5206  				vVar.VolumeProperties = &volumeProperties
  5207  			}
  5208  		case "id":
  5209  			if v != nil {
  5210  				var ID string
  5211  				err = json.Unmarshal(*v, &ID)
  5212  				if err != nil {
  5213  					return err
  5214  				}
  5215  				vVar.ID = &ID
  5216  			}
  5217  		case "name":
  5218  			if v != nil {
  5219  				var name string
  5220  				err = json.Unmarshal(*v, &name)
  5221  				if err != nil {
  5222  					return err
  5223  				}
  5224  				vVar.Name = &name
  5225  			}
  5226  		case "type":
  5227  			if v != nil {
  5228  				var typeVar string
  5229  				err = json.Unmarshal(*v, &typeVar)
  5230  				if err != nil {
  5231  					return err
  5232  				}
  5233  				vVar.Type = &typeVar
  5234  			}
  5235  		case "kind":
  5236  			if v != nil {
  5237  				var kind Kind
  5238  				err = json.Unmarshal(*v, &kind)
  5239  				if err != nil {
  5240  					return err
  5241  				}
  5242  				vVar.Kind = kind
  5243  			}
  5244  		}
  5245  	}
  5246  
  5247  	return nil
  5248  }
  5249  
  5250  // VolumeContainer the volume container.
  5251  type VolumeContainer struct {
  5252  	autorest.Response `json:"-"`
  5253  	// VolumeContainerProperties - The volume container properties.
  5254  	*VolumeContainerProperties `json:"properties,omitempty"`
  5255  	// ID - READ-ONLY; The path ID that uniquely identifies the object.
  5256  	ID *string `json:"id,omitempty"`
  5257  	// Name - READ-ONLY; The name of the object.
  5258  	Name *string `json:"name,omitempty"`
  5259  	// Type - READ-ONLY; The hierarchical type of the object.
  5260  	Type *string `json:"type,omitempty"`
  5261  	// Kind - The Kind of the object. Currently only Series8000 is supported. Possible values include: 'Series8000'
  5262  	Kind Kind `json:"kind,omitempty"`
  5263  }
  5264  
  5265  // MarshalJSON is the custom marshaler for VolumeContainer.
  5266  func (vc VolumeContainer) MarshalJSON() ([]byte, error) {
  5267  	objectMap := make(map[string]interface{})
  5268  	if vc.VolumeContainerProperties != nil {
  5269  		objectMap["properties"] = vc.VolumeContainerProperties
  5270  	}
  5271  	if vc.Kind != "" {
  5272  		objectMap["kind"] = vc.Kind
  5273  	}
  5274  	return json.Marshal(objectMap)
  5275  }
  5276  
  5277  // UnmarshalJSON is the custom unmarshaler for VolumeContainer struct.
  5278  func (vc *VolumeContainer) UnmarshalJSON(body []byte) error {
  5279  	var m map[string]*json.RawMessage
  5280  	err := json.Unmarshal(body, &m)
  5281  	if err != nil {
  5282  		return err
  5283  	}
  5284  	for k, v := range m {
  5285  		switch k {
  5286  		case "properties":
  5287  			if v != nil {
  5288  				var volumeContainerProperties VolumeContainerProperties
  5289  				err = json.Unmarshal(*v, &volumeContainerProperties)
  5290  				if err != nil {
  5291  					return err
  5292  				}
  5293  				vc.VolumeContainerProperties = &volumeContainerProperties
  5294  			}
  5295  		case "id":
  5296  			if v != nil {
  5297  				var ID string
  5298  				err = json.Unmarshal(*v, &ID)
  5299  				if err != nil {
  5300  					return err
  5301  				}
  5302  				vc.ID = &ID
  5303  			}
  5304  		case "name":
  5305  			if v != nil {
  5306  				var name string
  5307  				err = json.Unmarshal(*v, &name)
  5308  				if err != nil {
  5309  					return err
  5310  				}
  5311  				vc.Name = &name
  5312  			}
  5313  		case "type":
  5314  			if v != nil {
  5315  				var typeVar string
  5316  				err = json.Unmarshal(*v, &typeVar)
  5317  				if err != nil {
  5318  					return err
  5319  				}
  5320  				vc.Type = &typeVar
  5321  			}
  5322  		case "kind":
  5323  			if v != nil {
  5324  				var kind Kind
  5325  				err = json.Unmarshal(*v, &kind)
  5326  				if err != nil {
  5327  					return err
  5328  				}
  5329  				vc.Kind = kind
  5330  			}
  5331  		}
  5332  	}
  5333  
  5334  	return nil
  5335  }
  5336  
  5337  // VolumeContainerFailoverMetadata the metadata of the volume container, that is being considered as part
  5338  // of a failover set.
  5339  type VolumeContainerFailoverMetadata struct {
  5340  	// VolumeContainerID - The path ID of the volume container.
  5341  	VolumeContainerID *string `json:"volumeContainerId,omitempty"`
  5342  	// Volumes - The list of metadata of volumes inside the volume container, which contains valid cloud snapshots.
  5343  	Volumes *[]VolumeFailoverMetadata `json:"volumes,omitempty"`
  5344  }
  5345  
  5346  // VolumeContainerList the collection of volume container entities.
  5347  type VolumeContainerList struct {
  5348  	autorest.Response `json:"-"`
  5349  	// Value - The value.
  5350  	Value *[]VolumeContainer `json:"value,omitempty"`
  5351  }
  5352  
  5353  // VolumeContainerProperties the properties of volume container.
  5354  type VolumeContainerProperties struct {
  5355  	// EncryptionKey - The key used to encrypt data in the volume container. It is required when property 'EncryptionStatus' is "Enabled".
  5356  	EncryptionKey *AsymmetricEncryptedSecret `json:"encryptionKey,omitempty"`
  5357  	// EncryptionStatus - READ-ONLY; The flag to denote whether encryption is enabled or not. Possible values include: 'EncryptionStatusEnabled', 'EncryptionStatusDisabled'
  5358  	EncryptionStatus EncryptionStatus `json:"encryptionStatus,omitempty"`
  5359  	// VolumeCount - READ-ONLY; The number of volumes in the volume Container.
  5360  	VolumeCount *int32 `json:"volumeCount,omitempty"`
  5361  	// StorageAccountCredentialID - The path ID of storage account associated with the volume container.
  5362  	StorageAccountCredentialID *string `json:"storageAccountCredentialId,omitempty"`
  5363  	// OwnerShipStatus - READ-ONLY; The owner ship status of the volume container. Only when the status is "NotOwned", the delete operation on the volume container is permitted. Possible values include: 'Owned', 'NotOwned'
  5364  	OwnerShipStatus OwnerShipStatus `json:"ownerShipStatus,omitempty"`
  5365  	// BandWidthRateInMbps - The bandwidth-rate set on the volume container.
  5366  	BandWidthRateInMbps *int32 `json:"bandWidthRateInMbps,omitempty"`
  5367  	// BandwidthSettingID - The ID of the bandwidth setting associated with the volume container.
  5368  	BandwidthSettingID *string `json:"bandwidthSettingId,omitempty"`
  5369  	// TotalCloudStorageUsageInBytes - READ-ONLY; The total cloud storage for the volume container.
  5370  	TotalCloudStorageUsageInBytes *int64 `json:"totalCloudStorageUsageInBytes,omitempty"`
  5371  }
  5372  
  5373  // MarshalJSON is the custom marshaler for VolumeContainerProperties.
  5374  func (vcp VolumeContainerProperties) MarshalJSON() ([]byte, error) {
  5375  	objectMap := make(map[string]interface{})
  5376  	if vcp.EncryptionKey != nil {
  5377  		objectMap["encryptionKey"] = vcp.EncryptionKey
  5378  	}
  5379  	if vcp.StorageAccountCredentialID != nil {
  5380  		objectMap["storageAccountCredentialId"] = vcp.StorageAccountCredentialID
  5381  	}
  5382  	if vcp.BandWidthRateInMbps != nil {
  5383  		objectMap["bandWidthRateInMbps"] = vcp.BandWidthRateInMbps
  5384  	}
  5385  	if vcp.BandwidthSettingID != nil {
  5386  		objectMap["bandwidthSettingId"] = vcp.BandwidthSettingID
  5387  	}
  5388  	return json.Marshal(objectMap)
  5389  }
  5390  
  5391  // VolumeContainersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  5392  // long-running operation.
  5393  type VolumeContainersCreateOrUpdateFuture struct {
  5394  	azure.FutureAPI
  5395  	// Result returns the result of the asynchronous operation.
  5396  	// If the operation has not completed it will return an error.
  5397  	Result func(VolumeContainersClient) (VolumeContainer, error)
  5398  }
  5399  
  5400  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5401  func (future *VolumeContainersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  5402  	var azFuture azure.Future
  5403  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5404  		return err
  5405  	}
  5406  	future.FutureAPI = &azFuture
  5407  	future.Result = future.result
  5408  	return nil
  5409  }
  5410  
  5411  // result is the default implementation for VolumeContainersCreateOrUpdateFuture.Result.
  5412  func (future *VolumeContainersCreateOrUpdateFuture) result(client VolumeContainersClient) (vc VolumeContainer, err error) {
  5413  	var done bool
  5414  	done, err = future.DoneWithContext(context.Background(), client)
  5415  	if err != nil {
  5416  		err = autorest.NewErrorWithError(err, "storsimple.VolumeContainersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  5417  		return
  5418  	}
  5419  	if !done {
  5420  		vc.Response.Response = future.Response()
  5421  		err = azure.NewAsyncOpIncompleteError("storsimple.VolumeContainersCreateOrUpdateFuture")
  5422  		return
  5423  	}
  5424  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  5425  	if vc.Response.Response, err = future.GetResult(sender); err == nil && vc.Response.Response.StatusCode != http.StatusNoContent {
  5426  		vc, err = client.CreateOrUpdateResponder(vc.Response.Response)
  5427  		if err != nil {
  5428  			err = autorest.NewErrorWithError(err, "storsimple.VolumeContainersCreateOrUpdateFuture", "Result", vc.Response.Response, "Failure responding to request")
  5429  		}
  5430  	}
  5431  	return
  5432  }
  5433  
  5434  // VolumeContainersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  5435  // operation.
  5436  type VolumeContainersDeleteFuture struct {
  5437  	azure.FutureAPI
  5438  	// Result returns the result of the asynchronous operation.
  5439  	// If the operation has not completed it will return an error.
  5440  	Result func(VolumeContainersClient) (autorest.Response, error)
  5441  }
  5442  
  5443  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5444  func (future *VolumeContainersDeleteFuture) UnmarshalJSON(body []byte) error {
  5445  	var azFuture azure.Future
  5446  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5447  		return err
  5448  	}
  5449  	future.FutureAPI = &azFuture
  5450  	future.Result = future.result
  5451  	return nil
  5452  }
  5453  
  5454  // result is the default implementation for VolumeContainersDeleteFuture.Result.
  5455  func (future *VolumeContainersDeleteFuture) result(client VolumeContainersClient) (ar autorest.Response, err error) {
  5456  	var done bool
  5457  	done, err = future.DoneWithContext(context.Background(), client)
  5458  	if err != nil {
  5459  		err = autorest.NewErrorWithError(err, "storsimple.VolumeContainersDeleteFuture", "Result", future.Response(), "Polling failure")
  5460  		return
  5461  	}
  5462  	if !done {
  5463  		ar.Response = future.Response()
  5464  		err = azure.NewAsyncOpIncompleteError("storsimple.VolumeContainersDeleteFuture")
  5465  		return
  5466  	}
  5467  	ar.Response = future.Response()
  5468  	return
  5469  }
  5470  
  5471  // VolumeFailoverMetadata the metadata of a volume that has valid cloud snapshot.
  5472  type VolumeFailoverMetadata struct {
  5473  	// VolumeID - The path ID of the volume.
  5474  	VolumeID *string `json:"volumeId,omitempty"`
  5475  	// VolumeType - The type of the volume. Possible values include: 'Tiered', 'Archival', 'LocallyPinned'
  5476  	VolumeType VolumeType `json:"volumeType,omitempty"`
  5477  	// SizeInBytes - The size of the volume in bytes at the time the snapshot was taken.
  5478  	SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
  5479  	// BackupCreatedDate - The date at which the snapshot was taken.
  5480  	BackupCreatedDate *date.Time `json:"backupCreatedDate,omitempty"`
  5481  	// BackupElementID - The path ID of the backup-element for this volume, inside the backup set.
  5482  	BackupElementID *string `json:"backupElementId,omitempty"`
  5483  	// BackupID - The path ID of the backup set.
  5484  	BackupID *string `json:"backupId,omitempty"`
  5485  	// BackupPolicyID - The path ID of the backup policy using which the snapshot was taken.
  5486  	BackupPolicyID *string `json:"backupPolicyId,omitempty"`
  5487  }
  5488  
  5489  // VolumeList the collection of volumes.
  5490  type VolumeList struct {
  5491  	autorest.Response `json:"-"`
  5492  	// Value - The value.
  5493  	Value *[]Volume `json:"value,omitempty"`
  5494  }
  5495  
  5496  // VolumeProperties the properties of volume.
  5497  type VolumeProperties struct {
  5498  	// SizeInBytes - The size of the volume in bytes.
  5499  	SizeInBytes *int64 `json:"sizeInBytes,omitempty"`
  5500  	// VolumeType - The type of the volume. Possible values include: 'Tiered', 'Archival', 'LocallyPinned'
  5501  	VolumeType VolumeType `json:"volumeType,omitempty"`
  5502  	// VolumeContainerID - READ-ONLY; The ID of the volume container, in which this volume is created.
  5503  	VolumeContainerID *string `json:"volumeContainerId,omitempty"`
  5504  	// AccessControlRecordIds - The IDs of the access control records, associated with the volume.
  5505  	AccessControlRecordIds *[]string `json:"accessControlRecordIds,omitempty"`
  5506  	// VolumeStatus - The volume status. Possible values include: 'VolumeStatusOnline', 'VolumeStatusOffline'
  5507  	VolumeStatus VolumeStatus `json:"volumeStatus,omitempty"`
  5508  	// OperationStatus - READ-ONLY; The operation status on the volume. Possible values include: 'OperationStatusNone', 'OperationStatusUpdating', 'OperationStatusDeleting', 'OperationStatusRestoring'
  5509  	OperationStatus OperationStatus `json:"operationStatus,omitempty"`
  5510  	// BackupStatus - READ-ONLY; The backup status of the volume. Possible values include: 'BackupStatusEnabled', 'BackupStatusDisabled'
  5511  	BackupStatus BackupStatus `json:"backupStatus,omitempty"`
  5512  	// MonitoringStatus - The monitoring status of the volume. Possible values include: 'MonitoringStatusEnabled', 'MonitoringStatusDisabled'
  5513  	MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"`
  5514  	// BackupPolicyIds - READ-ONLY; The IDs of the backup policies, in which this volume is part of.
  5515  	BackupPolicyIds *[]string `json:"backupPolicyIds,omitempty"`
  5516  }
  5517  
  5518  // MarshalJSON is the custom marshaler for VolumeProperties.
  5519  func (vp VolumeProperties) MarshalJSON() ([]byte, error) {
  5520  	objectMap := make(map[string]interface{})
  5521  	if vp.SizeInBytes != nil {
  5522  		objectMap["sizeInBytes"] = vp.SizeInBytes
  5523  	}
  5524  	if vp.VolumeType != "" {
  5525  		objectMap["volumeType"] = vp.VolumeType
  5526  	}
  5527  	if vp.AccessControlRecordIds != nil {
  5528  		objectMap["accessControlRecordIds"] = vp.AccessControlRecordIds
  5529  	}
  5530  	if vp.VolumeStatus != "" {
  5531  		objectMap["volumeStatus"] = vp.VolumeStatus
  5532  	}
  5533  	if vp.MonitoringStatus != "" {
  5534  		objectMap["monitoringStatus"] = vp.MonitoringStatus
  5535  	}
  5536  	return json.Marshal(objectMap)
  5537  }
  5538  
  5539  // VolumesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  5540  // operation.
  5541  type VolumesCreateOrUpdateFuture struct {
  5542  	azure.FutureAPI
  5543  	// Result returns the result of the asynchronous operation.
  5544  	// If the operation has not completed it will return an error.
  5545  	Result func(VolumesClient) (Volume, error)
  5546  }
  5547  
  5548  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5549  func (future *VolumesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  5550  	var azFuture azure.Future
  5551  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5552  		return err
  5553  	}
  5554  	future.FutureAPI = &azFuture
  5555  	future.Result = future.result
  5556  	return nil
  5557  }
  5558  
  5559  // result is the default implementation for VolumesCreateOrUpdateFuture.Result.
  5560  func (future *VolumesCreateOrUpdateFuture) result(client VolumesClient) (vVar Volume, err error) {
  5561  	var done bool
  5562  	done, err = future.DoneWithContext(context.Background(), client)
  5563  	if err != nil {
  5564  		err = autorest.NewErrorWithError(err, "storsimple.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  5565  		return
  5566  	}
  5567  	if !done {
  5568  		vVar.Response.Response = future.Response()
  5569  		err = azure.NewAsyncOpIncompleteError("storsimple.VolumesCreateOrUpdateFuture")
  5570  		return
  5571  	}
  5572  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  5573  	if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent {
  5574  		vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response)
  5575  		if err != nil {
  5576  			err = autorest.NewErrorWithError(err, "storsimple.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request")
  5577  		}
  5578  	}
  5579  	return
  5580  }
  5581  
  5582  // VolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  5583  // operation.
  5584  type VolumesDeleteFuture struct {
  5585  	azure.FutureAPI
  5586  	// Result returns the result of the asynchronous operation.
  5587  	// If the operation has not completed it will return an error.
  5588  	Result func(VolumesClient) (autorest.Response, error)
  5589  }
  5590  
  5591  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  5592  func (future *VolumesDeleteFuture) UnmarshalJSON(body []byte) error {
  5593  	var azFuture azure.Future
  5594  	if err := json.Unmarshal(body, &azFuture); err != nil {
  5595  		return err
  5596  	}
  5597  	future.FutureAPI = &azFuture
  5598  	future.Result = future.result
  5599  	return nil
  5600  }
  5601  
  5602  // result is the default implementation for VolumesDeleteFuture.Result.
  5603  func (future *VolumesDeleteFuture) result(client VolumesClient) (ar autorest.Response, err error) {
  5604  	var done bool
  5605  	done, err = future.DoneWithContext(context.Background(), client)
  5606  	if err != nil {
  5607  		err = autorest.NewErrorWithError(err, "storsimple.VolumesDeleteFuture", "Result", future.Response(), "Polling failure")
  5608  		return
  5609  	}
  5610  	if !done {
  5611  		ar.Response = future.Response()
  5612  		err = azure.NewAsyncOpIncompleteError("storsimple.VolumesDeleteFuture")
  5613  		return
  5614  	}
  5615  	ar.Response = future.Response()
  5616  	return
  5617  }
  5618  
  5619  // WebproxySettings the web proxy settings on the device.
  5620  type WebproxySettings struct {
  5621  	// ConnectionURI - The connection URI.
  5622  	ConnectionURI *string `json:"connectionUri,omitempty"`
  5623  	// Authentication - The authentication type. Possible values include: 'Invalid', 'None', 'Basic', 'NTLM'
  5624  	Authentication AuthenticationType `json:"authentication,omitempty"`
  5625  	// Username - The webproxy username.
  5626  	Username *string `json:"username,omitempty"`
  5627  }
  5628  

View as plain text