...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/iothub/mgmt/2021-03-03-preview/devices/models.go

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

View as plain text