...

Source file src/github.com/Azure/azure-sdk-for-go/services/provisioningservices/mgmt/2021-10-15/iothub/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/provisioningservices/mgmt/2021-10-15/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/provisioningservices/mgmt/2021-10-15/iothub"
    22  
    23  // AsyncOperationResult result of a long running operation.
    24  type AsyncOperationResult struct {
    25  	autorest.Response `json:"-"`
    26  	// Status - current status of a long running operation.
    27  	Status *string `json:"status,omitempty"`
    28  	// Error - Error message containing code, description and details
    29  	Error *ErrorMesssage `json:"error,omitempty"`
    30  }
    31  
    32  // CertificateBodyDescription the JSON-serialized X509 Certificate.
    33  type CertificateBodyDescription struct {
    34  	// Certificate - Base-64 representation of the X509 leaf certificate .cer file or just .pem file content.
    35  	Certificate *string `json:"certificate,omitempty"`
    36  	// IsVerified - True indicates that the certificate will be created in verified state and proof of possession will not be required.
    37  	IsVerified *bool `json:"isVerified,omitempty"`
    38  }
    39  
    40  // CertificateListDescription the JSON-serialized array of Certificate objects.
    41  type CertificateListDescription struct {
    42  	autorest.Response `json:"-"`
    43  	// Value - The array of Certificate objects.
    44  	Value *[]CertificateResponse `json:"value,omitempty"`
    45  }
    46  
    47  // CertificateProperties the description of an X509 CA Certificate.
    48  type CertificateProperties struct {
    49  	// Subject - READ-ONLY; The certificate's subject name.
    50  	Subject *string `json:"subject,omitempty"`
    51  	// Expiry - READ-ONLY; The certificate's expiration date and time.
    52  	Expiry *date.TimeRFC1123 `json:"expiry,omitempty"`
    53  	// Thumbprint - READ-ONLY; The certificate's thumbprint.
    54  	Thumbprint *string `json:"thumbprint,omitempty"`
    55  	// IsVerified - READ-ONLY; Determines whether certificate has been verified.
    56  	IsVerified *bool `json:"isVerified,omitempty"`
    57  	// Certificate - READ-ONLY; base-64 representation of X509 certificate .cer file or just .pem file content.
    58  	Certificate *[]byte `json:"certificate,omitempty"`
    59  	// Created - READ-ONLY; The certificate's creation date and time.
    60  	Created *date.TimeRFC1123 `json:"created,omitempty"`
    61  	// Updated - READ-ONLY; The certificate's last update date and time.
    62  	Updated *date.TimeRFC1123 `json:"updated,omitempty"`
    63  }
    64  
    65  // MarshalJSON is the custom marshaler for CertificateProperties.
    66  func (cp CertificateProperties) MarshalJSON() ([]byte, error) {
    67  	objectMap := make(map[string]interface{})
    68  	return json.Marshal(objectMap)
    69  }
    70  
    71  // CertificateResponse the X509 Certificate.
    72  type CertificateResponse struct {
    73  	autorest.Response `json:"-"`
    74  	// Properties - properties of a certificate
    75  	Properties *CertificateProperties `json:"properties,omitempty"`
    76  	// ID - READ-ONLY; The resource identifier.
    77  	ID *string `json:"id,omitempty"`
    78  	// Name - READ-ONLY; The name of the certificate.
    79  	Name *string `json:"name,omitempty"`
    80  	// Etag - READ-ONLY; The entity tag.
    81  	Etag *string `json:"etag,omitempty"`
    82  	// Type - READ-ONLY; The resource type.
    83  	Type *string `json:"type,omitempty"`
    84  	// SystemData - READ-ONLY
    85  	SystemData *SystemData `json:"systemData,omitempty"`
    86  }
    87  
    88  // MarshalJSON is the custom marshaler for CertificateResponse.
    89  func (cr CertificateResponse) MarshalJSON() ([]byte, error) {
    90  	objectMap := make(map[string]interface{})
    91  	if cr.Properties != nil {
    92  		objectMap["properties"] = cr.Properties
    93  	}
    94  	return json.Marshal(objectMap)
    95  }
    96  
    97  // DefinitionDescription description of the IoT hub.
    98  type DefinitionDescription struct {
    99  	// ApplyAllocationPolicy - flag for applying allocationPolicy or not for a given iot hub.
   100  	ApplyAllocationPolicy *bool `json:"applyAllocationPolicy,omitempty"`
   101  	// AllocationWeight - weight to apply for a given iot h.
   102  	AllocationWeight *int32 `json:"allocationWeight,omitempty"`
   103  	// Name - READ-ONLY; Host name of the IoT hub.
   104  	Name *string `json:"name,omitempty"`
   105  	// ConnectionString - Connection string of the IoT hub.
   106  	ConnectionString *string `json:"connectionString,omitempty"`
   107  	// Location - ARM region of the IoT hub.
   108  	Location *string `json:"location,omitempty"`
   109  }
   110  
   111  // MarshalJSON is the custom marshaler for DefinitionDescription.
   112  func (dd DefinitionDescription) MarshalJSON() ([]byte, error) {
   113  	objectMap := make(map[string]interface{})
   114  	if dd.ApplyAllocationPolicy != nil {
   115  		objectMap["applyAllocationPolicy"] = dd.ApplyAllocationPolicy
   116  	}
   117  	if dd.AllocationWeight != nil {
   118  		objectMap["allocationWeight"] = dd.AllocationWeight
   119  	}
   120  	if dd.ConnectionString != nil {
   121  		objectMap["connectionString"] = dd.ConnectionString
   122  	}
   123  	if dd.Location != nil {
   124  		objectMap["location"] = dd.Location
   125  	}
   126  	return json.Marshal(objectMap)
   127  }
   128  
   129  // ErrorDetails error details.
   130  type ErrorDetails struct {
   131  	// Code - READ-ONLY; The error code.
   132  	Code *string `json:"code,omitempty"`
   133  	// HTTPStatusCode - READ-ONLY; The HTTP status code.
   134  	HTTPStatusCode *string `json:"httpStatusCode,omitempty"`
   135  	// Message - READ-ONLY; The error message.
   136  	Message *string `json:"message,omitempty"`
   137  	// Details - READ-ONLY; The error details.
   138  	Details *string `json:"details,omitempty"`
   139  }
   140  
   141  // MarshalJSON is the custom marshaler for ErrorDetails.
   142  func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
   143  	objectMap := make(map[string]interface{})
   144  	return json.Marshal(objectMap)
   145  }
   146  
   147  // ErrorMesssage error response containing message and code.
   148  type ErrorMesssage struct {
   149  	// Code - standard error code
   150  	Code *string `json:"code,omitempty"`
   151  	// Message - standard error description
   152  	Message *string `json:"message,omitempty"`
   153  	// Details - detailed summary of error
   154  	Details *string `json:"details,omitempty"`
   155  }
   156  
   157  // GroupIDInformation the group information for creating a private endpoint on a provisioning service
   158  type GroupIDInformation struct {
   159  	autorest.Response `json:"-"`
   160  	// ID - READ-ONLY; The resource identifier.
   161  	ID *string `json:"id,omitempty"`
   162  	// Name - READ-ONLY; The resource name.
   163  	Name *string `json:"name,omitempty"`
   164  	// Type - READ-ONLY; The resource type.
   165  	Type *string `json:"type,omitempty"`
   166  	// Properties - The properties for a group information object
   167  	Properties *GroupIDInformationProperties `json:"properties,omitempty"`
   168  }
   169  
   170  // MarshalJSON is the custom marshaler for GroupIDInformation.
   171  func (gii GroupIDInformation) MarshalJSON() ([]byte, error) {
   172  	objectMap := make(map[string]interface{})
   173  	if gii.Properties != nil {
   174  		objectMap["properties"] = gii.Properties
   175  	}
   176  	return json.Marshal(objectMap)
   177  }
   178  
   179  // GroupIDInformationProperties the properties for a group information object
   180  type GroupIDInformationProperties struct {
   181  	// GroupID - The group id
   182  	GroupID *string `json:"groupId,omitempty"`
   183  	// RequiredMembers - The required members for a specific group id
   184  	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
   185  	// RequiredZoneNames - The required DNS zones for a specific group id
   186  	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
   187  }
   188  
   189  // IotDpsPropertiesDescription the service specific properties of a provisioning service, including keys,
   190  // linked iot hubs, current state, and system generated properties such as hostname and idScope
   191  type IotDpsPropertiesDescription struct {
   192  	// State - Current state of the provisioning service. Possible values include: 'StateActivating', 'StateActive', 'StateDeleting', 'StateDeleted', 'StateActivationFailed', 'StateDeletionFailed', 'StateTransitioning', 'StateSuspending', 'StateSuspended', 'StateResuming', 'StateFailingOver', 'StateFailoverFailed'
   193  	State State `json:"state,omitempty"`
   194  	// PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled'
   195  	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
   196  	// IPFilterRules - The IP filter rules.
   197  	IPFilterRules *[]IPFilterRule `json:"ipFilterRules,omitempty"`
   198  	// PrivateEndpointConnections - Private endpoint connections created on this IotHub
   199  	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
   200  	// ProvisioningState - The ARM provisioning state of the provisioning service.
   201  	ProvisioningState *string `json:"provisioningState,omitempty"`
   202  	// IotHubs - List of IoT hubs associated with this provisioning service.
   203  	IotHubs *[]DefinitionDescription `json:"iotHubs,omitempty"`
   204  	// AllocationPolicy - Allocation policy to be used by this provisioning service. Possible values include: 'AllocationPolicyHashed', 'AllocationPolicyGeoLatency', 'AllocationPolicyStatic'
   205  	AllocationPolicy AllocationPolicy `json:"allocationPolicy,omitempty"`
   206  	// ServiceOperationsHostName - READ-ONLY; Service endpoint for provisioning service.
   207  	ServiceOperationsHostName *string `json:"serviceOperationsHostName,omitempty"`
   208  	// DeviceProvisioningHostName - READ-ONLY; Device endpoint for this provisioning service.
   209  	DeviceProvisioningHostName *string `json:"deviceProvisioningHostName,omitempty"`
   210  	// IDScope - READ-ONLY; Unique identifier of this provisioning service.
   211  	IDScope *string `json:"idScope,omitempty"`
   212  	// AuthorizationPolicies - List of authorization keys for a provisioning service.
   213  	AuthorizationPolicies *[]SharedAccessSignatureAuthorizationRuleAccessRightsDescription `json:"authorizationPolicies,omitempty"`
   214  	// EnableDataResidency - Optional.
   215  	// Indicates if the DPS instance has Data Residency enabled, removing the cross geo-pair disaster recovery.
   216  	EnableDataResidency *bool `json:"enableDataResidency,omitempty"`
   217  }
   218  
   219  // MarshalJSON is the custom marshaler for IotDpsPropertiesDescription.
   220  func (idpd IotDpsPropertiesDescription) MarshalJSON() ([]byte, error) {
   221  	objectMap := make(map[string]interface{})
   222  	if idpd.State != "" {
   223  		objectMap["state"] = idpd.State
   224  	}
   225  	if idpd.PublicNetworkAccess != "" {
   226  		objectMap["publicNetworkAccess"] = idpd.PublicNetworkAccess
   227  	}
   228  	if idpd.IPFilterRules != nil {
   229  		objectMap["ipFilterRules"] = idpd.IPFilterRules
   230  	}
   231  	if idpd.PrivateEndpointConnections != nil {
   232  		objectMap["privateEndpointConnections"] = idpd.PrivateEndpointConnections
   233  	}
   234  	if idpd.ProvisioningState != nil {
   235  		objectMap["provisioningState"] = idpd.ProvisioningState
   236  	}
   237  	if idpd.IotHubs != nil {
   238  		objectMap["iotHubs"] = idpd.IotHubs
   239  	}
   240  	if idpd.AllocationPolicy != "" {
   241  		objectMap["allocationPolicy"] = idpd.AllocationPolicy
   242  	}
   243  	if idpd.AuthorizationPolicies != nil {
   244  		objectMap["authorizationPolicies"] = idpd.AuthorizationPolicies
   245  	}
   246  	if idpd.EnableDataResidency != nil {
   247  		objectMap["enableDataResidency"] = idpd.EnableDataResidency
   248  	}
   249  	return json.Marshal(objectMap)
   250  }
   251  
   252  // IotDpsResourceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
   253  // long-running operation.
   254  type IotDpsResourceCreateOrUpdateFuture struct {
   255  	azure.FutureAPI
   256  	// Result returns the result of the asynchronous operation.
   257  	// If the operation has not completed it will return an error.
   258  	Result func(IotDpsResourceClient) (ProvisioningServiceDescription, error)
   259  }
   260  
   261  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   262  func (future *IotDpsResourceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
   263  	var azFuture azure.Future
   264  	if err := json.Unmarshal(body, &azFuture); err != nil {
   265  		return err
   266  	}
   267  	future.FutureAPI = &azFuture
   268  	future.Result = future.result
   269  	return nil
   270  }
   271  
   272  // result is the default implementation for IotDpsResourceCreateOrUpdateFuture.Result.
   273  func (future *IotDpsResourceCreateOrUpdateFuture) result(client IotDpsResourceClient) (psd ProvisioningServiceDescription, err error) {
   274  	var done bool
   275  	done, err = future.DoneWithContext(context.Background(), client)
   276  	if err != nil {
   277  		err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
   278  		return
   279  	}
   280  	if !done {
   281  		psd.Response.Response = future.Response()
   282  		err = azure.NewAsyncOpIncompleteError("iothub.IotDpsResourceCreateOrUpdateFuture")
   283  		return
   284  	}
   285  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   286  	if psd.Response.Response, err = future.GetResult(sender); err == nil && psd.Response.Response.StatusCode != http.StatusNoContent {
   287  		psd, err = client.CreateOrUpdateResponder(psd.Response.Response)
   288  		if err != nil {
   289  			err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceCreateOrUpdateFuture", "Result", psd.Response.Response, "Failure responding to request")
   290  		}
   291  	}
   292  	return
   293  }
   294  
   295  // IotDpsResourceCreateOrUpdatePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving
   296  // the results of a long-running operation.
   297  type IotDpsResourceCreateOrUpdatePrivateEndpointConnectionFuture struct {
   298  	azure.FutureAPI
   299  	// Result returns the result of the asynchronous operation.
   300  	// If the operation has not completed it will return an error.
   301  	Result func(IotDpsResourceClient) (PrivateEndpointConnection, error)
   302  }
   303  
   304  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   305  func (future *IotDpsResourceCreateOrUpdatePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error {
   306  	var azFuture azure.Future
   307  	if err := json.Unmarshal(body, &azFuture); err != nil {
   308  		return err
   309  	}
   310  	future.FutureAPI = &azFuture
   311  	future.Result = future.result
   312  	return nil
   313  }
   314  
   315  // result is the default implementation for IotDpsResourceCreateOrUpdatePrivateEndpointConnectionFuture.Result.
   316  func (future *IotDpsResourceCreateOrUpdatePrivateEndpointConnectionFuture) result(client IotDpsResourceClient) (pec PrivateEndpointConnection, err error) {
   317  	var done bool
   318  	done, err = future.DoneWithContext(context.Background(), client)
   319  	if err != nil {
   320  		err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceCreateOrUpdatePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure")
   321  		return
   322  	}
   323  	if !done {
   324  		pec.Response.Response = future.Response()
   325  		err = azure.NewAsyncOpIncompleteError("iothub.IotDpsResourceCreateOrUpdatePrivateEndpointConnectionFuture")
   326  		return
   327  	}
   328  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   329  	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
   330  		pec, err = client.CreateOrUpdatePrivateEndpointConnectionResponder(pec.Response.Response)
   331  		if err != nil {
   332  			err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceCreateOrUpdatePrivateEndpointConnectionFuture", "Result", pec.Response.Response, "Failure responding to request")
   333  		}
   334  	}
   335  	return
   336  }
   337  
   338  // IotDpsResourceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
   339  // operation.
   340  type IotDpsResourceDeleteFuture struct {
   341  	azure.FutureAPI
   342  	// Result returns the result of the asynchronous operation.
   343  	// If the operation has not completed it will return an error.
   344  	Result func(IotDpsResourceClient) (autorest.Response, error)
   345  }
   346  
   347  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   348  func (future *IotDpsResourceDeleteFuture) UnmarshalJSON(body []byte) error {
   349  	var azFuture azure.Future
   350  	if err := json.Unmarshal(body, &azFuture); err != nil {
   351  		return err
   352  	}
   353  	future.FutureAPI = &azFuture
   354  	future.Result = future.result
   355  	return nil
   356  }
   357  
   358  // result is the default implementation for IotDpsResourceDeleteFuture.Result.
   359  func (future *IotDpsResourceDeleteFuture) result(client IotDpsResourceClient) (ar autorest.Response, err error) {
   360  	var done bool
   361  	done, err = future.DoneWithContext(context.Background(), client)
   362  	if err != nil {
   363  		err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceDeleteFuture", "Result", future.Response(), "Polling failure")
   364  		return
   365  	}
   366  	if !done {
   367  		ar.Response = future.Response()
   368  		err = azure.NewAsyncOpIncompleteError("iothub.IotDpsResourceDeleteFuture")
   369  		return
   370  	}
   371  	ar.Response = future.Response()
   372  	return
   373  }
   374  
   375  // IotDpsResourceDeletePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the
   376  // results of a long-running operation.
   377  type IotDpsResourceDeletePrivateEndpointConnectionFuture struct {
   378  	azure.FutureAPI
   379  	// Result returns the result of the asynchronous operation.
   380  	// If the operation has not completed it will return an error.
   381  	Result func(IotDpsResourceClient) (PrivateEndpointConnection, error)
   382  }
   383  
   384  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   385  func (future *IotDpsResourceDeletePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error {
   386  	var azFuture azure.Future
   387  	if err := json.Unmarshal(body, &azFuture); err != nil {
   388  		return err
   389  	}
   390  	future.FutureAPI = &azFuture
   391  	future.Result = future.result
   392  	return nil
   393  }
   394  
   395  // result is the default implementation for IotDpsResourceDeletePrivateEndpointConnectionFuture.Result.
   396  func (future *IotDpsResourceDeletePrivateEndpointConnectionFuture) result(client IotDpsResourceClient) (pec PrivateEndpointConnection, err error) {
   397  	var done bool
   398  	done, err = future.DoneWithContext(context.Background(), client)
   399  	if err != nil {
   400  		err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceDeletePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure")
   401  		return
   402  	}
   403  	if !done {
   404  		pec.Response.Response = future.Response()
   405  		err = azure.NewAsyncOpIncompleteError("iothub.IotDpsResourceDeletePrivateEndpointConnectionFuture")
   406  		return
   407  	}
   408  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   409  	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
   410  		pec, err = client.DeletePrivateEndpointConnectionResponder(pec.Response.Response)
   411  		if err != nil {
   412  			err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceDeletePrivateEndpointConnectionFuture", "Result", pec.Response.Response, "Failure responding to request")
   413  		}
   414  	}
   415  	return
   416  }
   417  
   418  // IotDpsResourceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
   419  // operation.
   420  type IotDpsResourceUpdateFuture struct {
   421  	azure.FutureAPI
   422  	// Result returns the result of the asynchronous operation.
   423  	// If the operation has not completed it will return an error.
   424  	Result func(IotDpsResourceClient) (ProvisioningServiceDescription, error)
   425  }
   426  
   427  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   428  func (future *IotDpsResourceUpdateFuture) UnmarshalJSON(body []byte) error {
   429  	var azFuture azure.Future
   430  	if err := json.Unmarshal(body, &azFuture); err != nil {
   431  		return err
   432  	}
   433  	future.FutureAPI = &azFuture
   434  	future.Result = future.result
   435  	return nil
   436  }
   437  
   438  // result is the default implementation for IotDpsResourceUpdateFuture.Result.
   439  func (future *IotDpsResourceUpdateFuture) result(client IotDpsResourceClient) (psd ProvisioningServiceDescription, err error) {
   440  	var done bool
   441  	done, err = future.DoneWithContext(context.Background(), client)
   442  	if err != nil {
   443  		err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceUpdateFuture", "Result", future.Response(), "Polling failure")
   444  		return
   445  	}
   446  	if !done {
   447  		psd.Response.Response = future.Response()
   448  		err = azure.NewAsyncOpIncompleteError("iothub.IotDpsResourceUpdateFuture")
   449  		return
   450  	}
   451  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   452  	if psd.Response.Response, err = future.GetResult(sender); err == nil && psd.Response.Response.StatusCode != http.StatusNoContent {
   453  		psd, err = client.UpdateResponder(psd.Response.Response)
   454  		if err != nil {
   455  			err = autorest.NewErrorWithError(err, "iothub.IotDpsResourceUpdateFuture", "Result", psd.Response.Response, "Failure responding to request")
   456  		}
   457  	}
   458  	return
   459  }
   460  
   461  // IotDpsSkuDefinition available SKUs of tier and units.
   462  type IotDpsSkuDefinition struct {
   463  	// Name - Sku name. Possible values include: 'IotDpsSkuS1'
   464  	Name IotDpsSku `json:"name,omitempty"`
   465  }
   466  
   467  // IotDpsSkuDefinitionListResult list of available SKUs.
   468  type IotDpsSkuDefinitionListResult struct {
   469  	autorest.Response `json:"-"`
   470  	// Value - The list of SKUs
   471  	Value *[]IotDpsSkuDefinition `json:"value,omitempty"`
   472  	// NextLink - READ-ONLY; The next link.
   473  	NextLink *string `json:"nextLink,omitempty"`
   474  }
   475  
   476  // MarshalJSON is the custom marshaler for IotDpsSkuDefinitionListResult.
   477  func (idsdlr IotDpsSkuDefinitionListResult) MarshalJSON() ([]byte, error) {
   478  	objectMap := make(map[string]interface{})
   479  	if idsdlr.Value != nil {
   480  		objectMap["value"] = idsdlr.Value
   481  	}
   482  	return json.Marshal(objectMap)
   483  }
   484  
   485  // IotDpsSkuDefinitionListResultIterator provides access to a complete listing of IotDpsSkuDefinition
   486  // values.
   487  type IotDpsSkuDefinitionListResultIterator struct {
   488  	i    int
   489  	page IotDpsSkuDefinitionListResultPage
   490  }
   491  
   492  // NextWithContext advances to the next value.  If there was an error making
   493  // the request the iterator does not advance and the error is returned.
   494  func (iter *IotDpsSkuDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) {
   495  	if tracing.IsEnabled() {
   496  		ctx = tracing.StartSpan(ctx, fqdn+"/IotDpsSkuDefinitionListResultIterator.NextWithContext")
   497  		defer func() {
   498  			sc := -1
   499  			if iter.Response().Response.Response != nil {
   500  				sc = iter.Response().Response.Response.StatusCode
   501  			}
   502  			tracing.EndSpan(ctx, sc, err)
   503  		}()
   504  	}
   505  	iter.i++
   506  	if iter.i < len(iter.page.Values()) {
   507  		return nil
   508  	}
   509  	err = iter.page.NextWithContext(ctx)
   510  	if err != nil {
   511  		iter.i--
   512  		return err
   513  	}
   514  	iter.i = 0
   515  	return nil
   516  }
   517  
   518  // Next advances to the next value.  If there was an error making
   519  // the request the iterator does not advance and the error is returned.
   520  // Deprecated: Use NextWithContext() instead.
   521  func (iter *IotDpsSkuDefinitionListResultIterator) Next() error {
   522  	return iter.NextWithContext(context.Background())
   523  }
   524  
   525  // NotDone returns true if the enumeration should be started or is not yet complete.
   526  func (iter IotDpsSkuDefinitionListResultIterator) NotDone() bool {
   527  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   528  }
   529  
   530  // Response returns the raw server response from the last page request.
   531  func (iter IotDpsSkuDefinitionListResultIterator) Response() IotDpsSkuDefinitionListResult {
   532  	return iter.page.Response()
   533  }
   534  
   535  // Value returns the current value or a zero-initialized value if the
   536  // iterator has advanced beyond the end of the collection.
   537  func (iter IotDpsSkuDefinitionListResultIterator) Value() IotDpsSkuDefinition {
   538  	if !iter.page.NotDone() {
   539  		return IotDpsSkuDefinition{}
   540  	}
   541  	return iter.page.Values()[iter.i]
   542  }
   543  
   544  // Creates a new instance of the IotDpsSkuDefinitionListResultIterator type.
   545  func NewIotDpsSkuDefinitionListResultIterator(page IotDpsSkuDefinitionListResultPage) IotDpsSkuDefinitionListResultIterator {
   546  	return IotDpsSkuDefinitionListResultIterator{page: page}
   547  }
   548  
   549  // IsEmpty returns true if the ListResult contains no values.
   550  func (idsdlr IotDpsSkuDefinitionListResult) IsEmpty() bool {
   551  	return idsdlr.Value == nil || len(*idsdlr.Value) == 0
   552  }
   553  
   554  // hasNextLink returns true if the NextLink is not empty.
   555  func (idsdlr IotDpsSkuDefinitionListResult) hasNextLink() bool {
   556  	return idsdlr.NextLink != nil && len(*idsdlr.NextLink) != 0
   557  }
   558  
   559  // iotDpsSkuDefinitionListResultPreparer prepares a request to retrieve the next set of results.
   560  // It returns nil if no more results exist.
   561  func (idsdlr IotDpsSkuDefinitionListResult) iotDpsSkuDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) {
   562  	if !idsdlr.hasNextLink() {
   563  		return nil, nil
   564  	}
   565  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   566  		autorest.AsJSON(),
   567  		autorest.AsGet(),
   568  		autorest.WithBaseURL(to.String(idsdlr.NextLink)))
   569  }
   570  
   571  // IotDpsSkuDefinitionListResultPage contains a page of IotDpsSkuDefinition values.
   572  type IotDpsSkuDefinitionListResultPage struct {
   573  	fn     func(context.Context, IotDpsSkuDefinitionListResult) (IotDpsSkuDefinitionListResult, error)
   574  	idsdlr IotDpsSkuDefinitionListResult
   575  }
   576  
   577  // NextWithContext advances to the next page of values.  If there was an error making
   578  // the request the page does not advance and the error is returned.
   579  func (page *IotDpsSkuDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) {
   580  	if tracing.IsEnabled() {
   581  		ctx = tracing.StartSpan(ctx, fqdn+"/IotDpsSkuDefinitionListResultPage.NextWithContext")
   582  		defer func() {
   583  			sc := -1
   584  			if page.Response().Response.Response != nil {
   585  				sc = page.Response().Response.Response.StatusCode
   586  			}
   587  			tracing.EndSpan(ctx, sc, err)
   588  		}()
   589  	}
   590  	for {
   591  		next, err := page.fn(ctx, page.idsdlr)
   592  		if err != nil {
   593  			return err
   594  		}
   595  		page.idsdlr = next
   596  		if !next.hasNextLink() || !next.IsEmpty() {
   597  			break
   598  		}
   599  	}
   600  	return nil
   601  }
   602  
   603  // Next advances to the next page of values.  If there was an error making
   604  // the request the page does not advance and the error is returned.
   605  // Deprecated: Use NextWithContext() instead.
   606  func (page *IotDpsSkuDefinitionListResultPage) Next() error {
   607  	return page.NextWithContext(context.Background())
   608  }
   609  
   610  // NotDone returns true if the page enumeration should be started or is not yet complete.
   611  func (page IotDpsSkuDefinitionListResultPage) NotDone() bool {
   612  	return !page.idsdlr.IsEmpty()
   613  }
   614  
   615  // Response returns the raw server response from the last page request.
   616  func (page IotDpsSkuDefinitionListResultPage) Response() IotDpsSkuDefinitionListResult {
   617  	return page.idsdlr
   618  }
   619  
   620  // Values returns the slice of values for the current page or nil if there are no values.
   621  func (page IotDpsSkuDefinitionListResultPage) Values() []IotDpsSkuDefinition {
   622  	if page.idsdlr.IsEmpty() {
   623  		return nil
   624  	}
   625  	return *page.idsdlr.Value
   626  }
   627  
   628  // Creates a new instance of the IotDpsSkuDefinitionListResultPage type.
   629  func NewIotDpsSkuDefinitionListResultPage(cur IotDpsSkuDefinitionListResult, getNextPage func(context.Context, IotDpsSkuDefinitionListResult) (IotDpsSkuDefinitionListResult, error)) IotDpsSkuDefinitionListResultPage {
   630  	return IotDpsSkuDefinitionListResultPage{
   631  		fn:     getNextPage,
   632  		idsdlr: cur,
   633  	}
   634  }
   635  
   636  // IotDpsSkuInfo list of possible provisioning service SKUs.
   637  type IotDpsSkuInfo struct {
   638  	// Name - Sku name. Possible values include: 'IotDpsSkuS1'
   639  	Name IotDpsSku `json:"name,omitempty"`
   640  	// Tier - READ-ONLY; Pricing tier name of the provisioning service.
   641  	Tier *string `json:"tier,omitempty"`
   642  	// Capacity - The number of units to provision
   643  	Capacity *int64 `json:"capacity,omitempty"`
   644  }
   645  
   646  // MarshalJSON is the custom marshaler for IotDpsSkuInfo.
   647  func (idsi IotDpsSkuInfo) MarshalJSON() ([]byte, error) {
   648  	objectMap := make(map[string]interface{})
   649  	if idsi.Name != "" {
   650  		objectMap["name"] = idsi.Name
   651  	}
   652  	if idsi.Capacity != nil {
   653  		objectMap["capacity"] = idsi.Capacity
   654  	}
   655  	return json.Marshal(objectMap)
   656  }
   657  
   658  // IPFilterRule the IP filter rules for a provisioning Service.
   659  type IPFilterRule struct {
   660  	// FilterName - The name of the IP filter rule.
   661  	FilterName *string `json:"filterName,omitempty"`
   662  	// Action - The desired action for requests captured by this rule. Possible values include: 'IPFilterActionTypeAccept', 'IPFilterActionTypeReject'
   663  	Action IPFilterActionType `json:"action,omitempty"`
   664  	// IPMask - A string that contains the IP address range in CIDR notation for the rule.
   665  	IPMask *string `json:"ipMask,omitempty"`
   666  	// Target - Target for requests captured by this rule. Possible values include: 'IPFilterTargetTypeAll', 'IPFilterTargetTypeServiceAPI', 'IPFilterTargetTypeDeviceAPI'
   667  	Target IPFilterTargetType `json:"target,omitempty"`
   668  }
   669  
   670  // ListPrivateEndpointConnection ...
   671  type ListPrivateEndpointConnection struct {
   672  	autorest.Response `json:"-"`
   673  	Value             *[]PrivateEndpointConnection `json:"value,omitempty"`
   674  }
   675  
   676  // NameAvailabilityInfo description of name availability.
   677  type NameAvailabilityInfo struct {
   678  	autorest.Response `json:"-"`
   679  	// NameAvailable - specifies if a name is available or not
   680  	NameAvailable *bool `json:"nameAvailable,omitempty"`
   681  	// Reason - specifies the reason a name is unavailable. Possible values include: 'NameUnavailabilityReasonInvalid', 'NameUnavailabilityReasonAlreadyExists'
   682  	Reason NameUnavailabilityReason `json:"reason,omitempty"`
   683  	// Message - message containing a detailed reason name is unavailable
   684  	Message *string `json:"message,omitempty"`
   685  }
   686  
   687  // Operation provisioning Service REST API operation.
   688  type Operation struct {
   689  	// Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete}
   690  	Name *string `json:"name,omitempty"`
   691  	// Display - The object that represents the operation.
   692  	Display *OperationDisplay `json:"display,omitempty"`
   693  }
   694  
   695  // MarshalJSON is the custom marshaler for Operation.
   696  func (o Operation) MarshalJSON() ([]byte, error) {
   697  	objectMap := make(map[string]interface{})
   698  	if o.Display != nil {
   699  		objectMap["display"] = o.Display
   700  	}
   701  	return json.Marshal(objectMap)
   702  }
   703  
   704  // OperationDisplay the object that represents the operation.
   705  type OperationDisplay struct {
   706  	// Provider - READ-ONLY; Service provider: Microsoft Devices.
   707  	Provider *string `json:"provider,omitempty"`
   708  	// Resource - READ-ONLY; Resource Type: ProvisioningServices.
   709  	Resource *string `json:"resource,omitempty"`
   710  	// Operation - READ-ONLY; Name of the operation.
   711  	Operation *string `json:"operation,omitempty"`
   712  }
   713  
   714  // MarshalJSON is the custom marshaler for OperationDisplay.
   715  func (o OperationDisplay) MarshalJSON() ([]byte, error) {
   716  	objectMap := make(map[string]interface{})
   717  	return json.Marshal(objectMap)
   718  }
   719  
   720  // OperationInputs input values for operation results call.
   721  type OperationInputs struct {
   722  	// Name - The name of the Provisioning Service to check.
   723  	Name *string `json:"name,omitempty"`
   724  }
   725  
   726  // OperationListResult result of the request to list provisioning service operations. It contains a list of
   727  // operations and a URL link to get the next set of results.
   728  type OperationListResult struct {
   729  	autorest.Response `json:"-"`
   730  	// Value - READ-ONLY; Provisioning service operations supported by the Microsoft.Devices resource provider.
   731  	Value *[]Operation `json:"value,omitempty"`
   732  	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
   733  	NextLink *string `json:"nextLink,omitempty"`
   734  }
   735  
   736  // MarshalJSON is the custom marshaler for OperationListResult.
   737  func (olr OperationListResult) MarshalJSON() ([]byte, error) {
   738  	objectMap := make(map[string]interface{})
   739  	return json.Marshal(objectMap)
   740  }
   741  
   742  // OperationListResultIterator provides access to a complete listing of Operation values.
   743  type OperationListResultIterator struct {
   744  	i    int
   745  	page OperationListResultPage
   746  }
   747  
   748  // NextWithContext advances to the next value.  If there was an error making
   749  // the request the iterator does not advance and the error is returned.
   750  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
   751  	if tracing.IsEnabled() {
   752  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
   753  		defer func() {
   754  			sc := -1
   755  			if iter.Response().Response.Response != nil {
   756  				sc = iter.Response().Response.Response.StatusCode
   757  			}
   758  			tracing.EndSpan(ctx, sc, err)
   759  		}()
   760  	}
   761  	iter.i++
   762  	if iter.i < len(iter.page.Values()) {
   763  		return nil
   764  	}
   765  	err = iter.page.NextWithContext(ctx)
   766  	if err != nil {
   767  		iter.i--
   768  		return err
   769  	}
   770  	iter.i = 0
   771  	return nil
   772  }
   773  
   774  // Next advances to the next value.  If there was an error making
   775  // the request the iterator does not advance and the error is returned.
   776  // Deprecated: Use NextWithContext() instead.
   777  func (iter *OperationListResultIterator) Next() error {
   778  	return iter.NextWithContext(context.Background())
   779  }
   780  
   781  // NotDone returns true if the enumeration should be started or is not yet complete.
   782  func (iter OperationListResultIterator) NotDone() bool {
   783  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   784  }
   785  
   786  // Response returns the raw server response from the last page request.
   787  func (iter OperationListResultIterator) Response() OperationListResult {
   788  	return iter.page.Response()
   789  }
   790  
   791  // Value returns the current value or a zero-initialized value if the
   792  // iterator has advanced beyond the end of the collection.
   793  func (iter OperationListResultIterator) Value() Operation {
   794  	if !iter.page.NotDone() {
   795  		return Operation{}
   796  	}
   797  	return iter.page.Values()[iter.i]
   798  }
   799  
   800  // Creates a new instance of the OperationListResultIterator type.
   801  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
   802  	return OperationListResultIterator{page: page}
   803  }
   804  
   805  // IsEmpty returns true if the ListResult contains no values.
   806  func (olr OperationListResult) IsEmpty() bool {
   807  	return olr.Value == nil || len(*olr.Value) == 0
   808  }
   809  
   810  // hasNextLink returns true if the NextLink is not empty.
   811  func (olr OperationListResult) hasNextLink() bool {
   812  	return olr.NextLink != nil && len(*olr.NextLink) != 0
   813  }
   814  
   815  // operationListResultPreparer prepares a request to retrieve the next set of results.
   816  // It returns nil if no more results exist.
   817  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
   818  	if !olr.hasNextLink() {
   819  		return nil, nil
   820  	}
   821  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   822  		autorest.AsJSON(),
   823  		autorest.AsGet(),
   824  		autorest.WithBaseURL(to.String(olr.NextLink)))
   825  }
   826  
   827  // OperationListResultPage contains a page of Operation values.
   828  type OperationListResultPage struct {
   829  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
   830  	olr OperationListResult
   831  }
   832  
   833  // NextWithContext advances to the next page of values.  If there was an error making
   834  // the request the page does not advance and the error is returned.
   835  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
   836  	if tracing.IsEnabled() {
   837  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
   838  		defer func() {
   839  			sc := -1
   840  			if page.Response().Response.Response != nil {
   841  				sc = page.Response().Response.Response.StatusCode
   842  			}
   843  			tracing.EndSpan(ctx, sc, err)
   844  		}()
   845  	}
   846  	for {
   847  		next, err := page.fn(ctx, page.olr)
   848  		if err != nil {
   849  			return err
   850  		}
   851  		page.olr = next
   852  		if !next.hasNextLink() || !next.IsEmpty() {
   853  			break
   854  		}
   855  	}
   856  	return nil
   857  }
   858  
   859  // Next advances to the next page of values.  If there was an error making
   860  // the request the page does not advance and the error is returned.
   861  // Deprecated: Use NextWithContext() instead.
   862  func (page *OperationListResultPage) Next() error {
   863  	return page.NextWithContext(context.Background())
   864  }
   865  
   866  // NotDone returns true if the page enumeration should be started or is not yet complete.
   867  func (page OperationListResultPage) NotDone() bool {
   868  	return !page.olr.IsEmpty()
   869  }
   870  
   871  // Response returns the raw server response from the last page request.
   872  func (page OperationListResultPage) Response() OperationListResult {
   873  	return page.olr
   874  }
   875  
   876  // Values returns the slice of values for the current page or nil if there are no values.
   877  func (page OperationListResultPage) Values() []Operation {
   878  	if page.olr.IsEmpty() {
   879  		return nil
   880  	}
   881  	return *page.olr.Value
   882  }
   883  
   884  // Creates a new instance of the OperationListResultPage type.
   885  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
   886  	return OperationListResultPage{
   887  		fn:  getNextPage,
   888  		olr: cur,
   889  	}
   890  }
   891  
   892  // PrivateEndpoint the private endpoint property of a private endpoint connection
   893  type PrivateEndpoint struct {
   894  	// ID - READ-ONLY; The resource identifier.
   895  	ID *string `json:"id,omitempty"`
   896  }
   897  
   898  // MarshalJSON is the custom marshaler for PrivateEndpoint.
   899  func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
   900  	objectMap := make(map[string]interface{})
   901  	return json.Marshal(objectMap)
   902  }
   903  
   904  // PrivateEndpointConnection the private endpoint connection of a provisioning service
   905  type PrivateEndpointConnection struct {
   906  	autorest.Response `json:"-"`
   907  	// ID - READ-ONLY; The resource identifier.
   908  	ID *string `json:"id,omitempty"`
   909  	// Name - READ-ONLY; The resource name.
   910  	Name *string `json:"name,omitempty"`
   911  	// Type - READ-ONLY; The resource type.
   912  	Type *string `json:"type,omitempty"`
   913  	// Properties - The properties of a private endpoint connection
   914  	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
   915  	// SystemData - READ-ONLY
   916  	SystemData *SystemData `json:"systemData,omitempty"`
   917  }
   918  
   919  // MarshalJSON is the custom marshaler for PrivateEndpointConnection.
   920  func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
   921  	objectMap := make(map[string]interface{})
   922  	if pec.Properties != nil {
   923  		objectMap["properties"] = pec.Properties
   924  	}
   925  	return json.Marshal(objectMap)
   926  }
   927  
   928  // PrivateEndpointConnectionProperties the properties of a private endpoint connection
   929  type PrivateEndpointConnectionProperties struct {
   930  	// PrivateEndpoint - The private endpoint property of a private endpoint connection
   931  	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
   932  	// PrivateLinkServiceConnectionState - The current state of a private endpoint connection
   933  	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
   934  }
   935  
   936  // PrivateLinkResources the available private link resources for a provisioning service
   937  type PrivateLinkResources struct {
   938  	autorest.Response `json:"-"`
   939  	// Value - The list of available private link resources for a provisioning service
   940  	Value *[]GroupIDInformation `json:"value,omitempty"`
   941  }
   942  
   943  // PrivateLinkServiceConnectionState the current state of a private endpoint connection
   944  type PrivateLinkServiceConnectionState struct {
   945  	// Status - The status of a private endpoint connection. Possible values include: 'PrivateLinkServiceConnectionStatusPending', 'PrivateLinkServiceConnectionStatusApproved', 'PrivateLinkServiceConnectionStatusRejected', 'PrivateLinkServiceConnectionStatusDisconnected'
   946  	Status PrivateLinkServiceConnectionStatus `json:"status,omitempty"`
   947  	// Description - The description for the current state of a private endpoint connection
   948  	Description *string `json:"description,omitempty"`
   949  	// ActionsRequired - Actions required for a private endpoint connection
   950  	ActionsRequired *string `json:"actionsRequired,omitempty"`
   951  }
   952  
   953  // ProvisioningServiceDescription the description of the provisioning service.
   954  type ProvisioningServiceDescription struct {
   955  	autorest.Response `json:"-"`
   956  	// 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.
   957  	Etag *string `json:"etag,omitempty"`
   958  	// Properties - Service specific properties for a provisioning service
   959  	Properties *IotDpsPropertiesDescription `json:"properties,omitempty"`
   960  	// Sku - Sku info for a provisioning Service.
   961  	Sku *IotDpsSkuInfo `json:"sku,omitempty"`
   962  	// SystemData - READ-ONLY
   963  	SystemData *SystemData `json:"systemData,omitempty"`
   964  	// ID - READ-ONLY; The resource identifier.
   965  	ID *string `json:"id,omitempty"`
   966  	// Name - READ-ONLY; The resource name.
   967  	Name *string `json:"name,omitempty"`
   968  	// Type - READ-ONLY; The resource type.
   969  	Type *string `json:"type,omitempty"`
   970  	// Location - The resource location.
   971  	Location *string `json:"location,omitempty"`
   972  	// Tags - The resource tags.
   973  	Tags map[string]*string `json:"tags"`
   974  }
   975  
   976  // MarshalJSON is the custom marshaler for ProvisioningServiceDescription.
   977  func (psd ProvisioningServiceDescription) MarshalJSON() ([]byte, error) {
   978  	objectMap := make(map[string]interface{})
   979  	if psd.Etag != nil {
   980  		objectMap["etag"] = psd.Etag
   981  	}
   982  	if psd.Properties != nil {
   983  		objectMap["properties"] = psd.Properties
   984  	}
   985  	if psd.Sku != nil {
   986  		objectMap["sku"] = psd.Sku
   987  	}
   988  	if psd.Location != nil {
   989  		objectMap["location"] = psd.Location
   990  	}
   991  	if psd.Tags != nil {
   992  		objectMap["tags"] = psd.Tags
   993  	}
   994  	return json.Marshal(objectMap)
   995  }
   996  
   997  // ProvisioningServiceDescriptionListResult list of provisioning service descriptions.
   998  type ProvisioningServiceDescriptionListResult struct {
   999  	autorest.Response `json:"-"`
  1000  	// Value - List of provisioning service descriptions.
  1001  	Value *[]ProvisioningServiceDescription `json:"value,omitempty"`
  1002  	// NextLink - READ-ONLY; the next link
  1003  	NextLink *string `json:"nextLink,omitempty"`
  1004  }
  1005  
  1006  // MarshalJSON is the custom marshaler for ProvisioningServiceDescriptionListResult.
  1007  func (psdlr ProvisioningServiceDescriptionListResult) MarshalJSON() ([]byte, error) {
  1008  	objectMap := make(map[string]interface{})
  1009  	if psdlr.Value != nil {
  1010  		objectMap["value"] = psdlr.Value
  1011  	}
  1012  	return json.Marshal(objectMap)
  1013  }
  1014  
  1015  // ProvisioningServiceDescriptionListResultIterator provides access to a complete listing of
  1016  // ProvisioningServiceDescription values.
  1017  type ProvisioningServiceDescriptionListResultIterator struct {
  1018  	i    int
  1019  	page ProvisioningServiceDescriptionListResultPage
  1020  }
  1021  
  1022  // NextWithContext advances to the next value.  If there was an error making
  1023  // the request the iterator does not advance and the error is returned.
  1024  func (iter *ProvisioningServiceDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1025  	if tracing.IsEnabled() {
  1026  		ctx = tracing.StartSpan(ctx, fqdn+"/ProvisioningServiceDescriptionListResultIterator.NextWithContext")
  1027  		defer func() {
  1028  			sc := -1
  1029  			if iter.Response().Response.Response != nil {
  1030  				sc = iter.Response().Response.Response.StatusCode
  1031  			}
  1032  			tracing.EndSpan(ctx, sc, err)
  1033  		}()
  1034  	}
  1035  	iter.i++
  1036  	if iter.i < len(iter.page.Values()) {
  1037  		return nil
  1038  	}
  1039  	err = iter.page.NextWithContext(ctx)
  1040  	if err != nil {
  1041  		iter.i--
  1042  		return err
  1043  	}
  1044  	iter.i = 0
  1045  	return nil
  1046  }
  1047  
  1048  // Next advances to the next value.  If there was an error making
  1049  // the request the iterator does not advance and the error is returned.
  1050  // Deprecated: Use NextWithContext() instead.
  1051  func (iter *ProvisioningServiceDescriptionListResultIterator) Next() error {
  1052  	return iter.NextWithContext(context.Background())
  1053  }
  1054  
  1055  // NotDone returns true if the enumeration should be started or is not yet complete.
  1056  func (iter ProvisioningServiceDescriptionListResultIterator) NotDone() bool {
  1057  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1058  }
  1059  
  1060  // Response returns the raw server response from the last page request.
  1061  func (iter ProvisioningServiceDescriptionListResultIterator) Response() ProvisioningServiceDescriptionListResult {
  1062  	return iter.page.Response()
  1063  }
  1064  
  1065  // Value returns the current value or a zero-initialized value if the
  1066  // iterator has advanced beyond the end of the collection.
  1067  func (iter ProvisioningServiceDescriptionListResultIterator) Value() ProvisioningServiceDescription {
  1068  	if !iter.page.NotDone() {
  1069  		return ProvisioningServiceDescription{}
  1070  	}
  1071  	return iter.page.Values()[iter.i]
  1072  }
  1073  
  1074  // Creates a new instance of the ProvisioningServiceDescriptionListResultIterator type.
  1075  func NewProvisioningServiceDescriptionListResultIterator(page ProvisioningServiceDescriptionListResultPage) ProvisioningServiceDescriptionListResultIterator {
  1076  	return ProvisioningServiceDescriptionListResultIterator{page: page}
  1077  }
  1078  
  1079  // IsEmpty returns true if the ListResult contains no values.
  1080  func (psdlr ProvisioningServiceDescriptionListResult) IsEmpty() bool {
  1081  	return psdlr.Value == nil || len(*psdlr.Value) == 0
  1082  }
  1083  
  1084  // hasNextLink returns true if the NextLink is not empty.
  1085  func (psdlr ProvisioningServiceDescriptionListResult) hasNextLink() bool {
  1086  	return psdlr.NextLink != nil && len(*psdlr.NextLink) != 0
  1087  }
  1088  
  1089  // provisioningServiceDescriptionListResultPreparer prepares a request to retrieve the next set of results.
  1090  // It returns nil if no more results exist.
  1091  func (psdlr ProvisioningServiceDescriptionListResult) provisioningServiceDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) {
  1092  	if !psdlr.hasNextLink() {
  1093  		return nil, nil
  1094  	}
  1095  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1096  		autorest.AsJSON(),
  1097  		autorest.AsGet(),
  1098  		autorest.WithBaseURL(to.String(psdlr.NextLink)))
  1099  }
  1100  
  1101  // ProvisioningServiceDescriptionListResultPage contains a page of ProvisioningServiceDescription values.
  1102  type ProvisioningServiceDescriptionListResultPage struct {
  1103  	fn    func(context.Context, ProvisioningServiceDescriptionListResult) (ProvisioningServiceDescriptionListResult, error)
  1104  	psdlr ProvisioningServiceDescriptionListResult
  1105  }
  1106  
  1107  // NextWithContext advances to the next page of values.  If there was an error making
  1108  // the request the page does not advance and the error is returned.
  1109  func (page *ProvisioningServiceDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) {
  1110  	if tracing.IsEnabled() {
  1111  		ctx = tracing.StartSpan(ctx, fqdn+"/ProvisioningServiceDescriptionListResultPage.NextWithContext")
  1112  		defer func() {
  1113  			sc := -1
  1114  			if page.Response().Response.Response != nil {
  1115  				sc = page.Response().Response.Response.StatusCode
  1116  			}
  1117  			tracing.EndSpan(ctx, sc, err)
  1118  		}()
  1119  	}
  1120  	for {
  1121  		next, err := page.fn(ctx, page.psdlr)
  1122  		if err != nil {
  1123  			return err
  1124  		}
  1125  		page.psdlr = next
  1126  		if !next.hasNextLink() || !next.IsEmpty() {
  1127  			break
  1128  		}
  1129  	}
  1130  	return nil
  1131  }
  1132  
  1133  // Next advances to the next page of values.  If there was an error making
  1134  // the request the page does not advance and the error is returned.
  1135  // Deprecated: Use NextWithContext() instead.
  1136  func (page *ProvisioningServiceDescriptionListResultPage) Next() error {
  1137  	return page.NextWithContext(context.Background())
  1138  }
  1139  
  1140  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1141  func (page ProvisioningServiceDescriptionListResultPage) NotDone() bool {
  1142  	return !page.psdlr.IsEmpty()
  1143  }
  1144  
  1145  // Response returns the raw server response from the last page request.
  1146  func (page ProvisioningServiceDescriptionListResultPage) Response() ProvisioningServiceDescriptionListResult {
  1147  	return page.psdlr
  1148  }
  1149  
  1150  // Values returns the slice of values for the current page or nil if there are no values.
  1151  func (page ProvisioningServiceDescriptionListResultPage) Values() []ProvisioningServiceDescription {
  1152  	if page.psdlr.IsEmpty() {
  1153  		return nil
  1154  	}
  1155  	return *page.psdlr.Value
  1156  }
  1157  
  1158  // Creates a new instance of the ProvisioningServiceDescriptionListResultPage type.
  1159  func NewProvisioningServiceDescriptionListResultPage(cur ProvisioningServiceDescriptionListResult, getNextPage func(context.Context, ProvisioningServiceDescriptionListResult) (ProvisioningServiceDescriptionListResult, error)) ProvisioningServiceDescriptionListResultPage {
  1160  	return ProvisioningServiceDescriptionListResultPage{
  1161  		fn:    getNextPage,
  1162  		psdlr: cur,
  1163  	}
  1164  }
  1165  
  1166  // Resource the common properties of an Azure resource.
  1167  type Resource struct {
  1168  	// ID - READ-ONLY; The resource identifier.
  1169  	ID *string `json:"id,omitempty"`
  1170  	// Name - READ-ONLY; The resource name.
  1171  	Name *string `json:"name,omitempty"`
  1172  	// Type - READ-ONLY; The resource type.
  1173  	Type *string `json:"type,omitempty"`
  1174  	// Location - The resource location.
  1175  	Location *string `json:"location,omitempty"`
  1176  	// Tags - The resource tags.
  1177  	Tags map[string]*string `json:"tags"`
  1178  }
  1179  
  1180  // MarshalJSON is the custom marshaler for Resource.
  1181  func (r Resource) MarshalJSON() ([]byte, error) {
  1182  	objectMap := make(map[string]interface{})
  1183  	if r.Location != nil {
  1184  		objectMap["location"] = r.Location
  1185  	}
  1186  	if r.Tags != nil {
  1187  		objectMap["tags"] = r.Tags
  1188  	}
  1189  	return json.Marshal(objectMap)
  1190  }
  1191  
  1192  // SharedAccessSignatureAuthorizationRuleAccessRightsDescription description of the shared access key.
  1193  type SharedAccessSignatureAuthorizationRuleAccessRightsDescription struct {
  1194  	autorest.Response `json:"-"`
  1195  	// KeyName - Name of the key.
  1196  	KeyName *string `json:"keyName,omitempty"`
  1197  	// PrimaryKey - Primary SAS key value.
  1198  	PrimaryKey *string `json:"primaryKey,omitempty"`
  1199  	// SecondaryKey - Secondary SAS key value.
  1200  	SecondaryKey *string `json:"secondaryKey,omitempty"`
  1201  	// Rights - Rights that this key has. Possible values include: 'AccessRightsDescriptionServiceConfig', 'AccessRightsDescriptionEnrollmentRead', 'AccessRightsDescriptionEnrollmentWrite', 'AccessRightsDescriptionDeviceConnect', 'AccessRightsDescriptionRegistrationStatusRead', 'AccessRightsDescriptionRegistrationStatusWrite'
  1202  	Rights AccessRightsDescription `json:"rights,omitempty"`
  1203  }
  1204  
  1205  // SharedAccessSignatureAuthorizationRuleListResult list of shared access keys.
  1206  type SharedAccessSignatureAuthorizationRuleListResult struct {
  1207  	autorest.Response `json:"-"`
  1208  	// Value - The list of shared access policies.
  1209  	Value *[]SharedAccessSignatureAuthorizationRuleAccessRightsDescription `json:"value,omitempty"`
  1210  	// NextLink - READ-ONLY; The next link.
  1211  	NextLink *string `json:"nextLink,omitempty"`
  1212  }
  1213  
  1214  // MarshalJSON is the custom marshaler for SharedAccessSignatureAuthorizationRuleListResult.
  1215  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) {
  1216  	objectMap := make(map[string]interface{})
  1217  	if sasarlr.Value != nil {
  1218  		objectMap["value"] = sasarlr.Value
  1219  	}
  1220  	return json.Marshal(objectMap)
  1221  }
  1222  
  1223  // SharedAccessSignatureAuthorizationRuleListResultIterator provides access to a complete listing of
  1224  // SharedAccessSignatureAuthorizationRuleAccessRightsDescription values.
  1225  type SharedAccessSignatureAuthorizationRuleListResultIterator struct {
  1226  	i    int
  1227  	page SharedAccessSignatureAuthorizationRuleListResultPage
  1228  }
  1229  
  1230  // NextWithContext advances to the next value.  If there was an error making
  1231  // the request the iterator does not advance and the error is returned.
  1232  func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
  1233  	if tracing.IsEnabled() {
  1234  		ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultIterator.NextWithContext")
  1235  		defer func() {
  1236  			sc := -1
  1237  			if iter.Response().Response.Response != nil {
  1238  				sc = iter.Response().Response.Response.StatusCode
  1239  			}
  1240  			tracing.EndSpan(ctx, sc, err)
  1241  		}()
  1242  	}
  1243  	iter.i++
  1244  	if iter.i < len(iter.page.Values()) {
  1245  		return nil
  1246  	}
  1247  	err = iter.page.NextWithContext(ctx)
  1248  	if err != nil {
  1249  		iter.i--
  1250  		return err
  1251  	}
  1252  	iter.i = 0
  1253  	return nil
  1254  }
  1255  
  1256  // Next advances to the next value.  If there was an error making
  1257  // the request the iterator does not advance and the error is returned.
  1258  // Deprecated: Use NextWithContext() instead.
  1259  func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) Next() error {
  1260  	return iter.NextWithContext(context.Background())
  1261  }
  1262  
  1263  // NotDone returns true if the enumeration should be started or is not yet complete.
  1264  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) NotDone() bool {
  1265  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1266  }
  1267  
  1268  // Response returns the raw server response from the last page request.
  1269  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Response() SharedAccessSignatureAuthorizationRuleListResult {
  1270  	return iter.page.Response()
  1271  }
  1272  
  1273  // Value returns the current value or a zero-initialized value if the
  1274  // iterator has advanced beyond the end of the collection.
  1275  func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Value() SharedAccessSignatureAuthorizationRuleAccessRightsDescription {
  1276  	if !iter.page.NotDone() {
  1277  		return SharedAccessSignatureAuthorizationRuleAccessRightsDescription{}
  1278  	}
  1279  	return iter.page.Values()[iter.i]
  1280  }
  1281  
  1282  // Creates a new instance of the SharedAccessSignatureAuthorizationRuleListResultIterator type.
  1283  func NewSharedAccessSignatureAuthorizationRuleListResultIterator(page SharedAccessSignatureAuthorizationRuleListResultPage) SharedAccessSignatureAuthorizationRuleListResultIterator {
  1284  	return SharedAccessSignatureAuthorizationRuleListResultIterator{page: page}
  1285  }
  1286  
  1287  // IsEmpty returns true if the ListResult contains no values.
  1288  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) IsEmpty() bool {
  1289  	return sasarlr.Value == nil || len(*sasarlr.Value) == 0
  1290  }
  1291  
  1292  // hasNextLink returns true if the NextLink is not empty.
  1293  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) hasNextLink() bool {
  1294  	return sasarlr.NextLink != nil && len(*sasarlr.NextLink) != 0
  1295  }
  1296  
  1297  // sharedAccessSignatureAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results.
  1298  // It returns nil if no more results exist.
  1299  func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) sharedAccessSignatureAuthorizationRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
  1300  	if !sasarlr.hasNextLink() {
  1301  		return nil, nil
  1302  	}
  1303  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1304  		autorest.AsJSON(),
  1305  		autorest.AsGet(),
  1306  		autorest.WithBaseURL(to.String(sasarlr.NextLink)))
  1307  }
  1308  
  1309  // SharedAccessSignatureAuthorizationRuleListResultPage contains a page of
  1310  // SharedAccessSignatureAuthorizationRuleAccessRightsDescription values.
  1311  type SharedAccessSignatureAuthorizationRuleListResultPage struct {
  1312  	fn      func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)
  1313  	sasarlr SharedAccessSignatureAuthorizationRuleListResult
  1314  }
  1315  
  1316  // NextWithContext advances to the next page of values.  If there was an error making
  1317  // the request the page does not advance and the error is returned.
  1318  func (page *SharedAccessSignatureAuthorizationRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
  1319  	if tracing.IsEnabled() {
  1320  		ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultPage.NextWithContext")
  1321  		defer func() {
  1322  			sc := -1
  1323  			if page.Response().Response.Response != nil {
  1324  				sc = page.Response().Response.Response.StatusCode
  1325  			}
  1326  			tracing.EndSpan(ctx, sc, err)
  1327  		}()
  1328  	}
  1329  	for {
  1330  		next, err := page.fn(ctx, page.sasarlr)
  1331  		if err != nil {
  1332  			return err
  1333  		}
  1334  		page.sasarlr = next
  1335  		if !next.hasNextLink() || !next.IsEmpty() {
  1336  			break
  1337  		}
  1338  	}
  1339  	return nil
  1340  }
  1341  
  1342  // Next advances to the next page of values.  If there was an error making
  1343  // the request the page does not advance and the error is returned.
  1344  // Deprecated: Use NextWithContext() instead.
  1345  func (page *SharedAccessSignatureAuthorizationRuleListResultPage) Next() error {
  1346  	return page.NextWithContext(context.Background())
  1347  }
  1348  
  1349  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1350  func (page SharedAccessSignatureAuthorizationRuleListResultPage) NotDone() bool {
  1351  	return !page.sasarlr.IsEmpty()
  1352  }
  1353  
  1354  // Response returns the raw server response from the last page request.
  1355  func (page SharedAccessSignatureAuthorizationRuleListResultPage) Response() SharedAccessSignatureAuthorizationRuleListResult {
  1356  	return page.sasarlr
  1357  }
  1358  
  1359  // Values returns the slice of values for the current page or nil if there are no values.
  1360  func (page SharedAccessSignatureAuthorizationRuleListResultPage) Values() []SharedAccessSignatureAuthorizationRuleAccessRightsDescription {
  1361  	if page.sasarlr.IsEmpty() {
  1362  		return nil
  1363  	}
  1364  	return *page.sasarlr.Value
  1365  }
  1366  
  1367  // Creates a new instance of the SharedAccessSignatureAuthorizationRuleListResultPage type.
  1368  func NewSharedAccessSignatureAuthorizationRuleListResultPage(cur SharedAccessSignatureAuthorizationRuleListResult, getNextPage func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)) SharedAccessSignatureAuthorizationRuleListResultPage {
  1369  	return SharedAccessSignatureAuthorizationRuleListResultPage{
  1370  		fn:      getNextPage,
  1371  		sasarlr: cur,
  1372  	}
  1373  }
  1374  
  1375  // SystemData metadata pertaining to creation and last modification of the resource.
  1376  type SystemData struct {
  1377  	// CreatedBy - The identity that created the resource.
  1378  	CreatedBy *string `json:"createdBy,omitempty"`
  1379  	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  1380  	CreatedByType CreatedByType `json:"createdByType,omitempty"`
  1381  	// CreatedAt - The timestamp of resource creation (UTC).
  1382  	CreatedAt *date.Time `json:"createdAt,omitempty"`
  1383  	// LastModifiedBy - The identity that last modified the resource.
  1384  	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
  1385  	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
  1386  	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
  1387  	// LastModifiedAt - The timestamp of resource last modification (UTC)
  1388  	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
  1389  }
  1390  
  1391  // TagsResource a container holding only the Tags for a resource, allowing the user to update the tags on a
  1392  // Provisioning Service instance.
  1393  type TagsResource struct {
  1394  	// Tags - Resource tags
  1395  	Tags map[string]*string `json:"tags"`
  1396  }
  1397  
  1398  // MarshalJSON is the custom marshaler for TagsResource.
  1399  func (tr TagsResource) MarshalJSON() ([]byte, error) {
  1400  	objectMap := make(map[string]interface{})
  1401  	if tr.Tags != nil {
  1402  		objectMap["tags"] = tr.Tags
  1403  	}
  1404  	return json.Marshal(objectMap)
  1405  }
  1406  
  1407  // VerificationCodeRequest the JSON-serialized leaf certificate
  1408  type VerificationCodeRequest struct {
  1409  	// Certificate - base-64 representation of X509 certificate .cer file or just .pem file content.
  1410  	Certificate *string `json:"certificate,omitempty"`
  1411  }
  1412  
  1413  // VerificationCodeResponse description of the response of the verification code.
  1414  type VerificationCodeResponse struct {
  1415  	autorest.Response `json:"-"`
  1416  	// Name - READ-ONLY; Name of certificate.
  1417  	Name *string `json:"name,omitempty"`
  1418  	// Etag - READ-ONLY; Request etag.
  1419  	Etag *string `json:"etag,omitempty"`
  1420  	// ID - READ-ONLY; The resource identifier.
  1421  	ID *string `json:"id,omitempty"`
  1422  	// Type - READ-ONLY; The resource type.
  1423  	Type       *string                             `json:"type,omitempty"`
  1424  	Properties *VerificationCodeResponseProperties `json:"properties,omitempty"`
  1425  }
  1426  
  1427  // MarshalJSON is the custom marshaler for VerificationCodeResponse.
  1428  func (vcr VerificationCodeResponse) MarshalJSON() ([]byte, error) {
  1429  	objectMap := make(map[string]interface{})
  1430  	if vcr.Properties != nil {
  1431  		objectMap["properties"] = vcr.Properties
  1432  	}
  1433  	return json.Marshal(objectMap)
  1434  }
  1435  
  1436  // VerificationCodeResponseProperties ...
  1437  type VerificationCodeResponseProperties struct {
  1438  	// VerificationCode - Verification code.
  1439  	VerificationCode *string `json:"verificationCode,omitempty"`
  1440  	// Subject - Certificate subject.
  1441  	Subject *string `json:"subject,omitempty"`
  1442  	// Expiry - Code expiry.
  1443  	Expiry *string `json:"expiry,omitempty"`
  1444  	// Thumbprint - Certificate thumbprint.
  1445  	Thumbprint *string `json:"thumbprint,omitempty"`
  1446  	// IsVerified - Indicate if the certificate is verified by owner of private key.
  1447  	IsVerified *bool `json:"isVerified,omitempty"`
  1448  	// Certificate - base-64 representation of X509 certificate .cer file or just .pem file content.
  1449  	Certificate *[]byte `json:"certificate,omitempty"`
  1450  	// Created - Certificate created time.
  1451  	Created *string `json:"created,omitempty"`
  1452  	// Updated - Certificate updated time.
  1453  	Updated *string `json:"updated,omitempty"`
  1454  }
  1455  

View as plain text