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