...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/provisioningservices/mgmt/2017-08-21-preview/iothub/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/provisioningservices/mgmt/2017-08-21-preview/iothub

     1  package iothub
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"context"
    11  	"encoding/json"
    12  	"github.com/Azure/go-autorest/autorest"
    13  	"github.com/Azure/go-autorest/autorest/azure"
    14  	"github.com/Azure/go-autorest/autorest/date"
    15  	"github.com/Azure/go-autorest/autorest/to"
    16  	"github.com/Azure/go-autorest/tracing"
    17  	"net/http"
    18  )
    19  
    20  // The package's fully qualified name.
    21  const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/provisioningservices/mgmt/2017-08-21-preview/iothub"
    22  
    23  // AsyncOperationResult result of a long running operation.
    24  type AsyncOperationResult struct {
    25  	autorest.Response `json:"-"`
    26  	Status            *string        `json:"status,omitempty"`
    27  	Error             *ErrorMesssage `json:"error,omitempty"`
    28  }
    29  
    30  // CertificateBodyDescription the JSON-serialized X509 Certificate.
    31  type CertificateBodyDescription struct {
    32  	// Certificate - Base-64 representation of the X509 leaf certificate .cer file or just .pem file content.
    33  	Certificate *string `json:"certificate,omitempty"`
    34  }
    35  
    36  // CertificateListDescription the JSON-serialized array of Certificate objects.
    37  type CertificateListDescription struct {
    38  	autorest.Response `json:"-"`
    39  	// Value - The array of Certificate objects.
    40  	Value *[]CertificateResponse `json:"value,omitempty"`
    41  }
    42  
    43  // CertificateProperties the description of an X509 CA Certificate.
    44  type CertificateProperties struct {
    45  	// Subject - READ-ONLY; The certificate's subject name.
    46  	Subject *string `json:"subject,omitempty"`
    47  	// Expiry - READ-ONLY; The certificate's expiration date and time.
    48  	Expiry *date.TimeRFC1123 `json:"expiry,omitempty"`
    49  	// Thumbprint - READ-ONLY; The certificate's thumbprint.
    50  	Thumbprint *string `json:"thumbprint,omitempty"`
    51  	// IsVerified - READ-ONLY; Determines whether certificate has been verified.
    52  	IsVerified *bool `json:"isVerified,omitempty"`
    53  	// Created - READ-ONLY; The certificate's creation date and time.
    54  	Created *date.TimeRFC1123 `json:"created,omitempty"`
    55  	// Updated - READ-ONLY; The certificate's last update date and time.
    56  	Updated *date.TimeRFC1123 `json:"updated,omitempty"`
    57  }
    58  
    59  // MarshalJSON is the custom marshaler for CertificateProperties.
    60  func (cp CertificateProperties) MarshalJSON() ([]byte, error) {
    61  	objectMap := make(map[string]interface{})
    62  	return json.Marshal(objectMap)
    63  }
    64  
    65  // CertificateResponse the X509 Certificate.
    66  type CertificateResponse struct {
    67  	autorest.Response `json:"-"`
    68  	Properties        *CertificateProperties `json:"properties,omitempty"`
    69  	// ID - READ-ONLY; The resource identifier.
    70  	ID *string `json:"id,omitempty"`
    71  	// Name - READ-ONLY; The name of the certificate.
    72  	Name *string `json:"name,omitempty"`
    73  	// Etag - READ-ONLY; The entity tag.
    74  	Etag *string `json:"etag,omitempty"`
    75  	// Type - READ-ONLY; The resource type.
    76  	Type *string `json:"type,omitempty"`
    77  }
    78  
    79  // MarshalJSON is the custom marshaler for CertificateResponse.
    80  func (cr CertificateResponse) MarshalJSON() ([]byte, error) {
    81  	objectMap := make(map[string]interface{})
    82  	if cr.Properties != nil {
    83  		objectMap["properties"] = cr.Properties
    84  	}
    85  	return json.Marshal(objectMap)
    86  }
    87  
    88  // DefinitionDescription description of the IoT hub.
    89  type DefinitionDescription struct {
    90  	ApplyAllocationPolicy *bool  `json:"applyAllocationPolicy,omitempty"`
    91  	AllocationWeight      *int32 `json:"allocationWeight,omitempty"`
    92  	// Name - READ-ONLY; Host name of the IoT hub.
    93  	Name *string `json:"name,omitempty"`
    94  	// ConnectionString - Connection string og the IoT hub.
    95  	ConnectionString *string `json:"connectionString,omitempty"`
    96  	// Location - ARM region of the IoT hub.
    97  	Location *string `json:"location,omitempty"`
    98  }
    99  
   100  // MarshalJSON is the custom marshaler for DefinitionDescription.
   101  func (dd DefinitionDescription) MarshalJSON() ([]byte, error) {
   102  	objectMap := make(map[string]interface{})
   103  	if dd.ApplyAllocationPolicy != nil {
   104  		objectMap["applyAllocationPolicy"] = dd.ApplyAllocationPolicy
   105  	}
   106  	if dd.AllocationWeight != nil {
   107  		objectMap["allocationWeight"] = dd.AllocationWeight
   108  	}
   109  	if dd.ConnectionString != nil {
   110  		objectMap["connectionString"] = dd.ConnectionString
   111  	}
   112  	if dd.Location != nil {
   113  		objectMap["location"] = dd.Location
   114  	}
   115  	return json.Marshal(objectMap)
   116  }
   117  
   118  // ErrorDetails ...
   119  type ErrorDetails struct {
   120  	// Code - READ-ONLY; error code.
   121  	Code *string `json:"code,omitempty"`
   122  	// HTTPStatusCode - READ-ONLY
   123  	HTTPStatusCode *string `json:"httpStatusCode,omitempty"`
   124  	Message        *string `json:"message,omitempty"`
   125  	Details        *string `json:"details,omitempty"`
   126  }
   127  
   128  // MarshalJSON is the custom marshaler for ErrorDetails.
   129  func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
   130  	objectMap := make(map[string]interface{})
   131  	if ed.Message != nil {
   132  		objectMap["message"] = ed.Message
   133  	}
   134  	if ed.Details != nil {
   135  		objectMap["details"] = ed.Details
   136  	}
   137  	return json.Marshal(objectMap)
   138  }
   139  
   140  // ErrorMesssage error response containing message and code.
   141  type ErrorMesssage struct {
   142  	Code    *string `json:"code,omitempty"`
   143  	Message *string `json:"message,omitempty"`
   144  	Details *string `json:"details,omitempty"`
   145  }
   146  
   147  // IotDpsPropertiesDescription ...
   148  type IotDpsPropertiesDescription struct {
   149  	// State - Current state of the provisioning service. Possible values include: 'Activating', 'Active', 'Deleting', 'Deleted', 'ActivationFailed', 'DeletionFailed', 'Transitioning', 'Suspending', 'Suspended', 'Resuming', 'FailingOver', 'FailoverFailed'
   150  	State State `json:"state,omitempty"`
   151  	// ProvisioningState - The ARM provisioning state of the provisioning service.
   152  	ProvisioningState *string `json:"provisioningState,omitempty"`
   153  	// IotHubs - List of IoT hubs associated with this provisioning service.
   154  	IotHubs *[]DefinitionDescription `json:"iotHubs,omitempty"`
   155  	// AllocationPolicy - Allocation policy to be used by this provisioning service. Possible values include: 'Hashed', 'GeoLatency', 'Static'
   156  	AllocationPolicy AllocationPolicy `json:"allocationPolicy,omitempty"`
   157  	// ServiceOperationsHostName - READ-ONLY; Service endpoint for provisioning service.
   158  	ServiceOperationsHostName *string `json:"serviceOperationsHostName,omitempty"`
   159  	// DeviceProvisioningHostName - READ-ONLY; Device endpoint for this provisioning service.
   160  	DeviceProvisioningHostName *string `json:"deviceProvisioningHostName,omitempty"`
   161  	// IDScope - READ-ONLY; Unique identifier of this provisioning service.
   162  	IDScope               *string                                                          `json:"idScope,omitempty"`
   163  	AuthorizationPolicies *[]SharedAccessSignatureAuthorizationRuleAccessRightsDescription `json:"authorizationPolicies,omitempty"`
   164  }
   165  
   166  // MarshalJSON is the custom marshaler for IotDpsPropertiesDescription.
   167  func (idpd IotDpsPropertiesDescription) MarshalJSON() ([]byte, error) {
   168  	objectMap := make(map[string]interface{})
   169  	if idpd.State != "" {
   170  		objectMap["state"] = idpd.State
   171  	}
   172  	if idpd.ProvisioningState != nil {
   173  		objectMap["provisioningState"] = idpd.ProvisioningState
   174  	}
   175  	if idpd.IotHubs != nil {
   176  		objectMap["iotHubs"] = idpd.IotHubs
   177  	}
   178  	if idpd.AllocationPolicy != "" {
   179  		objectMap["allocationPolicy"] = idpd.AllocationPolicy
   180  	}
   181  	if idpd.AuthorizationPolicies != nil {
   182  		objectMap["authorizationPolicies"] = idpd.AuthorizationPolicies
   183  	}
   184  	return json.Marshal(objectMap)
   185  }
   186  
   187  // IotDpsResourceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
   188  // long-running operation.
   189  type IotDpsResourceCreateOrUpdateFuture struct {
   190  	azure.FutureAPI
   191  	// Result returns the result of the asynchronous operation.
   192  	// If the operation has not completed it will return an error.
   193  	Result func(IotDpsResourceClient) (ProvisioningServiceDescription, error)
   194  }
   195  
   196  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   197  func (future *IotDpsResourceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
   198  	var azFuture azure.Future
   199  	if err := json.Unmarshal(body, &azFuture); err != nil {
   200  		return err
   201  	}
   202  	future.FutureAPI = &azFuture
   203  	future.Result = future.result
   204  	return nil
   205  }
   206  
   207  // result is the default implementation for IotDpsResourceCreateOrUpdateFuture.Result.
   208  func (future *IotDpsResourceCreateOrUpdateFuture) result(client IotDpsResourceClient) (psd ProvisioningServiceDescription, err error) {
   209  	var done bool
   210  	done, err = future.DoneWithContext(context.Background(), client)
   211  	if err != nil {
   212  		err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
   213  		return
   214  	}
   215  	if !done {
   216  		psd.Response.Response = future.Response()
   217  		err = azure.NewAsyncOpIncompleteError("iothub.IotDpsResourceCreateOrUpdateFuture")
   218  		return
   219  	}
   220  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   221  	if psd.Response.Response, err = future.GetResult(sender); err == nil && psd.Response.Response.StatusCode != http.StatusNoContent {
   222  		psd, err = client.CreateOrUpdateResponder(psd.Response.Response)
   223  		if err != nil {
   224  			err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceCreateOrUpdateFuture", "Result", psd.Response.Response, "Failure responding to request")
   225  		}
   226  	}
   227  	return
   228  }
   229  
   230  // IotDpsResourceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
   231  // operation.
   232  type IotDpsResourceDeleteFuture struct {
   233  	azure.FutureAPI
   234  	// Result returns the result of the asynchronous operation.
   235  	// If the operation has not completed it will return an error.
   236  	Result func(IotDpsResourceClient) (autorest.Response, error)
   237  }
   238  
   239  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   240  func (future *IotDpsResourceDeleteFuture) UnmarshalJSON(body []byte) error {
   241  	var azFuture azure.Future
   242  	if err := json.Unmarshal(body, &azFuture); err != nil {
   243  		return err
   244  	}
   245  	future.FutureAPI = &azFuture
   246  	future.Result = future.result
   247  	return nil
   248  }
   249  
   250  // result is the default implementation for IotDpsResourceDeleteFuture.Result.
   251  func (future *IotDpsResourceDeleteFuture) result(client IotDpsResourceClient) (ar autorest.Response, err error) {
   252  	var done bool
   253  	done, err = future.DoneWithContext(context.Background(), client)
   254  	if err != nil {
   255  		err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceDeleteFuture", "Result", future.Response(), "Polling failure")
   256  		return
   257  	}
   258  	if !done {
   259  		ar.Response = future.Response()
   260  		err = azure.NewAsyncOpIncompleteError("iothub.IotDpsResourceDeleteFuture")
   261  		return
   262  	}
   263  	ar.Response = future.Response()
   264  	return
   265  }
   266  
   267  // IotDpsSkuDefinition SKU definition in terms of tier and units.
   268  type IotDpsSkuDefinition struct {
   269  	// Name - Possible values include: 'S1'
   270  	Name IotDpsSku `json:"name,omitempty"`
   271  }
   272  
   273  // IotDpsSkuDefinitionListResult list of available SKUs.
   274  type IotDpsSkuDefinitionListResult struct {
   275  	autorest.Response `json:"-"`
   276  	Value             *[]IotDpsSkuDefinition `json:"value,omitempty"`
   277  	// NextLink - READ-ONLY
   278  	NextLink *string `json:"nextLink,omitempty"`
   279  }
   280  
   281  // MarshalJSON is the custom marshaler for IotDpsSkuDefinitionListResult.
   282  func (idsdlr IotDpsSkuDefinitionListResult) MarshalJSON() ([]byte, error) {
   283  	objectMap := make(map[string]interface{})
   284  	if idsdlr.Value != nil {
   285  		objectMap["value"] = idsdlr.Value
   286  	}
   287  	return json.Marshal(objectMap)
   288  }
   289  
   290  // IotDpsSkuDefinitionListResultIterator provides access to a complete listing of IotDpsSkuDefinition
   291  // values.
   292  type IotDpsSkuDefinitionListResultIterator struct {
   293  	i    int
   294  	page IotDpsSkuDefinitionListResultPage
   295  }
   296  
   297  // NextWithContext advances to the next value.  If there was an error making
   298  // the request the iterator does not advance and the error is returned.
   299  func (iter *IotDpsSkuDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) {
   300  	if tracing.IsEnabled() {
   301  		ctx = tracing.StartSpan(ctx, fqdn+"/IotDpsSkuDefinitionListResultIterator.NextWithContext")
   302  		defer func() {
   303  			sc := -1
   304  			if iter.Response().Response.Response != nil {
   305  				sc = iter.Response().Response.Response.StatusCode
   306  			}
   307  			tracing.EndSpan(ctx, sc, err)
   308  		}()
   309  	}
   310  	iter.i++
   311  	if iter.i < len(iter.page.Values()) {
   312  		return nil
   313  	}
   314  	err = iter.page.NextWithContext(ctx)
   315  	if err != nil {
   316  		iter.i--
   317  		return err
   318  	}
   319  	iter.i = 0
   320  	return nil
   321  }
   322  
   323  // Next advances to the next value.  If there was an error making
   324  // the request the iterator does not advance and the error is returned.
   325  // Deprecated: Use NextWithContext() instead.
   326  func (iter *IotDpsSkuDefinitionListResultIterator) Next() error {
   327  	return iter.NextWithContext(context.Background())
   328  }
   329  
   330  // NotDone returns true if the enumeration should be started or is not yet complete.
   331  func (iter IotDpsSkuDefinitionListResultIterator) NotDone() bool {
   332  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   333  }
   334  
   335  // Response returns the raw server response from the last page request.
   336  func (iter IotDpsSkuDefinitionListResultIterator) Response() IotDpsSkuDefinitionListResult {
   337  	return iter.page.Response()
   338  }
   339  
   340  // Value returns the current value or a zero-initialized value if the
   341  // iterator has advanced beyond the end of the collection.
   342  func (iter IotDpsSkuDefinitionListResultIterator) Value() IotDpsSkuDefinition {
   343  	if !iter.page.NotDone() {
   344  		return IotDpsSkuDefinition{}
   345  	}
   346  	return iter.page.Values()[iter.i]
   347  }
   348  
   349  // Creates a new instance of the IotDpsSkuDefinitionListResultIterator type.
   350  func NewIotDpsSkuDefinitionListResultIterator(page IotDpsSkuDefinitionListResultPage) IotDpsSkuDefinitionListResultIterator {
   351  	return IotDpsSkuDefinitionListResultIterator{page: page}
   352  }
   353  
   354  // IsEmpty returns true if the ListResult contains no values.
   355  func (idsdlr IotDpsSkuDefinitionListResult) IsEmpty() bool {
   356  	return idsdlr.Value == nil || len(*idsdlr.Value) == 0
   357  }
   358  
   359  // hasNextLink returns true if the NextLink is not empty.
   360  func (idsdlr IotDpsSkuDefinitionListResult) hasNextLink() bool {
   361  	return idsdlr.NextLink != nil && len(*idsdlr.NextLink) != 0
   362  }
   363  
   364  // iotDpsSkuDefinitionListResultPreparer prepares a request to retrieve the next set of results.
   365  // It returns nil if no more results exist.
   366  func (idsdlr IotDpsSkuDefinitionListResult) iotDpsSkuDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) {
   367  	if !idsdlr.hasNextLink() {
   368  		return nil, nil
   369  	}
   370  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   371  		autorest.AsJSON(),
   372  		autorest.AsGet(),
   373  		autorest.WithBaseURL(to.String(idsdlr.NextLink)))
   374  }
   375  
   376  // IotDpsSkuDefinitionListResultPage contains a page of IotDpsSkuDefinition values.
   377  type IotDpsSkuDefinitionListResultPage struct {
   378  	fn     func(context.Context, IotDpsSkuDefinitionListResult) (IotDpsSkuDefinitionListResult, error)
   379  	idsdlr IotDpsSkuDefinitionListResult
   380  }
   381  
   382  // NextWithContext advances to the next page of values.  If there was an error making
   383  // the request the page does not advance and the error is returned.
   384  func (page *IotDpsSkuDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) {
   385  	if tracing.IsEnabled() {
   386  		ctx = tracing.StartSpan(ctx, fqdn+"/IotDpsSkuDefinitionListResultPage.NextWithContext")
   387  		defer func() {
   388  			sc := -1
   389  			if page.Response().Response.Response != nil {
   390  				sc = page.Response().Response.Response.StatusCode
   391  			}
   392  			tracing.EndSpan(ctx, sc, err)
   393  		}()
   394  	}
   395  	for {
   396  		next, err := page.fn(ctx, page.idsdlr)
   397  		if err != nil {
   398  			return err
   399  		}
   400  		page.idsdlr = next
   401  		if !next.hasNextLink() || !next.IsEmpty() {
   402  			break
   403  		}
   404  	}
   405  	return nil
   406  }
   407  
   408  // Next advances to the next page of values.  If there was an error making
   409  // the request the page does not advance and the error is returned.
   410  // Deprecated: Use NextWithContext() instead.
   411  func (page *IotDpsSkuDefinitionListResultPage) Next() error {
   412  	return page.NextWithContext(context.Background())
   413  }
   414  
   415  // NotDone returns true if the page enumeration should be started or is not yet complete.
   416  func (page IotDpsSkuDefinitionListResultPage) NotDone() bool {
   417  	return !page.idsdlr.IsEmpty()
   418  }
   419  
   420  // Response returns the raw server response from the last page request.
   421  func (page IotDpsSkuDefinitionListResultPage) Response() IotDpsSkuDefinitionListResult {
   422  	return page.idsdlr
   423  }
   424  
   425  // Values returns the slice of values for the current page or nil if there are no values.
   426  func (page IotDpsSkuDefinitionListResultPage) Values() []IotDpsSkuDefinition {
   427  	if page.idsdlr.IsEmpty() {
   428  		return nil
   429  	}
   430  	return *page.idsdlr.Value
   431  }
   432  
   433  // Creates a new instance of the IotDpsSkuDefinitionListResultPage type.
   434  func NewIotDpsSkuDefinitionListResultPage(cur IotDpsSkuDefinitionListResult, getNextPage func(context.Context, IotDpsSkuDefinitionListResult) (IotDpsSkuDefinitionListResult, error)) IotDpsSkuDefinitionListResultPage {
   435  	return IotDpsSkuDefinitionListResultPage{
   436  		fn:     getNextPage,
   437  		idsdlr: cur,
   438  	}
   439  }
   440  
   441  // IotDpsSkuInfo list of possible provisioning service SKUs.
   442  type IotDpsSkuInfo struct {
   443  	// Name - Possible values include: 'S1'
   444  	Name IotDpsSku `json:"name,omitempty"`
   445  	// Tier - READ-ONLY; Pricing tier of the provisioning service.
   446  	Tier *string `json:"tier,omitempty"`
   447  	// Capacity - The number of services of the selected tier allowed in the subscription.
   448  	Capacity *int64 `json:"capacity,omitempty"`
   449  }
   450  
   451  // MarshalJSON is the custom marshaler for IotDpsSkuInfo.
   452  func (idsi IotDpsSkuInfo) MarshalJSON() ([]byte, error) {
   453  	objectMap := make(map[string]interface{})
   454  	if idsi.Name != "" {
   455  		objectMap["name"] = idsi.Name
   456  	}
   457  	if idsi.Capacity != nil {
   458  		objectMap["capacity"] = idsi.Capacity
   459  	}
   460  	return json.Marshal(objectMap)
   461  }
   462  
   463  // NameAvailabilityInfo description of name availability.
   464  type NameAvailabilityInfo struct {
   465  	autorest.Response `json:"-"`
   466  	NameAvailable     *bool `json:"nameAvailable,omitempty"`
   467  	// Reason - Possible values include: 'Invalid', 'AlreadyExists'
   468  	Reason  NameUnavailabilityReason `json:"reason,omitempty"`
   469  	Message *string                  `json:"message,omitempty"`
   470  }
   471  
   472  // Operation ioT Hub REST API operation.
   473  type Operation struct {
   474  	// Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete}
   475  	Name *string `json:"name,omitempty"`
   476  	// Display - The object that represents the operation.
   477  	Display *OperationDisplay `json:"display,omitempty"`
   478  }
   479  
   480  // MarshalJSON is the custom marshaler for Operation.
   481  func (o Operation) MarshalJSON() ([]byte, error) {
   482  	objectMap := make(map[string]interface{})
   483  	if o.Display != nil {
   484  		objectMap["display"] = o.Display
   485  	}
   486  	return json.Marshal(objectMap)
   487  }
   488  
   489  // OperationDisplay the object that represents the operation.
   490  type OperationDisplay struct {
   491  	// Provider - READ-ONLY; Service provider: Microsoft Devices.
   492  	Provider *string `json:"provider,omitempty"`
   493  	// Resource - READ-ONLY; Resource Type: ProvisioningServices.
   494  	Resource *string `json:"resource,omitempty"`
   495  	// Operation - READ-ONLY; Name of the operation.
   496  	Operation *string `json:"operation,omitempty"`
   497  }
   498  
   499  // MarshalJSON is the custom marshaler for OperationDisplay.
   500  func (o OperationDisplay) MarshalJSON() ([]byte, error) {
   501  	objectMap := make(map[string]interface{})
   502  	return json.Marshal(objectMap)
   503  }
   504  
   505  // OperationInputs input values for operation results call.
   506  type OperationInputs struct {
   507  	// Name - The name of the Provisioning Service to check.
   508  	Name *string `json:"name,omitempty"`
   509  }
   510  
   511  // OperationListResult result of the request to list IoT Hub operations. It contains a list of operations
   512  // and a URL link to get the next set of results.
   513  type OperationListResult struct {
   514  	autorest.Response `json:"-"`
   515  	// Value - READ-ONLY; List of IoT Hub operations supported by the Microsoft.Devices resource provider.
   516  	Value *[]Operation `json:"value,omitempty"`
   517  	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
   518  	NextLink *string `json:"nextLink,omitempty"`
   519  }
   520  
   521  // MarshalJSON is the custom marshaler for OperationListResult.
   522  func (olr OperationListResult) MarshalJSON() ([]byte, error) {
   523  	objectMap := make(map[string]interface{})
   524  	return json.Marshal(objectMap)
   525  }
   526  
   527  // OperationListResultIterator provides access to a complete listing of Operation values.
   528  type OperationListResultIterator struct {
   529  	i    int
   530  	page OperationListResultPage
   531  }
   532  
   533  // NextWithContext advances to the next value.  If there was an error making
   534  // the request the iterator does not advance and the error is returned.
   535  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
   536  	if tracing.IsEnabled() {
   537  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
   538  		defer func() {
   539  			sc := -1
   540  			if iter.Response().Response.Response != nil {
   541  				sc = iter.Response().Response.Response.StatusCode
   542  			}
   543  			tracing.EndSpan(ctx, sc, err)
   544  		}()
   545  	}
   546  	iter.i++
   547  	if iter.i < len(iter.page.Values()) {
   548  		return nil
   549  	}
   550  	err = iter.page.NextWithContext(ctx)
   551  	if err != nil {
   552  		iter.i--
   553  		return err
   554  	}
   555  	iter.i = 0
   556  	return nil
   557  }
   558  
   559  // Next advances to the next value.  If there was an error making
   560  // the request the iterator does not advance and the error is returned.
   561  // Deprecated: Use NextWithContext() instead.
   562  func (iter *OperationListResultIterator) Next() error {
   563  	return iter.NextWithContext(context.Background())
   564  }
   565  
   566  // NotDone returns true if the enumeration should be started or is not yet complete.
   567  func (iter OperationListResultIterator) NotDone() bool {
   568  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   569  }
   570  
   571  // Response returns the raw server response from the last page request.
   572  func (iter OperationListResultIterator) Response() OperationListResult {
   573  	return iter.page.Response()
   574  }
   575  
   576  // Value returns the current value or a zero-initialized value if the
   577  // iterator has advanced beyond the end of the collection.
   578  func (iter OperationListResultIterator) Value() Operation {
   579  	if !iter.page.NotDone() {
   580  		return Operation{}
   581  	}
   582  	return iter.page.Values()[iter.i]
   583  }
   584  
   585  // Creates a new instance of the OperationListResultIterator type.
   586  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
   587  	return OperationListResultIterator{page: page}
   588  }
   589  
   590  // IsEmpty returns true if the ListResult contains no values.
   591  func (olr OperationListResult) IsEmpty() bool {
   592  	return olr.Value == nil || len(*olr.Value) == 0
   593  }
   594  
   595  // hasNextLink returns true if the NextLink is not empty.
   596  func (olr OperationListResult) hasNextLink() bool {
   597  	return olr.NextLink != nil && len(*olr.NextLink) != 0
   598  }
   599  
   600  // operationListResultPreparer prepares a request to retrieve the next set of results.
   601  // It returns nil if no more results exist.
   602  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
   603  	if !olr.hasNextLink() {
   604  		return nil, nil
   605  	}
   606  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   607  		autorest.AsJSON(),
   608  		autorest.AsGet(),
   609  		autorest.WithBaseURL(to.String(olr.NextLink)))
   610  }
   611  
   612  // OperationListResultPage contains a page of Operation values.
   613  type OperationListResultPage struct {
   614  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
   615  	olr OperationListResult
   616  }
   617  
   618  // NextWithContext advances to the next page of values.  If there was an error making
   619  // the request the page does not advance and the error is returned.
   620  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
   621  	if tracing.IsEnabled() {
   622  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
   623  		defer func() {
   624  			sc := -1
   625  			if page.Response().Response.Response != nil {
   626  				sc = page.Response().Response.Response.StatusCode
   627  			}
   628  			tracing.EndSpan(ctx, sc, err)
   629  		}()
   630  	}
   631  	for {
   632  		next, err := page.fn(ctx, page.olr)
   633  		if err != nil {
   634  			return err
   635  		}
   636  		page.olr = next
   637  		if !next.hasNextLink() || !next.IsEmpty() {
   638  			break
   639  		}
   640  	}
   641  	return nil
   642  }
   643  
   644  // Next advances to the next page of values.  If there was an error making
   645  // the request the page does not advance and the error is returned.
   646  // Deprecated: Use NextWithContext() instead.
   647  func (page *OperationListResultPage) Next() error {
   648  	return page.NextWithContext(context.Background())
   649  }
   650  
   651  // NotDone returns true if the page enumeration should be started or is not yet complete.
   652  func (page OperationListResultPage) NotDone() bool {
   653  	return !page.olr.IsEmpty()
   654  }
   655  
   656  // Response returns the raw server response from the last page request.
   657  func (page OperationListResultPage) Response() OperationListResult {
   658  	return page.olr
   659  }
   660  
   661  // Values returns the slice of values for the current page or nil if there are no values.
   662  func (page OperationListResultPage) Values() []Operation {
   663  	if page.olr.IsEmpty() {
   664  		return nil
   665  	}
   666  	return *page.olr.Value
   667  }
   668  
   669  // Creates a new instance of the OperationListResultPage type.
   670  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
   671  	return OperationListResultPage{
   672  		fn:  getNextPage,
   673  		olr: cur,
   674  	}
   675  }
   676  
   677  // ProvisioningServiceDescription the description of the provisioning service.
   678  type ProvisioningServiceDescription struct {
   679  	autorest.Response `json:"-"`
   680  	// 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.
   681  	Etag       *string                      `json:"etag,omitempty"`
   682  	Properties *IotDpsPropertiesDescription `json:"properties,omitempty"`
   683  	Sku        *IotDpsSkuInfo               `json:"sku,omitempty"`
   684  	// ID - READ-ONLY; The resource identifier.
   685  	ID *string `json:"id,omitempty"`
   686  	// Name - READ-ONLY; The resource name.
   687  	Name *string `json:"name,omitempty"`
   688  	// Type - READ-ONLY; The resource type.
   689  	Type *string `json:"type,omitempty"`
   690  	// Location - The resource location.
   691  	Location *string `json:"location,omitempty"`
   692  	// Tags - The resource tags.
   693  	Tags map[string]*string `json:"tags"`
   694  }
   695  
   696  // MarshalJSON is the custom marshaler for ProvisioningServiceDescription.
   697  func (psd ProvisioningServiceDescription) MarshalJSON() ([]byte, error) {
   698  	objectMap := make(map[string]interface{})
   699  	if psd.Etag != nil {
   700  		objectMap["etag"] = psd.Etag
   701  	}
   702  	if psd.Properties != nil {
   703  		objectMap["properties"] = psd.Properties
   704  	}
   705  	if psd.Sku != nil {
   706  		objectMap["sku"] = psd.Sku
   707  	}
   708  	if psd.Location != nil {
   709  		objectMap["location"] = psd.Location
   710  	}
   711  	if psd.Tags != nil {
   712  		objectMap["tags"] = psd.Tags
   713  	}
   714  	return json.Marshal(objectMap)
   715  }
   716  
   717  // ProvisioningServiceDescriptionListResult list of provisioning service descriptions.
   718  type ProvisioningServiceDescriptionListResult struct {
   719  	autorest.Response `json:"-"`
   720  	Value             *[]ProvisioningServiceDescription `json:"value,omitempty"`
   721  	// NextLink - READ-ONLY
   722  	NextLink *string `json:"nextLink,omitempty"`
   723  }
   724  
   725  // MarshalJSON is the custom marshaler for ProvisioningServiceDescriptionListResult.
   726  func (psdlr ProvisioningServiceDescriptionListResult) MarshalJSON() ([]byte, error) {
   727  	objectMap := make(map[string]interface{})
   728  	if psdlr.Value != nil {
   729  		objectMap["value"] = psdlr.Value
   730  	}
   731  	return json.Marshal(objectMap)
   732  }
   733  
   734  // ProvisioningServiceDescriptionListResultIterator provides access to a complete listing of
   735  // ProvisioningServiceDescription values.
   736  type ProvisioningServiceDescriptionListResultIterator struct {
   737  	i    int
   738  	page ProvisioningServiceDescriptionListResultPage
   739  }
   740  
   741  // NextWithContext advances to the next value.  If there was an error making
   742  // the request the iterator does not advance and the error is returned.
   743  func (iter *ProvisioningServiceDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
   744  	if tracing.IsEnabled() {
   745  		ctx = tracing.StartSpan(ctx, fqdn+"/ProvisioningServiceDescriptionListResultIterator.NextWithContext")
   746  		defer func() {
   747  			sc := -1
   748  			if iter.Response().Response.Response != nil {
   749  				sc = iter.Response().Response.Response.StatusCode
   750  			}
   751  			tracing.EndSpan(ctx, sc, err)
   752  		}()
   753  	}
   754  	iter.i++
   755  	if iter.i < len(iter.page.Values()) {
   756  		return nil
   757  	}
   758  	err = iter.page.NextWithContext(ctx)
   759  	if err != nil {
   760  		iter.i--
   761  		return err
   762  	}
   763  	iter.i = 0
   764  	return nil
   765  }
   766  
   767  // Next advances to the next value.  If there was an error making
   768  // the request the iterator does not advance and the error is returned.
   769  // Deprecated: Use NextWithContext() instead.
   770  func (iter *ProvisioningServiceDescriptionListResultIterator) Next() error {
   771  	return iter.NextWithContext(context.Background())
   772  }
   773  
   774  // NotDone returns true if the enumeration should be started or is not yet complete.
   775  func (iter ProvisioningServiceDescriptionListResultIterator) NotDone() bool {
   776  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   777  }
   778  
   779  // Response returns the raw server response from the last page request.
   780  func (iter ProvisioningServiceDescriptionListResultIterator) Response() ProvisioningServiceDescriptionListResult {
   781  	return iter.page.Response()
   782  }
   783  
   784  // Value returns the current value or a zero-initialized value if the
   785  // iterator has advanced beyond the end of the collection.
   786  func (iter ProvisioningServiceDescriptionListResultIterator) Value() ProvisioningServiceDescription {
   787  	if !iter.page.NotDone() {
   788  		return ProvisioningServiceDescription{}
   789  	}
   790  	return iter.page.Values()[iter.i]
   791  }
   792  
   793  // Creates a new instance of the ProvisioningServiceDescriptionListResultIterator type.
   794  func NewProvisioningServiceDescriptionListResultIterator(page ProvisioningServiceDescriptionListResultPage) ProvisioningServiceDescriptionListResultIterator {
   795  	return ProvisioningServiceDescriptionListResultIterator{page: page}
   796  }
   797  
   798  // IsEmpty returns true if the ListResult contains no values.
   799  func (psdlr ProvisioningServiceDescriptionListResult) IsEmpty() bool {
   800  	return psdlr.Value == nil || len(*psdlr.Value) == 0
   801  }
   802  
   803  // hasNextLink returns true if the NextLink is not empty.
   804  func (psdlr ProvisioningServiceDescriptionListResult) hasNextLink() bool {
   805  	return psdlr.NextLink != nil && len(*psdlr.NextLink) != 0
   806  }
   807  
   808  // provisioningServiceDescriptionListResultPreparer prepares a request to retrieve the next set of results.
   809  // It returns nil if no more results exist.
   810  func (psdlr ProvisioningServiceDescriptionListResult) provisioningServiceDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
   811  	if !psdlr.hasNextLink() {
   812  		return nil, nil
   813  	}
   814  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   815  		autorest.AsJSON(),
   816  		autorest.AsGet(),
   817  		autorest.WithBaseURL(to.String(psdlr.NextLink)))
   818  }
   819  
   820  // ProvisioningServiceDescriptionListResultPage contains a page of ProvisioningServiceDescription values.
   821  type ProvisioningServiceDescriptionListResultPage struct {
   822  	fn    func(context.Context, ProvisioningServiceDescriptionListResult) (ProvisioningServiceDescriptionListResult, error)
   823  	psdlr ProvisioningServiceDescriptionListResult
   824  }
   825  
   826  // NextWithContext advances to the next page of values.  If there was an error making
   827  // the request the page does not advance and the error is returned.
   828  func (page *ProvisioningServiceDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
   829  	if tracing.IsEnabled() {
   830  		ctx = tracing.StartSpan(ctx, fqdn+"/ProvisioningServiceDescriptionListResultPage.NextWithContext")
   831  		defer func() {
   832  			sc := -1
   833  			if page.Response().Response.Response != nil {
   834  				sc = page.Response().Response.Response.StatusCode
   835  			}
   836  			tracing.EndSpan(ctx, sc, err)
   837  		}()
   838  	}
   839  	for {
   840  		next, err := page.fn(ctx, page.psdlr)
   841  		if err != nil {
   842  			return err
   843  		}
   844  		page.psdlr = next
   845  		if !next.hasNextLink() || !next.IsEmpty() {
   846  			break
   847  		}
   848  	}
   849  	return nil
   850  }
   851  
   852  // Next advances to the next page of values.  If there was an error making
   853  // the request the page does not advance and the error is returned.
   854  // Deprecated: Use NextWithContext() instead.
   855  func (page *ProvisioningServiceDescriptionListResultPage) Next() error {
   856  	return page.NextWithContext(context.Background())
   857  }
   858  
   859  // NotDone returns true if the page enumeration should be started or is not yet complete.
   860  func (page ProvisioningServiceDescriptionListResultPage) NotDone() bool {
   861  	return !page.psdlr.IsEmpty()
   862  }
   863  
   864  // Response returns the raw server response from the last page request.
   865  func (page ProvisioningServiceDescriptionListResultPage) Response() ProvisioningServiceDescriptionListResult {
   866  	return page.psdlr
   867  }
   868  
   869  // Values returns the slice of values for the current page or nil if there are no values.
   870  func (page ProvisioningServiceDescriptionListResultPage) Values() []ProvisioningServiceDescription {
   871  	if page.psdlr.IsEmpty() {
   872  		return nil
   873  	}
   874  	return *page.psdlr.Value
   875  }
   876  
   877  // Creates a new instance of the ProvisioningServiceDescriptionListResultPage type.
   878  func NewProvisioningServiceDescriptionListResultPage(cur ProvisioningServiceDescriptionListResult, getNextPage func(context.Context, ProvisioningServiceDescriptionListResult) (ProvisioningServiceDescriptionListResult, error)) ProvisioningServiceDescriptionListResultPage {
   879  	return ProvisioningServiceDescriptionListResultPage{
   880  		fn:    getNextPage,
   881  		psdlr: cur,
   882  	}
   883  }
   884  
   885  // Resource the common properties of an Azure resource.
   886  type Resource struct {
   887  	// ID - READ-ONLY; The resource identifier.
   888  	ID *string `json:"id,omitempty"`
   889  	// Name - READ-ONLY; The resource name.
   890  	Name *string `json:"name,omitempty"`
   891  	// Type - READ-ONLY; The resource type.
   892  	Type *string `json:"type,omitempty"`
   893  	// Location - The resource location.
   894  	Location *string `json:"location,omitempty"`
   895  	// Tags - The resource tags.
   896  	Tags map[string]*string `json:"tags"`
   897  }
   898  
   899  // MarshalJSON is the custom marshaler for Resource.
   900  func (r Resource) MarshalJSON() ([]byte, error) {
   901  	objectMap := make(map[string]interface{})
   902  	if r.Location != nil {
   903  		objectMap["location"] = r.Location
   904  	}
   905  	if r.Tags != nil {
   906  		objectMap["tags"] = r.Tags
   907  	}
   908  	return json.Marshal(objectMap)
   909  }
   910  
   911  // SharedAccessSignatureAuthorizationRuleAccessRightsDescription description of the shared access key.
   912  type SharedAccessSignatureAuthorizationRuleAccessRightsDescription struct {
   913  	autorest.Response `json:"-"`
   914  	// KeyName - Name of the key.
   915  	KeyName *string `json:"keyName,omitempty"`
   916  	// PrimaryKey - Primary SAS key value.
   917  	PrimaryKey *string `json:"primaryKey,omitempty"`
   918  	// SecondaryKey - Secondary SAS key value.
   919  	SecondaryKey *string `json:"secondaryKey,omitempty"`
   920  	// Rights - Rights that this key has. Possible values include: 'ServiceConfig', 'EnrollmentRead', 'EnrollmentWrite', 'DeviceConnect', 'RegistrationStatusRead', 'RegistrationStatusWrite'
   921  	Rights AccessRightsDescription `json:"rights,omitempty"`
   922  }
   923  
   924  // SharedAccessSignatureAuthorizationRuleListResult list of shared access keys.
   925  type SharedAccessSignatureAuthorizationRuleListResult struct {
   926  	autorest.Response `json:"-"`
   927  	Value             *[]SharedAccessSignatureAuthorizationRuleAccessRightsDescription `json:"value,omitempty"`
   928  	// NextLink - READ-ONLY
   929  	NextLink *string `json:"nextLink,omitempty"`
   930  }
   931  
   932  // MarshalJSON is the custom marshaler for SharedAccessSignatureAuthorizationRuleListResult.
   933  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) {
   934  	objectMap := make(map[string]interface{})
   935  	if sasarlr.Value != nil {
   936  		objectMap["value"] = sasarlr.Value
   937  	}
   938  	return json.Marshal(objectMap)
   939  }
   940  
   941  // SharedAccessSignatureAuthorizationRuleListResultIterator provides access to a complete listing of
   942  // SharedAccessSignatureAuthorizationRuleAccessRightsDescription values.
   943  type SharedAccessSignatureAuthorizationRuleListResultIterator struct {
   944  	i    int
   945  	page SharedAccessSignatureAuthorizationRuleListResultPage
   946  }
   947  
   948  // NextWithContext advances to the next value.  If there was an error making
   949  // the request the iterator does not advance and the error is returned.
   950  func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
   951  	if tracing.IsEnabled() {
   952  		ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultIterator.NextWithContext")
   953  		defer func() {
   954  			sc := -1
   955  			if iter.Response().Response.Response != nil {
   956  				sc = iter.Response().Response.Response.StatusCode
   957  			}
   958  			tracing.EndSpan(ctx, sc, err)
   959  		}()
   960  	}
   961  	iter.i++
   962  	if iter.i < len(iter.page.Values()) {
   963  		return nil
   964  	}
   965  	err = iter.page.NextWithContext(ctx)
   966  	if err != nil {
   967  		iter.i--
   968  		return err
   969  	}
   970  	iter.i = 0
   971  	return nil
   972  }
   973  
   974  // Next advances to the next value.  If there was an error making
   975  // the request the iterator does not advance and the error is returned.
   976  // Deprecated: Use NextWithContext() instead.
   977  func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) Next() error {
   978  	return iter.NextWithContext(context.Background())
   979  }
   980  
   981  // NotDone returns true if the enumeration should be started or is not yet complete.
   982  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) NotDone() bool {
   983  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   984  }
   985  
   986  // Response returns the raw server response from the last page request.
   987  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Response() SharedAccessSignatureAuthorizationRuleListResult {
   988  	return iter.page.Response()
   989  }
   990  
   991  // Value returns the current value or a zero-initialized value if the
   992  // iterator has advanced beyond the end of the collection.
   993  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Value() SharedAccessSignatureAuthorizationRuleAccessRightsDescription {
   994  	if !iter.page.NotDone() {
   995  		return SharedAccessSignatureAuthorizationRuleAccessRightsDescription{}
   996  	}
   997  	return iter.page.Values()[iter.i]
   998  }
   999  
  1000  // Creates a new instance of the SharedAccessSignatureAuthorizationRuleListResultIterator type.
  1001  func NewSharedAccessSignatureAuthorizationRuleListResultIterator(page SharedAccessSignatureAuthorizationRuleListResultPage) SharedAccessSignatureAuthorizationRuleListResultIterator {
  1002  	return SharedAccessSignatureAuthorizationRuleListResultIterator{page: page}
  1003  }
  1004  
  1005  // IsEmpty returns true if the ListResult contains no values.
  1006  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) IsEmpty() bool {
  1007  	return sasarlr.Value == nil || len(*sasarlr.Value) == 0
  1008  }
  1009  
  1010  // hasNextLink returns true if the NextLink is not empty.
  1011  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) hasNextLink() bool {
  1012  	return sasarlr.NextLink != nil && len(*sasarlr.NextLink) != 0
  1013  }
  1014  
  1015  // sharedAccessSignatureAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results.
  1016  // It returns nil if no more results exist.
  1017  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) sharedAccessSignatureAuthorizationRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
  1018  	if !sasarlr.hasNextLink() {
  1019  		return nil, nil
  1020  	}
  1021  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1022  		autorest.AsJSON(),
  1023  		autorest.AsGet(),
  1024  		autorest.WithBaseURL(to.String(sasarlr.NextLink)))
  1025  }
  1026  
  1027  // SharedAccessSignatureAuthorizationRuleListResultPage contains a page of
  1028  // SharedAccessSignatureAuthorizationRuleAccessRightsDescription values.
  1029  type SharedAccessSignatureAuthorizationRuleListResultPage struct {
  1030  	fn      func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)
  1031  	sasarlr SharedAccessSignatureAuthorizationRuleListResult
  1032  }
  1033  
  1034  // NextWithContext advances to the next page of values.  If there was an error making
  1035  // the request the page does not advance and the error is returned.
  1036  func (page *SharedAccessSignatureAuthorizationRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
  1037  	if tracing.IsEnabled() {
  1038  		ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultPage.NextWithContext")
  1039  		defer func() {
  1040  			sc := -1
  1041  			if page.Response().Response.Response != nil {
  1042  				sc = page.Response().Response.Response.StatusCode
  1043  			}
  1044  			tracing.EndSpan(ctx, sc, err)
  1045  		}()
  1046  	}
  1047  	for {
  1048  		next, err := page.fn(ctx, page.sasarlr)
  1049  		if err != nil {
  1050  			return err
  1051  		}
  1052  		page.sasarlr = next
  1053  		if !next.hasNextLink() || !next.IsEmpty() {
  1054  			break
  1055  		}
  1056  	}
  1057  	return nil
  1058  }
  1059  
  1060  // Next advances to the next page of values.  If there was an error making
  1061  // the request the page does not advance and the error is returned.
  1062  // Deprecated: Use NextWithContext() instead.
  1063  func (page *SharedAccessSignatureAuthorizationRuleListResultPage) Next() error {
  1064  	return page.NextWithContext(context.Background())
  1065  }
  1066  
  1067  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1068  func (page SharedAccessSignatureAuthorizationRuleListResultPage) NotDone() bool {
  1069  	return !page.sasarlr.IsEmpty()
  1070  }
  1071  
  1072  // Response returns the raw server response from the last page request.
  1073  func (page SharedAccessSignatureAuthorizationRuleListResultPage) Response() SharedAccessSignatureAuthorizationRuleListResult {
  1074  	return page.sasarlr
  1075  }
  1076  
  1077  // Values returns the slice of values for the current page or nil if there are no values.
  1078  func (page SharedAccessSignatureAuthorizationRuleListResultPage) Values() []SharedAccessSignatureAuthorizationRuleAccessRightsDescription {
  1079  	if page.sasarlr.IsEmpty() {
  1080  		return nil
  1081  	}
  1082  	return *page.sasarlr.Value
  1083  }
  1084  
  1085  // Creates a new instance of the SharedAccessSignatureAuthorizationRuleListResultPage type.
  1086  func NewSharedAccessSignatureAuthorizationRuleListResultPage(cur SharedAccessSignatureAuthorizationRuleListResult, getNextPage func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)) SharedAccessSignatureAuthorizationRuleListResultPage {
  1087  	return SharedAccessSignatureAuthorizationRuleListResultPage{
  1088  		fn:      getNextPage,
  1089  		sasarlr: cur,
  1090  	}
  1091  }
  1092  
  1093  // VerificationCodeRequest certificate to generate verification code for.
  1094  type VerificationCodeRequest struct {
  1095  	Certificate *string `json:"certificate,omitempty"`
  1096  }
  1097  
  1098  // VerificationCodeResponse description of the response of the verification code.
  1099  type VerificationCodeResponse struct {
  1100  	autorest.Response `json:"-"`
  1101  	// VerificationCode - Verification code.
  1102  	VerificationCode *string `json:"verificationCode,omitempty"`
  1103  	// Name - Name of certificate.
  1104  	Name *string `json:"name,omitempty"`
  1105  	// Etag - Request etag.
  1106  	Etag *string `json:"etag,omitempty"`
  1107  	// Subject - Certificate subject.
  1108  	Subject *string `json:"subject,omitempty"`
  1109  	// Expiry - Code expiry.
  1110  	Expiry *string `json:"expiry,omitempty"`
  1111  	// Thumbprint - Certificate thumbprint.
  1112  	Thumbprint *string `json:"thumbprint,omitempty"`
  1113  	// IsVerified - Indicate if the certificate is verified by owner of private key.
  1114  	IsVerified *bool `json:"isVerified,omitempty"`
  1115  	// Created - Certificate created time.
  1116  	Created *string `json:"created,omitempty"`
  1117  	// Updated - Certificate updated time.
  1118  	Updated *string `json:"updated,omitempty"`
  1119  }
  1120  

View as plain text