...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-07-01-preview/devices/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2019-07-01-preview/devices

     1  package devices
     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/preview/iothub/mgmt/2019-07-01-preview/devices"
    22  
    23  // CertificateBodyDescription the JSON-serialized X509 Certificate.
    24  type CertificateBodyDescription struct {
    25  	// Certificate - base-64 representation of the X509 leaf certificate .cer file or just .pem file content.
    26  	Certificate *string `json:"certificate,omitempty"`
    27  }
    28  
    29  // CertificateDescription the X509 Certificate.
    30  type CertificateDescription struct {
    31  	autorest.Response `json:"-"`
    32  	Properties        *CertificateProperties `json:"properties,omitempty"`
    33  	// ID - READ-ONLY; The resource identifier.
    34  	ID *string `json:"id,omitempty"`
    35  	// Name - READ-ONLY; The name of the certificate.
    36  	Name *string `json:"name,omitempty"`
    37  	// Etag - READ-ONLY; The entity tag.
    38  	Etag *string `json:"etag,omitempty"`
    39  	// Type - READ-ONLY; The resource type.
    40  	Type *string `json:"type,omitempty"`
    41  }
    42  
    43  // MarshalJSON is the custom marshaler for CertificateDescription.
    44  func (cd CertificateDescription) MarshalJSON() ([]byte, error) {
    45  	objectMap := make(map[string]interface{})
    46  	if cd.Properties != nil {
    47  		objectMap["properties"] = cd.Properties
    48  	}
    49  	return json.Marshal(objectMap)
    50  }
    51  
    52  // CertificateListDescription the JSON-serialized array of Certificate objects.
    53  type CertificateListDescription struct {
    54  	autorest.Response `json:"-"`
    55  	// Value - The array of Certificate objects.
    56  	Value *[]CertificateDescription `json:"value,omitempty"`
    57  }
    58  
    59  // CertificateProperties the description of an X509 CA Certificate.
    60  type CertificateProperties struct {
    61  	// Subject - READ-ONLY; The certificate's subject name.
    62  	Subject *string `json:"subject,omitempty"`
    63  	// Expiry - READ-ONLY; The certificate's expiration date and time.
    64  	Expiry *date.TimeRFC1123 `json:"expiry,omitempty"`
    65  	// Thumbprint - READ-ONLY; The certificate's thumbprint.
    66  	Thumbprint *string `json:"thumbprint,omitempty"`
    67  	// IsVerified - READ-ONLY; Determines whether certificate has been verified.
    68  	IsVerified *bool `json:"isVerified,omitempty"`
    69  	// Created - READ-ONLY; The certificate's create date and time.
    70  	Created *date.TimeRFC1123 `json:"created,omitempty"`
    71  	// Updated - READ-ONLY; The certificate's last update date and time.
    72  	Updated *date.TimeRFC1123 `json:"updated,omitempty"`
    73  	// Certificate - The certificate content
    74  	Certificate *string `json:"certificate,omitempty"`
    75  }
    76  
    77  // MarshalJSON is the custom marshaler for CertificateProperties.
    78  func (cp CertificateProperties) MarshalJSON() ([]byte, error) {
    79  	objectMap := make(map[string]interface{})
    80  	if cp.Certificate != nil {
    81  		objectMap["certificate"] = cp.Certificate
    82  	}
    83  	return json.Marshal(objectMap)
    84  }
    85  
    86  // CertificatePropertiesWithNonce the description of an X509 CA Certificate including the challenge nonce
    87  // issued for the Proof-Of-Possession flow.
    88  type CertificatePropertiesWithNonce struct {
    89  	// Subject - READ-ONLY; The certificate's subject name.
    90  	Subject *string `json:"subject,omitempty"`
    91  	// Expiry - READ-ONLY; The certificate's expiration date and time.
    92  	Expiry *date.TimeRFC1123 `json:"expiry,omitempty"`
    93  	// Thumbprint - READ-ONLY; The certificate's thumbprint.
    94  	Thumbprint *string `json:"thumbprint,omitempty"`
    95  	// IsVerified - READ-ONLY; Determines whether certificate has been verified.
    96  	IsVerified *bool `json:"isVerified,omitempty"`
    97  	// Created - READ-ONLY; The certificate's create date and time.
    98  	Created *date.TimeRFC1123 `json:"created,omitempty"`
    99  	// Updated - READ-ONLY; The certificate's last update date and time.
   100  	Updated *date.TimeRFC1123 `json:"updated,omitempty"`
   101  	// VerificationCode - READ-ONLY; The certificate's verification code that will be used for proof of possession.
   102  	VerificationCode *string `json:"verificationCode,omitempty"`
   103  	// Certificate - READ-ONLY; The certificate content
   104  	Certificate *string `json:"certificate,omitempty"`
   105  }
   106  
   107  // MarshalJSON is the custom marshaler for CertificatePropertiesWithNonce.
   108  func (cpwn CertificatePropertiesWithNonce) MarshalJSON() ([]byte, error) {
   109  	objectMap := make(map[string]interface{})
   110  	return json.Marshal(objectMap)
   111  }
   112  
   113  // CertificateVerificationDescription the JSON-serialized leaf certificate
   114  type CertificateVerificationDescription struct {
   115  	// Certificate - base-64 representation of X509 certificate .cer file or just .pem file content.
   116  	Certificate *string `json:"certificate,omitempty"`
   117  }
   118  
   119  // CertificateWithNonceDescription the X509 Certificate.
   120  type CertificateWithNonceDescription struct {
   121  	autorest.Response `json:"-"`
   122  	Properties        *CertificatePropertiesWithNonce `json:"properties,omitempty"`
   123  	// ID - READ-ONLY; The resource identifier.
   124  	ID *string `json:"id,omitempty"`
   125  	// Name - READ-ONLY; The name of the certificate.
   126  	Name *string `json:"name,omitempty"`
   127  	// Etag - READ-ONLY; The entity tag.
   128  	Etag *string `json:"etag,omitempty"`
   129  	// Type - READ-ONLY; The resource type.
   130  	Type *string `json:"type,omitempty"`
   131  }
   132  
   133  // MarshalJSON is the custom marshaler for CertificateWithNonceDescription.
   134  func (cwnd CertificateWithNonceDescription) MarshalJSON() ([]byte, error) {
   135  	objectMap := make(map[string]interface{})
   136  	if cwnd.Properties != nil {
   137  		objectMap["properties"] = cwnd.Properties
   138  	}
   139  	return json.Marshal(objectMap)
   140  }
   141  
   142  // CloudToDeviceProperties the IoT hub cloud-to-device messaging properties.
   143  type CloudToDeviceProperties struct {
   144  	// MaxDeliveryCount - The max delivery count for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
   145  	MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
   146  	// DefaultTTLAsIso8601 - The default time to live for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
   147  	DefaultTTLAsIso8601 *string             `json:"defaultTtlAsIso8601,omitempty"`
   148  	Feedback            *FeedbackProperties `json:"feedback,omitempty"`
   149  }
   150  
   151  // EndpointHealthData the health data for an endpoint
   152  type EndpointHealthData struct {
   153  	// EndpointID - Id of the endpoint
   154  	EndpointID *string `json:"endpointId,omitempty"`
   155  	// HealthStatus - Health statuses have following meanings. The 'healthy' status shows that the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an eventually consistent state of health. The 'dead' status shows that the endpoint is not accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub has not established a connection with the endpoint. No messages have been delivered to or rejected from this endpoint. Possible values include: 'Unknown', 'Healthy', 'Unhealthy', 'Dead'
   156  	HealthStatus EndpointHealthStatus `json:"healthStatus,omitempty"`
   157  }
   158  
   159  // EndpointHealthDataListResult the JSON-serialized array of EndpointHealthData objects with a next link.
   160  type EndpointHealthDataListResult struct {
   161  	autorest.Response `json:"-"`
   162  	// Value - JSON-serialized array of Endpoint health data
   163  	Value *[]EndpointHealthData `json:"value,omitempty"`
   164  	// NextLink - READ-ONLY; Link to more results
   165  	NextLink *string `json:"nextLink,omitempty"`
   166  }
   167  
   168  // MarshalJSON is the custom marshaler for EndpointHealthDataListResult.
   169  func (ehdlr EndpointHealthDataListResult) MarshalJSON() ([]byte, error) {
   170  	objectMap := make(map[string]interface{})
   171  	if ehdlr.Value != nil {
   172  		objectMap["value"] = ehdlr.Value
   173  	}
   174  	return json.Marshal(objectMap)
   175  }
   176  
   177  // EndpointHealthDataListResultIterator provides access to a complete listing of EndpointHealthData values.
   178  type EndpointHealthDataListResultIterator struct {
   179  	i    int
   180  	page EndpointHealthDataListResultPage
   181  }
   182  
   183  // NextWithContext advances to the next value.  If there was an error making
   184  // the request the iterator does not advance and the error is returned.
   185  func (iter *EndpointHealthDataListResultIterator) NextWithContext(ctx context.Context) (err error) {
   186  	if tracing.IsEnabled() {
   187  		ctx = tracing.StartSpan(ctx, fqdn+"/EndpointHealthDataListResultIterator.NextWithContext")
   188  		defer func() {
   189  			sc := -1
   190  			if iter.Response().Response.Response != nil {
   191  				sc = iter.Response().Response.Response.StatusCode
   192  			}
   193  			tracing.EndSpan(ctx, sc, err)
   194  		}()
   195  	}
   196  	iter.i++
   197  	if iter.i < len(iter.page.Values()) {
   198  		return nil
   199  	}
   200  	err = iter.page.NextWithContext(ctx)
   201  	if err != nil {
   202  		iter.i--
   203  		return err
   204  	}
   205  	iter.i = 0
   206  	return nil
   207  }
   208  
   209  // Next advances to the next value.  If there was an error making
   210  // the request the iterator does not advance and the error is returned.
   211  // Deprecated: Use NextWithContext() instead.
   212  func (iter *EndpointHealthDataListResultIterator) Next() error {
   213  	return iter.NextWithContext(context.Background())
   214  }
   215  
   216  // NotDone returns true if the enumeration should be started or is not yet complete.
   217  func (iter EndpointHealthDataListResultIterator) NotDone() bool {
   218  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   219  }
   220  
   221  // Response returns the raw server response from the last page request.
   222  func (iter EndpointHealthDataListResultIterator) Response() EndpointHealthDataListResult {
   223  	return iter.page.Response()
   224  }
   225  
   226  // Value returns the current value or a zero-initialized value if the
   227  // iterator has advanced beyond the end of the collection.
   228  func (iter EndpointHealthDataListResultIterator) Value() EndpointHealthData {
   229  	if !iter.page.NotDone() {
   230  		return EndpointHealthData{}
   231  	}
   232  	return iter.page.Values()[iter.i]
   233  }
   234  
   235  // Creates a new instance of the EndpointHealthDataListResultIterator type.
   236  func NewEndpointHealthDataListResultIterator(page EndpointHealthDataListResultPage) EndpointHealthDataListResultIterator {
   237  	return EndpointHealthDataListResultIterator{page: page}
   238  }
   239  
   240  // IsEmpty returns true if the ListResult contains no values.
   241  func (ehdlr EndpointHealthDataListResult) IsEmpty() bool {
   242  	return ehdlr.Value == nil || len(*ehdlr.Value) == 0
   243  }
   244  
   245  // hasNextLink returns true if the NextLink is not empty.
   246  func (ehdlr EndpointHealthDataListResult) hasNextLink() bool {
   247  	return ehdlr.NextLink != nil && len(*ehdlr.NextLink) != 0
   248  }
   249  
   250  // endpointHealthDataListResultPreparer prepares a request to retrieve the next set of results.
   251  // It returns nil if no more results exist.
   252  func (ehdlr EndpointHealthDataListResult) endpointHealthDataListResultPreparer(ctx context.Context) (*http.Request, error) {
   253  	if !ehdlr.hasNextLink() {
   254  		return nil, nil
   255  	}
   256  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   257  		autorest.AsJSON(),
   258  		autorest.AsGet(),
   259  		autorest.WithBaseURL(to.String(ehdlr.NextLink)))
   260  }
   261  
   262  // EndpointHealthDataListResultPage contains a page of EndpointHealthData values.
   263  type EndpointHealthDataListResultPage struct {
   264  	fn    func(context.Context, EndpointHealthDataListResult) (EndpointHealthDataListResult, error)
   265  	ehdlr EndpointHealthDataListResult
   266  }
   267  
   268  // NextWithContext advances to the next page of values.  If there was an error making
   269  // the request the page does not advance and the error is returned.
   270  func (page *EndpointHealthDataListResultPage) NextWithContext(ctx context.Context) (err error) {
   271  	if tracing.IsEnabled() {
   272  		ctx = tracing.StartSpan(ctx, fqdn+"/EndpointHealthDataListResultPage.NextWithContext")
   273  		defer func() {
   274  			sc := -1
   275  			if page.Response().Response.Response != nil {
   276  				sc = page.Response().Response.Response.StatusCode
   277  			}
   278  			tracing.EndSpan(ctx, sc, err)
   279  		}()
   280  	}
   281  	for {
   282  		next, err := page.fn(ctx, page.ehdlr)
   283  		if err != nil {
   284  			return err
   285  		}
   286  		page.ehdlr = next
   287  		if !next.hasNextLink() || !next.IsEmpty() {
   288  			break
   289  		}
   290  	}
   291  	return nil
   292  }
   293  
   294  // Next advances to the next page of values.  If there was an error making
   295  // the request the page does not advance and the error is returned.
   296  // Deprecated: Use NextWithContext() instead.
   297  func (page *EndpointHealthDataListResultPage) Next() error {
   298  	return page.NextWithContext(context.Background())
   299  }
   300  
   301  // NotDone returns true if the page enumeration should be started or is not yet complete.
   302  func (page EndpointHealthDataListResultPage) NotDone() bool {
   303  	return !page.ehdlr.IsEmpty()
   304  }
   305  
   306  // Response returns the raw server response from the last page request.
   307  func (page EndpointHealthDataListResultPage) Response() EndpointHealthDataListResult {
   308  	return page.ehdlr
   309  }
   310  
   311  // Values returns the slice of values for the current page or nil if there are no values.
   312  func (page EndpointHealthDataListResultPage) Values() []EndpointHealthData {
   313  	if page.ehdlr.IsEmpty() {
   314  		return nil
   315  	}
   316  	return *page.ehdlr.Value
   317  }
   318  
   319  // Creates a new instance of the EndpointHealthDataListResultPage type.
   320  func NewEndpointHealthDataListResultPage(cur EndpointHealthDataListResult, getNextPage func(context.Context, EndpointHealthDataListResult) (EndpointHealthDataListResult, error)) EndpointHealthDataListResultPage {
   321  	return EndpointHealthDataListResultPage{
   322  		fn:    getNextPage,
   323  		ehdlr: cur,
   324  	}
   325  }
   326  
   327  // EnrichmentProperties the properties of an enrichment that your IoT hub applies to messages delivered to
   328  // endpoints.
   329  type EnrichmentProperties struct {
   330  	// Key - The key or name for the enrichment property.
   331  	Key *string `json:"key,omitempty"`
   332  	// Value - The value for the enrichment property.
   333  	Value *string `json:"value,omitempty"`
   334  	// EndpointNames - The list of endpoints for which the enrichment is applied to the message.
   335  	EndpointNames *[]string `json:"endpointNames,omitempty"`
   336  }
   337  
   338  // ErrorDetails error details.
   339  type ErrorDetails struct {
   340  	// Code - READ-ONLY; The error code.
   341  	Code *string `json:"code,omitempty"`
   342  	// HTTPStatusCode - READ-ONLY; The HTTP status code.
   343  	HTTPStatusCode *string `json:"httpStatusCode,omitempty"`
   344  	// Message - READ-ONLY; The error message.
   345  	Message *string `json:"message,omitempty"`
   346  	// Details - READ-ONLY; The error details.
   347  	Details *string `json:"details,omitempty"`
   348  }
   349  
   350  // MarshalJSON is the custom marshaler for ErrorDetails.
   351  func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
   352  	objectMap := make(map[string]interface{})
   353  	return json.Marshal(objectMap)
   354  }
   355  
   356  // EventHubConsumerGroupInfo the properties of the EventHubConsumerGroupInfo object.
   357  type EventHubConsumerGroupInfo struct {
   358  	autorest.Response `json:"-"`
   359  	// Properties - The tags.
   360  	Properties map[string]*string `json:"properties"`
   361  	// ID - READ-ONLY; The Event Hub-compatible consumer group identifier.
   362  	ID *string `json:"id,omitempty"`
   363  	// Name - READ-ONLY; The Event Hub-compatible consumer group name.
   364  	Name *string `json:"name,omitempty"`
   365  	// Type - READ-ONLY; the resource type.
   366  	Type *string `json:"type,omitempty"`
   367  	// Etag - READ-ONLY; The etag.
   368  	Etag *string `json:"etag,omitempty"`
   369  }
   370  
   371  // MarshalJSON is the custom marshaler for EventHubConsumerGroupInfo.
   372  func (ehcgi EventHubConsumerGroupInfo) MarshalJSON() ([]byte, error) {
   373  	objectMap := make(map[string]interface{})
   374  	if ehcgi.Properties != nil {
   375  		objectMap["properties"] = ehcgi.Properties
   376  	}
   377  	return json.Marshal(objectMap)
   378  }
   379  
   380  // EventHubConsumerGroupsListResult the JSON-serialized array of Event Hub-compatible consumer group names
   381  // with a next link.
   382  type EventHubConsumerGroupsListResult struct {
   383  	autorest.Response `json:"-"`
   384  	// Value - List of consumer groups objects
   385  	Value *[]EventHubConsumerGroupInfo `json:"value,omitempty"`
   386  	// NextLink - READ-ONLY; The next link.
   387  	NextLink *string `json:"nextLink,omitempty"`
   388  }
   389  
   390  // MarshalJSON is the custom marshaler for EventHubConsumerGroupsListResult.
   391  func (ehcglr EventHubConsumerGroupsListResult) MarshalJSON() ([]byte, error) {
   392  	objectMap := make(map[string]interface{})
   393  	if ehcglr.Value != nil {
   394  		objectMap["value"] = ehcglr.Value
   395  	}
   396  	return json.Marshal(objectMap)
   397  }
   398  
   399  // EventHubConsumerGroupsListResultIterator provides access to a complete listing of
   400  // EventHubConsumerGroupInfo values.
   401  type EventHubConsumerGroupsListResultIterator struct {
   402  	i    int
   403  	page EventHubConsumerGroupsListResultPage
   404  }
   405  
   406  // NextWithContext advances to the next value.  If there was an error making
   407  // the request the iterator does not advance and the error is returned.
   408  func (iter *EventHubConsumerGroupsListResultIterator) NextWithContext(ctx context.Context) (err error) {
   409  	if tracing.IsEnabled() {
   410  		ctx = tracing.StartSpan(ctx, fqdn+"/EventHubConsumerGroupsListResultIterator.NextWithContext")
   411  		defer func() {
   412  			sc := -1
   413  			if iter.Response().Response.Response != nil {
   414  				sc = iter.Response().Response.Response.StatusCode
   415  			}
   416  			tracing.EndSpan(ctx, sc, err)
   417  		}()
   418  	}
   419  	iter.i++
   420  	if iter.i < len(iter.page.Values()) {
   421  		return nil
   422  	}
   423  	err = iter.page.NextWithContext(ctx)
   424  	if err != nil {
   425  		iter.i--
   426  		return err
   427  	}
   428  	iter.i = 0
   429  	return nil
   430  }
   431  
   432  // Next advances to the next value.  If there was an error making
   433  // the request the iterator does not advance and the error is returned.
   434  // Deprecated: Use NextWithContext() instead.
   435  func (iter *EventHubConsumerGroupsListResultIterator) Next() error {
   436  	return iter.NextWithContext(context.Background())
   437  }
   438  
   439  // NotDone returns true if the enumeration should be started or is not yet complete.
   440  func (iter EventHubConsumerGroupsListResultIterator) NotDone() bool {
   441  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   442  }
   443  
   444  // Response returns the raw server response from the last page request.
   445  func (iter EventHubConsumerGroupsListResultIterator) Response() EventHubConsumerGroupsListResult {
   446  	return iter.page.Response()
   447  }
   448  
   449  // Value returns the current value or a zero-initialized value if the
   450  // iterator has advanced beyond the end of the collection.
   451  func (iter EventHubConsumerGroupsListResultIterator) Value() EventHubConsumerGroupInfo {
   452  	if !iter.page.NotDone() {
   453  		return EventHubConsumerGroupInfo{}
   454  	}
   455  	return iter.page.Values()[iter.i]
   456  }
   457  
   458  // Creates a new instance of the EventHubConsumerGroupsListResultIterator type.
   459  func NewEventHubConsumerGroupsListResultIterator(page EventHubConsumerGroupsListResultPage) EventHubConsumerGroupsListResultIterator {
   460  	return EventHubConsumerGroupsListResultIterator{page: page}
   461  }
   462  
   463  // IsEmpty returns true if the ListResult contains no values.
   464  func (ehcglr EventHubConsumerGroupsListResult) IsEmpty() bool {
   465  	return ehcglr.Value == nil || len(*ehcglr.Value) == 0
   466  }
   467  
   468  // hasNextLink returns true if the NextLink is not empty.
   469  func (ehcglr EventHubConsumerGroupsListResult) hasNextLink() bool {
   470  	return ehcglr.NextLink != nil && len(*ehcglr.NextLink) != 0
   471  }
   472  
   473  // eventHubConsumerGroupsListResultPreparer prepares a request to retrieve the next set of results.
   474  // It returns nil if no more results exist.
   475  func (ehcglr EventHubConsumerGroupsListResult) eventHubConsumerGroupsListResultPreparer(ctx context.Context) (*http.Request, error) {
   476  	if !ehcglr.hasNextLink() {
   477  		return nil, nil
   478  	}
   479  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   480  		autorest.AsJSON(),
   481  		autorest.AsGet(),
   482  		autorest.WithBaseURL(to.String(ehcglr.NextLink)))
   483  }
   484  
   485  // EventHubConsumerGroupsListResultPage contains a page of EventHubConsumerGroupInfo values.
   486  type EventHubConsumerGroupsListResultPage struct {
   487  	fn     func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)
   488  	ehcglr EventHubConsumerGroupsListResult
   489  }
   490  
   491  // NextWithContext advances to the next page of values.  If there was an error making
   492  // the request the page does not advance and the error is returned.
   493  func (page *EventHubConsumerGroupsListResultPage) NextWithContext(ctx context.Context) (err error) {
   494  	if tracing.IsEnabled() {
   495  		ctx = tracing.StartSpan(ctx, fqdn+"/EventHubConsumerGroupsListResultPage.NextWithContext")
   496  		defer func() {
   497  			sc := -1
   498  			if page.Response().Response.Response != nil {
   499  				sc = page.Response().Response.Response.StatusCode
   500  			}
   501  			tracing.EndSpan(ctx, sc, err)
   502  		}()
   503  	}
   504  	for {
   505  		next, err := page.fn(ctx, page.ehcglr)
   506  		if err != nil {
   507  			return err
   508  		}
   509  		page.ehcglr = next
   510  		if !next.hasNextLink() || !next.IsEmpty() {
   511  			break
   512  		}
   513  	}
   514  	return nil
   515  }
   516  
   517  // Next advances to the next page of values.  If there was an error making
   518  // the request the page does not advance and the error is returned.
   519  // Deprecated: Use NextWithContext() instead.
   520  func (page *EventHubConsumerGroupsListResultPage) Next() error {
   521  	return page.NextWithContext(context.Background())
   522  }
   523  
   524  // NotDone returns true if the page enumeration should be started or is not yet complete.
   525  func (page EventHubConsumerGroupsListResultPage) NotDone() bool {
   526  	return !page.ehcglr.IsEmpty()
   527  }
   528  
   529  // Response returns the raw server response from the last page request.
   530  func (page EventHubConsumerGroupsListResultPage) Response() EventHubConsumerGroupsListResult {
   531  	return page.ehcglr
   532  }
   533  
   534  // Values returns the slice of values for the current page or nil if there are no values.
   535  func (page EventHubConsumerGroupsListResultPage) Values() []EventHubConsumerGroupInfo {
   536  	if page.ehcglr.IsEmpty() {
   537  		return nil
   538  	}
   539  	return *page.ehcglr.Value
   540  }
   541  
   542  // Creates a new instance of the EventHubConsumerGroupsListResultPage type.
   543  func NewEventHubConsumerGroupsListResultPage(cur EventHubConsumerGroupsListResult, getNextPage func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)) EventHubConsumerGroupsListResultPage {
   544  	return EventHubConsumerGroupsListResultPage{
   545  		fn:     getNextPage,
   546  		ehcglr: cur,
   547  	}
   548  }
   549  
   550  // EventHubProperties the properties of the provisioned Event Hub-compatible endpoint used by the IoT hub.
   551  type EventHubProperties struct {
   552  	// RetentionTimeInDays - The retention time for device-to-cloud messages in days. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages
   553  	RetentionTimeInDays *int64 `json:"retentionTimeInDays,omitempty"`
   554  	// PartitionCount - The number of partitions for receiving device-to-cloud messages in the Event Hub-compatible endpoint. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages.
   555  	PartitionCount *int32 `json:"partitionCount,omitempty"`
   556  	// PartitionIds - READ-ONLY; The partition ids in the Event Hub-compatible endpoint.
   557  	PartitionIds *[]string `json:"partitionIds,omitempty"`
   558  	// Path - READ-ONLY; The Event Hub-compatible name.
   559  	Path *string `json:"path,omitempty"`
   560  	// Endpoint - READ-ONLY; The Event Hub-compatible endpoint.
   561  	Endpoint *string `json:"endpoint,omitempty"`
   562  }
   563  
   564  // MarshalJSON is the custom marshaler for EventHubProperties.
   565  func (ehp EventHubProperties) MarshalJSON() ([]byte, error) {
   566  	objectMap := make(map[string]interface{})
   567  	if ehp.RetentionTimeInDays != nil {
   568  		objectMap["retentionTimeInDays"] = ehp.RetentionTimeInDays
   569  	}
   570  	if ehp.PartitionCount != nil {
   571  		objectMap["partitionCount"] = ehp.PartitionCount
   572  	}
   573  	return json.Marshal(objectMap)
   574  }
   575  
   576  // ExportDevicesRequest use to provide parameters when requesting an export of all devices in the IoT hub.
   577  type ExportDevicesRequest struct {
   578  	// ExportBlobContainerURI - The export blob container URI.
   579  	ExportBlobContainerURI *string `json:"exportBlobContainerUri,omitempty"`
   580  	// ExcludeKeys - The value indicating whether keys should be excluded during export.
   581  	ExcludeKeys *bool `json:"excludeKeys,omitempty"`
   582  }
   583  
   584  // FailoverInput use to provide failover region when requesting manual Failover for a hub.
   585  type FailoverInput struct {
   586  	// FailoverRegion - Region the hub will be failed over to
   587  	FailoverRegion *string `json:"failoverRegion,omitempty"`
   588  }
   589  
   590  // FallbackRouteProperties the properties of the fallback route. IoT Hub uses these properties when it
   591  // routes messages to the fallback endpoint.
   592  type FallbackRouteProperties struct {
   593  	// Name - The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique.
   594  	Name *string `json:"name,omitempty"`
   595  	// Source - The source to which the routing rule is to be applied to. For example, DeviceMessages
   596  	Source *string `json:"source,omitempty"`
   597  	// Condition - The condition which is evaluated in order to apply the fallback route. If the condition is not provided it will evaluate to true by default. For grammar, See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language
   598  	Condition *string `json:"condition,omitempty"`
   599  	// EndpointNames - The list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint is allowed.
   600  	EndpointNames *[]string `json:"endpointNames,omitempty"`
   601  	// IsEnabled - Used to specify whether the fallback route is enabled.
   602  	IsEnabled *bool `json:"isEnabled,omitempty"`
   603  }
   604  
   605  // FeedbackProperties the properties of the feedback queue for cloud-to-device messages.
   606  type FeedbackProperties struct {
   607  	// LockDurationAsIso8601 - The lock duration for the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
   608  	LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"`
   609  	// TTLAsIso8601 - The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
   610  	TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"`
   611  	// MaxDeliveryCount - The number of times the IoT hub attempts to deliver a message on the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
   612  	MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
   613  }
   614  
   615  // ImportDevicesRequest use to provide parameters when requesting an import of all devices in the hub.
   616  type ImportDevicesRequest struct {
   617  	// InputBlobContainerURI - The input blob container URI.
   618  	InputBlobContainerURI *string `json:"inputBlobContainerUri,omitempty"`
   619  	// OutputBlobContainerURI - The output blob container URI.
   620  	OutputBlobContainerURI *string `json:"outputBlobContainerUri,omitempty"`
   621  }
   622  
   623  // IotHubCapacity ioT Hub capacity information.
   624  type IotHubCapacity struct {
   625  	// Minimum - READ-ONLY; The minimum number of units.
   626  	Minimum *int64 `json:"minimum,omitempty"`
   627  	// Maximum - READ-ONLY; The maximum number of units.
   628  	Maximum *int64 `json:"maximum,omitempty"`
   629  	// Default - READ-ONLY; The default number of units.
   630  	Default *int64 `json:"default,omitempty"`
   631  	// ScaleType - READ-ONLY; The type of the scaling enabled. Possible values include: 'IotHubScaleTypeAutomatic', 'IotHubScaleTypeManual', 'IotHubScaleTypeNone'
   632  	ScaleType IotHubScaleType `json:"scaleType,omitempty"`
   633  }
   634  
   635  // MarshalJSON is the custom marshaler for IotHubCapacity.
   636  func (ihc IotHubCapacity) MarshalJSON() ([]byte, error) {
   637  	objectMap := make(map[string]interface{})
   638  	return json.Marshal(objectMap)
   639  }
   640  
   641  // IotHubDescription the description of the IoT hub.
   642  type IotHubDescription struct {
   643  	autorest.Response `json:"-"`
   644  	// Etag - The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention.
   645  	Etag *string `json:"etag,omitempty"`
   646  	// Properties - IotHub properties
   647  	Properties *IotHubProperties `json:"properties,omitempty"`
   648  	// Sku - IotHub SKU info
   649  	Sku *IotHubSkuInfo `json:"sku,omitempty"`
   650  	// ID - READ-ONLY; The resource identifier.
   651  	ID *string `json:"id,omitempty"`
   652  	// Name - READ-ONLY; The resource name.
   653  	Name *string `json:"name,omitempty"`
   654  	// Type - READ-ONLY; The resource type.
   655  	Type *string `json:"type,omitempty"`
   656  	// Location - The resource location.
   657  	Location *string `json:"location,omitempty"`
   658  	// Tags - The resource tags.
   659  	Tags map[string]*string `json:"tags"`
   660  }
   661  
   662  // MarshalJSON is the custom marshaler for IotHubDescription.
   663  func (ihd IotHubDescription) MarshalJSON() ([]byte, error) {
   664  	objectMap := make(map[string]interface{})
   665  	if ihd.Etag != nil {
   666  		objectMap["etag"] = ihd.Etag
   667  	}
   668  	if ihd.Properties != nil {
   669  		objectMap["properties"] = ihd.Properties
   670  	}
   671  	if ihd.Sku != nil {
   672  		objectMap["sku"] = ihd.Sku
   673  	}
   674  	if ihd.Location != nil {
   675  		objectMap["location"] = ihd.Location
   676  	}
   677  	if ihd.Tags != nil {
   678  		objectMap["tags"] = ihd.Tags
   679  	}
   680  	return json.Marshal(objectMap)
   681  }
   682  
   683  // IotHubDescriptionListResult the JSON-serialized array of IotHubDescription objects with a next link.
   684  type IotHubDescriptionListResult struct {
   685  	autorest.Response `json:"-"`
   686  	// Value - The array of IotHubDescription objects.
   687  	Value *[]IotHubDescription `json:"value,omitempty"`
   688  	// NextLink - READ-ONLY; The next link.
   689  	NextLink *string `json:"nextLink,omitempty"`
   690  }
   691  
   692  // MarshalJSON is the custom marshaler for IotHubDescriptionListResult.
   693  func (ihdlr IotHubDescriptionListResult) MarshalJSON() ([]byte, error) {
   694  	objectMap := make(map[string]interface{})
   695  	if ihdlr.Value != nil {
   696  		objectMap["value"] = ihdlr.Value
   697  	}
   698  	return json.Marshal(objectMap)
   699  }
   700  
   701  // IotHubDescriptionListResultIterator provides access to a complete listing of IotHubDescription values.
   702  type IotHubDescriptionListResultIterator struct {
   703  	i    int
   704  	page IotHubDescriptionListResultPage
   705  }
   706  
   707  // NextWithContext advances to the next value.  If there was an error making
   708  // the request the iterator does not advance and the error is returned.
   709  func (iter *IotHubDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
   710  	if tracing.IsEnabled() {
   711  		ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultIterator.NextWithContext")
   712  		defer func() {
   713  			sc := -1
   714  			if iter.Response().Response.Response != nil {
   715  				sc = iter.Response().Response.Response.StatusCode
   716  			}
   717  			tracing.EndSpan(ctx, sc, err)
   718  		}()
   719  	}
   720  	iter.i++
   721  	if iter.i < len(iter.page.Values()) {
   722  		return nil
   723  	}
   724  	err = iter.page.NextWithContext(ctx)
   725  	if err != nil {
   726  		iter.i--
   727  		return err
   728  	}
   729  	iter.i = 0
   730  	return nil
   731  }
   732  
   733  // Next advances to the next value.  If there was an error making
   734  // the request the iterator does not advance and the error is returned.
   735  // Deprecated: Use NextWithContext() instead.
   736  func (iter *IotHubDescriptionListResultIterator) Next() error {
   737  	return iter.NextWithContext(context.Background())
   738  }
   739  
   740  // NotDone returns true if the enumeration should be started or is not yet complete.
   741  func (iter IotHubDescriptionListResultIterator) NotDone() bool {
   742  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   743  }
   744  
   745  // Response returns the raw server response from the last page request.
   746  func (iter IotHubDescriptionListResultIterator) Response() IotHubDescriptionListResult {
   747  	return iter.page.Response()
   748  }
   749  
   750  // Value returns the current value or a zero-initialized value if the
   751  // iterator has advanced beyond the end of the collection.
   752  func (iter IotHubDescriptionListResultIterator) Value() IotHubDescription {
   753  	if !iter.page.NotDone() {
   754  		return IotHubDescription{}
   755  	}
   756  	return iter.page.Values()[iter.i]
   757  }
   758  
   759  // Creates a new instance of the IotHubDescriptionListResultIterator type.
   760  func NewIotHubDescriptionListResultIterator(page IotHubDescriptionListResultPage) IotHubDescriptionListResultIterator {
   761  	return IotHubDescriptionListResultIterator{page: page}
   762  }
   763  
   764  // IsEmpty returns true if the ListResult contains no values.
   765  func (ihdlr IotHubDescriptionListResult) IsEmpty() bool {
   766  	return ihdlr.Value == nil || len(*ihdlr.Value) == 0
   767  }
   768  
   769  // hasNextLink returns true if the NextLink is not empty.
   770  func (ihdlr IotHubDescriptionListResult) hasNextLink() bool {
   771  	return ihdlr.NextLink != nil && len(*ihdlr.NextLink) != 0
   772  }
   773  
   774  // iotHubDescriptionListResultPreparer prepares a request to retrieve the next set of results.
   775  // It returns nil if no more results exist.
   776  func (ihdlr IotHubDescriptionListResult) iotHubDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
   777  	if !ihdlr.hasNextLink() {
   778  		return nil, nil
   779  	}
   780  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   781  		autorest.AsJSON(),
   782  		autorest.AsGet(),
   783  		autorest.WithBaseURL(to.String(ihdlr.NextLink)))
   784  }
   785  
   786  // IotHubDescriptionListResultPage contains a page of IotHubDescription values.
   787  type IotHubDescriptionListResultPage struct {
   788  	fn    func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)
   789  	ihdlr IotHubDescriptionListResult
   790  }
   791  
   792  // NextWithContext advances to the next page of values.  If there was an error making
   793  // the request the page does not advance and the error is returned.
   794  func (page *IotHubDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
   795  	if tracing.IsEnabled() {
   796  		ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultPage.NextWithContext")
   797  		defer func() {
   798  			sc := -1
   799  			if page.Response().Response.Response != nil {
   800  				sc = page.Response().Response.Response.StatusCode
   801  			}
   802  			tracing.EndSpan(ctx, sc, err)
   803  		}()
   804  	}
   805  	for {
   806  		next, err := page.fn(ctx, page.ihdlr)
   807  		if err != nil {
   808  			return err
   809  		}
   810  		page.ihdlr = next
   811  		if !next.hasNextLink() || !next.IsEmpty() {
   812  			break
   813  		}
   814  	}
   815  	return nil
   816  }
   817  
   818  // Next advances to the next page of values.  If there was an error making
   819  // the request the page does not advance and the error is returned.
   820  // Deprecated: Use NextWithContext() instead.
   821  func (page *IotHubDescriptionListResultPage) Next() error {
   822  	return page.NextWithContext(context.Background())
   823  }
   824  
   825  // NotDone returns true if the page enumeration should be started or is not yet complete.
   826  func (page IotHubDescriptionListResultPage) NotDone() bool {
   827  	return !page.ihdlr.IsEmpty()
   828  }
   829  
   830  // Response returns the raw server response from the last page request.
   831  func (page IotHubDescriptionListResultPage) Response() IotHubDescriptionListResult {
   832  	return page.ihdlr
   833  }
   834  
   835  // Values returns the slice of values for the current page or nil if there are no values.
   836  func (page IotHubDescriptionListResultPage) Values() []IotHubDescription {
   837  	if page.ihdlr.IsEmpty() {
   838  		return nil
   839  	}
   840  	return *page.ihdlr.Value
   841  }
   842  
   843  // Creates a new instance of the IotHubDescriptionListResultPage type.
   844  func NewIotHubDescriptionListResultPage(cur IotHubDescriptionListResult, getNextPage func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)) IotHubDescriptionListResultPage {
   845  	return IotHubDescriptionListResultPage{
   846  		fn:    getNextPage,
   847  		ihdlr: cur,
   848  	}
   849  }
   850  
   851  // IotHubLocationDescription public representation of one of the locations where a resource is provisioned.
   852  type IotHubLocationDescription struct {
   853  	// Location - Azure Geo Regions
   854  	Location *string `json:"location,omitempty"`
   855  	// Role - Specific Role assigned to this location. Possible values include: 'Primary', 'Secondary'
   856  	Role IotHubReplicaRoleType `json:"role,omitempty"`
   857  }
   858  
   859  // IotHubManualFailoverFuture an abstraction for monitoring and retrieving the results of a long-running
   860  // operation.
   861  type IotHubManualFailoverFuture struct {
   862  	azure.FutureAPI
   863  	// Result returns the result of the asynchronous operation.
   864  	// If the operation has not completed it will return an error.
   865  	Result func(IotHubClient) (autorest.Response, error)
   866  }
   867  
   868  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   869  func (future *IotHubManualFailoverFuture) UnmarshalJSON(body []byte) error {
   870  	var azFuture azure.Future
   871  	if err := json.Unmarshal(body, &azFuture); err != nil {
   872  		return err
   873  	}
   874  	future.FutureAPI = &azFuture
   875  	future.Result = future.result
   876  	return nil
   877  }
   878  
   879  // result is the default implementation for IotHubManualFailoverFuture.Result.
   880  func (future *IotHubManualFailoverFuture) result(client IotHubClient) (ar autorest.Response, err error) {
   881  	var done bool
   882  	done, err = future.DoneWithContext(context.Background(), client)
   883  	if err != nil {
   884  		err = autorest.NewErrorWithError(err, "devices.IotHubManualFailoverFuture", "Result", future.Response(), "Polling failure")
   885  		return
   886  	}
   887  	if !done {
   888  		ar.Response = future.Response()
   889  		err = azure.NewAsyncOpIncompleteError("devices.IotHubManualFailoverFuture")
   890  		return
   891  	}
   892  	ar.Response = future.Response()
   893  	return
   894  }
   895  
   896  // IotHubNameAvailabilityInfo the properties indicating whether a given IoT hub name is available.
   897  type IotHubNameAvailabilityInfo struct {
   898  	autorest.Response `json:"-"`
   899  	// NameAvailable - READ-ONLY; The value which indicates whether the provided name is available.
   900  	NameAvailable *bool `json:"nameAvailable,omitempty"`
   901  	// Reason - READ-ONLY; The reason for unavailability. Possible values include: 'Invalid', 'AlreadyExists'
   902  	Reason IotHubNameUnavailabilityReason `json:"reason,omitempty"`
   903  	// Message - The detailed reason message.
   904  	Message *string `json:"message,omitempty"`
   905  }
   906  
   907  // MarshalJSON is the custom marshaler for IotHubNameAvailabilityInfo.
   908  func (ihnai IotHubNameAvailabilityInfo) MarshalJSON() ([]byte, error) {
   909  	objectMap := make(map[string]interface{})
   910  	if ihnai.Message != nil {
   911  		objectMap["message"] = ihnai.Message
   912  	}
   913  	return json.Marshal(objectMap)
   914  }
   915  
   916  // IotHubProperties the properties of an IoT hub.
   917  type IotHubProperties struct {
   918  	// AuthorizationPolicies - The shared access policies you can use to secure a connection to the IoT hub.
   919  	AuthorizationPolicies *[]SharedAccessSignatureAuthorizationRule `json:"authorizationPolicies,omitempty"`
   920  	// IPFilterRules - The IP filter rules.
   921  	IPFilterRules *[]IPFilterRule `json:"ipFilterRules,omitempty"`
   922  	// ProvisioningState - READ-ONLY; The provisioning state.
   923  	ProvisioningState *string `json:"provisioningState,omitempty"`
   924  	// State - READ-ONLY; The hub state.
   925  	State *string `json:"state,omitempty"`
   926  	// HostName - READ-ONLY; The name of the host.
   927  	HostName *string `json:"hostName,omitempty"`
   928  	// EventHubEndpoints - The Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has to be present in the dictionary while making create or update calls for the IoT hub.
   929  	EventHubEndpoints map[string]*EventHubProperties `json:"eventHubEndpoints"`
   930  	Routing           *RoutingProperties             `json:"routing,omitempty"`
   931  	// StorageEndpoints - The list of Azure Storage endpoints where you can upload files. Currently you can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one storage account causes an error to be thrown. Not specifying a value for this property when the enableFileUploadNotifications property is set to True, causes an error to be thrown.
   932  	StorageEndpoints map[string]*StorageEndpointProperties `json:"storageEndpoints"`
   933  	// MessagingEndpoints - The messaging endpoint properties for the file upload notification queue.
   934  	MessagingEndpoints map[string]*MessagingEndpointProperties `json:"messagingEndpoints"`
   935  	// EnableFileUploadNotifications - If True, file upload notifications are enabled.
   936  	EnableFileUploadNotifications *bool                    `json:"enableFileUploadNotifications,omitempty"`
   937  	CloudToDevice                 *CloudToDeviceProperties `json:"cloudToDevice,omitempty"`
   938  	// Comments - IoT hub comments.
   939  	Comments *string `json:"comments,omitempty"`
   940  	// DeviceStreams - The device streams properties of iothub.
   941  	DeviceStreams *IotHubPropertiesDeviceStreams `json:"deviceStreams,omitempty"`
   942  	// Features - The capabilities and features enabled for the IoT hub. Possible values include: 'None', 'DeviceManagement'
   943  	Features Capabilities `json:"features,omitempty"`
   944  	// Locations - READ-ONLY; Primary and secondary location for iot hub
   945  	Locations *[]IotHubLocationDescription `json:"locations,omitempty"`
   946  }
   947  
   948  // MarshalJSON is the custom marshaler for IotHubProperties.
   949  func (ihp IotHubProperties) MarshalJSON() ([]byte, error) {
   950  	objectMap := make(map[string]interface{})
   951  	if ihp.AuthorizationPolicies != nil {
   952  		objectMap["authorizationPolicies"] = ihp.AuthorizationPolicies
   953  	}
   954  	if ihp.IPFilterRules != nil {
   955  		objectMap["ipFilterRules"] = ihp.IPFilterRules
   956  	}
   957  	if ihp.EventHubEndpoints != nil {
   958  		objectMap["eventHubEndpoints"] = ihp.EventHubEndpoints
   959  	}
   960  	if ihp.Routing != nil {
   961  		objectMap["routing"] = ihp.Routing
   962  	}
   963  	if ihp.StorageEndpoints != nil {
   964  		objectMap["storageEndpoints"] = ihp.StorageEndpoints
   965  	}
   966  	if ihp.MessagingEndpoints != nil {
   967  		objectMap["messagingEndpoints"] = ihp.MessagingEndpoints
   968  	}
   969  	if ihp.EnableFileUploadNotifications != nil {
   970  		objectMap["enableFileUploadNotifications"] = ihp.EnableFileUploadNotifications
   971  	}
   972  	if ihp.CloudToDevice != nil {
   973  		objectMap["cloudToDevice"] = ihp.CloudToDevice
   974  	}
   975  	if ihp.Comments != nil {
   976  		objectMap["comments"] = ihp.Comments
   977  	}
   978  	if ihp.DeviceStreams != nil {
   979  		objectMap["deviceStreams"] = ihp.DeviceStreams
   980  	}
   981  	if ihp.Features != "" {
   982  		objectMap["features"] = ihp.Features
   983  	}
   984  	return json.Marshal(objectMap)
   985  }
   986  
   987  // IotHubPropertiesDeviceStreams the device streams properties of iothub.
   988  type IotHubPropertiesDeviceStreams struct {
   989  	// StreamingEndpoints - List of Device Streams Endpoints.
   990  	StreamingEndpoints *[]string `json:"streamingEndpoints,omitempty"`
   991  }
   992  
   993  // IotHubQuotaMetricInfo quota metrics properties.
   994  type IotHubQuotaMetricInfo struct {
   995  	// Name - READ-ONLY; The name of the quota metric.
   996  	Name *string `json:"name,omitempty"`
   997  	// CurrentValue - READ-ONLY; The current value for the quota metric.
   998  	CurrentValue *int64 `json:"currentValue,omitempty"`
   999  	// MaxValue - READ-ONLY; The maximum value of the quota metric.
  1000  	MaxValue *int64 `json:"maxValue,omitempty"`
  1001  }
  1002  
  1003  // MarshalJSON is the custom marshaler for IotHubQuotaMetricInfo.
  1004  func (ihqmi IotHubQuotaMetricInfo) MarshalJSON() ([]byte, error) {
  1005  	objectMap := make(map[string]interface{})
  1006  	return json.Marshal(objectMap)
  1007  }
  1008  
  1009  // IotHubQuotaMetricInfoListResult the JSON-serialized array of IotHubQuotaMetricInfo objects with a next
  1010  // link.
  1011  type IotHubQuotaMetricInfoListResult struct {
  1012  	autorest.Response `json:"-"`
  1013  	// Value - The array of quota metrics objects.
  1014  	Value *[]IotHubQuotaMetricInfo `json:"value,omitempty"`
  1015  	// NextLink - READ-ONLY; The next link.
  1016  	NextLink *string `json:"nextLink,omitempty"`
  1017  }
  1018  
  1019  // MarshalJSON is the custom marshaler for IotHubQuotaMetricInfoListResult.
  1020  func (ihqmilr IotHubQuotaMetricInfoListResult) MarshalJSON() ([]byte, error) {
  1021  	objectMap := make(map[string]interface{})
  1022  	if ihqmilr.Value != nil {
  1023  		objectMap["value"] = ihqmilr.Value
  1024  	}
  1025  	return json.Marshal(objectMap)
  1026  }
  1027  
  1028  // IotHubQuotaMetricInfoListResultIterator provides access to a complete listing of IotHubQuotaMetricInfo
  1029  // values.
  1030  type IotHubQuotaMetricInfoListResultIterator struct {
  1031  	i    int
  1032  	page IotHubQuotaMetricInfoListResultPage
  1033  }
  1034  
  1035  // NextWithContext advances to the next value.  If there was an error making
  1036  // the request the iterator does not advance and the error is returned.
  1037  func (iter *IotHubQuotaMetricInfoListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1038  	if tracing.IsEnabled() {
  1039  		ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultIterator.NextWithContext")
  1040  		defer func() {
  1041  			sc := -1
  1042  			if iter.Response().Response.Response != nil {
  1043  				sc = iter.Response().Response.Response.StatusCode
  1044  			}
  1045  			tracing.EndSpan(ctx, sc, err)
  1046  		}()
  1047  	}
  1048  	iter.i++
  1049  	if iter.i < len(iter.page.Values()) {
  1050  		return nil
  1051  	}
  1052  	err = iter.page.NextWithContext(ctx)
  1053  	if err != nil {
  1054  		iter.i--
  1055  		return err
  1056  	}
  1057  	iter.i = 0
  1058  	return nil
  1059  }
  1060  
  1061  // Next advances to the next value.  If there was an error making
  1062  // the request the iterator does not advance and the error is returned.
  1063  // Deprecated: Use NextWithContext() instead.
  1064  func (iter *IotHubQuotaMetricInfoListResultIterator) Next() error {
  1065  	return iter.NextWithContext(context.Background())
  1066  }
  1067  
  1068  // NotDone returns true if the enumeration should be started or is not yet complete.
  1069  func (iter IotHubQuotaMetricInfoListResultIterator) NotDone() bool {
  1070  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1071  }
  1072  
  1073  // Response returns the raw server response from the last page request.
  1074  func (iter IotHubQuotaMetricInfoListResultIterator) Response() IotHubQuotaMetricInfoListResult {
  1075  	return iter.page.Response()
  1076  }
  1077  
  1078  // Value returns the current value or a zero-initialized value if the
  1079  // iterator has advanced beyond the end of the collection.
  1080  func (iter IotHubQuotaMetricInfoListResultIterator) Value() IotHubQuotaMetricInfo {
  1081  	if !iter.page.NotDone() {
  1082  		return IotHubQuotaMetricInfo{}
  1083  	}
  1084  	return iter.page.Values()[iter.i]
  1085  }
  1086  
  1087  // Creates a new instance of the IotHubQuotaMetricInfoListResultIterator type.
  1088  func NewIotHubQuotaMetricInfoListResultIterator(page IotHubQuotaMetricInfoListResultPage) IotHubQuotaMetricInfoListResultIterator {
  1089  	return IotHubQuotaMetricInfoListResultIterator{page: page}
  1090  }
  1091  
  1092  // IsEmpty returns true if the ListResult contains no values.
  1093  func (ihqmilr IotHubQuotaMetricInfoListResult) IsEmpty() bool {
  1094  	return ihqmilr.Value == nil || len(*ihqmilr.Value) == 0
  1095  }
  1096  
  1097  // hasNextLink returns true if the NextLink is not empty.
  1098  func (ihqmilr IotHubQuotaMetricInfoListResult) hasNextLink() bool {
  1099  	return ihqmilr.NextLink != nil && len(*ihqmilr.NextLink) != 0
  1100  }
  1101  
  1102  // iotHubQuotaMetricInfoListResultPreparer prepares a request to retrieve the next set of results.
  1103  // It returns nil if no more results exist.
  1104  func (ihqmilr IotHubQuotaMetricInfoListResult) iotHubQuotaMetricInfoListResultPreparer(ctx context.Context) (*http.Request, error) {
  1105  	if !ihqmilr.hasNextLink() {
  1106  		return nil, nil
  1107  	}
  1108  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1109  		autorest.AsJSON(),
  1110  		autorest.AsGet(),
  1111  		autorest.WithBaseURL(to.String(ihqmilr.NextLink)))
  1112  }
  1113  
  1114  // IotHubQuotaMetricInfoListResultPage contains a page of IotHubQuotaMetricInfo values.
  1115  type IotHubQuotaMetricInfoListResultPage struct {
  1116  	fn      func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)
  1117  	ihqmilr IotHubQuotaMetricInfoListResult
  1118  }
  1119  
  1120  // NextWithContext advances to the next page of values.  If there was an error making
  1121  // the request the page does not advance and the error is returned.
  1122  func (page *IotHubQuotaMetricInfoListResultPage) NextWithContext(ctx context.Context) (err error) {
  1123  	if tracing.IsEnabled() {
  1124  		ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultPage.NextWithContext")
  1125  		defer func() {
  1126  			sc := -1
  1127  			if page.Response().Response.Response != nil {
  1128  				sc = page.Response().Response.Response.StatusCode
  1129  			}
  1130  			tracing.EndSpan(ctx, sc, err)
  1131  		}()
  1132  	}
  1133  	for {
  1134  		next, err := page.fn(ctx, page.ihqmilr)
  1135  		if err != nil {
  1136  			return err
  1137  		}
  1138  		page.ihqmilr = next
  1139  		if !next.hasNextLink() || !next.IsEmpty() {
  1140  			break
  1141  		}
  1142  	}
  1143  	return nil
  1144  }
  1145  
  1146  // Next advances to the next page of values.  If there was an error making
  1147  // the request the page does not advance and the error is returned.
  1148  // Deprecated: Use NextWithContext() instead.
  1149  func (page *IotHubQuotaMetricInfoListResultPage) Next() error {
  1150  	return page.NextWithContext(context.Background())
  1151  }
  1152  
  1153  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1154  func (page IotHubQuotaMetricInfoListResultPage) NotDone() bool {
  1155  	return !page.ihqmilr.IsEmpty()
  1156  }
  1157  
  1158  // Response returns the raw server response from the last page request.
  1159  func (page IotHubQuotaMetricInfoListResultPage) Response() IotHubQuotaMetricInfoListResult {
  1160  	return page.ihqmilr
  1161  }
  1162  
  1163  // Values returns the slice of values for the current page or nil if there are no values.
  1164  func (page IotHubQuotaMetricInfoListResultPage) Values() []IotHubQuotaMetricInfo {
  1165  	if page.ihqmilr.IsEmpty() {
  1166  		return nil
  1167  	}
  1168  	return *page.ihqmilr.Value
  1169  }
  1170  
  1171  // Creates a new instance of the IotHubQuotaMetricInfoListResultPage type.
  1172  func NewIotHubQuotaMetricInfoListResultPage(cur IotHubQuotaMetricInfoListResult, getNextPage func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)) IotHubQuotaMetricInfoListResultPage {
  1173  	return IotHubQuotaMetricInfoListResultPage{
  1174  		fn:      getNextPage,
  1175  		ihqmilr: cur,
  1176  	}
  1177  }
  1178  
  1179  // IotHubResourceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
  1180  // long-running operation.
  1181  type IotHubResourceCreateOrUpdateFuture struct {
  1182  	azure.FutureAPI
  1183  	// Result returns the result of the asynchronous operation.
  1184  	// If the operation has not completed it will return an error.
  1185  	Result func(IotHubResourceClient) (IotHubDescription, error)
  1186  }
  1187  
  1188  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1189  func (future *IotHubResourceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
  1190  	var azFuture azure.Future
  1191  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1192  		return err
  1193  	}
  1194  	future.FutureAPI = &azFuture
  1195  	future.Result = future.result
  1196  	return nil
  1197  }
  1198  
  1199  // result is the default implementation for IotHubResourceCreateOrUpdateFuture.Result.
  1200  func (future *IotHubResourceCreateOrUpdateFuture) result(client IotHubResourceClient) (ihd IotHubDescription, err error) {
  1201  	var done bool
  1202  	done, err = future.DoneWithContext(context.Background(), client)
  1203  	if err != nil {
  1204  		err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
  1205  		return
  1206  	}
  1207  	if !done {
  1208  		ihd.Response.Response = future.Response()
  1209  		err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceCreateOrUpdateFuture")
  1210  		return
  1211  	}
  1212  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1213  	if ihd.Response.Response, err = future.GetResult(sender); err == nil && ihd.Response.Response.StatusCode != http.StatusNoContent {
  1214  		ihd, err = client.CreateOrUpdateResponder(ihd.Response.Response)
  1215  		if err != nil {
  1216  			err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", ihd.Response.Response, "Failure responding to request")
  1217  		}
  1218  	}
  1219  	return
  1220  }
  1221  
  1222  // IotHubResourceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
  1223  // operation.
  1224  type IotHubResourceDeleteFuture struct {
  1225  	azure.FutureAPI
  1226  	// Result returns the result of the asynchronous operation.
  1227  	// If the operation has not completed it will return an error.
  1228  	Result func(IotHubResourceClient) (SetObject, error)
  1229  }
  1230  
  1231  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1232  func (future *IotHubResourceDeleteFuture) UnmarshalJSON(body []byte) error {
  1233  	var azFuture azure.Future
  1234  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1235  		return err
  1236  	}
  1237  	future.FutureAPI = &azFuture
  1238  	future.Result = future.result
  1239  	return nil
  1240  }
  1241  
  1242  // result is the default implementation for IotHubResourceDeleteFuture.Result.
  1243  func (future *IotHubResourceDeleteFuture) result(client IotHubResourceClient) (so SetObject, err error) {
  1244  	var done bool
  1245  	done, err = future.DoneWithContext(context.Background(), client)
  1246  	if err != nil {
  1247  		err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", future.Response(), "Polling failure")
  1248  		return
  1249  	}
  1250  	if !done {
  1251  		so.Response.Response = future.Response()
  1252  		err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceDeleteFuture")
  1253  		return
  1254  	}
  1255  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1256  	if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent {
  1257  		so, err = client.DeleteResponder(so.Response.Response)
  1258  		if err != nil {
  1259  			err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", so.Response.Response, "Failure responding to request")
  1260  		}
  1261  	}
  1262  	return
  1263  }
  1264  
  1265  // IotHubResourceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
  1266  // operation.
  1267  type IotHubResourceUpdateFuture struct {
  1268  	azure.FutureAPI
  1269  	// Result returns the result of the asynchronous operation.
  1270  	// If the operation has not completed it will return an error.
  1271  	Result func(IotHubResourceClient) (IotHubDescription, error)
  1272  }
  1273  
  1274  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
  1275  func (future *IotHubResourceUpdateFuture) UnmarshalJSON(body []byte) error {
  1276  	var azFuture azure.Future
  1277  	if err := json.Unmarshal(body, &azFuture); err != nil {
  1278  		return err
  1279  	}
  1280  	future.FutureAPI = &azFuture
  1281  	future.Result = future.result
  1282  	return nil
  1283  }
  1284  
  1285  // result is the default implementation for IotHubResourceUpdateFuture.Result.
  1286  func (future *IotHubResourceUpdateFuture) result(client IotHubResourceClient) (ihd IotHubDescription, err error) {
  1287  	var done bool
  1288  	done, err = future.DoneWithContext(context.Background(), client)
  1289  	if err != nil {
  1290  		err = autorest.NewErrorWithError(err, "devices.IotHubResourceUpdateFuture", "Result", future.Response(), "Polling failure")
  1291  		return
  1292  	}
  1293  	if !done {
  1294  		ihd.Response.Response = future.Response()
  1295  		err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceUpdateFuture")
  1296  		return
  1297  	}
  1298  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
  1299  	if ihd.Response.Response, err = future.GetResult(sender); err == nil && ihd.Response.Response.StatusCode != http.StatusNoContent {
  1300  		ihd, err = client.UpdateResponder(ihd.Response.Response)
  1301  		if err != nil {
  1302  			err = autorest.NewErrorWithError(err, "devices.IotHubResourceUpdateFuture", "Result", ihd.Response.Response, "Failure responding to request")
  1303  		}
  1304  	}
  1305  	return
  1306  }
  1307  
  1308  // IotHubSkuDescription SKU properties.
  1309  type IotHubSkuDescription struct {
  1310  	// ResourceType - READ-ONLY; The type of the resource.
  1311  	ResourceType *string `json:"resourceType,omitempty"`
  1312  	// Sku - The type of the resource.
  1313  	Sku *IotHubSkuInfo `json:"sku,omitempty"`
  1314  	// Capacity - IotHub capacity
  1315  	Capacity *IotHubCapacity `json:"capacity,omitempty"`
  1316  }
  1317  
  1318  // MarshalJSON is the custom marshaler for IotHubSkuDescription.
  1319  func (ihsd IotHubSkuDescription) MarshalJSON() ([]byte, error) {
  1320  	objectMap := make(map[string]interface{})
  1321  	if ihsd.Sku != nil {
  1322  		objectMap["sku"] = ihsd.Sku
  1323  	}
  1324  	if ihsd.Capacity != nil {
  1325  		objectMap["capacity"] = ihsd.Capacity
  1326  	}
  1327  	return json.Marshal(objectMap)
  1328  }
  1329  
  1330  // IotHubSkuDescriptionListResult the JSON-serialized array of IotHubSkuDescription objects with a next
  1331  // link.
  1332  type IotHubSkuDescriptionListResult struct {
  1333  	autorest.Response `json:"-"`
  1334  	// Value - The array of IotHubSkuDescription.
  1335  	Value *[]IotHubSkuDescription `json:"value,omitempty"`
  1336  	// NextLink - READ-ONLY; The next link.
  1337  	NextLink *string `json:"nextLink,omitempty"`
  1338  }
  1339  
  1340  // MarshalJSON is the custom marshaler for IotHubSkuDescriptionListResult.
  1341  func (ihsdlr IotHubSkuDescriptionListResult) MarshalJSON() ([]byte, error) {
  1342  	objectMap := make(map[string]interface{})
  1343  	if ihsdlr.Value != nil {
  1344  		objectMap["value"] = ihsdlr.Value
  1345  	}
  1346  	return json.Marshal(objectMap)
  1347  }
  1348  
  1349  // IotHubSkuDescriptionListResultIterator provides access to a complete listing of IotHubSkuDescription
  1350  // values.
  1351  type IotHubSkuDescriptionListResultIterator struct {
  1352  	i    int
  1353  	page IotHubSkuDescriptionListResultPage
  1354  }
  1355  
  1356  // NextWithContext advances to the next value.  If there was an error making
  1357  // the request the iterator does not advance and the error is returned.
  1358  func (iter *IotHubSkuDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1359  	if tracing.IsEnabled() {
  1360  		ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultIterator.NextWithContext")
  1361  		defer func() {
  1362  			sc := -1
  1363  			if iter.Response().Response.Response != nil {
  1364  				sc = iter.Response().Response.Response.StatusCode
  1365  			}
  1366  			tracing.EndSpan(ctx, sc, err)
  1367  		}()
  1368  	}
  1369  	iter.i++
  1370  	if iter.i < len(iter.page.Values()) {
  1371  		return nil
  1372  	}
  1373  	err = iter.page.NextWithContext(ctx)
  1374  	if err != nil {
  1375  		iter.i--
  1376  		return err
  1377  	}
  1378  	iter.i = 0
  1379  	return nil
  1380  }
  1381  
  1382  // Next advances to the next value.  If there was an error making
  1383  // the request the iterator does not advance and the error is returned.
  1384  // Deprecated: Use NextWithContext() instead.
  1385  func (iter *IotHubSkuDescriptionListResultIterator) Next() error {
  1386  	return iter.NextWithContext(context.Background())
  1387  }
  1388  
  1389  // NotDone returns true if the enumeration should be started or is not yet complete.
  1390  func (iter IotHubSkuDescriptionListResultIterator) NotDone() bool {
  1391  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1392  }
  1393  
  1394  // Response returns the raw server response from the last page request.
  1395  func (iter IotHubSkuDescriptionListResultIterator) Response() IotHubSkuDescriptionListResult {
  1396  	return iter.page.Response()
  1397  }
  1398  
  1399  // Value returns the current value or a zero-initialized value if the
  1400  // iterator has advanced beyond the end of the collection.
  1401  func (iter IotHubSkuDescriptionListResultIterator) Value() IotHubSkuDescription {
  1402  	if !iter.page.NotDone() {
  1403  		return IotHubSkuDescription{}
  1404  	}
  1405  	return iter.page.Values()[iter.i]
  1406  }
  1407  
  1408  // Creates a new instance of the IotHubSkuDescriptionListResultIterator type.
  1409  func NewIotHubSkuDescriptionListResultIterator(page IotHubSkuDescriptionListResultPage) IotHubSkuDescriptionListResultIterator {
  1410  	return IotHubSkuDescriptionListResultIterator{page: page}
  1411  }
  1412  
  1413  // IsEmpty returns true if the ListResult contains no values.
  1414  func (ihsdlr IotHubSkuDescriptionListResult) IsEmpty() bool {
  1415  	return ihsdlr.Value == nil || len(*ihsdlr.Value) == 0
  1416  }
  1417  
  1418  // hasNextLink returns true if the NextLink is not empty.
  1419  func (ihsdlr IotHubSkuDescriptionListResult) hasNextLink() bool {
  1420  	return ihsdlr.NextLink != nil && len(*ihsdlr.NextLink) != 0
  1421  }
  1422  
  1423  // iotHubSkuDescriptionListResultPreparer prepares a request to retrieve the next set of results.
  1424  // It returns nil if no more results exist.
  1425  func (ihsdlr IotHubSkuDescriptionListResult) iotHubSkuDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
  1426  	if !ihsdlr.hasNextLink() {
  1427  		return nil, nil
  1428  	}
  1429  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1430  		autorest.AsJSON(),
  1431  		autorest.AsGet(),
  1432  		autorest.WithBaseURL(to.String(ihsdlr.NextLink)))
  1433  }
  1434  
  1435  // IotHubSkuDescriptionListResultPage contains a page of IotHubSkuDescription values.
  1436  type IotHubSkuDescriptionListResultPage struct {
  1437  	fn     func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)
  1438  	ihsdlr IotHubSkuDescriptionListResult
  1439  }
  1440  
  1441  // NextWithContext advances to the next page of values.  If there was an error making
  1442  // the request the page does not advance and the error is returned.
  1443  func (page *IotHubSkuDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
  1444  	if tracing.IsEnabled() {
  1445  		ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultPage.NextWithContext")
  1446  		defer func() {
  1447  			sc := -1
  1448  			if page.Response().Response.Response != nil {
  1449  				sc = page.Response().Response.Response.StatusCode
  1450  			}
  1451  			tracing.EndSpan(ctx, sc, err)
  1452  		}()
  1453  	}
  1454  	for {
  1455  		next, err := page.fn(ctx, page.ihsdlr)
  1456  		if err != nil {
  1457  			return err
  1458  		}
  1459  		page.ihsdlr = next
  1460  		if !next.hasNextLink() || !next.IsEmpty() {
  1461  			break
  1462  		}
  1463  	}
  1464  	return nil
  1465  }
  1466  
  1467  // Next advances to the next page of values.  If there was an error making
  1468  // the request the page does not advance and the error is returned.
  1469  // Deprecated: Use NextWithContext() instead.
  1470  func (page *IotHubSkuDescriptionListResultPage) Next() error {
  1471  	return page.NextWithContext(context.Background())
  1472  }
  1473  
  1474  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1475  func (page IotHubSkuDescriptionListResultPage) NotDone() bool {
  1476  	return !page.ihsdlr.IsEmpty()
  1477  }
  1478  
  1479  // Response returns the raw server response from the last page request.
  1480  func (page IotHubSkuDescriptionListResultPage) Response() IotHubSkuDescriptionListResult {
  1481  	return page.ihsdlr
  1482  }
  1483  
  1484  // Values returns the slice of values for the current page or nil if there are no values.
  1485  func (page IotHubSkuDescriptionListResultPage) Values() []IotHubSkuDescription {
  1486  	if page.ihsdlr.IsEmpty() {
  1487  		return nil
  1488  	}
  1489  	return *page.ihsdlr.Value
  1490  }
  1491  
  1492  // Creates a new instance of the IotHubSkuDescriptionListResultPage type.
  1493  func NewIotHubSkuDescriptionListResultPage(cur IotHubSkuDescriptionListResult, getNextPage func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)) IotHubSkuDescriptionListResultPage {
  1494  	return IotHubSkuDescriptionListResultPage{
  1495  		fn:     getNextPage,
  1496  		ihsdlr: cur,
  1497  	}
  1498  }
  1499  
  1500  // IotHubSkuInfo information about the SKU of the IoT hub.
  1501  type IotHubSkuInfo struct {
  1502  	// Name - The name of the SKU. Possible values include: 'F1', 'S1', 'S2', 'S3', 'B1', 'B2', 'B3'
  1503  	Name IotHubSku `json:"name,omitempty"`
  1504  	// Tier - READ-ONLY; The billing tier for the IoT hub. Possible values include: 'Free', 'Standard', 'Basic'
  1505  	Tier IotHubSkuTier `json:"tier,omitempty"`
  1506  	// Capacity - The number of provisioned IoT Hub units. See: https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits.
  1507  	Capacity *int64 `json:"capacity,omitempty"`
  1508  }
  1509  
  1510  // MarshalJSON is the custom marshaler for IotHubSkuInfo.
  1511  func (ihsi IotHubSkuInfo) MarshalJSON() ([]byte, error) {
  1512  	objectMap := make(map[string]interface{})
  1513  	if ihsi.Name != "" {
  1514  		objectMap["name"] = ihsi.Name
  1515  	}
  1516  	if ihsi.Capacity != nil {
  1517  		objectMap["capacity"] = ihsi.Capacity
  1518  	}
  1519  	return json.Marshal(objectMap)
  1520  }
  1521  
  1522  // IPFilterRule the IP filter rules for the IoT hub.
  1523  type IPFilterRule struct {
  1524  	// FilterName - The name of the IP filter rule.
  1525  	FilterName *string `json:"filterName,omitempty"`
  1526  	// Action - The desired action for requests captured by this rule. Possible values include: 'Accept', 'Reject'
  1527  	Action IPFilterActionType `json:"action,omitempty"`
  1528  	// IPMask - A string that contains the IP address range in CIDR notation for the rule.
  1529  	IPMask *string `json:"ipMask,omitempty"`
  1530  }
  1531  
  1532  // JobResponse the properties of the Job Response object.
  1533  type JobResponse struct {
  1534  	autorest.Response `json:"-"`
  1535  	// JobID - READ-ONLY; The job identifier.
  1536  	JobID *string `json:"jobId,omitempty"`
  1537  	// StartTimeUtc - READ-ONLY; The start time of the job.
  1538  	StartTimeUtc *date.TimeRFC1123 `json:"startTimeUtc,omitempty"`
  1539  	// EndTimeUtc - READ-ONLY; The time the job stopped processing.
  1540  	EndTimeUtc *date.TimeRFC1123 `json:"endTimeUtc,omitempty"`
  1541  	// Type - READ-ONLY; The type of the job. Possible values include: 'JobTypeUnknown', 'JobTypeExport', 'JobTypeImport', 'JobTypeBackup', 'JobTypeReadDeviceProperties', 'JobTypeWriteDeviceProperties', 'JobTypeUpdateDeviceConfiguration', 'JobTypeRebootDevice', 'JobTypeFactoryResetDevice', 'JobTypeFirmwareUpdate'
  1542  	Type JobType `json:"type,omitempty"`
  1543  	// Status - READ-ONLY; The status of the job. Possible values include: 'JobStatusUnknown', 'JobStatusEnqueued', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCancelled'
  1544  	Status JobStatus `json:"status,omitempty"`
  1545  	// FailureReason - READ-ONLY; If status == failed, this string containing the reason for the failure.
  1546  	FailureReason *string `json:"failureReason,omitempty"`
  1547  	// StatusMessage - READ-ONLY; The status message for the job.
  1548  	StatusMessage *string `json:"statusMessage,omitempty"`
  1549  	// ParentJobID - READ-ONLY; The job identifier of the parent job, if any.
  1550  	ParentJobID *string `json:"parentJobId,omitempty"`
  1551  }
  1552  
  1553  // MarshalJSON is the custom marshaler for JobResponse.
  1554  func (jr JobResponse) MarshalJSON() ([]byte, error) {
  1555  	objectMap := make(map[string]interface{})
  1556  	return json.Marshal(objectMap)
  1557  }
  1558  
  1559  // JobResponseListResult the JSON-serialized array of JobResponse objects with a next link.
  1560  type JobResponseListResult struct {
  1561  	autorest.Response `json:"-"`
  1562  	// Value - The array of JobResponse objects.
  1563  	Value *[]JobResponse `json:"value,omitempty"`
  1564  	// NextLink - READ-ONLY; The next link.
  1565  	NextLink *string `json:"nextLink,omitempty"`
  1566  }
  1567  
  1568  // MarshalJSON is the custom marshaler for JobResponseListResult.
  1569  func (jrlr JobResponseListResult) MarshalJSON() ([]byte, error) {
  1570  	objectMap := make(map[string]interface{})
  1571  	if jrlr.Value != nil {
  1572  		objectMap["value"] = jrlr.Value
  1573  	}
  1574  	return json.Marshal(objectMap)
  1575  }
  1576  
  1577  // JobResponseListResultIterator provides access to a complete listing of JobResponse values.
  1578  type JobResponseListResultIterator struct {
  1579  	i    int
  1580  	page JobResponseListResultPage
  1581  }
  1582  
  1583  // NextWithContext advances to the next value.  If there was an error making
  1584  // the request the iterator does not advance and the error is returned.
  1585  func (iter *JobResponseListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1586  	if tracing.IsEnabled() {
  1587  		ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultIterator.NextWithContext")
  1588  		defer func() {
  1589  			sc := -1
  1590  			if iter.Response().Response.Response != nil {
  1591  				sc = iter.Response().Response.Response.StatusCode
  1592  			}
  1593  			tracing.EndSpan(ctx, sc, err)
  1594  		}()
  1595  	}
  1596  	iter.i++
  1597  	if iter.i < len(iter.page.Values()) {
  1598  		return nil
  1599  	}
  1600  	err = iter.page.NextWithContext(ctx)
  1601  	if err != nil {
  1602  		iter.i--
  1603  		return err
  1604  	}
  1605  	iter.i = 0
  1606  	return nil
  1607  }
  1608  
  1609  // Next advances to the next value.  If there was an error making
  1610  // the request the iterator does not advance and the error is returned.
  1611  // Deprecated: Use NextWithContext() instead.
  1612  func (iter *JobResponseListResultIterator) Next() error {
  1613  	return iter.NextWithContext(context.Background())
  1614  }
  1615  
  1616  // NotDone returns true if the enumeration should be started or is not yet complete.
  1617  func (iter JobResponseListResultIterator) NotDone() bool {
  1618  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1619  }
  1620  
  1621  // Response returns the raw server response from the last page request.
  1622  func (iter JobResponseListResultIterator) Response() JobResponseListResult {
  1623  	return iter.page.Response()
  1624  }
  1625  
  1626  // Value returns the current value or a zero-initialized value if the
  1627  // iterator has advanced beyond the end of the collection.
  1628  func (iter JobResponseListResultIterator) Value() JobResponse {
  1629  	if !iter.page.NotDone() {
  1630  		return JobResponse{}
  1631  	}
  1632  	return iter.page.Values()[iter.i]
  1633  }
  1634  
  1635  // Creates a new instance of the JobResponseListResultIterator type.
  1636  func NewJobResponseListResultIterator(page JobResponseListResultPage) JobResponseListResultIterator {
  1637  	return JobResponseListResultIterator{page: page}
  1638  }
  1639  
  1640  // IsEmpty returns true if the ListResult contains no values.
  1641  func (jrlr JobResponseListResult) IsEmpty() bool {
  1642  	return jrlr.Value == nil || len(*jrlr.Value) == 0
  1643  }
  1644  
  1645  // hasNextLink returns true if the NextLink is not empty.
  1646  func (jrlr JobResponseListResult) hasNextLink() bool {
  1647  	return jrlr.NextLink != nil && len(*jrlr.NextLink) != 0
  1648  }
  1649  
  1650  // jobResponseListResultPreparer prepares a request to retrieve the next set of results.
  1651  // It returns nil if no more results exist.
  1652  func (jrlr JobResponseListResult) jobResponseListResultPreparer(ctx context.Context) (*http.Request, error) {
  1653  	if !jrlr.hasNextLink() {
  1654  		return nil, nil
  1655  	}
  1656  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1657  		autorest.AsJSON(),
  1658  		autorest.AsGet(),
  1659  		autorest.WithBaseURL(to.String(jrlr.NextLink)))
  1660  }
  1661  
  1662  // JobResponseListResultPage contains a page of JobResponse values.
  1663  type JobResponseListResultPage struct {
  1664  	fn   func(context.Context, JobResponseListResult) (JobResponseListResult, error)
  1665  	jrlr JobResponseListResult
  1666  }
  1667  
  1668  // NextWithContext advances to the next page of values.  If there was an error making
  1669  // the request the page does not advance and the error is returned.
  1670  func (page *JobResponseListResultPage) NextWithContext(ctx context.Context) (err error) {
  1671  	if tracing.IsEnabled() {
  1672  		ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultPage.NextWithContext")
  1673  		defer func() {
  1674  			sc := -1
  1675  			if page.Response().Response.Response != nil {
  1676  				sc = page.Response().Response.Response.StatusCode
  1677  			}
  1678  			tracing.EndSpan(ctx, sc, err)
  1679  		}()
  1680  	}
  1681  	for {
  1682  		next, err := page.fn(ctx, page.jrlr)
  1683  		if err != nil {
  1684  			return err
  1685  		}
  1686  		page.jrlr = next
  1687  		if !next.hasNextLink() || !next.IsEmpty() {
  1688  			break
  1689  		}
  1690  	}
  1691  	return nil
  1692  }
  1693  
  1694  // Next advances to the next page of values.  If there was an error making
  1695  // the request the page does not advance and the error is returned.
  1696  // Deprecated: Use NextWithContext() instead.
  1697  func (page *JobResponseListResultPage) Next() error {
  1698  	return page.NextWithContext(context.Background())
  1699  }
  1700  
  1701  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1702  func (page JobResponseListResultPage) NotDone() bool {
  1703  	return !page.jrlr.IsEmpty()
  1704  }
  1705  
  1706  // Response returns the raw server response from the last page request.
  1707  func (page JobResponseListResultPage) Response() JobResponseListResult {
  1708  	return page.jrlr
  1709  }
  1710  
  1711  // Values returns the slice of values for the current page or nil if there are no values.
  1712  func (page JobResponseListResultPage) Values() []JobResponse {
  1713  	if page.jrlr.IsEmpty() {
  1714  		return nil
  1715  	}
  1716  	return *page.jrlr.Value
  1717  }
  1718  
  1719  // Creates a new instance of the JobResponseListResultPage type.
  1720  func NewJobResponseListResultPage(cur JobResponseListResult, getNextPage func(context.Context, JobResponseListResult) (JobResponseListResult, error)) JobResponseListResultPage {
  1721  	return JobResponseListResultPage{
  1722  		fn:   getNextPage,
  1723  		jrlr: cur,
  1724  	}
  1725  }
  1726  
  1727  // MatchedRoute routes that matched
  1728  type MatchedRoute struct {
  1729  	// Properties - Properties of routes that matched
  1730  	Properties *RouteProperties `json:"properties,omitempty"`
  1731  }
  1732  
  1733  // MessagingEndpointProperties the properties of the messaging endpoints used by this IoT hub.
  1734  type MessagingEndpointProperties struct {
  1735  	// LockDurationAsIso8601 - The lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
  1736  	LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"`
  1737  	// TTLAsIso8601 - The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
  1738  	TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"`
  1739  	// MaxDeliveryCount - The number of times the IoT hub attempts to deliver a message. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
  1740  	MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"`
  1741  }
  1742  
  1743  // Name name of Iot Hub type
  1744  type Name struct {
  1745  	// Value - IotHub type
  1746  	Value *string `json:"value,omitempty"`
  1747  	// LocalizedValue - Localized value of name
  1748  	LocalizedValue *string `json:"localizedValue,omitempty"`
  1749  }
  1750  
  1751  // Operation ioT Hub REST API operation
  1752  type Operation struct {
  1753  	// Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete}
  1754  	Name *string `json:"name,omitempty"`
  1755  	// Display - The object that represents the operation.
  1756  	Display *OperationDisplay `json:"display,omitempty"`
  1757  }
  1758  
  1759  // MarshalJSON is the custom marshaler for Operation.
  1760  func (o Operation) MarshalJSON() ([]byte, error) {
  1761  	objectMap := make(map[string]interface{})
  1762  	if o.Display != nil {
  1763  		objectMap["display"] = o.Display
  1764  	}
  1765  	return json.Marshal(objectMap)
  1766  }
  1767  
  1768  // OperationDisplay the object that represents the operation.
  1769  type OperationDisplay struct {
  1770  	// Provider - READ-ONLY; Service provider: Microsoft Devices
  1771  	Provider *string `json:"provider,omitempty"`
  1772  	// Resource - READ-ONLY; Resource Type: IotHubs
  1773  	Resource *string `json:"resource,omitempty"`
  1774  	// Operation - READ-ONLY; Name of the operation
  1775  	Operation *string `json:"operation,omitempty"`
  1776  	// Description - READ-ONLY; Description of the operation
  1777  	Description *string `json:"description,omitempty"`
  1778  }
  1779  
  1780  // MarshalJSON is the custom marshaler for OperationDisplay.
  1781  func (o OperationDisplay) MarshalJSON() ([]byte, error) {
  1782  	objectMap := make(map[string]interface{})
  1783  	return json.Marshal(objectMap)
  1784  }
  1785  
  1786  // OperationInputs input values.
  1787  type OperationInputs struct {
  1788  	// Name - The name of the IoT hub to check.
  1789  	Name *string `json:"name,omitempty"`
  1790  }
  1791  
  1792  // OperationListResult result of the request to list IoT Hub operations. It contains a list of operations
  1793  // and a URL link to get the next set of results.
  1794  type OperationListResult struct {
  1795  	autorest.Response `json:"-"`
  1796  	// Value - READ-ONLY; List of IoT Hub operations supported by the Microsoft.Devices resource provider.
  1797  	Value *[]Operation `json:"value,omitempty"`
  1798  	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
  1799  	NextLink *string `json:"nextLink,omitempty"`
  1800  }
  1801  
  1802  // MarshalJSON is the custom marshaler for OperationListResult.
  1803  func (olr OperationListResult) MarshalJSON() ([]byte, error) {
  1804  	objectMap := make(map[string]interface{})
  1805  	return json.Marshal(objectMap)
  1806  }
  1807  
  1808  // OperationListResultIterator provides access to a complete listing of Operation values.
  1809  type OperationListResultIterator struct {
  1810  	i    int
  1811  	page OperationListResultPage
  1812  }
  1813  
  1814  // NextWithContext advances to the next value.  If there was an error making
  1815  // the request the iterator does not advance and the error is returned.
  1816  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1817  	if tracing.IsEnabled() {
  1818  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
  1819  		defer func() {
  1820  			sc := -1
  1821  			if iter.Response().Response.Response != nil {
  1822  				sc = iter.Response().Response.Response.StatusCode
  1823  			}
  1824  			tracing.EndSpan(ctx, sc, err)
  1825  		}()
  1826  	}
  1827  	iter.i++
  1828  	if iter.i < len(iter.page.Values()) {
  1829  		return nil
  1830  	}
  1831  	err = iter.page.NextWithContext(ctx)
  1832  	if err != nil {
  1833  		iter.i--
  1834  		return err
  1835  	}
  1836  	iter.i = 0
  1837  	return nil
  1838  }
  1839  
  1840  // Next advances to the next value.  If there was an error making
  1841  // the request the iterator does not advance and the error is returned.
  1842  // Deprecated: Use NextWithContext() instead.
  1843  func (iter *OperationListResultIterator) Next() error {
  1844  	return iter.NextWithContext(context.Background())
  1845  }
  1846  
  1847  // NotDone returns true if the enumeration should be started or is not yet complete.
  1848  func (iter OperationListResultIterator) NotDone() bool {
  1849  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1850  }
  1851  
  1852  // Response returns the raw server response from the last page request.
  1853  func (iter OperationListResultIterator) Response() OperationListResult {
  1854  	return iter.page.Response()
  1855  }
  1856  
  1857  // Value returns the current value or a zero-initialized value if the
  1858  // iterator has advanced beyond the end of the collection.
  1859  func (iter OperationListResultIterator) Value() Operation {
  1860  	if !iter.page.NotDone() {
  1861  		return Operation{}
  1862  	}
  1863  	return iter.page.Values()[iter.i]
  1864  }
  1865  
  1866  // Creates a new instance of the OperationListResultIterator type.
  1867  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
  1868  	return OperationListResultIterator{page: page}
  1869  }
  1870  
  1871  // IsEmpty returns true if the ListResult contains no values.
  1872  func (olr OperationListResult) IsEmpty() bool {
  1873  	return olr.Value == nil || len(*olr.Value) == 0
  1874  }
  1875  
  1876  // hasNextLink returns true if the NextLink is not empty.
  1877  func (olr OperationListResult) hasNextLink() bool {
  1878  	return olr.NextLink != nil && len(*olr.NextLink) != 0
  1879  }
  1880  
  1881  // operationListResultPreparer prepares a request to retrieve the next set of results.
  1882  // It returns nil if no more results exist.
  1883  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
  1884  	if !olr.hasNextLink() {
  1885  		return nil, nil
  1886  	}
  1887  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1888  		autorest.AsJSON(),
  1889  		autorest.AsGet(),
  1890  		autorest.WithBaseURL(to.String(olr.NextLink)))
  1891  }
  1892  
  1893  // OperationListResultPage contains a page of Operation values.
  1894  type OperationListResultPage struct {
  1895  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
  1896  	olr OperationListResult
  1897  }
  1898  
  1899  // NextWithContext advances to the next page of values.  If there was an error making
  1900  // the request the page does not advance and the error is returned.
  1901  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
  1902  	if tracing.IsEnabled() {
  1903  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
  1904  		defer func() {
  1905  			sc := -1
  1906  			if page.Response().Response.Response != nil {
  1907  				sc = page.Response().Response.Response.StatusCode
  1908  			}
  1909  			tracing.EndSpan(ctx, sc, err)
  1910  		}()
  1911  	}
  1912  	for {
  1913  		next, err := page.fn(ctx, page.olr)
  1914  		if err != nil {
  1915  			return err
  1916  		}
  1917  		page.olr = next
  1918  		if !next.hasNextLink() || !next.IsEmpty() {
  1919  			break
  1920  		}
  1921  	}
  1922  	return nil
  1923  }
  1924  
  1925  // Next advances to the next page of values.  If there was an error making
  1926  // the request the page does not advance and the error is returned.
  1927  // Deprecated: Use NextWithContext() instead.
  1928  func (page *OperationListResultPage) Next() error {
  1929  	return page.NextWithContext(context.Background())
  1930  }
  1931  
  1932  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1933  func (page OperationListResultPage) NotDone() bool {
  1934  	return !page.olr.IsEmpty()
  1935  }
  1936  
  1937  // Response returns the raw server response from the last page request.
  1938  func (page OperationListResultPage) Response() OperationListResult {
  1939  	return page.olr
  1940  }
  1941  
  1942  // Values returns the slice of values for the current page or nil if there are no values.
  1943  func (page OperationListResultPage) Values() []Operation {
  1944  	if page.olr.IsEmpty() {
  1945  		return nil
  1946  	}
  1947  	return *page.olr.Value
  1948  }
  1949  
  1950  // Creates a new instance of the OperationListResultPage type.
  1951  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
  1952  	return OperationListResultPage{
  1953  		fn:  getNextPage,
  1954  		olr: cur,
  1955  	}
  1956  }
  1957  
  1958  // RegistryStatistics identity registry statistics.
  1959  type RegistryStatistics struct {
  1960  	autorest.Response `json:"-"`
  1961  	// TotalDeviceCount - READ-ONLY; The total count of devices in the identity registry.
  1962  	TotalDeviceCount *int64 `json:"totalDeviceCount,omitempty"`
  1963  	// EnabledDeviceCount - READ-ONLY; The count of enabled devices in the identity registry.
  1964  	EnabledDeviceCount *int64 `json:"enabledDeviceCount,omitempty"`
  1965  	// DisabledDeviceCount - READ-ONLY; The count of disabled devices in the identity registry.
  1966  	DisabledDeviceCount *int64 `json:"disabledDeviceCount,omitempty"`
  1967  }
  1968  
  1969  // MarshalJSON is the custom marshaler for RegistryStatistics.
  1970  func (rs RegistryStatistics) MarshalJSON() ([]byte, error) {
  1971  	objectMap := make(map[string]interface{})
  1972  	return json.Marshal(objectMap)
  1973  }
  1974  
  1975  // Resource the common properties of an Azure resource.
  1976  type Resource struct {
  1977  	// ID - READ-ONLY; The resource identifier.
  1978  	ID *string `json:"id,omitempty"`
  1979  	// Name - READ-ONLY; The resource name.
  1980  	Name *string `json:"name,omitempty"`
  1981  	// Type - READ-ONLY; The resource type.
  1982  	Type *string `json:"type,omitempty"`
  1983  	// Location - The resource location.
  1984  	Location *string `json:"location,omitempty"`
  1985  	// Tags - The resource tags.
  1986  	Tags map[string]*string `json:"tags"`
  1987  }
  1988  
  1989  // MarshalJSON is the custom marshaler for Resource.
  1990  func (r Resource) MarshalJSON() ([]byte, error) {
  1991  	objectMap := make(map[string]interface{})
  1992  	if r.Location != nil {
  1993  		objectMap["location"] = r.Location
  1994  	}
  1995  	if r.Tags != nil {
  1996  		objectMap["tags"] = r.Tags
  1997  	}
  1998  	return json.Marshal(objectMap)
  1999  }
  2000  
  2001  // RouteCompilationError compilation error when evaluating route
  2002  type RouteCompilationError struct {
  2003  	// Message - Route error message
  2004  	Message *string `json:"message,omitempty"`
  2005  	// Severity - Severity of the route error. Possible values include: 'Error', 'Warning'
  2006  	Severity RouteErrorSeverity `json:"severity,omitempty"`
  2007  	// Location - Location where the route error happened
  2008  	Location *RouteErrorRange `json:"location,omitempty"`
  2009  }
  2010  
  2011  // RouteErrorPosition position where the route error happened
  2012  type RouteErrorPosition struct {
  2013  	// Line - Line where the route error happened
  2014  	Line *int32 `json:"line,omitempty"`
  2015  	// Column - Column where the route error happened
  2016  	Column *int32 `json:"column,omitempty"`
  2017  }
  2018  
  2019  // RouteErrorRange range of route errors
  2020  type RouteErrorRange struct {
  2021  	// Start - Start where the route error happened
  2022  	Start *RouteErrorPosition `json:"start,omitempty"`
  2023  	// End - End where the route error happened
  2024  	End *RouteErrorPosition `json:"end,omitempty"`
  2025  }
  2026  
  2027  // RouteProperties the properties of a routing rule that your IoT hub uses to route messages to endpoints.
  2028  type RouteProperties struct {
  2029  	// Name - The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique.
  2030  	Name *string `json:"name,omitempty"`
  2031  	// Source - The source that the routing rule is to be applied to, such as DeviceMessages. Possible values include: 'RoutingSourceInvalid', 'RoutingSourceDeviceMessages', 'RoutingSourceTwinChangeEvents', 'RoutingSourceDeviceLifecycleEvents', 'RoutingSourceDeviceJobLifecycleEvents', 'RoutingSourceDigitalTwinChangeEvents'
  2032  	Source RoutingSource `json:"source,omitempty"`
  2033  	// Condition - The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language
  2034  	Condition *string `json:"condition,omitempty"`
  2035  	// EndpointNames - The list of endpoints to which messages that satisfy the condition are routed. Currently only one endpoint is allowed.
  2036  	EndpointNames *[]string `json:"endpointNames,omitempty"`
  2037  	// IsEnabled - Used to specify whether a route is enabled.
  2038  	IsEnabled *bool `json:"isEnabled,omitempty"`
  2039  }
  2040  
  2041  // RoutingEndpoints the properties related to the custom endpoints to which your IoT hub routes messages
  2042  // based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for
  2043  // paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs.
  2044  type RoutingEndpoints struct {
  2045  	// ServiceBusQueues - The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules.
  2046  	ServiceBusQueues *[]RoutingServiceBusQueueEndpointProperties `json:"serviceBusQueues,omitempty"`
  2047  	// ServiceBusTopics - The list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the routing rules.
  2048  	ServiceBusTopics *[]RoutingServiceBusTopicEndpointProperties `json:"serviceBusTopics,omitempty"`
  2049  	// EventHubs - The list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not include the built-in Event Hubs endpoint.
  2050  	EventHubs *[]RoutingEventHubProperties `json:"eventHubs,omitempty"`
  2051  	// StorageContainers - The list of storage container endpoints that IoT hub routes messages to, based on the routing rules.
  2052  	StorageContainers *[]RoutingStorageContainerProperties `json:"storageContainers,omitempty"`
  2053  }
  2054  
  2055  // RoutingEventHubProperties the properties related to an event hub endpoint.
  2056  type RoutingEventHubProperties struct {
  2057  	// ConnectionString - The connection string of the event hub endpoint.
  2058  	ConnectionString *string `json:"connectionString,omitempty"`
  2059  	// Name - The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved:  events, fileNotifications, $default. Endpoint names must be unique across endpoint types.
  2060  	Name *string `json:"name,omitempty"`
  2061  	// SubscriptionID - The subscription identifier of the event hub endpoint.
  2062  	SubscriptionID *string `json:"subscriptionId,omitempty"`
  2063  	// ResourceGroup - The name of the resource group of the event hub endpoint.
  2064  	ResourceGroup *string `json:"resourceGroup,omitempty"`
  2065  }
  2066  
  2067  // RoutingMessage routing message
  2068  type RoutingMessage struct {
  2069  	// Body - Body of routing message
  2070  	Body *string `json:"body,omitempty"`
  2071  	// AppProperties - App properties
  2072  	AppProperties map[string]*string `json:"appProperties"`
  2073  	// SystemProperties - System properties
  2074  	SystemProperties map[string]*string `json:"systemProperties"`
  2075  }
  2076  
  2077  // MarshalJSON is the custom marshaler for RoutingMessage.
  2078  func (rm RoutingMessage) MarshalJSON() ([]byte, error) {
  2079  	objectMap := make(map[string]interface{})
  2080  	if rm.Body != nil {
  2081  		objectMap["body"] = rm.Body
  2082  	}
  2083  	if rm.AppProperties != nil {
  2084  		objectMap["appProperties"] = rm.AppProperties
  2085  	}
  2086  	if rm.SystemProperties != nil {
  2087  		objectMap["systemProperties"] = rm.SystemProperties
  2088  	}
  2089  	return json.Marshal(objectMap)
  2090  }
  2091  
  2092  // RoutingProperties the routing related properties of the IoT hub. See:
  2093  // https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging
  2094  type RoutingProperties struct {
  2095  	Endpoints *RoutingEndpoints `json:"endpoints,omitempty"`
  2096  	// Routes - The list of user-provided routing rules that the IoT hub uses to route messages to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 routing rules are allowed for free hubs.
  2097  	Routes *[]RouteProperties `json:"routes,omitempty"`
  2098  	// FallbackRoute - The properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the built-in eventhub endpoint.
  2099  	FallbackRoute *FallbackRouteProperties `json:"fallbackRoute,omitempty"`
  2100  	// Enrichments - The list of user-provided enrichments that the IoT hub applies to messages to be delivered to built-in and custom endpoints. See: https://aka.ms/iotmsgenrich
  2101  	Enrichments *[]EnrichmentProperties `json:"enrichments,omitempty"`
  2102  }
  2103  
  2104  // RoutingServiceBusQueueEndpointProperties the properties related to service bus queue endpoint types.
  2105  type RoutingServiceBusQueueEndpointProperties struct {
  2106  	// ConnectionString - The connection string of the service bus queue endpoint.
  2107  	ConnectionString *string `json:"connectionString,omitempty"`
  2108  	// Name - The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved:  events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual queue name.
  2109  	Name *string `json:"name,omitempty"`
  2110  	// SubscriptionID - The subscription identifier of the service bus queue endpoint.
  2111  	SubscriptionID *string `json:"subscriptionId,omitempty"`
  2112  	// ResourceGroup - The name of the resource group of the service bus queue endpoint.
  2113  	ResourceGroup *string `json:"resourceGroup,omitempty"`
  2114  }
  2115  
  2116  // RoutingServiceBusTopicEndpointProperties the properties related to service bus topic endpoint types.
  2117  type RoutingServiceBusTopicEndpointProperties struct {
  2118  	// ConnectionString - The connection string of the service bus topic endpoint.
  2119  	ConnectionString *string `json:"connectionString,omitempty"`
  2120  	// Name - The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved:  events, fileNotifications, $default. Endpoint names must be unique across endpoint types.  The name need not be the same as the actual topic name.
  2121  	Name *string `json:"name,omitempty"`
  2122  	// SubscriptionID - The subscription identifier of the service bus topic endpoint.
  2123  	SubscriptionID *string `json:"subscriptionId,omitempty"`
  2124  	// ResourceGroup - The name of the resource group of the service bus topic endpoint.
  2125  	ResourceGroup *string `json:"resourceGroup,omitempty"`
  2126  }
  2127  
  2128  // RoutingStorageContainerProperties the properties related to a storage container endpoint.
  2129  type RoutingStorageContainerProperties struct {
  2130  	// ConnectionString - The connection string of the storage account.
  2131  	ConnectionString *string `json:"connectionString,omitempty"`
  2132  	// Name - The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved:  events, fileNotifications, $default. Endpoint names must be unique across endpoint types.
  2133  	Name *string `json:"name,omitempty"`
  2134  	// SubscriptionID - The subscription identifier of the storage account.
  2135  	SubscriptionID *string `json:"subscriptionId,omitempty"`
  2136  	// ResourceGroup - The name of the resource group of the storage account.
  2137  	ResourceGroup *string `json:"resourceGroup,omitempty"`
  2138  	// ContainerName - The name of storage container in the storage account.
  2139  	ContainerName *string `json:"containerName,omitempty"`
  2140  	// FileNameFormat - File name format for the blob. Default format is {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be reordered.
  2141  	FileNameFormat *string `json:"fileNameFormat,omitempty"`
  2142  	// BatchFrequencyInSeconds - Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds.
  2143  	BatchFrequencyInSeconds *int32 `json:"batchFrequencyInSeconds,omitempty"`
  2144  	// MaxChunkSizeInBytes - Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).
  2145  	MaxChunkSizeInBytes *int32 `json:"maxChunkSizeInBytes,omitempty"`
  2146  	// Encoding - Encoding that is used to serialize messages to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Possible values include: 'Avro', 'AvroDeflate', 'JSON'
  2147  	Encoding Encoding `json:"encoding,omitempty"`
  2148  }
  2149  
  2150  // RoutingTwin twin reference input parameter. This is an optional parameter
  2151  type RoutingTwin struct {
  2152  	// Tags - Twin Tags
  2153  	Tags       interface{}            `json:"tags,omitempty"`
  2154  	Properties *RoutingTwinProperties `json:"properties,omitempty"`
  2155  }
  2156  
  2157  // RoutingTwinProperties ...
  2158  type RoutingTwinProperties struct {
  2159  	// Desired - Twin desired properties
  2160  	Desired interface{} `json:"desired,omitempty"`
  2161  	// Reported - Twin desired properties
  2162  	Reported interface{} `json:"reported,omitempty"`
  2163  }
  2164  
  2165  // SetObject ...
  2166  type SetObject struct {
  2167  	autorest.Response `json:"-"`
  2168  	Value             interface{} `json:"value,omitempty"`
  2169  }
  2170  
  2171  // SharedAccessSignatureAuthorizationRule the properties of an IoT hub shared access policy.
  2172  type SharedAccessSignatureAuthorizationRule struct {
  2173  	autorest.Response `json:"-"`
  2174  	// KeyName - The name of the shared access policy.
  2175  	KeyName *string `json:"keyName,omitempty"`
  2176  	// PrimaryKey - The primary key.
  2177  	PrimaryKey *string `json:"primaryKey,omitempty"`
  2178  	// SecondaryKey - The secondary key.
  2179  	SecondaryKey *string `json:"secondaryKey,omitempty"`
  2180  	// Rights - The permissions assigned to the shared access policy. Possible values include: 'RegistryRead', 'RegistryWrite', 'ServiceConnect', 'DeviceConnect', 'RegistryReadRegistryWrite', 'RegistryReadServiceConnect', 'RegistryReadDeviceConnect', 'RegistryWriteServiceConnect', 'RegistryWriteDeviceConnect', 'ServiceConnectDeviceConnect', 'RegistryReadRegistryWriteServiceConnect', 'RegistryReadRegistryWriteDeviceConnect', 'RegistryReadServiceConnectDeviceConnect', 'RegistryWriteServiceConnectDeviceConnect', 'RegistryReadRegistryWriteServiceConnectDeviceConnect'
  2181  	Rights AccessRights `json:"rights,omitempty"`
  2182  }
  2183  
  2184  // SharedAccessSignatureAuthorizationRuleListResult the list of shared access policies with a next link.
  2185  type SharedAccessSignatureAuthorizationRuleListResult struct {
  2186  	autorest.Response `json:"-"`
  2187  	// Value - The list of shared access policies.
  2188  	Value *[]SharedAccessSignatureAuthorizationRule `json:"value,omitempty"`
  2189  	// NextLink - READ-ONLY; The next link.
  2190  	NextLink *string `json:"nextLink,omitempty"`
  2191  }
  2192  
  2193  // MarshalJSON is the custom marshaler for SharedAccessSignatureAuthorizationRuleListResult.
  2194  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) {
  2195  	objectMap := make(map[string]interface{})
  2196  	if sasarlr.Value != nil {
  2197  		objectMap["value"] = sasarlr.Value
  2198  	}
  2199  	return json.Marshal(objectMap)
  2200  }
  2201  
  2202  // SharedAccessSignatureAuthorizationRuleListResultIterator provides access to a complete listing of
  2203  // SharedAccessSignatureAuthorizationRule values.
  2204  type SharedAccessSignatureAuthorizationRuleListResultIterator struct {
  2205  	i    int
  2206  	page SharedAccessSignatureAuthorizationRuleListResultPage
  2207  }
  2208  
  2209  // NextWithContext advances to the next value.  If there was an error making
  2210  // the request the iterator does not advance and the error is returned.
  2211  func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
  2212  	if tracing.IsEnabled() {
  2213  		ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultIterator.NextWithContext")
  2214  		defer func() {
  2215  			sc := -1
  2216  			if iter.Response().Response.Response != nil {
  2217  				sc = iter.Response().Response.Response.StatusCode
  2218  			}
  2219  			tracing.EndSpan(ctx, sc, err)
  2220  		}()
  2221  	}
  2222  	iter.i++
  2223  	if iter.i < len(iter.page.Values()) {
  2224  		return nil
  2225  	}
  2226  	err = iter.page.NextWithContext(ctx)
  2227  	if err != nil {
  2228  		iter.i--
  2229  		return err
  2230  	}
  2231  	iter.i = 0
  2232  	return nil
  2233  }
  2234  
  2235  // Next advances to the next value.  If there was an error making
  2236  // the request the iterator does not advance and the error is returned.
  2237  // Deprecated: Use NextWithContext() instead.
  2238  func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) Next() error {
  2239  	return iter.NextWithContext(context.Background())
  2240  }
  2241  
  2242  // NotDone returns true if the enumeration should be started or is not yet complete.
  2243  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) NotDone() bool {
  2244  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  2245  }
  2246  
  2247  // Response returns the raw server response from the last page request.
  2248  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Response() SharedAccessSignatureAuthorizationRuleListResult {
  2249  	return iter.page.Response()
  2250  }
  2251  
  2252  // Value returns the current value or a zero-initialized value if the
  2253  // iterator has advanced beyond the end of the collection.
  2254  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Value() SharedAccessSignatureAuthorizationRule {
  2255  	if !iter.page.NotDone() {
  2256  		return SharedAccessSignatureAuthorizationRule{}
  2257  	}
  2258  	return iter.page.Values()[iter.i]
  2259  }
  2260  
  2261  // Creates a new instance of the SharedAccessSignatureAuthorizationRuleListResultIterator type.
  2262  func NewSharedAccessSignatureAuthorizationRuleListResultIterator(page SharedAccessSignatureAuthorizationRuleListResultPage) SharedAccessSignatureAuthorizationRuleListResultIterator {
  2263  	return SharedAccessSignatureAuthorizationRuleListResultIterator{page: page}
  2264  }
  2265  
  2266  // IsEmpty returns true if the ListResult contains no values.
  2267  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) IsEmpty() bool {
  2268  	return sasarlr.Value == nil || len(*sasarlr.Value) == 0
  2269  }
  2270  
  2271  // hasNextLink returns true if the NextLink is not empty.
  2272  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) hasNextLink() bool {
  2273  	return sasarlr.NextLink != nil && len(*sasarlr.NextLink) != 0
  2274  }
  2275  
  2276  // sharedAccessSignatureAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results.
  2277  // It returns nil if no more results exist.
  2278  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) sharedAccessSignatureAuthorizationRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
  2279  	if !sasarlr.hasNextLink() {
  2280  		return nil, nil
  2281  	}
  2282  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  2283  		autorest.AsJSON(),
  2284  		autorest.AsGet(),
  2285  		autorest.WithBaseURL(to.String(sasarlr.NextLink)))
  2286  }
  2287  
  2288  // SharedAccessSignatureAuthorizationRuleListResultPage contains a page of
  2289  // SharedAccessSignatureAuthorizationRule values.
  2290  type SharedAccessSignatureAuthorizationRuleListResultPage struct {
  2291  	fn      func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)
  2292  	sasarlr SharedAccessSignatureAuthorizationRuleListResult
  2293  }
  2294  
  2295  // NextWithContext advances to the next page of values.  If there was an error making
  2296  // the request the page does not advance and the error is returned.
  2297  func (page *SharedAccessSignatureAuthorizationRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
  2298  	if tracing.IsEnabled() {
  2299  		ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultPage.NextWithContext")
  2300  		defer func() {
  2301  			sc := -1
  2302  			if page.Response().Response.Response != nil {
  2303  				sc = page.Response().Response.Response.StatusCode
  2304  			}
  2305  			tracing.EndSpan(ctx, sc, err)
  2306  		}()
  2307  	}
  2308  	for {
  2309  		next, err := page.fn(ctx, page.sasarlr)
  2310  		if err != nil {
  2311  			return err
  2312  		}
  2313  		page.sasarlr = next
  2314  		if !next.hasNextLink() || !next.IsEmpty() {
  2315  			break
  2316  		}
  2317  	}
  2318  	return nil
  2319  }
  2320  
  2321  // Next advances to the next page of values.  If there was an error making
  2322  // the request the page does not advance and the error is returned.
  2323  // Deprecated: Use NextWithContext() instead.
  2324  func (page *SharedAccessSignatureAuthorizationRuleListResultPage) Next() error {
  2325  	return page.NextWithContext(context.Background())
  2326  }
  2327  
  2328  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2329  func (page SharedAccessSignatureAuthorizationRuleListResultPage) NotDone() bool {
  2330  	return !page.sasarlr.IsEmpty()
  2331  }
  2332  
  2333  // Response returns the raw server response from the last page request.
  2334  func (page SharedAccessSignatureAuthorizationRuleListResultPage) Response() SharedAccessSignatureAuthorizationRuleListResult {
  2335  	return page.sasarlr
  2336  }
  2337  
  2338  // Values returns the slice of values for the current page or nil if there are no values.
  2339  func (page SharedAccessSignatureAuthorizationRuleListResultPage) Values() []SharedAccessSignatureAuthorizationRule {
  2340  	if page.sasarlr.IsEmpty() {
  2341  		return nil
  2342  	}
  2343  	return *page.sasarlr.Value
  2344  }
  2345  
  2346  // Creates a new instance of the SharedAccessSignatureAuthorizationRuleListResultPage type.
  2347  func NewSharedAccessSignatureAuthorizationRuleListResultPage(cur SharedAccessSignatureAuthorizationRuleListResult, getNextPage func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)) SharedAccessSignatureAuthorizationRuleListResultPage {
  2348  	return SharedAccessSignatureAuthorizationRuleListResultPage{
  2349  		fn:      getNextPage,
  2350  		sasarlr: cur,
  2351  	}
  2352  }
  2353  
  2354  // StorageEndpointProperties the properties of the Azure Storage endpoint for file upload.
  2355  type StorageEndpointProperties struct {
  2356  	// SasTTLAsIso8601 - The period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options.
  2357  	SasTTLAsIso8601 *string `json:"sasTtlAsIso8601,omitempty"`
  2358  	// ConnectionString - The connection string for the Azure Storage account to which files are uploaded.
  2359  	ConnectionString *string `json:"connectionString,omitempty"`
  2360  	// ContainerName - The name of the root container where you upload files. The container need not exist but should be creatable using the connectionString specified.
  2361  	ContainerName *string `json:"containerName,omitempty"`
  2362  }
  2363  
  2364  // TagsResource a container holding only the Tags for a resource, allowing the user to update the tags on
  2365  // an IoT Hub instance.
  2366  type TagsResource struct {
  2367  	// Tags - Resource tags
  2368  	Tags map[string]*string `json:"tags"`
  2369  }
  2370  
  2371  // MarshalJSON is the custom marshaler for TagsResource.
  2372  func (tr TagsResource) MarshalJSON() ([]byte, error) {
  2373  	objectMap := make(map[string]interface{})
  2374  	if tr.Tags != nil {
  2375  		objectMap["tags"] = tr.Tags
  2376  	}
  2377  	return json.Marshal(objectMap)
  2378  }
  2379  
  2380  // TestAllRoutesInput input for testing all routes
  2381  type TestAllRoutesInput struct {
  2382  	// RoutingSource - Routing source. Possible values include: 'RoutingSourceInvalid', 'RoutingSourceDeviceMessages', 'RoutingSourceTwinChangeEvents', 'RoutingSourceDeviceLifecycleEvents', 'RoutingSourceDeviceJobLifecycleEvents', 'RoutingSourceDigitalTwinChangeEvents'
  2383  	RoutingSource RoutingSource `json:"routingSource,omitempty"`
  2384  	// Message - Routing message
  2385  	Message *RoutingMessage `json:"message,omitempty"`
  2386  	// Twin - Routing Twin Reference
  2387  	Twin *RoutingTwin `json:"twin,omitempty"`
  2388  }
  2389  
  2390  // TestAllRoutesResult result of testing all routes
  2391  type TestAllRoutesResult struct {
  2392  	autorest.Response `json:"-"`
  2393  	// Routes - JSON-serialized array of matched routes
  2394  	Routes *[]MatchedRoute `json:"routes,omitempty"`
  2395  }
  2396  
  2397  // TestRouteInput input for testing route
  2398  type TestRouteInput struct {
  2399  	// Message - Routing message
  2400  	Message *RoutingMessage `json:"message,omitempty"`
  2401  	// Route - Route properties
  2402  	Route *RouteProperties `json:"route,omitempty"`
  2403  	// Twin - Routing Twin Reference
  2404  	Twin *RoutingTwin `json:"twin,omitempty"`
  2405  }
  2406  
  2407  // TestRouteResult result of testing one route
  2408  type TestRouteResult struct {
  2409  	autorest.Response `json:"-"`
  2410  	// Result - Result of testing route. Possible values include: 'Undefined', 'False', 'True'
  2411  	Result TestResultStatus `json:"result,omitempty"`
  2412  	// Details - Detailed result of testing route
  2413  	Details *TestRouteResultDetails `json:"details,omitempty"`
  2414  }
  2415  
  2416  // TestRouteResultDetails detailed result of testing a route
  2417  type TestRouteResultDetails struct {
  2418  	// CompilationErrors - JSON-serialized list of route compilation errors
  2419  	CompilationErrors *[]RouteCompilationError `json:"compilationErrors,omitempty"`
  2420  }
  2421  
  2422  // UserSubscriptionQuota user subscription quota response
  2423  type UserSubscriptionQuota struct {
  2424  	// ID - IotHub type id
  2425  	ID *string `json:"id,omitempty"`
  2426  	// Type - Response type
  2427  	Type *string `json:"type,omitempty"`
  2428  	// Unit - Unit of IotHub type
  2429  	Unit *string `json:"unit,omitempty"`
  2430  	// CurrentValue - Current number of IotHub type
  2431  	CurrentValue *int32 `json:"currentValue,omitempty"`
  2432  	// Limit - Numerical limit on IotHub type
  2433  	Limit *int32 `json:"limit,omitempty"`
  2434  	// Name - IotHub type
  2435  	Name *Name `json:"name,omitempty"`
  2436  }
  2437  
  2438  // UserSubscriptionQuotaListResult json-serialized array of User subscription quota response
  2439  type UserSubscriptionQuotaListResult struct {
  2440  	autorest.Response `json:"-"`
  2441  	Value             *[]UserSubscriptionQuota `json:"value,omitempty"`
  2442  	// NextLink - READ-ONLY
  2443  	NextLink *string `json:"nextLink,omitempty"`
  2444  }
  2445  
  2446  // MarshalJSON is the custom marshaler for UserSubscriptionQuotaListResult.
  2447  func (usqlr UserSubscriptionQuotaListResult) MarshalJSON() ([]byte, error) {
  2448  	objectMap := make(map[string]interface{})
  2449  	if usqlr.Value != nil {
  2450  		objectMap["value"] = usqlr.Value
  2451  	}
  2452  	return json.Marshal(objectMap)
  2453  }
  2454  

View as plain text