...

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

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

View as plain text