...

Source file src/github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/2017-01-01/aad/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/2017-01-01/aad

     1  package aad
     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/domainservices/mgmt/2017-01-01/aad"
    22  
    23  // DomainSecuritySettings domain Security Settings
    24  type DomainSecuritySettings struct {
    25  	// NtlmV1 - A flag to determine whether or not NtlmV1 is enabled or disabled. Possible values include: 'NtlmV1Enabled', 'NtlmV1Disabled'
    26  	NtlmV1 NtlmV1 `json:"ntlmV1,omitempty"`
    27  	// TLSV1 - A flag to determine whether or not TlsV1 is enabled or disabled. Possible values include: 'TLSV1Enabled', 'TLSV1Disabled'
    28  	TLSV1 TLSV1 `json:"tlsV1,omitempty"`
    29  	// SyncNtlmPasswords - A flag to determine whether or not SyncNtlmPasswords is enabled or disabled. Possible values include: 'SyncNtlmPasswordsEnabled', 'SyncNtlmPasswordsDisabled'
    30  	SyncNtlmPasswords SyncNtlmPasswords `json:"syncNtlmPasswords,omitempty"`
    31  }
    32  
    33  // DomainService domain service.
    34  type DomainService struct {
    35  	autorest.Response `json:"-"`
    36  	// DomainServiceProperties - Domain service properties
    37  	*DomainServiceProperties `json:"properties,omitempty"`
    38  	// ID - READ-ONLY; Resource Id
    39  	ID *string `json:"id,omitempty"`
    40  	// Name - READ-ONLY; Resource name
    41  	Name *string `json:"name,omitempty"`
    42  	// Type - READ-ONLY; Resource type
    43  	Type *string `json:"type,omitempty"`
    44  	// Location - Resource location
    45  	Location *string `json:"location,omitempty"`
    46  	// Tags - Resource tags
    47  	Tags map[string]*string `json:"tags"`
    48  	// Etag - Resource etag
    49  	Etag *string `json:"etag,omitempty"`
    50  }
    51  
    52  // MarshalJSON is the custom marshaler for DomainService.
    53  func (ds DomainService) MarshalJSON() ([]byte, error) {
    54  	objectMap := make(map[string]interface{})
    55  	if ds.DomainServiceProperties != nil {
    56  		objectMap["properties"] = ds.DomainServiceProperties
    57  	}
    58  	if ds.Location != nil {
    59  		objectMap["location"] = ds.Location
    60  	}
    61  	if ds.Tags != nil {
    62  		objectMap["tags"] = ds.Tags
    63  	}
    64  	if ds.Etag != nil {
    65  		objectMap["etag"] = ds.Etag
    66  	}
    67  	return json.Marshal(objectMap)
    68  }
    69  
    70  // UnmarshalJSON is the custom unmarshaler for DomainService struct.
    71  func (ds *DomainService) UnmarshalJSON(body []byte) error {
    72  	var m map[string]*json.RawMessage
    73  	err := json.Unmarshal(body, &m)
    74  	if err != nil {
    75  		return err
    76  	}
    77  	for k, v := range m {
    78  		switch k {
    79  		case "properties":
    80  			if v != nil {
    81  				var domainServiceProperties DomainServiceProperties
    82  				err = json.Unmarshal(*v, &domainServiceProperties)
    83  				if err != nil {
    84  					return err
    85  				}
    86  				ds.DomainServiceProperties = &domainServiceProperties
    87  			}
    88  		case "id":
    89  			if v != nil {
    90  				var ID string
    91  				err = json.Unmarshal(*v, &ID)
    92  				if err != nil {
    93  					return err
    94  				}
    95  				ds.ID = &ID
    96  			}
    97  		case "name":
    98  			if v != nil {
    99  				var name string
   100  				err = json.Unmarshal(*v, &name)
   101  				if err != nil {
   102  					return err
   103  				}
   104  				ds.Name = &name
   105  			}
   106  		case "type":
   107  			if v != nil {
   108  				var typeVar string
   109  				err = json.Unmarshal(*v, &typeVar)
   110  				if err != nil {
   111  					return err
   112  				}
   113  				ds.Type = &typeVar
   114  			}
   115  		case "location":
   116  			if v != nil {
   117  				var location string
   118  				err = json.Unmarshal(*v, &location)
   119  				if err != nil {
   120  					return err
   121  				}
   122  				ds.Location = &location
   123  			}
   124  		case "tags":
   125  			if v != nil {
   126  				var tags map[string]*string
   127  				err = json.Unmarshal(*v, &tags)
   128  				if err != nil {
   129  					return err
   130  				}
   131  				ds.Tags = tags
   132  			}
   133  		case "etag":
   134  			if v != nil {
   135  				var etag string
   136  				err = json.Unmarshal(*v, &etag)
   137  				if err != nil {
   138  					return err
   139  				}
   140  				ds.Etag = &etag
   141  			}
   142  		}
   143  	}
   144  
   145  	return nil
   146  }
   147  
   148  // DomainServiceListResult the response from the List Domain Services operation.
   149  type DomainServiceListResult struct {
   150  	autorest.Response `json:"-"`
   151  	// Value - the list of domain services.
   152  	Value *[]DomainService `json:"value,omitempty"`
   153  	// NextLink - READ-ONLY; The continuation token for the next page of results.
   154  	NextLink *string `json:"nextLink,omitempty"`
   155  }
   156  
   157  // MarshalJSON is the custom marshaler for DomainServiceListResult.
   158  func (dslr DomainServiceListResult) MarshalJSON() ([]byte, error) {
   159  	objectMap := make(map[string]interface{})
   160  	if dslr.Value != nil {
   161  		objectMap["value"] = dslr.Value
   162  	}
   163  	return json.Marshal(objectMap)
   164  }
   165  
   166  // DomainServiceListResultIterator provides access to a complete listing of DomainService values.
   167  type DomainServiceListResultIterator struct {
   168  	i    int
   169  	page DomainServiceListResultPage
   170  }
   171  
   172  // NextWithContext advances to the next value.  If there was an error making
   173  // the request the iterator does not advance and the error is returned.
   174  func (iter *DomainServiceListResultIterator) NextWithContext(ctx context.Context) (err error) {
   175  	if tracing.IsEnabled() {
   176  		ctx = tracing.StartSpan(ctx, fqdn+"/DomainServiceListResultIterator.NextWithContext")
   177  		defer func() {
   178  			sc := -1
   179  			if iter.Response().Response.Response != nil {
   180  				sc = iter.Response().Response.Response.StatusCode
   181  			}
   182  			tracing.EndSpan(ctx, sc, err)
   183  		}()
   184  	}
   185  	iter.i++
   186  	if iter.i < len(iter.page.Values()) {
   187  		return nil
   188  	}
   189  	err = iter.page.NextWithContext(ctx)
   190  	if err != nil {
   191  		iter.i--
   192  		return err
   193  	}
   194  	iter.i = 0
   195  	return nil
   196  }
   197  
   198  // Next advances to the next value.  If there was an error making
   199  // the request the iterator does not advance and the error is returned.
   200  // Deprecated: Use NextWithContext() instead.
   201  func (iter *DomainServiceListResultIterator) Next() error {
   202  	return iter.NextWithContext(context.Background())
   203  }
   204  
   205  // NotDone returns true if the enumeration should be started or is not yet complete.
   206  func (iter DomainServiceListResultIterator) NotDone() bool {
   207  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   208  }
   209  
   210  // Response returns the raw server response from the last page request.
   211  func (iter DomainServiceListResultIterator) Response() DomainServiceListResult {
   212  	return iter.page.Response()
   213  }
   214  
   215  // Value returns the current value or a zero-initialized value if the
   216  // iterator has advanced beyond the end of the collection.
   217  func (iter DomainServiceListResultIterator) Value() DomainService {
   218  	if !iter.page.NotDone() {
   219  		return DomainService{}
   220  	}
   221  	return iter.page.Values()[iter.i]
   222  }
   223  
   224  // Creates a new instance of the DomainServiceListResultIterator type.
   225  func NewDomainServiceListResultIterator(page DomainServiceListResultPage) DomainServiceListResultIterator {
   226  	return DomainServiceListResultIterator{page: page}
   227  }
   228  
   229  // IsEmpty returns true if the ListResult contains no values.
   230  func (dslr DomainServiceListResult) IsEmpty() bool {
   231  	return dslr.Value == nil || len(*dslr.Value) == 0
   232  }
   233  
   234  // hasNextLink returns true if the NextLink is not empty.
   235  func (dslr DomainServiceListResult) hasNextLink() bool {
   236  	return dslr.NextLink != nil && len(*dslr.NextLink) != 0
   237  }
   238  
   239  // domainServiceListResultPreparer prepares a request to retrieve the next set of results.
   240  // It returns nil if no more results exist.
   241  func (dslr DomainServiceListResult) domainServiceListResultPreparer(ctx context.Context) (*http.Request, error) {
   242  	if !dslr.hasNextLink() {
   243  		return nil, nil
   244  	}
   245  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   246  		autorest.AsJSON(),
   247  		autorest.AsGet(),
   248  		autorest.WithBaseURL(to.String(dslr.NextLink)))
   249  }
   250  
   251  // DomainServiceListResultPage contains a page of DomainService values.
   252  type DomainServiceListResultPage struct {
   253  	fn   func(context.Context, DomainServiceListResult) (DomainServiceListResult, error)
   254  	dslr DomainServiceListResult
   255  }
   256  
   257  // NextWithContext advances to the next page of values.  If there was an error making
   258  // the request the page does not advance and the error is returned.
   259  func (page *DomainServiceListResultPage) NextWithContext(ctx context.Context) (err error) {
   260  	if tracing.IsEnabled() {
   261  		ctx = tracing.StartSpan(ctx, fqdn+"/DomainServiceListResultPage.NextWithContext")
   262  		defer func() {
   263  			sc := -1
   264  			if page.Response().Response.Response != nil {
   265  				sc = page.Response().Response.Response.StatusCode
   266  			}
   267  			tracing.EndSpan(ctx, sc, err)
   268  		}()
   269  	}
   270  	for {
   271  		next, err := page.fn(ctx, page.dslr)
   272  		if err != nil {
   273  			return err
   274  		}
   275  		page.dslr = next
   276  		if !next.hasNextLink() || !next.IsEmpty() {
   277  			break
   278  		}
   279  	}
   280  	return nil
   281  }
   282  
   283  // Next advances to the next page of values.  If there was an error making
   284  // the request the page does not advance and the error is returned.
   285  // Deprecated: Use NextWithContext() instead.
   286  func (page *DomainServiceListResultPage) Next() error {
   287  	return page.NextWithContext(context.Background())
   288  }
   289  
   290  // NotDone returns true if the page enumeration should be started or is not yet complete.
   291  func (page DomainServiceListResultPage) NotDone() bool {
   292  	return !page.dslr.IsEmpty()
   293  }
   294  
   295  // Response returns the raw server response from the last page request.
   296  func (page DomainServiceListResultPage) Response() DomainServiceListResult {
   297  	return page.dslr
   298  }
   299  
   300  // Values returns the slice of values for the current page or nil if there are no values.
   301  func (page DomainServiceListResultPage) Values() []DomainService {
   302  	if page.dslr.IsEmpty() {
   303  		return nil
   304  	}
   305  	return *page.dslr.Value
   306  }
   307  
   308  // Creates a new instance of the DomainServiceListResultPage type.
   309  func NewDomainServiceListResultPage(cur DomainServiceListResult, getNextPage func(context.Context, DomainServiceListResult) (DomainServiceListResult, error)) DomainServiceListResultPage {
   310  	return DomainServiceListResultPage{
   311  		fn:   getNextPage,
   312  		dslr: cur,
   313  	}
   314  }
   315  
   316  // DomainServiceProperties properties of the Domain Service.
   317  type DomainServiceProperties struct {
   318  	// TenantID - READ-ONLY; Azure Active Directory tenant id
   319  	TenantID *string `json:"tenantId,omitempty"`
   320  	// DomainName - The name of the Azure domain that the user would like to deploy Domain Services to.
   321  	DomainName *string `json:"domainName,omitempty"`
   322  	// DeploymentID - READ-ONLY; Deployment Id
   323  	DeploymentID *string `json:"deploymentId,omitempty"`
   324  	// VnetSiteID - READ-ONLY; Virtual network site id
   325  	VnetSiteID *string `json:"vnetSiteId,omitempty"`
   326  	// SubnetID - The name of the virtual network that Domain Services will be deployed on. The id of the subnet that Domain Services will be deployed on. /virtualNetwork/vnetName/subnets/subnetName.
   327  	SubnetID *string `json:"subnetId,omitempty"`
   328  	// LdapsSettings - Secure LDAP Settings
   329  	LdapsSettings *LdapsSettings `json:"ldapsSettings,omitempty"`
   330  	// HealthLastEvaluated - READ-ONLY; Last domain evaluation run DateTime
   331  	HealthLastEvaluated *date.TimeRFC1123 `json:"healthLastEvaluated,omitempty"`
   332  	// HealthMonitors - READ-ONLY; List of Domain Health Monitors
   333  	HealthMonitors *[]HealthMonitor `json:"healthMonitors,omitempty"`
   334  	// HealthAlerts - READ-ONLY; List of Domain Health Alerts
   335  	HealthAlerts *[]HealthAlert `json:"healthAlerts,omitempty"`
   336  	// NotificationSettings - Notification Settings
   337  	NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"`
   338  	// DomainSecuritySettings - DomainSecurity Settings
   339  	DomainSecuritySettings *DomainSecuritySettings `json:"domainSecuritySettings,omitempty"`
   340  	// FilteredSync - Enabled or Disabled flag to turn on Group-based filtered sync. Possible values include: 'FilteredSyncEnabled', 'FilteredSyncDisabled'
   341  	FilteredSync FilteredSync `json:"filteredSync,omitempty"`
   342  	// DomainControllerIPAddress - READ-ONLY; List of Domain Controller IP Address
   343  	DomainControllerIPAddress *[]string `json:"domainControllerIpAddress,omitempty"`
   344  	// ServiceStatus - READ-ONLY; Status of Domain Service instance
   345  	ServiceStatus *string `json:"serviceStatus,omitempty"`
   346  	// ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response.
   347  	ProvisioningState *string `json:"provisioningState,omitempty"`
   348  }
   349  
   350  // MarshalJSON is the custom marshaler for DomainServiceProperties.
   351  func (dsp DomainServiceProperties) MarshalJSON() ([]byte, error) {
   352  	objectMap := make(map[string]interface{})
   353  	if dsp.DomainName != nil {
   354  		objectMap["domainName"] = dsp.DomainName
   355  	}
   356  	if dsp.SubnetID != nil {
   357  		objectMap["subnetId"] = dsp.SubnetID
   358  	}
   359  	if dsp.LdapsSettings != nil {
   360  		objectMap["ldapsSettings"] = dsp.LdapsSettings
   361  	}
   362  	if dsp.NotificationSettings != nil {
   363  		objectMap["notificationSettings"] = dsp.NotificationSettings
   364  	}
   365  	if dsp.DomainSecuritySettings != nil {
   366  		objectMap["domainSecuritySettings"] = dsp.DomainSecuritySettings
   367  	}
   368  	if dsp.FilteredSync != "" {
   369  		objectMap["filteredSync"] = dsp.FilteredSync
   370  	}
   371  	return json.Marshal(objectMap)
   372  }
   373  
   374  // DomainServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
   375  // long-running operation.
   376  type DomainServicesCreateOrUpdateFuture struct {
   377  	azure.FutureAPI
   378  	// Result returns the result of the asynchronous operation.
   379  	// If the operation has not completed it will return an error.
   380  	Result func(DomainServicesClient) (DomainService, error)
   381  }
   382  
   383  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   384  func (future *DomainServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
   385  	var azFuture azure.Future
   386  	if err := json.Unmarshal(body, &azFuture); err != nil {
   387  		return err
   388  	}
   389  	future.FutureAPI = &azFuture
   390  	future.Result = future.result
   391  	return nil
   392  }
   393  
   394  // result is the default implementation for DomainServicesCreateOrUpdateFuture.Result.
   395  func (future *DomainServicesCreateOrUpdateFuture) result(client DomainServicesClient) (ds DomainService, err error) {
   396  	var done bool
   397  	done, err = future.DoneWithContext(context.Background(), client)
   398  	if err != nil {
   399  		err = autorest.NewErrorWithError(err, "aad.DomainServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
   400  		return
   401  	}
   402  	if !done {
   403  		ds.Response.Response = future.Response()
   404  		err = azure.NewAsyncOpIncompleteError("aad.DomainServicesCreateOrUpdateFuture")
   405  		return
   406  	}
   407  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   408  	if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent {
   409  		ds, err = client.CreateOrUpdateResponder(ds.Response.Response)
   410  		if err != nil {
   411  			err = autorest.NewErrorWithError(err, "aad.DomainServicesCreateOrUpdateFuture", "Result", ds.Response.Response, "Failure responding to request")
   412  		}
   413  	}
   414  	return
   415  }
   416  
   417  // DomainServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
   418  // operation.
   419  type DomainServicesDeleteFuture struct {
   420  	azure.FutureAPI
   421  	// Result returns the result of the asynchronous operation.
   422  	// If the operation has not completed it will return an error.
   423  	Result func(DomainServicesClient) (autorest.Response, error)
   424  }
   425  
   426  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   427  func (future *DomainServicesDeleteFuture) UnmarshalJSON(body []byte) error {
   428  	var azFuture azure.Future
   429  	if err := json.Unmarshal(body, &azFuture); err != nil {
   430  		return err
   431  	}
   432  	future.FutureAPI = &azFuture
   433  	future.Result = future.result
   434  	return nil
   435  }
   436  
   437  // result is the default implementation for DomainServicesDeleteFuture.Result.
   438  func (future *DomainServicesDeleteFuture) result(client DomainServicesClient) (ar autorest.Response, err error) {
   439  	var done bool
   440  	done, err = future.DoneWithContext(context.Background(), client)
   441  	if err != nil {
   442  		err = autorest.NewErrorWithError(err, "aad.DomainServicesDeleteFuture", "Result", future.Response(), "Polling failure")
   443  		return
   444  	}
   445  	if !done {
   446  		ar.Response = future.Response()
   447  		err = azure.NewAsyncOpIncompleteError("aad.DomainServicesDeleteFuture")
   448  		return
   449  	}
   450  	ar.Response = future.Response()
   451  	return
   452  }
   453  
   454  // DomainServicesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
   455  // operation.
   456  type DomainServicesUpdateFuture struct {
   457  	azure.FutureAPI
   458  	// Result returns the result of the asynchronous operation.
   459  	// If the operation has not completed it will return an error.
   460  	Result func(DomainServicesClient) (DomainService, error)
   461  }
   462  
   463  // UnmarshalJSON is the custom unmarshaller for CreateFuture.
   464  func (future *DomainServicesUpdateFuture) UnmarshalJSON(body []byte) error {
   465  	var azFuture azure.Future
   466  	if err := json.Unmarshal(body, &azFuture); err != nil {
   467  		return err
   468  	}
   469  	future.FutureAPI = &azFuture
   470  	future.Result = future.result
   471  	return nil
   472  }
   473  
   474  // result is the default implementation for DomainServicesUpdateFuture.Result.
   475  func (future *DomainServicesUpdateFuture) result(client DomainServicesClient) (ds DomainService, err error) {
   476  	var done bool
   477  	done, err = future.DoneWithContext(context.Background(), client)
   478  	if err != nil {
   479  		err = autorest.NewErrorWithError(err, "aad.DomainServicesUpdateFuture", "Result", future.Response(), "Polling failure")
   480  		return
   481  	}
   482  	if !done {
   483  		ds.Response.Response = future.Response()
   484  		err = azure.NewAsyncOpIncompleteError("aad.DomainServicesUpdateFuture")
   485  		return
   486  	}
   487  	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
   488  	if ds.Response.Response, err = future.GetResult(sender); err == nil && ds.Response.Response.StatusCode != http.StatusNoContent {
   489  		ds, err = client.UpdateResponder(ds.Response.Response)
   490  		if err != nil {
   491  			err = autorest.NewErrorWithError(err, "aad.DomainServicesUpdateFuture", "Result", ds.Response.Response, "Failure responding to request")
   492  		}
   493  	}
   494  	return
   495  }
   496  
   497  // HealthAlert health Alert Description
   498  type HealthAlert struct {
   499  	// ID - READ-ONLY; Health Alert Id
   500  	ID *string `json:"id,omitempty"`
   501  	// Name - READ-ONLY; Health Alert Name
   502  	Name *string `json:"name,omitempty"`
   503  	// Issue - READ-ONLY; Health Alert Issue
   504  	Issue *string `json:"issue,omitempty"`
   505  	// Severity - READ-ONLY; Health Alert Severity
   506  	Severity *string `json:"severity,omitempty"`
   507  	// Raised - READ-ONLY; Health Alert Raised DateTime
   508  	Raised *date.Time `json:"raised,omitempty"`
   509  	// LastDetected - READ-ONLY; Health Alert Last Detected DateTime
   510  	LastDetected *date.Time `json:"lastDetected,omitempty"`
   511  	// ResolutionURI - READ-ONLY; Health Alert TSG Link
   512  	ResolutionURI *string `json:"resolutionUri,omitempty"`
   513  }
   514  
   515  // MarshalJSON is the custom marshaler for HealthAlert.
   516  func (ha HealthAlert) MarshalJSON() ([]byte, error) {
   517  	objectMap := make(map[string]interface{})
   518  	return json.Marshal(objectMap)
   519  }
   520  
   521  // HealthMonitor health Monitor Description
   522  type HealthMonitor struct {
   523  	// ID - READ-ONLY; Health Monitor Id
   524  	ID *string `json:"id,omitempty"`
   525  	// Name - READ-ONLY; Health Monitor Name
   526  	Name *string `json:"name,omitempty"`
   527  	// Details - READ-ONLY; Health Monitor Details
   528  	Details *string `json:"details,omitempty"`
   529  }
   530  
   531  // MarshalJSON is the custom marshaler for HealthMonitor.
   532  func (hm HealthMonitor) MarshalJSON() ([]byte, error) {
   533  	objectMap := make(map[string]interface{})
   534  	return json.Marshal(objectMap)
   535  }
   536  
   537  // LdapsSettings secure LDAP Settings
   538  type LdapsSettings struct {
   539  	// Ldaps - A flag to determine whether or not Secure LDAP is enabled or disabled. Possible values include: 'LdapsEnabled', 'LdapsDisabled'
   540  	Ldaps Ldaps `json:"ldaps,omitempty"`
   541  	// PfxCertificate - The certificate required to configure Secure LDAP. The parameter passed here should be a base64encoded representation of the certificate pfx file.
   542  	PfxCertificate *string `json:"pfxCertificate,omitempty"`
   543  	// PfxCertificatePassword - The password to decrypt the provided Secure LDAP certificate pfx file.
   544  	PfxCertificatePassword *string `json:"pfxCertificatePassword,omitempty"`
   545  	// PublicCertificate - READ-ONLY; Public certificate used to configure secure ldap.
   546  	PublicCertificate *string `json:"publicCertificate,omitempty"`
   547  	// CertificateThumbprint - READ-ONLY; Thumbprint of configure ldaps certificate.
   548  	CertificateThumbprint *string `json:"certificateThumbprint,omitempty"`
   549  	// CertificateNotAfter - READ-ONLY; NotAfter DateTime of configure ldaps certificate.
   550  	CertificateNotAfter *date.Time `json:"certificateNotAfter,omitempty"`
   551  	// ExternalAccess - A flag to determine whether or not Secure LDAP access over the internet is enabled or disabled. Possible values include: 'Enabled', 'Disabled'
   552  	ExternalAccess ExternalAccess `json:"externalAccess,omitempty"`
   553  	// ExternalAccessIPAddress - READ-ONLY; External access ip address.
   554  	ExternalAccessIPAddress *string `json:"externalAccessIpAddress,omitempty"`
   555  }
   556  
   557  // MarshalJSON is the custom marshaler for LdapsSettings.
   558  func (ls LdapsSettings) MarshalJSON() ([]byte, error) {
   559  	objectMap := make(map[string]interface{})
   560  	if ls.Ldaps != "" {
   561  		objectMap["ldaps"] = ls.Ldaps
   562  	}
   563  	if ls.PfxCertificate != nil {
   564  		objectMap["pfxCertificate"] = ls.PfxCertificate
   565  	}
   566  	if ls.PfxCertificatePassword != nil {
   567  		objectMap["pfxCertificatePassword"] = ls.PfxCertificatePassword
   568  	}
   569  	if ls.ExternalAccess != "" {
   570  		objectMap["externalAccess"] = ls.ExternalAccess
   571  	}
   572  	return json.Marshal(objectMap)
   573  }
   574  
   575  // NotificationSettings settings for notification
   576  type NotificationSettings struct {
   577  	// NotifyGlobalAdmins - Should global admins be notified. Possible values include: 'NotifyGlobalAdminsEnabled', 'NotifyGlobalAdminsDisabled'
   578  	NotifyGlobalAdmins NotifyGlobalAdmins `json:"notifyGlobalAdmins,omitempty"`
   579  	// NotifyDcAdmins - Should domain controller admins be notified. Possible values include: 'NotifyDcAdminsEnabled', 'NotifyDcAdminsDisabled'
   580  	NotifyDcAdmins NotifyDcAdmins `json:"notifyDcAdmins,omitempty"`
   581  	// AdditionalRecipients - The list of additional recipients
   582  	AdditionalRecipients *[]string `json:"additionalRecipients,omitempty"`
   583  }
   584  
   585  // OperationDisplayInfo the operation supported by Domain Services.
   586  type OperationDisplayInfo struct {
   587  	// Description - The description of the operation.
   588  	Description *string `json:"description,omitempty"`
   589  	// Operation - The action that users can perform, based on their permission level.
   590  	Operation *string `json:"operation,omitempty"`
   591  	// Provider - Service provider: Domain Services.
   592  	Provider *string `json:"provider,omitempty"`
   593  	// Resource - Resource on which the operation is performed.
   594  	Resource *string `json:"resource,omitempty"`
   595  }
   596  
   597  // OperationEntity the operation supported by Domain Services.
   598  type OperationEntity struct {
   599  	// Name - Operation name: {provider}/{resource}/{operation}.
   600  	Name *string `json:"name,omitempty"`
   601  	// Display - The operation supported by Domain Services.
   602  	Display *OperationDisplayInfo `json:"display,omitempty"`
   603  	// Origin - The origin of the operation.
   604  	Origin *string `json:"origin,omitempty"`
   605  }
   606  
   607  // OperationEntityListResult the list of domain service operation response.
   608  type OperationEntityListResult struct {
   609  	autorest.Response `json:"-"`
   610  	// Value - The list of operations.
   611  	Value *[]OperationEntity `json:"value,omitempty"`
   612  	// NextLink - READ-ONLY; The continuation token for the next page of results.
   613  	NextLink *string `json:"nextLink,omitempty"`
   614  }
   615  
   616  // MarshalJSON is the custom marshaler for OperationEntityListResult.
   617  func (oelr OperationEntityListResult) MarshalJSON() ([]byte, error) {
   618  	objectMap := make(map[string]interface{})
   619  	if oelr.Value != nil {
   620  		objectMap["value"] = oelr.Value
   621  	}
   622  	return json.Marshal(objectMap)
   623  }
   624  
   625  // OperationEntityListResultIterator provides access to a complete listing of OperationEntity values.
   626  type OperationEntityListResultIterator struct {
   627  	i    int
   628  	page OperationEntityListResultPage
   629  }
   630  
   631  // NextWithContext advances to the next value.  If there was an error making
   632  // the request the iterator does not advance and the error is returned.
   633  func (iter *OperationEntityListResultIterator) NextWithContext(ctx context.Context) (err error) {
   634  	if tracing.IsEnabled() {
   635  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultIterator.NextWithContext")
   636  		defer func() {
   637  			sc := -1
   638  			if iter.Response().Response.Response != nil {
   639  				sc = iter.Response().Response.Response.StatusCode
   640  			}
   641  			tracing.EndSpan(ctx, sc, err)
   642  		}()
   643  	}
   644  	iter.i++
   645  	if iter.i < len(iter.page.Values()) {
   646  		return nil
   647  	}
   648  	err = iter.page.NextWithContext(ctx)
   649  	if err != nil {
   650  		iter.i--
   651  		return err
   652  	}
   653  	iter.i = 0
   654  	return nil
   655  }
   656  
   657  // Next advances to the next value.  If there was an error making
   658  // the request the iterator does not advance and the error is returned.
   659  // Deprecated: Use NextWithContext() instead.
   660  func (iter *OperationEntityListResultIterator) Next() error {
   661  	return iter.NextWithContext(context.Background())
   662  }
   663  
   664  // NotDone returns true if the enumeration should be started or is not yet complete.
   665  func (iter OperationEntityListResultIterator) NotDone() bool {
   666  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   667  }
   668  
   669  // Response returns the raw server response from the last page request.
   670  func (iter OperationEntityListResultIterator) Response() OperationEntityListResult {
   671  	return iter.page.Response()
   672  }
   673  
   674  // Value returns the current value or a zero-initialized value if the
   675  // iterator has advanced beyond the end of the collection.
   676  func (iter OperationEntityListResultIterator) Value() OperationEntity {
   677  	if !iter.page.NotDone() {
   678  		return OperationEntity{}
   679  	}
   680  	return iter.page.Values()[iter.i]
   681  }
   682  
   683  // Creates a new instance of the OperationEntityListResultIterator type.
   684  func NewOperationEntityListResultIterator(page OperationEntityListResultPage) OperationEntityListResultIterator {
   685  	return OperationEntityListResultIterator{page: page}
   686  }
   687  
   688  // IsEmpty returns true if the ListResult contains no values.
   689  func (oelr OperationEntityListResult) IsEmpty() bool {
   690  	return oelr.Value == nil || len(*oelr.Value) == 0
   691  }
   692  
   693  // hasNextLink returns true if the NextLink is not empty.
   694  func (oelr OperationEntityListResult) hasNextLink() bool {
   695  	return oelr.NextLink != nil && len(*oelr.NextLink) != 0
   696  }
   697  
   698  // operationEntityListResultPreparer prepares a request to retrieve the next set of results.
   699  // It returns nil if no more results exist.
   700  func (oelr OperationEntityListResult) operationEntityListResultPreparer(ctx context.Context) (*http.Request, error) {
   701  	if !oelr.hasNextLink() {
   702  		return nil, nil
   703  	}
   704  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   705  		autorest.AsJSON(),
   706  		autorest.AsGet(),
   707  		autorest.WithBaseURL(to.String(oelr.NextLink)))
   708  }
   709  
   710  // OperationEntityListResultPage contains a page of OperationEntity values.
   711  type OperationEntityListResultPage struct {
   712  	fn   func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)
   713  	oelr OperationEntityListResult
   714  }
   715  
   716  // NextWithContext advances to the next page of values.  If there was an error making
   717  // the request the page does not advance and the error is returned.
   718  func (page *OperationEntityListResultPage) NextWithContext(ctx context.Context) (err error) {
   719  	if tracing.IsEnabled() {
   720  		ctx = tracing.StartSpan(ctx, fqdn+"/OperationEntityListResultPage.NextWithContext")
   721  		defer func() {
   722  			sc := -1
   723  			if page.Response().Response.Response != nil {
   724  				sc = page.Response().Response.Response.StatusCode
   725  			}
   726  			tracing.EndSpan(ctx, sc, err)
   727  		}()
   728  	}
   729  	for {
   730  		next, err := page.fn(ctx, page.oelr)
   731  		if err != nil {
   732  			return err
   733  		}
   734  		page.oelr = next
   735  		if !next.hasNextLink() || !next.IsEmpty() {
   736  			break
   737  		}
   738  	}
   739  	return nil
   740  }
   741  
   742  // Next advances to the next page of values.  If there was an error making
   743  // the request the page does not advance and the error is returned.
   744  // Deprecated: Use NextWithContext() instead.
   745  func (page *OperationEntityListResultPage) Next() error {
   746  	return page.NextWithContext(context.Background())
   747  }
   748  
   749  // NotDone returns true if the page enumeration should be started or is not yet complete.
   750  func (page OperationEntityListResultPage) NotDone() bool {
   751  	return !page.oelr.IsEmpty()
   752  }
   753  
   754  // Response returns the raw server response from the last page request.
   755  func (page OperationEntityListResultPage) Response() OperationEntityListResult {
   756  	return page.oelr
   757  }
   758  
   759  // Values returns the slice of values for the current page or nil if there are no values.
   760  func (page OperationEntityListResultPage) Values() []OperationEntity {
   761  	if page.oelr.IsEmpty() {
   762  		return nil
   763  	}
   764  	return *page.oelr.Value
   765  }
   766  
   767  // Creates a new instance of the OperationEntityListResultPage type.
   768  func NewOperationEntityListResultPage(cur OperationEntityListResult, getNextPage func(context.Context, OperationEntityListResult) (OperationEntityListResult, error)) OperationEntityListResultPage {
   769  	return OperationEntityListResultPage{
   770  		fn:   getNextPage,
   771  		oelr: cur,
   772  	}
   773  }
   774  
   775  // Resource the Resource model definition.
   776  type Resource struct {
   777  	// ID - READ-ONLY; Resource Id
   778  	ID *string `json:"id,omitempty"`
   779  	// Name - READ-ONLY; Resource name
   780  	Name *string `json:"name,omitempty"`
   781  	// Type - READ-ONLY; Resource type
   782  	Type *string `json:"type,omitempty"`
   783  	// Location - Resource location
   784  	Location *string `json:"location,omitempty"`
   785  	// Tags - Resource tags
   786  	Tags map[string]*string `json:"tags"`
   787  	// Etag - Resource etag
   788  	Etag *string `json:"etag,omitempty"`
   789  }
   790  
   791  // MarshalJSON is the custom marshaler for Resource.
   792  func (r Resource) MarshalJSON() ([]byte, error) {
   793  	objectMap := make(map[string]interface{})
   794  	if r.Location != nil {
   795  		objectMap["location"] = r.Location
   796  	}
   797  	if r.Tags != nil {
   798  		objectMap["tags"] = r.Tags
   799  	}
   800  	if r.Etag != nil {
   801  		objectMap["etag"] = r.Etag
   802  	}
   803  	return json.Marshal(objectMap)
   804  }
   805  

View as plain text