...

Source file src/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2021-07-01/features/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2021-07-01/features

     1  package features
     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/date"
    14  	"github.com/Azure/go-autorest/autorest/to"
    15  	"github.com/Azure/go-autorest/tracing"
    16  	"net/http"
    17  )
    18  
    19  // The package's fully qualified name.
    20  const fqdn = "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2021-07-01/features"
    21  
    22  // AuthorizationProfile authorization Profile
    23  type AuthorizationProfile struct {
    24  	// RequestedTime - READ-ONLY; The requested time
    25  	RequestedTime *date.Time `json:"requestedTime,omitempty"`
    26  	// Requester - READ-ONLY; The requester
    27  	Requester *string `json:"requester,omitempty"`
    28  	// RequesterObjectID - READ-ONLY; The requester object id
    29  	RequesterObjectID *string `json:"requesterObjectId,omitempty"`
    30  	// ApprovedTime - READ-ONLY; The approved time
    31  	ApprovedTime *date.Time `json:"approvedTime,omitempty"`
    32  	// Approver - READ-ONLY; The approver
    33  	Approver *string `json:"approver,omitempty"`
    34  }
    35  
    36  // MarshalJSON is the custom marshaler for AuthorizationProfile.
    37  func (ap AuthorizationProfile) MarshalJSON() ([]byte, error) {
    38  	objectMap := make(map[string]interface{})
    39  	return json.Marshal(objectMap)
    40  }
    41  
    42  // ErrorDefinition error definition.
    43  type ErrorDefinition struct {
    44  	// Code - READ-ONLY; Service specific error code which serves as the substatus for the HTTP error code.
    45  	Code *string `json:"code,omitempty"`
    46  	// Message - READ-ONLY; Description of the error.
    47  	Message *string `json:"message,omitempty"`
    48  	// Details - Internal error details.
    49  	Details *[]ErrorDefinition `json:"details,omitempty"`
    50  }
    51  
    52  // MarshalJSON is the custom marshaler for ErrorDefinition.
    53  func (ed ErrorDefinition) MarshalJSON() ([]byte, error) {
    54  	objectMap := make(map[string]interface{})
    55  	if ed.Details != nil {
    56  		objectMap["details"] = ed.Details
    57  	}
    58  	return json.Marshal(objectMap)
    59  }
    60  
    61  // ErrorResponse error response indicates that the service is not able to process the incoming request.
    62  type ErrorResponse struct {
    63  	// Error - The error details.
    64  	Error *ErrorDefinition `json:"error,omitempty"`
    65  }
    66  
    67  // Operation microsoft.Features operation
    68  type Operation struct {
    69  	// Name - Operation name: {provider}/{resource}/{operation}
    70  	Name *string `json:"name,omitempty"`
    71  	// Display - The object that represents the operation.
    72  	Display *OperationDisplay `json:"display,omitempty"`
    73  }
    74  
    75  // OperationDisplay the object that represents the operation.
    76  type OperationDisplay struct {
    77  	// Provider - Service provider: Microsoft.Features
    78  	Provider *string `json:"provider,omitempty"`
    79  	// Resource - Resource on which the operation is performed: Profile, endpoint, etc.
    80  	Resource *string `json:"resource,omitempty"`
    81  	// Operation - Operation type: Read, write, delete, etc.
    82  	Operation *string `json:"operation,omitempty"`
    83  }
    84  
    85  // OperationListResult result of the request to list Microsoft.Features operations. It contains a list of
    86  // operations and a URL link to get the next set of results.
    87  type OperationListResult struct {
    88  	autorest.Response `json:"-"`
    89  	// Value - List of Microsoft.Features operations.
    90  	Value *[]Operation `json:"value,omitempty"`
    91  	// NextLink - URL to get the next set of operation list results if there are any.
    92  	NextLink *string `json:"nextLink,omitempty"`
    93  }
    94  
    95  // OperationListResultIterator provides access to a complete listing of Operation values.
    96  type OperationListResultIterator struct {
    97  	i    int
    98  	page OperationListResultPage
    99  }
   100  
   101  // NextWithContext advances to the next value.  If there was an error making
   102  // the request the iterator does not advance and the error is returned.
   103  func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
   104  	if tracing.IsEnabled() {
   105  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
   106  		defer func() {
   107  			sc := -1
   108  			if iter.Response().Response.Response != nil {
   109  				sc = iter.Response().Response.Response.StatusCode
   110  			}
   111  			tracing.EndSpan(ctx, sc, err)
   112  		}()
   113  	}
   114  	iter.i++
   115  	if iter.i < len(iter.page.Values()) {
   116  		return nil
   117  	}
   118  	err = iter.page.NextWithContext(ctx)
   119  	if err != nil {
   120  		iter.i--
   121  		return err
   122  	}
   123  	iter.i = 0
   124  	return nil
   125  }
   126  
   127  // Next advances to the next value.  If there was an error making
   128  // the request the iterator does not advance and the error is returned.
   129  // Deprecated: Use NextWithContext() instead.
   130  func (iter *OperationListResultIterator) Next() error {
   131  	return iter.NextWithContext(context.Background())
   132  }
   133  
   134  // NotDone returns true if the enumeration should be started or is not yet complete.
   135  func (iter OperationListResultIterator) NotDone() bool {
   136  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   137  }
   138  
   139  // Response returns the raw server response from the last page request.
   140  func (iter OperationListResultIterator) Response() OperationListResult {
   141  	return iter.page.Response()
   142  }
   143  
   144  // Value returns the current value or a zero-initialized value if the
   145  // iterator has advanced beyond the end of the collection.
   146  func (iter OperationListResultIterator) Value() Operation {
   147  	if !iter.page.NotDone() {
   148  		return Operation{}
   149  	}
   150  	return iter.page.Values()[iter.i]
   151  }
   152  
   153  // Creates a new instance of the OperationListResultIterator type.
   154  func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
   155  	return OperationListResultIterator{page: page}
   156  }
   157  
   158  // IsEmpty returns true if the ListResult contains no values.
   159  func (olr OperationListResult) IsEmpty() bool {
   160  	return olr.Value == nil || len(*olr.Value) == 0
   161  }
   162  
   163  // hasNextLink returns true if the NextLink is not empty.
   164  func (olr OperationListResult) hasNextLink() bool {
   165  	return olr.NextLink != nil && len(*olr.NextLink) != 0
   166  }
   167  
   168  // operationListResultPreparer prepares a request to retrieve the next set of results.
   169  // It returns nil if no more results exist.
   170  func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
   171  	if !olr.hasNextLink() {
   172  		return nil, nil
   173  	}
   174  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   175  		autorest.AsJSON(),
   176  		autorest.AsGet(),
   177  		autorest.WithBaseURL(to.String(olr.NextLink)))
   178  }
   179  
   180  // OperationListResultPage contains a page of Operation values.
   181  type OperationListResultPage struct {
   182  	fn  func(context.Context, OperationListResult) (OperationListResult, error)
   183  	olr OperationListResult
   184  }
   185  
   186  // NextWithContext advances to the next page of values.  If there was an error making
   187  // the request the page does not advance and the error is returned.
   188  func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
   189  	if tracing.IsEnabled() {
   190  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
   191  		defer func() {
   192  			sc := -1
   193  			if page.Response().Response.Response != nil {
   194  				sc = page.Response().Response.Response.StatusCode
   195  			}
   196  			tracing.EndSpan(ctx, sc, err)
   197  		}()
   198  	}
   199  	for {
   200  		next, err := page.fn(ctx, page.olr)
   201  		if err != nil {
   202  			return err
   203  		}
   204  		page.olr = next
   205  		if !next.hasNextLink() || !next.IsEmpty() {
   206  			break
   207  		}
   208  	}
   209  	return nil
   210  }
   211  
   212  // Next advances to the next page of values.  If there was an error making
   213  // the request the page does not advance and the error is returned.
   214  // Deprecated: Use NextWithContext() instead.
   215  func (page *OperationListResultPage) Next() error {
   216  	return page.NextWithContext(context.Background())
   217  }
   218  
   219  // NotDone returns true if the page enumeration should be started or is not yet complete.
   220  func (page OperationListResultPage) NotDone() bool {
   221  	return !page.olr.IsEmpty()
   222  }
   223  
   224  // Response returns the raw server response from the last page request.
   225  func (page OperationListResultPage) Response() OperationListResult {
   226  	return page.olr
   227  }
   228  
   229  // Values returns the slice of values for the current page or nil if there are no values.
   230  func (page OperationListResultPage) Values() []Operation {
   231  	if page.olr.IsEmpty() {
   232  		return nil
   233  	}
   234  	return *page.olr.Value
   235  }
   236  
   237  // Creates a new instance of the OperationListResultPage type.
   238  func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
   239  	return OperationListResultPage{
   240  		fn:  getNextPage,
   241  		olr: cur,
   242  	}
   243  }
   244  
   245  // OperationsListResult list of previewed features.
   246  type OperationsListResult struct {
   247  	autorest.Response `json:"-"`
   248  	// Value - The array of features.
   249  	Value *[]Result `json:"value,omitempty"`
   250  	// NextLink - The URL to use for getting the next set of results.
   251  	NextLink *string `json:"nextLink,omitempty"`
   252  }
   253  
   254  // OperationsListResultIterator provides access to a complete listing of Result values.
   255  type OperationsListResultIterator struct {
   256  	i    int
   257  	page OperationsListResultPage
   258  }
   259  
   260  // NextWithContext advances to the next value.  If there was an error making
   261  // the request the iterator does not advance and the error is returned.
   262  func (iter *OperationsListResultIterator) NextWithContext(ctx context.Context) (err error) {
   263  	if tracing.IsEnabled() {
   264  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultIterator.NextWithContext")
   265  		defer func() {
   266  			sc := -1
   267  			if iter.Response().Response.Response != nil {
   268  				sc = iter.Response().Response.Response.StatusCode
   269  			}
   270  			tracing.EndSpan(ctx, sc, err)
   271  		}()
   272  	}
   273  	iter.i++
   274  	if iter.i < len(iter.page.Values()) {
   275  		return nil
   276  	}
   277  	err = iter.page.NextWithContext(ctx)
   278  	if err != nil {
   279  		iter.i--
   280  		return err
   281  	}
   282  	iter.i = 0
   283  	return nil
   284  }
   285  
   286  // Next advances to the next value.  If there was an error making
   287  // the request the iterator does not advance and the error is returned.
   288  // Deprecated: Use NextWithContext() instead.
   289  func (iter *OperationsListResultIterator) Next() error {
   290  	return iter.NextWithContext(context.Background())
   291  }
   292  
   293  // NotDone returns true if the enumeration should be started or is not yet complete.
   294  func (iter OperationsListResultIterator) NotDone() bool {
   295  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   296  }
   297  
   298  // Response returns the raw server response from the last page request.
   299  func (iter OperationsListResultIterator) Response() OperationsListResult {
   300  	return iter.page.Response()
   301  }
   302  
   303  // Value returns the current value or a zero-initialized value if the
   304  // iterator has advanced beyond the end of the collection.
   305  func (iter OperationsListResultIterator) Value() Result {
   306  	if !iter.page.NotDone() {
   307  		return Result{}
   308  	}
   309  	return iter.page.Values()[iter.i]
   310  }
   311  
   312  // Creates a new instance of the OperationsListResultIterator type.
   313  func NewOperationsListResultIterator(page OperationsListResultPage) OperationsListResultIterator {
   314  	return OperationsListResultIterator{page: page}
   315  }
   316  
   317  // IsEmpty returns true if the ListResult contains no values.
   318  func (olr OperationsListResult) IsEmpty() bool {
   319  	return olr.Value == nil || len(*olr.Value) == 0
   320  }
   321  
   322  // hasNextLink returns true if the NextLink is not empty.
   323  func (olr OperationsListResult) hasNextLink() bool {
   324  	return olr.NextLink != nil && len(*olr.NextLink) != 0
   325  }
   326  
   327  // operationsListResultPreparer prepares a request to retrieve the next set of results.
   328  // It returns nil if no more results exist.
   329  func (olr OperationsListResult) operationsListResultPreparer(ctx context.Context) (*http.Request, error) {
   330  	if !olr.hasNextLink() {
   331  		return nil, nil
   332  	}
   333  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   334  		autorest.AsJSON(),
   335  		autorest.AsGet(),
   336  		autorest.WithBaseURL(to.String(olr.NextLink)))
   337  }
   338  
   339  // OperationsListResultPage contains a page of Result values.
   340  type OperationsListResultPage struct {
   341  	fn  func(context.Context, OperationsListResult) (OperationsListResult, error)
   342  	olr OperationsListResult
   343  }
   344  
   345  // NextWithContext advances to the next page of values.  If there was an error making
   346  // the request the page does not advance and the error is returned.
   347  func (page *OperationsListResultPage) NextWithContext(ctx context.Context) (err error) {
   348  	if tracing.IsEnabled() {
   349  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultPage.NextWithContext")
   350  		defer func() {
   351  			sc := -1
   352  			if page.Response().Response.Response != nil {
   353  				sc = page.Response().Response.Response.StatusCode
   354  			}
   355  			tracing.EndSpan(ctx, sc, err)
   356  		}()
   357  	}
   358  	for {
   359  		next, err := page.fn(ctx, page.olr)
   360  		if err != nil {
   361  			return err
   362  		}
   363  		page.olr = next
   364  		if !next.hasNextLink() || !next.IsEmpty() {
   365  			break
   366  		}
   367  	}
   368  	return nil
   369  }
   370  
   371  // Next advances to the next page of values.  If there was an error making
   372  // the request the page does not advance and the error is returned.
   373  // Deprecated: Use NextWithContext() instead.
   374  func (page *OperationsListResultPage) Next() error {
   375  	return page.NextWithContext(context.Background())
   376  }
   377  
   378  // NotDone returns true if the page enumeration should be started or is not yet complete.
   379  func (page OperationsListResultPage) NotDone() bool {
   380  	return !page.olr.IsEmpty()
   381  }
   382  
   383  // Response returns the raw server response from the last page request.
   384  func (page OperationsListResultPage) Response() OperationsListResult {
   385  	return page.olr
   386  }
   387  
   388  // Values returns the slice of values for the current page or nil if there are no values.
   389  func (page OperationsListResultPage) Values() []Result {
   390  	if page.olr.IsEmpty() {
   391  		return nil
   392  	}
   393  	return *page.olr.Value
   394  }
   395  
   396  // Creates a new instance of the OperationsListResultPage type.
   397  func NewOperationsListResultPage(cur OperationsListResult, getNextPage func(context.Context, OperationsListResult) (OperationsListResult, error)) OperationsListResultPage {
   398  	return OperationsListResultPage{
   399  		fn:  getNextPage,
   400  		olr: cur,
   401  	}
   402  }
   403  
   404  // Properties information about feature.
   405  type Properties struct {
   406  	// State - The registration state of the feature for the subscription.
   407  	State *string `json:"state,omitempty"`
   408  }
   409  
   410  // ProxyResource an Azure proxy resource.
   411  type ProxyResource struct {
   412  	// ID - READ-ONLY; Azure resource Id.
   413  	ID *string `json:"id,omitempty"`
   414  	// Name - READ-ONLY; Azure resource name.
   415  	Name *string `json:"name,omitempty"`
   416  	// Type - READ-ONLY; Azure resource type.
   417  	Type *string `json:"type,omitempty"`
   418  }
   419  
   420  // MarshalJSON is the custom marshaler for ProxyResource.
   421  func (pr ProxyResource) MarshalJSON() ([]byte, error) {
   422  	objectMap := make(map[string]interface{})
   423  	return json.Marshal(objectMap)
   424  }
   425  
   426  // Result previewed feature information.
   427  type Result struct {
   428  	autorest.Response `json:"-"`
   429  	// Name - The name of the feature.
   430  	Name *string `json:"name,omitempty"`
   431  	// Properties - Properties of the previewed feature.
   432  	Properties *Properties `json:"properties,omitempty"`
   433  	// ID - The resource ID of the feature.
   434  	ID *string `json:"id,omitempty"`
   435  	// Type - The resource type of the feature.
   436  	Type *string `json:"type,omitempty"`
   437  }
   438  
   439  // SubscriptionFeatureRegistration subscription feature registration details
   440  type SubscriptionFeatureRegistration struct {
   441  	autorest.Response `json:"-"`
   442  	Properties        *SubscriptionFeatureRegistrationProperties `json:"properties,omitempty"`
   443  	// ID - READ-ONLY; Azure resource Id.
   444  	ID *string `json:"id,omitempty"`
   445  	// Name - READ-ONLY; Azure resource name.
   446  	Name *string `json:"name,omitempty"`
   447  	// Type - READ-ONLY; Azure resource type.
   448  	Type *string `json:"type,omitempty"`
   449  }
   450  
   451  // MarshalJSON is the custom marshaler for SubscriptionFeatureRegistration.
   452  func (sfr SubscriptionFeatureRegistration) MarshalJSON() ([]byte, error) {
   453  	objectMap := make(map[string]interface{})
   454  	if sfr.Properties != nil {
   455  		objectMap["properties"] = sfr.Properties
   456  	}
   457  	return json.Marshal(objectMap)
   458  }
   459  
   460  // SubscriptionFeatureRegistrationList the list of subscription feature registrations.
   461  type SubscriptionFeatureRegistrationList struct {
   462  	autorest.Response `json:"-"`
   463  	// NextLink - The link used to get the next page of subscription feature registrations list.
   464  	NextLink *string `json:"nextLink,omitempty"`
   465  	// Value - The list of subscription feature registrations.
   466  	Value *[]SubscriptionFeatureRegistration `json:"value,omitempty"`
   467  }
   468  
   469  // SubscriptionFeatureRegistrationListIterator provides access to a complete listing of
   470  // SubscriptionFeatureRegistration values.
   471  type SubscriptionFeatureRegistrationListIterator struct {
   472  	i    int
   473  	page SubscriptionFeatureRegistrationListPage
   474  }
   475  
   476  // NextWithContext advances to the next value.  If there was an error making
   477  // the request the iterator does not advance and the error is returned.
   478  func (iter *SubscriptionFeatureRegistrationListIterator) NextWithContext(ctx context.Context) (err error) {
   479  	if tracing.IsEnabled() {
   480  		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionFeatureRegistrationListIterator.NextWithContext")
   481  		defer func() {
   482  			sc := -1
   483  			if iter.Response().Response.Response != nil {
   484  				sc = iter.Response().Response.Response.StatusCode
   485  			}
   486  			tracing.EndSpan(ctx, sc, err)
   487  		}()
   488  	}
   489  	iter.i++
   490  	if iter.i < len(iter.page.Values()) {
   491  		return nil
   492  	}
   493  	err = iter.page.NextWithContext(ctx)
   494  	if err != nil {
   495  		iter.i--
   496  		return err
   497  	}
   498  	iter.i = 0
   499  	return nil
   500  }
   501  
   502  // Next advances to the next value.  If there was an error making
   503  // the request the iterator does not advance and the error is returned.
   504  // Deprecated: Use NextWithContext() instead.
   505  func (iter *SubscriptionFeatureRegistrationListIterator) Next() error {
   506  	return iter.NextWithContext(context.Background())
   507  }
   508  
   509  // NotDone returns true if the enumeration should be started or is not yet complete.
   510  func (iter SubscriptionFeatureRegistrationListIterator) NotDone() bool {
   511  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   512  }
   513  
   514  // Response returns the raw server response from the last page request.
   515  func (iter SubscriptionFeatureRegistrationListIterator) Response() SubscriptionFeatureRegistrationList {
   516  	return iter.page.Response()
   517  }
   518  
   519  // Value returns the current value or a zero-initialized value if the
   520  // iterator has advanced beyond the end of the collection.
   521  func (iter SubscriptionFeatureRegistrationListIterator) Value() SubscriptionFeatureRegistration {
   522  	if !iter.page.NotDone() {
   523  		return SubscriptionFeatureRegistration{}
   524  	}
   525  	return iter.page.Values()[iter.i]
   526  }
   527  
   528  // Creates a new instance of the SubscriptionFeatureRegistrationListIterator type.
   529  func NewSubscriptionFeatureRegistrationListIterator(page SubscriptionFeatureRegistrationListPage) SubscriptionFeatureRegistrationListIterator {
   530  	return SubscriptionFeatureRegistrationListIterator{page: page}
   531  }
   532  
   533  // IsEmpty returns true if the ListResult contains no values.
   534  func (sfrl SubscriptionFeatureRegistrationList) IsEmpty() bool {
   535  	return sfrl.Value == nil || len(*sfrl.Value) == 0
   536  }
   537  
   538  // hasNextLink returns true if the NextLink is not empty.
   539  func (sfrl SubscriptionFeatureRegistrationList) hasNextLink() bool {
   540  	return sfrl.NextLink != nil && len(*sfrl.NextLink) != 0
   541  }
   542  
   543  // subscriptionFeatureRegistrationListPreparer prepares a request to retrieve the next set of results.
   544  // It returns nil if no more results exist.
   545  func (sfrl SubscriptionFeatureRegistrationList) subscriptionFeatureRegistrationListPreparer(ctx context.Context) (*http.Request, error) {
   546  	if !sfrl.hasNextLink() {
   547  		return nil, nil
   548  	}
   549  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   550  		autorest.AsJSON(),
   551  		autorest.AsGet(),
   552  		autorest.WithBaseURL(to.String(sfrl.NextLink)))
   553  }
   554  
   555  // SubscriptionFeatureRegistrationListPage contains a page of SubscriptionFeatureRegistration values.
   556  type SubscriptionFeatureRegistrationListPage struct {
   557  	fn   func(context.Context, SubscriptionFeatureRegistrationList) (SubscriptionFeatureRegistrationList, error)
   558  	sfrl SubscriptionFeatureRegistrationList
   559  }
   560  
   561  // NextWithContext advances to the next page of values.  If there was an error making
   562  // the request the page does not advance and the error is returned.
   563  func (page *SubscriptionFeatureRegistrationListPage) NextWithContext(ctx context.Context) (err error) {
   564  	if tracing.IsEnabled() {
   565  		ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionFeatureRegistrationListPage.NextWithContext")
   566  		defer func() {
   567  			sc := -1
   568  			if page.Response().Response.Response != nil {
   569  				sc = page.Response().Response.Response.StatusCode
   570  			}
   571  			tracing.EndSpan(ctx, sc, err)
   572  		}()
   573  	}
   574  	for {
   575  		next, err := page.fn(ctx, page.sfrl)
   576  		if err != nil {
   577  			return err
   578  		}
   579  		page.sfrl = next
   580  		if !next.hasNextLink() || !next.IsEmpty() {
   581  			break
   582  		}
   583  	}
   584  	return nil
   585  }
   586  
   587  // Next advances to the next page of values.  If there was an error making
   588  // the request the page does not advance and the error is returned.
   589  // Deprecated: Use NextWithContext() instead.
   590  func (page *SubscriptionFeatureRegistrationListPage) Next() error {
   591  	return page.NextWithContext(context.Background())
   592  }
   593  
   594  // NotDone returns true if the page enumeration should be started or is not yet complete.
   595  func (page SubscriptionFeatureRegistrationListPage) NotDone() bool {
   596  	return !page.sfrl.IsEmpty()
   597  }
   598  
   599  // Response returns the raw server response from the last page request.
   600  func (page SubscriptionFeatureRegistrationListPage) Response() SubscriptionFeatureRegistrationList {
   601  	return page.sfrl
   602  }
   603  
   604  // Values returns the slice of values for the current page or nil if there are no values.
   605  func (page SubscriptionFeatureRegistrationListPage) Values() []SubscriptionFeatureRegistration {
   606  	if page.sfrl.IsEmpty() {
   607  		return nil
   608  	}
   609  	return *page.sfrl.Value
   610  }
   611  
   612  // Creates a new instance of the SubscriptionFeatureRegistrationListPage type.
   613  func NewSubscriptionFeatureRegistrationListPage(cur SubscriptionFeatureRegistrationList, getNextPage func(context.Context, SubscriptionFeatureRegistrationList) (SubscriptionFeatureRegistrationList, error)) SubscriptionFeatureRegistrationListPage {
   614  	return SubscriptionFeatureRegistrationListPage{
   615  		fn:   getNextPage,
   616  		sfrl: cur,
   617  	}
   618  }
   619  
   620  // SubscriptionFeatureRegistrationProperties ...
   621  type SubscriptionFeatureRegistrationProperties struct {
   622  	// TenantID - READ-ONLY; The tenantId.
   623  	TenantID *string `json:"tenantId,omitempty"`
   624  	// SubscriptionID - READ-ONLY; The subscriptionId.
   625  	SubscriptionID *string `json:"subscriptionId,omitempty"`
   626  	// FeatureName - READ-ONLY; The featureName.
   627  	FeatureName *string `json:"featureName,omitempty"`
   628  	// DisplayName - READ-ONLY; The featureDisplayName.
   629  	DisplayName *string `json:"displayName,omitempty"`
   630  	// ProviderNamespace - READ-ONLY; The providerNamespace.
   631  	ProviderNamespace *string `json:"providerNamespace,omitempty"`
   632  	// State - The state. Possible values include: 'SubscriptionFeatureRegistrationStateNotSpecified', 'SubscriptionFeatureRegistrationStateNotRegistered', 'SubscriptionFeatureRegistrationStatePending', 'SubscriptionFeatureRegistrationStateRegistering', 'SubscriptionFeatureRegistrationStateRegistered', 'SubscriptionFeatureRegistrationStateUnregistering', 'SubscriptionFeatureRegistrationStateUnregistered'
   633  	State                SubscriptionFeatureRegistrationState `json:"state,omitempty"`
   634  	AuthorizationProfile *AuthorizationProfile                `json:"authorizationProfile,omitempty"`
   635  	// Metadata - Key-value pairs for meta data.
   636  	Metadata map[string]*string `json:"metadata"`
   637  	// ReleaseDate - READ-ONLY; The feature release date.
   638  	ReleaseDate *date.Time `json:"releaseDate,omitempty"`
   639  	// RegistrationDate - READ-ONLY; The feature registration date.
   640  	RegistrationDate *date.Time `json:"registrationDate,omitempty"`
   641  	// DocumentationLink - READ-ONLY; The feature documentation link.
   642  	DocumentationLink *string `json:"documentationLink,omitempty"`
   643  	// ApprovalType - READ-ONLY; The feature approval type. Possible values include: 'SubscriptionFeatureRegistrationApprovalTypeNotSpecified', 'SubscriptionFeatureRegistrationApprovalTypeApprovalRequired', 'SubscriptionFeatureRegistrationApprovalTypeAutoApproval'
   644  	ApprovalType SubscriptionFeatureRegistrationApprovalType `json:"approvalType,omitempty"`
   645  	// ShouldFeatureDisplayInPortal - Indicates whether feature should be displayed in Portal.
   646  	ShouldFeatureDisplayInPortal *bool `json:"shouldFeatureDisplayInPortal,omitempty"`
   647  	// Description - The feature description.
   648  	Description *string `json:"description,omitempty"`
   649  }
   650  
   651  // MarshalJSON is the custom marshaler for SubscriptionFeatureRegistrationProperties.
   652  func (sfr SubscriptionFeatureRegistrationProperties) MarshalJSON() ([]byte, error) {
   653  	objectMap := make(map[string]interface{})
   654  	if sfr.State != "" {
   655  		objectMap["state"] = sfr.State
   656  	}
   657  	if sfr.AuthorizationProfile != nil {
   658  		objectMap["authorizationProfile"] = sfr.AuthorizationProfile
   659  	}
   660  	if sfr.Metadata != nil {
   661  		objectMap["metadata"] = sfr.Metadata
   662  	}
   663  	if sfr.ShouldFeatureDisplayInPortal != nil {
   664  		objectMap["shouldFeatureDisplayInPortal"] = sfr.ShouldFeatureDisplayInPortal
   665  	}
   666  	if sfr.Description != nil {
   667  		objectMap["description"] = sfr.Description
   668  	}
   669  	return json.Marshal(objectMap)
   670  }
   671  

View as plain text