...

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

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

View as plain text