1package databricks
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
9import (
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	"github.com/gofrs/uuid"
18	"net/http"
19)
20
21// The package's fully qualified name.
22const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/databricks/mgmt/2021-04-01-preview/databricks"
23
24// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the
25// virtual network.
26type AddressSpace struct {
27	// AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation.
28	AddressPrefixes *[]string `json:"addressPrefixes,omitempty"`
29}
30
31// CreatedBy provides details of the entity that created/updated the workspace.
32type CreatedBy struct {
33	// Oid - READ-ONLY; The Object ID that created the workspace.
34	Oid *uuid.UUID `json:"oid,omitempty"`
35	// Puid - READ-ONLY; The Personal Object ID corresponding to the object ID above
36	Puid *string `json:"puid,omitempty"`
37	// ApplicationID - READ-ONLY; The application ID of the application that initiated the creation of the workspace. For example, Azure Portal.
38	ApplicationID *uuid.UUID `json:"applicationId,omitempty"`
39}
40
41// MarshalJSON is the custom marshaler for CreatedBy.
42func (cb CreatedBy) MarshalJSON() ([]byte, error) {
43	objectMap := make(map[string]interface{})
44	return json.Marshal(objectMap)
45}
46
47// Encryption the object that contains details of encryption used on the workspace.
48type Encryption struct {
49	// KeySource - The encryption keySource (provider). Possible values (case-insensitive):  Default, Microsoft.Keyvault. Possible values include: 'KeySourceDefault', 'KeySourceMicrosoftKeyvault'
50	KeySource KeySource `json:"keySource,omitempty"`
51	// KeyName - The name of KeyVault key.
52	KeyName *string `json:"KeyName,omitempty"`
53	// KeyVersion - The version of KeyVault key.
54	KeyVersion *string `json:"keyversion,omitempty"`
55	// KeyVaultURI - The Uri of KeyVault.
56	KeyVaultURI *string `json:"keyvaulturi,omitempty"`
57}
58
59// EncryptionEntitiesDefinition encryption entities for databricks workspace resource.
60type EncryptionEntitiesDefinition struct {
61	// ManagedServices - Encryption properties for the databricks managed services.
62	ManagedServices *EncryptionV2 `json:"managedServices,omitempty"`
63}
64
65// EncryptionV2 the object that contains details of encryption used on the workspace.
66type EncryptionV2 struct {
67	// KeySource - The encryption keySource (provider). Possible values (case-insensitive):  Microsoft.Keyvault
68	KeySource *string `json:"keySource,omitempty"`
69	// KeyVaultProperties - Key Vault input properties for encryption.
70	KeyVaultProperties *EncryptionV2KeyVaultProperties `json:"keyVaultProperties,omitempty"`
71}
72
73// EncryptionV2KeyVaultProperties key Vault input properties for encryption.
74type EncryptionV2KeyVaultProperties struct {
75	// KeyVaultURI - The Uri of KeyVault.
76	KeyVaultURI *string `json:"keyVaultUri,omitempty"`
77	// KeyName - The name of KeyVault key.
78	KeyName *string `json:"keyName,omitempty"`
79	// KeyVersion - The version of KeyVault key.
80	KeyVersion *string `json:"keyVersion,omitempty"`
81}
82
83// ErrorDetail ...
84type ErrorDetail struct {
85	// Code - The error's code.
86	Code *string `json:"code,omitempty"`
87	// Message - A human readable error message.
88	Message *string `json:"message,omitempty"`
89	// Target - Indicates which property in the request is responsible for the error.
90	Target *string `json:"target,omitempty"`
91}
92
93// ErrorInfo ...
94type ErrorInfo struct {
95	// Code - A machine readable error code.
96	Code *string `json:"code,omitempty"`
97	// Message - A human readable error message.
98	Message *string `json:"message,omitempty"`
99	// Details - error details.
100	Details *[]ErrorDetail `json:"details,omitempty"`
101	// Innererror - Inner error details if they exist.
102	Innererror *string `json:"innererror,omitempty"`
103}
104
105// ErrorResponse contains details when the response code indicates an error.
106type ErrorResponse struct {
107	// Error - The error details.
108	Error *ErrorInfo `json:"error,omitempty"`
109}
110
111// GroupIDInformation the group information for creating a private endpoint on a workspace
112type GroupIDInformation struct {
113	autorest.Response `json:"-"`
114	// Properties - The group id properties.
115	Properties *GroupIDInformationProperties `json:"properties,omitempty"`
116	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
117	ID *string `json:"id,omitempty"`
118	// Name - READ-ONLY; The name of the resource
119	Name *string `json:"name,omitempty"`
120	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
121	Type *string `json:"type,omitempty"`
122}
123
124// MarshalJSON is the custom marshaler for GroupIDInformation.
125func (gii GroupIDInformation) MarshalJSON() ([]byte, error) {
126	objectMap := make(map[string]interface{})
127	if gii.Properties != nil {
128		objectMap["properties"] = gii.Properties
129	}
130	return json.Marshal(objectMap)
131}
132
133// GroupIDInformationProperties the properties for a group information object
134type GroupIDInformationProperties struct {
135	// GroupID - The group id
136	GroupID *string `json:"groupId,omitempty"`
137	// RequiredMembers - The required members for a specific group id
138	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
139	// RequiredZoneNames - The required DNS zones for a specific group id
140	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
141}
142
143// ManagedIdentityConfiguration the Managed Identity details for storage account.
144type ManagedIdentityConfiguration struct {
145	// PrincipalID - READ-ONLY; The objectId of the Managed Identity that is linked to the Managed Storage account.
146	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
147	// TenantID - READ-ONLY; The tenant Id where the Managed Identity is created.
148	TenantID *uuid.UUID `json:"tenantId,omitempty"`
149	// Type - READ-ONLY; The type of Identity created. It can be either SystemAssigned or UserAssigned.
150	Type *string `json:"type,omitempty"`
151}
152
153// MarshalJSON is the custom marshaler for ManagedIdentityConfiguration.
154func (mic ManagedIdentityConfiguration) MarshalJSON() ([]byte, error) {
155	objectMap := make(map[string]interface{})
156	return json.Marshal(objectMap)
157}
158
159// Operation REST API operation
160type Operation struct {
161	// Name - Operation name: {provider}/{resource}/{operation}
162	Name *string `json:"name,omitempty"`
163	// Display - The object that represents the operation.
164	Display *OperationDisplay `json:"display,omitempty"`
165}
166
167// OperationDisplay the object that represents the operation.
168type OperationDisplay struct {
169	// Provider - Service provider: Microsoft.ResourceProvider
170	Provider *string `json:"provider,omitempty"`
171	// Resource - Resource on which the operation is performed.
172	Resource *string `json:"resource,omitempty"`
173	// Operation - Operation type: Read, write, delete, etc.
174	Operation *string `json:"operation,omitempty"`
175}
176
177// OperationListResult result of the request to list Resource Provider operations. It contains a list of
178// operations and a URL link to get the next set of results.
179type OperationListResult struct {
180	autorest.Response `json:"-"`
181	// Value - List of Resource Provider operations supported by the Resource Provider resource provider.
182	Value *[]Operation `json:"value,omitempty"`
183	// NextLink - URL to get the next set of operation list results if there are any.
184	NextLink *string `json:"nextLink,omitempty"`
185}
186
187// OperationListResultIterator provides access to a complete listing of Operation values.
188type OperationListResultIterator struct {
189	i    int
190	page OperationListResultPage
191}
192
193// NextWithContext advances to the next value.  If there was an error making
194// the request the iterator does not advance and the error is returned.
195func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
196	if tracing.IsEnabled() {
197		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
198		defer func() {
199			sc := -1
200			if iter.Response().Response.Response != nil {
201				sc = iter.Response().Response.Response.StatusCode
202			}
203			tracing.EndSpan(ctx, sc, err)
204		}()
205	}
206	iter.i++
207	if iter.i < len(iter.page.Values()) {
208		return nil
209	}
210	err = iter.page.NextWithContext(ctx)
211	if err != nil {
212		iter.i--
213		return err
214	}
215	iter.i = 0
216	return nil
217}
218
219// Next advances to the next value.  If there was an error making
220// the request the iterator does not advance and the error is returned.
221// Deprecated: Use NextWithContext() instead.
222func (iter *OperationListResultIterator) Next() error {
223	return iter.NextWithContext(context.Background())
224}
225
226// NotDone returns true if the enumeration should be started or is not yet complete.
227func (iter OperationListResultIterator) NotDone() bool {
228	return iter.page.NotDone() && iter.i < len(iter.page.Values())
229}
230
231// Response returns the raw server response from the last page request.
232func (iter OperationListResultIterator) Response() OperationListResult {
233	return iter.page.Response()
234}
235
236// Value returns the current value or a zero-initialized value if the
237// iterator has advanced beyond the end of the collection.
238func (iter OperationListResultIterator) Value() Operation {
239	if !iter.page.NotDone() {
240		return Operation{}
241	}
242	return iter.page.Values()[iter.i]
243}
244
245// Creates a new instance of the OperationListResultIterator type.
246func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
247	return OperationListResultIterator{page: page}
248}
249
250// IsEmpty returns true if the ListResult contains no values.
251func (olr OperationListResult) IsEmpty() bool {
252	return olr.Value == nil || len(*olr.Value) == 0
253}
254
255// hasNextLink returns true if the NextLink is not empty.
256func (olr OperationListResult) hasNextLink() bool {
257	return olr.NextLink != nil && len(*olr.NextLink) != 0
258}
259
260// operationListResultPreparer prepares a request to retrieve the next set of results.
261// It returns nil if no more results exist.
262func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
263	if !olr.hasNextLink() {
264		return nil, nil
265	}
266	return autorest.Prepare((&http.Request{}).WithContext(ctx),
267		autorest.AsJSON(),
268		autorest.AsGet(),
269		autorest.WithBaseURL(to.String(olr.NextLink)))
270}
271
272// OperationListResultPage contains a page of Operation values.
273type OperationListResultPage struct {
274	fn  func(context.Context, OperationListResult) (OperationListResult, error)
275	olr OperationListResult
276}
277
278// NextWithContext advances to the next page of values.  If there was an error making
279// the request the page does not advance and the error is returned.
280func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
281	if tracing.IsEnabled() {
282		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
283		defer func() {
284			sc := -1
285			if page.Response().Response.Response != nil {
286				sc = page.Response().Response.Response.StatusCode
287			}
288			tracing.EndSpan(ctx, sc, err)
289		}()
290	}
291	for {
292		next, err := page.fn(ctx, page.olr)
293		if err != nil {
294			return err
295		}
296		page.olr = next
297		if !next.hasNextLink() || !next.IsEmpty() {
298			break
299		}
300	}
301	return nil
302}
303
304// Next advances to the next page of values.  If there was an error making
305// the request the page does not advance and the error is returned.
306// Deprecated: Use NextWithContext() instead.
307func (page *OperationListResultPage) Next() error {
308	return page.NextWithContext(context.Background())
309}
310
311// NotDone returns true if the page enumeration should be started or is not yet complete.
312func (page OperationListResultPage) NotDone() bool {
313	return !page.olr.IsEmpty()
314}
315
316// Response returns the raw server response from the last page request.
317func (page OperationListResultPage) Response() OperationListResult {
318	return page.olr
319}
320
321// Values returns the slice of values for the current page or nil if there are no values.
322func (page OperationListResultPage) Values() []Operation {
323	if page.olr.IsEmpty() {
324		return nil
325	}
326	return *page.olr.Value
327}
328
329// Creates a new instance of the OperationListResultPage type.
330func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
331	return OperationListResultPage{
332		fn:  getNextPage,
333		olr: cur,
334	}
335}
336
337// PrivateEndpoint the private endpoint property of a private endpoint connection
338type PrivateEndpoint struct {
339	// ID - READ-ONLY; The resource identifier.
340	ID *string `json:"id,omitempty"`
341}
342
343// MarshalJSON is the custom marshaler for PrivateEndpoint.
344func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
345	objectMap := make(map[string]interface{})
346	return json.Marshal(objectMap)
347}
348
349// PrivateEndpointConnection the private endpoint connection of a workspace
350type PrivateEndpointConnection struct {
351	autorest.Response `json:"-"`
352	// ID - READ-ONLY; The resource identifier.
353	ID *string `json:"id,omitempty"`
354	// Name - READ-ONLY; The resource name.
355	Name *string `json:"name,omitempty"`
356	// Type - READ-ONLY; The resource type.
357	Type *string `json:"type,omitempty"`
358	// Properties - The private endpoint connection properties.
359	Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"`
360}
361
362// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
363func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
364	objectMap := make(map[string]interface{})
365	if pec.Properties != nil {
366		objectMap["properties"] = pec.Properties
367	}
368	return json.Marshal(objectMap)
369}
370
371// PrivateEndpointConnectionProperties the properties of a private endpoint connection
372type PrivateEndpointConnectionProperties struct {
373	// PrivateEndpoint - Private endpoint
374	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
375	// PrivateLinkServiceConnectionState - Private endpoint connection state
376	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
377	// ProvisioningState - Provisioning state of the private endpoint connection. Possible values include: 'PrivateEndpointConnectionProvisioningStateSucceeded', 'PrivateEndpointConnectionProvisioningStateCreating', 'PrivateEndpointConnectionProvisioningStateUpdating', 'PrivateEndpointConnectionProvisioningStateDeleting', 'PrivateEndpointConnectionProvisioningStateFailed'
378	ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
379}
380
381// PrivateEndpointConnectionsCreateFuture an abstraction for monitoring and retrieving the results of a
382// long-running operation.
383type PrivateEndpointConnectionsCreateFuture struct {
384	azure.FutureAPI
385	// Result returns the result of the asynchronous operation.
386	// If the operation has not completed it will return an error.
387	Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
388}
389
390// UnmarshalJSON is the custom unmarshaller for CreateFuture.
391func (future *PrivateEndpointConnectionsCreateFuture) UnmarshalJSON(body []byte) error {
392	var azFuture azure.Future
393	if err := json.Unmarshal(body, &azFuture); err != nil {
394		return err
395	}
396	future.FutureAPI = &azFuture
397	future.Result = future.result
398	return nil
399}
400
401// result is the default implementation for PrivateEndpointConnectionsCreateFuture.Result.
402func (future *PrivateEndpointConnectionsCreateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
403	var done bool
404	done, err = future.DoneWithContext(context.Background(), client)
405	if err != nil {
406		err = autorest.NewErrorWithError(err, "databricks.PrivateEndpointConnectionsCreateFuture", "Result", future.Response(), "Polling failure")
407		return
408	}
409	if !done {
410		pec.Response.Response = future.Response()
411		err = azure.NewAsyncOpIncompleteError("databricks.PrivateEndpointConnectionsCreateFuture")
412		return
413	}
414	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
415	if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
416		pec, err = client.CreateResponder(pec.Response.Response)
417		if err != nil {
418			err = autorest.NewErrorWithError(err, "databricks.PrivateEndpointConnectionsCreateFuture", "Result", pec.Response.Response, "Failure responding to request")
419		}
420	}
421	return
422}
423
424// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
425// long-running operation.
426type PrivateEndpointConnectionsDeleteFuture struct {
427	azure.FutureAPI
428	// Result returns the result of the asynchronous operation.
429	// If the operation has not completed it will return an error.
430	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
431}
432
433// UnmarshalJSON is the custom unmarshaller for CreateFuture.
434func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
435	var azFuture azure.Future
436	if err := json.Unmarshal(body, &azFuture); err != nil {
437		return err
438	}
439	future.FutureAPI = &azFuture
440	future.Result = future.result
441	return nil
442}
443
444// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
445func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
446	var done bool
447	done, err = future.DoneWithContext(context.Background(), client)
448	if err != nil {
449		err = autorest.NewErrorWithError(err, "databricks.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
450		return
451	}
452	if !done {
453		ar.Response = future.Response()
454		err = azure.NewAsyncOpIncompleteError("databricks.PrivateEndpointConnectionsDeleteFuture")
455		return
456	}
457	ar.Response = future.Response()
458	return
459}
460
461// PrivateEndpointConnectionsList list of private link connections.
462type PrivateEndpointConnectionsList struct {
463	autorest.Response `json:"-"`
464	// Value - The list of returned private endpoint connection.
465	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
466	// NextLink - The URL to get the next set of endpoint connections.
467	NextLink *string `json:"nextLink,omitempty"`
468}
469
470// PrivateEndpointConnectionsListIterator provides access to a complete listing of
471// PrivateEndpointConnection values.
472type PrivateEndpointConnectionsListIterator struct {
473	i    int
474	page PrivateEndpointConnectionsListPage
475}
476
477// NextWithContext advances to the next value.  If there was an error making
478// the request the iterator does not advance and the error is returned.
479func (iter *PrivateEndpointConnectionsListIterator) NextWithContext(ctx context.Context) (err error) {
480	if tracing.IsEnabled() {
481		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsListIterator.NextWithContext")
482		defer func() {
483			sc := -1
484			if iter.Response().Response.Response != nil {
485				sc = iter.Response().Response.Response.StatusCode
486			}
487			tracing.EndSpan(ctx, sc, err)
488		}()
489	}
490	iter.i++
491	if iter.i < len(iter.page.Values()) {
492		return nil
493	}
494	err = iter.page.NextWithContext(ctx)
495	if err != nil {
496		iter.i--
497		return err
498	}
499	iter.i = 0
500	return nil
501}
502
503// Next advances to the next value.  If there was an error making
504// the request the iterator does not advance and the error is returned.
505// Deprecated: Use NextWithContext() instead.
506func (iter *PrivateEndpointConnectionsListIterator) Next() error {
507	return iter.NextWithContext(context.Background())
508}
509
510// NotDone returns true if the enumeration should be started or is not yet complete.
511func (iter PrivateEndpointConnectionsListIterator) NotDone() bool {
512	return iter.page.NotDone() && iter.i < len(iter.page.Values())
513}
514
515// Response returns the raw server response from the last page request.
516func (iter PrivateEndpointConnectionsListIterator) Response() PrivateEndpointConnectionsList {
517	return iter.page.Response()
518}
519
520// Value returns the current value or a zero-initialized value if the
521// iterator has advanced beyond the end of the collection.
522func (iter PrivateEndpointConnectionsListIterator) Value() PrivateEndpointConnection {
523	if !iter.page.NotDone() {
524		return PrivateEndpointConnection{}
525	}
526	return iter.page.Values()[iter.i]
527}
528
529// Creates a new instance of the PrivateEndpointConnectionsListIterator type.
530func NewPrivateEndpointConnectionsListIterator(page PrivateEndpointConnectionsListPage) PrivateEndpointConnectionsListIterator {
531	return PrivateEndpointConnectionsListIterator{page: page}
532}
533
534// IsEmpty returns true if the ListResult contains no values.
535func (pecl PrivateEndpointConnectionsList) IsEmpty() bool {
536	return pecl.Value == nil || len(*pecl.Value) == 0
537}
538
539// hasNextLink returns true if the NextLink is not empty.
540func (pecl PrivateEndpointConnectionsList) hasNextLink() bool {
541	return pecl.NextLink != nil && len(*pecl.NextLink) != 0
542}
543
544// privateEndpointConnectionsListPreparer prepares a request to retrieve the next set of results.
545// It returns nil if no more results exist.
546func (pecl PrivateEndpointConnectionsList) privateEndpointConnectionsListPreparer(ctx context.Context) (*http.Request, error) {
547	if !pecl.hasNextLink() {
548		return nil, nil
549	}
550	return autorest.Prepare((&http.Request{}).WithContext(ctx),
551		autorest.AsJSON(),
552		autorest.AsGet(),
553		autorest.WithBaseURL(to.String(pecl.NextLink)))
554}
555
556// PrivateEndpointConnectionsListPage contains a page of PrivateEndpointConnection values.
557type PrivateEndpointConnectionsListPage struct {
558	fn   func(context.Context, PrivateEndpointConnectionsList) (PrivateEndpointConnectionsList, error)
559	pecl PrivateEndpointConnectionsList
560}
561
562// NextWithContext advances to the next page of values.  If there was an error making
563// the request the page does not advance and the error is returned.
564func (page *PrivateEndpointConnectionsListPage) NextWithContext(ctx context.Context) (err error) {
565	if tracing.IsEnabled() {
566		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsListPage.NextWithContext")
567		defer func() {
568			sc := -1
569			if page.Response().Response.Response != nil {
570				sc = page.Response().Response.Response.StatusCode
571			}
572			tracing.EndSpan(ctx, sc, err)
573		}()
574	}
575	for {
576		next, err := page.fn(ctx, page.pecl)
577		if err != nil {
578			return err
579		}
580		page.pecl = next
581		if !next.hasNextLink() || !next.IsEmpty() {
582			break
583		}
584	}
585	return nil
586}
587
588// Next advances to the next page of values.  If there was an error making
589// the request the page does not advance and the error is returned.
590// Deprecated: Use NextWithContext() instead.
591func (page *PrivateEndpointConnectionsListPage) Next() error {
592	return page.NextWithContext(context.Background())
593}
594
595// NotDone returns true if the page enumeration should be started or is not yet complete.
596func (page PrivateEndpointConnectionsListPage) NotDone() bool {
597	return !page.pecl.IsEmpty()
598}
599
600// Response returns the raw server response from the last page request.
601func (page PrivateEndpointConnectionsListPage) Response() PrivateEndpointConnectionsList {
602	return page.pecl
603}
604
605// Values returns the slice of values for the current page or nil if there are no values.
606func (page PrivateEndpointConnectionsListPage) Values() []PrivateEndpointConnection {
607	if page.pecl.IsEmpty() {
608		return nil
609	}
610	return *page.pecl.Value
611}
612
613// Creates a new instance of the PrivateEndpointConnectionsListPage type.
614func NewPrivateEndpointConnectionsListPage(cur PrivateEndpointConnectionsList, getNextPage func(context.Context, PrivateEndpointConnectionsList) (PrivateEndpointConnectionsList, error)) PrivateEndpointConnectionsListPage {
615	return PrivateEndpointConnectionsListPage{
616		fn:   getNextPage,
617		pecl: cur,
618	}
619}
620
621// PrivateLinkResourcesList the available private link resources for a workspace
622type PrivateLinkResourcesList struct {
623	autorest.Response `json:"-"`
624	// Value - The list of available private link resources for a workspace
625	Value *[]GroupIDInformation `json:"value,omitempty"`
626	// NextLink - The URL to get the next set of private link resources.
627	NextLink *string `json:"nextLink,omitempty"`
628}
629
630// PrivateLinkResourcesListIterator provides access to a complete listing of GroupIDInformation values.
631type PrivateLinkResourcesListIterator struct {
632	i    int
633	page PrivateLinkResourcesListPage
634}
635
636// NextWithContext advances to the next value.  If there was an error making
637// the request the iterator does not advance and the error is returned.
638func (iter *PrivateLinkResourcesListIterator) NextWithContext(ctx context.Context) (err error) {
639	if tracing.IsEnabled() {
640		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesListIterator.NextWithContext")
641		defer func() {
642			sc := -1
643			if iter.Response().Response.Response != nil {
644				sc = iter.Response().Response.Response.StatusCode
645			}
646			tracing.EndSpan(ctx, sc, err)
647		}()
648	}
649	iter.i++
650	if iter.i < len(iter.page.Values()) {
651		return nil
652	}
653	err = iter.page.NextWithContext(ctx)
654	if err != nil {
655		iter.i--
656		return err
657	}
658	iter.i = 0
659	return nil
660}
661
662// Next advances to the next value.  If there was an error making
663// the request the iterator does not advance and the error is returned.
664// Deprecated: Use NextWithContext() instead.
665func (iter *PrivateLinkResourcesListIterator) Next() error {
666	return iter.NextWithContext(context.Background())
667}
668
669// NotDone returns true if the enumeration should be started or is not yet complete.
670func (iter PrivateLinkResourcesListIterator) NotDone() bool {
671	return iter.page.NotDone() && iter.i < len(iter.page.Values())
672}
673
674// Response returns the raw server response from the last page request.
675func (iter PrivateLinkResourcesListIterator) Response() PrivateLinkResourcesList {
676	return iter.page.Response()
677}
678
679// Value returns the current value or a zero-initialized value if the
680// iterator has advanced beyond the end of the collection.
681func (iter PrivateLinkResourcesListIterator) Value() GroupIDInformation {
682	if !iter.page.NotDone() {
683		return GroupIDInformation{}
684	}
685	return iter.page.Values()[iter.i]
686}
687
688// Creates a new instance of the PrivateLinkResourcesListIterator type.
689func NewPrivateLinkResourcesListIterator(page PrivateLinkResourcesListPage) PrivateLinkResourcesListIterator {
690	return PrivateLinkResourcesListIterator{page: page}
691}
692
693// IsEmpty returns true if the ListResult contains no values.
694func (plrl PrivateLinkResourcesList) IsEmpty() bool {
695	return plrl.Value == nil || len(*plrl.Value) == 0
696}
697
698// hasNextLink returns true if the NextLink is not empty.
699func (plrl PrivateLinkResourcesList) hasNextLink() bool {
700	return plrl.NextLink != nil && len(*plrl.NextLink) != 0
701}
702
703// privateLinkResourcesListPreparer prepares a request to retrieve the next set of results.
704// It returns nil if no more results exist.
705func (plrl PrivateLinkResourcesList) privateLinkResourcesListPreparer(ctx context.Context) (*http.Request, error) {
706	if !plrl.hasNextLink() {
707		return nil, nil
708	}
709	return autorest.Prepare((&http.Request{}).WithContext(ctx),
710		autorest.AsJSON(),
711		autorest.AsGet(),
712		autorest.WithBaseURL(to.String(plrl.NextLink)))
713}
714
715// PrivateLinkResourcesListPage contains a page of GroupIDInformation values.
716type PrivateLinkResourcesListPage struct {
717	fn   func(context.Context, PrivateLinkResourcesList) (PrivateLinkResourcesList, error)
718	plrl PrivateLinkResourcesList
719}
720
721// NextWithContext advances to the next page of values.  If there was an error making
722// the request the page does not advance and the error is returned.
723func (page *PrivateLinkResourcesListPage) NextWithContext(ctx context.Context) (err error) {
724	if tracing.IsEnabled() {
725		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesListPage.NextWithContext")
726		defer func() {
727			sc := -1
728			if page.Response().Response.Response != nil {
729				sc = page.Response().Response.Response.StatusCode
730			}
731			tracing.EndSpan(ctx, sc, err)
732		}()
733	}
734	for {
735		next, err := page.fn(ctx, page.plrl)
736		if err != nil {
737			return err
738		}
739		page.plrl = next
740		if !next.hasNextLink() || !next.IsEmpty() {
741			break
742		}
743	}
744	return nil
745}
746
747// Next advances to the next page of values.  If there was an error making
748// the request the page does not advance and the error is returned.
749// Deprecated: Use NextWithContext() instead.
750func (page *PrivateLinkResourcesListPage) Next() error {
751	return page.NextWithContext(context.Background())
752}
753
754// NotDone returns true if the page enumeration should be started or is not yet complete.
755func (page PrivateLinkResourcesListPage) NotDone() bool {
756	return !page.plrl.IsEmpty()
757}
758
759// Response returns the raw server response from the last page request.
760func (page PrivateLinkResourcesListPage) Response() PrivateLinkResourcesList {
761	return page.plrl
762}
763
764// Values returns the slice of values for the current page or nil if there are no values.
765func (page PrivateLinkResourcesListPage) Values() []GroupIDInformation {
766	if page.plrl.IsEmpty() {
767		return nil
768	}
769	return *page.plrl.Value
770}
771
772// Creates a new instance of the PrivateLinkResourcesListPage type.
773func NewPrivateLinkResourcesListPage(cur PrivateLinkResourcesList, getNextPage func(context.Context, PrivateLinkResourcesList) (PrivateLinkResourcesList, error)) PrivateLinkResourcesListPage {
774	return PrivateLinkResourcesListPage{
775		fn:   getNextPage,
776		plrl: cur,
777	}
778}
779
780// PrivateLinkServiceConnectionState the current state of a private endpoint connection
781type PrivateLinkServiceConnectionState struct {
782	// Status - The status of a private endpoint connection. Possible values include: 'PrivateLinkServiceConnectionStatusPending', 'PrivateLinkServiceConnectionStatusApproved', 'PrivateLinkServiceConnectionStatusRejected', 'PrivateLinkServiceConnectionStatusDisconnected'
783	Status PrivateLinkServiceConnectionStatus `json:"status,omitempty"`
784	// Description - The description for the current state of a private endpoint connection
785	Description *string `json:"description,omitempty"`
786	// ActionRequired - Actions required for a private endpoint connection
787	ActionRequired *string `json:"actionRequired,omitempty"`
788}
789
790// Resource the core properties of ARM resources
791type Resource struct {
792	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
793	ID *string `json:"id,omitempty"`
794	// Name - READ-ONLY; The name of the resource
795	Name *string `json:"name,omitempty"`
796	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
797	Type *string `json:"type,omitempty"`
798}
799
800// MarshalJSON is the custom marshaler for Resource.
801func (r Resource) MarshalJSON() ([]byte, error) {
802	objectMap := make(map[string]interface{})
803	return json.Marshal(objectMap)
804}
805
806// Sku SKU for the resource.
807type Sku struct {
808	// Name - The SKU name.
809	Name *string `json:"name,omitempty"`
810	// Tier - The SKU tier.
811	Tier *string `json:"tier,omitempty"`
812}
813
814// SystemData metadata pertaining to creation and last modification of the resource.
815type SystemData struct {
816	// CreatedBy - The identity that created the resource.
817	CreatedBy *string `json:"createdBy,omitempty"`
818	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
819	CreatedByType CreatedByType `json:"createdByType,omitempty"`
820	// CreatedAt - The timestamp of resource creation (UTC).
821	CreatedAt *date.Time `json:"createdAt,omitempty"`
822	// LastModifiedBy - The identity that last modified the resource.
823	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
824	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
825	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
826	// LastModifiedAt - The timestamp of resource last modification (UTC)
827	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
828}
829
830// TrackedResource the resource model definition for a ARM tracked top level resource
831type TrackedResource struct {
832	// Tags - Resource tags.
833	Tags map[string]*string `json:"tags"`
834	// Location - The geo-location where the resource lives
835	Location *string `json:"location,omitempty"`
836	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
837	ID *string `json:"id,omitempty"`
838	// Name - READ-ONLY; The name of the resource
839	Name *string `json:"name,omitempty"`
840	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
841	Type *string `json:"type,omitempty"`
842}
843
844// MarshalJSON is the custom marshaler for TrackedResource.
845func (tr TrackedResource) MarshalJSON() ([]byte, error) {
846	objectMap := make(map[string]interface{})
847	if tr.Tags != nil {
848		objectMap["tags"] = tr.Tags
849	}
850	if tr.Location != nil {
851		objectMap["location"] = tr.Location
852	}
853	return json.Marshal(objectMap)
854}
855
856// VirtualNetworkPeering peerings in a VirtualNetwork resource
857type VirtualNetworkPeering struct {
858	autorest.Response `json:"-"`
859	// VirtualNetworkPeeringPropertiesFormat - List of properties for vNet Peering
860	*VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"`
861	// Name - READ-ONLY; Name of the virtual network peering resource
862	Name *string `json:"name,omitempty"`
863	// ID - READ-ONLY; Resource ID.
864	ID *string `json:"id,omitempty"`
865	// Type - READ-ONLY; type of the virtual network peering resource
866	Type *string `json:"type,omitempty"`
867}
868
869// MarshalJSON is the custom marshaler for VirtualNetworkPeering.
870func (vnp VirtualNetworkPeering) MarshalJSON() ([]byte, error) {
871	objectMap := make(map[string]interface{})
872	if vnp.VirtualNetworkPeeringPropertiesFormat != nil {
873		objectMap["properties"] = vnp.VirtualNetworkPeeringPropertiesFormat
874	}
875	return json.Marshal(objectMap)
876}
877
878// UnmarshalJSON is the custom unmarshaler for VirtualNetworkPeering struct.
879func (vnp *VirtualNetworkPeering) UnmarshalJSON(body []byte) error {
880	var m map[string]*json.RawMessage
881	err := json.Unmarshal(body, &m)
882	if err != nil {
883		return err
884	}
885	for k, v := range m {
886		switch k {
887		case "properties":
888			if v != nil {
889				var virtualNetworkPeeringPropertiesFormat VirtualNetworkPeeringPropertiesFormat
890				err = json.Unmarshal(*v, &virtualNetworkPeeringPropertiesFormat)
891				if err != nil {
892					return err
893				}
894				vnp.VirtualNetworkPeeringPropertiesFormat = &virtualNetworkPeeringPropertiesFormat
895			}
896		case "name":
897			if v != nil {
898				var name string
899				err = json.Unmarshal(*v, &name)
900				if err != nil {
901					return err
902				}
903				vnp.Name = &name
904			}
905		case "id":
906			if v != nil {
907				var ID string
908				err = json.Unmarshal(*v, &ID)
909				if err != nil {
910					return err
911				}
912				vnp.ID = &ID
913			}
914		case "type":
915			if v != nil {
916				var typeVar string
917				err = json.Unmarshal(*v, &typeVar)
918				if err != nil {
919					return err
920				}
921				vnp.Type = &typeVar
922			}
923		}
924	}
925
926	return nil
927}
928
929// VirtualNetworkPeeringList gets all virtual network peerings under a workspace.
930type VirtualNetworkPeeringList struct {
931	autorest.Response `json:"-"`
932	// Value - List of virtual network peerings on workspace.
933	Value *[]VirtualNetworkPeering `json:"value,omitempty"`
934	// NextLink - URL to get the next set of virtual network peering list results if there are any.
935	NextLink *string `json:"nextLink,omitempty"`
936}
937
938// VirtualNetworkPeeringListIterator provides access to a complete listing of VirtualNetworkPeering values.
939type VirtualNetworkPeeringListIterator struct {
940	i    int
941	page VirtualNetworkPeeringListPage
942}
943
944// NextWithContext advances to the next value.  If there was an error making
945// the request the iterator does not advance and the error is returned.
946func (iter *VirtualNetworkPeeringListIterator) NextWithContext(ctx context.Context) (err error) {
947	if tracing.IsEnabled() {
948		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListIterator.NextWithContext")
949		defer func() {
950			sc := -1
951			if iter.Response().Response.Response != nil {
952				sc = iter.Response().Response.Response.StatusCode
953			}
954			tracing.EndSpan(ctx, sc, err)
955		}()
956	}
957	iter.i++
958	if iter.i < len(iter.page.Values()) {
959		return nil
960	}
961	err = iter.page.NextWithContext(ctx)
962	if err != nil {
963		iter.i--
964		return err
965	}
966	iter.i = 0
967	return nil
968}
969
970// Next advances to the next value.  If there was an error making
971// the request the iterator does not advance and the error is returned.
972// Deprecated: Use NextWithContext() instead.
973func (iter *VirtualNetworkPeeringListIterator) Next() error {
974	return iter.NextWithContext(context.Background())
975}
976
977// NotDone returns true if the enumeration should be started or is not yet complete.
978func (iter VirtualNetworkPeeringListIterator) NotDone() bool {
979	return iter.page.NotDone() && iter.i < len(iter.page.Values())
980}
981
982// Response returns the raw server response from the last page request.
983func (iter VirtualNetworkPeeringListIterator) Response() VirtualNetworkPeeringList {
984	return iter.page.Response()
985}
986
987// Value returns the current value or a zero-initialized value if the
988// iterator has advanced beyond the end of the collection.
989func (iter VirtualNetworkPeeringListIterator) Value() VirtualNetworkPeering {
990	if !iter.page.NotDone() {
991		return VirtualNetworkPeering{}
992	}
993	return iter.page.Values()[iter.i]
994}
995
996// Creates a new instance of the VirtualNetworkPeeringListIterator type.
997func NewVirtualNetworkPeeringListIterator(page VirtualNetworkPeeringListPage) VirtualNetworkPeeringListIterator {
998	return VirtualNetworkPeeringListIterator{page: page}
999}
1000
1001// IsEmpty returns true if the ListResult contains no values.
1002func (vnpl VirtualNetworkPeeringList) IsEmpty() bool {
1003	return vnpl.Value == nil || len(*vnpl.Value) == 0
1004}
1005
1006// hasNextLink returns true if the NextLink is not empty.
1007func (vnpl VirtualNetworkPeeringList) hasNextLink() bool {
1008	return vnpl.NextLink != nil && len(*vnpl.NextLink) != 0
1009}
1010
1011// virtualNetworkPeeringListPreparer prepares a request to retrieve the next set of results.
1012// It returns nil if no more results exist.
1013func (vnpl VirtualNetworkPeeringList) virtualNetworkPeeringListPreparer(ctx context.Context) (*http.Request, error) {
1014	if !vnpl.hasNextLink() {
1015		return nil, nil
1016	}
1017	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1018		autorest.AsJSON(),
1019		autorest.AsGet(),
1020		autorest.WithBaseURL(to.String(vnpl.NextLink)))
1021}
1022
1023// VirtualNetworkPeeringListPage contains a page of VirtualNetworkPeering values.
1024type VirtualNetworkPeeringListPage struct {
1025	fn   func(context.Context, VirtualNetworkPeeringList) (VirtualNetworkPeeringList, error)
1026	vnpl VirtualNetworkPeeringList
1027}
1028
1029// NextWithContext advances to the next page of values.  If there was an error making
1030// the request the page does not advance and the error is returned.
1031func (page *VirtualNetworkPeeringListPage) NextWithContext(ctx context.Context) (err error) {
1032	if tracing.IsEnabled() {
1033		ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkPeeringListPage.NextWithContext")
1034		defer func() {
1035			sc := -1
1036			if page.Response().Response.Response != nil {
1037				sc = page.Response().Response.Response.StatusCode
1038			}
1039			tracing.EndSpan(ctx, sc, err)
1040		}()
1041	}
1042	for {
1043		next, err := page.fn(ctx, page.vnpl)
1044		if err != nil {
1045			return err
1046		}
1047		page.vnpl = next
1048		if !next.hasNextLink() || !next.IsEmpty() {
1049			break
1050		}
1051	}
1052	return nil
1053}
1054
1055// Next advances to the next page of values.  If there was an error making
1056// the request the page does not advance and the error is returned.
1057// Deprecated: Use NextWithContext() instead.
1058func (page *VirtualNetworkPeeringListPage) Next() error {
1059	return page.NextWithContext(context.Background())
1060}
1061
1062// NotDone returns true if the page enumeration should be started or is not yet complete.
1063func (page VirtualNetworkPeeringListPage) NotDone() bool {
1064	return !page.vnpl.IsEmpty()
1065}
1066
1067// Response returns the raw server response from the last page request.
1068func (page VirtualNetworkPeeringListPage) Response() VirtualNetworkPeeringList {
1069	return page.vnpl
1070}
1071
1072// Values returns the slice of values for the current page or nil if there are no values.
1073func (page VirtualNetworkPeeringListPage) Values() []VirtualNetworkPeering {
1074	if page.vnpl.IsEmpty() {
1075		return nil
1076	}
1077	return *page.vnpl.Value
1078}
1079
1080// Creates a new instance of the VirtualNetworkPeeringListPage type.
1081func NewVirtualNetworkPeeringListPage(cur VirtualNetworkPeeringList, getNextPage func(context.Context, VirtualNetworkPeeringList) (VirtualNetworkPeeringList, error)) VirtualNetworkPeeringListPage {
1082	return VirtualNetworkPeeringListPage{
1083		fn:   getNextPage,
1084		vnpl: cur,
1085	}
1086}
1087
1088// VirtualNetworkPeeringPropertiesFormat properties of the virtual network peering.
1089type VirtualNetworkPeeringPropertiesFormat struct {
1090	// AllowVirtualNetworkAccess - Whether the VMs in the local virtual network space would be able to access the VMs in remote virtual network space.
1091	AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"`
1092	// AllowForwardedTraffic - Whether the forwarded traffic from the VMs in the local virtual network will be allowed/disallowed in remote virtual network.
1093	AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"`
1094	// AllowGatewayTransit - If gateway links can be used in remote virtual networking to link to this virtual network.
1095	AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"`
1096	// UseRemoteGateways - If remote gateways can be used on this virtual network. If the flag is set to true, and allowGatewayTransit on remote peering is also true, virtual network will use gateways of remote virtual network for transit. Only one peering can have this flag set to true. This flag cannot be set if virtual network already has a gateway.
1097	UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"`
1098	// DatabricksVirtualNetwork -  The remote virtual network should be in the same region. See here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering).
1099	DatabricksVirtualNetwork *VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork `json:"databricksVirtualNetwork,omitempty"`
1100	// DatabricksAddressSpace - The reference to the databricks virtual network address space.
1101	DatabricksAddressSpace *AddressSpace `json:"databricksAddressSpace,omitempty"`
1102	// RemoteVirtualNetwork -  The remote virtual network should be in the same region. See here to learn more (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering).
1103	RemoteVirtualNetwork *VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork `json:"remoteVirtualNetwork,omitempty"`
1104	// RemoteAddressSpace - The reference to the remote virtual network address space.
1105	RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"`
1106	// PeeringState - READ-ONLY; The status of the virtual network peering. Possible values include: 'PeeringStateInitiated', 'PeeringStateConnected', 'PeeringStateDisconnected'
1107	PeeringState PeeringState `json:"peeringState,omitempty"`
1108	// ProvisioningState - READ-ONLY; The provisioning state of the virtual network peering resource. Possible values include: 'PeeringProvisioningStateSucceeded', 'PeeringProvisioningStateUpdating', 'PeeringProvisioningStateDeleting', 'PeeringProvisioningStateFailed'
1109	ProvisioningState PeeringProvisioningState `json:"provisioningState,omitempty"`
1110}
1111
1112// MarshalJSON is the custom marshaler for VirtualNetworkPeeringPropertiesFormat.
1113func (vnppf VirtualNetworkPeeringPropertiesFormat) MarshalJSON() ([]byte, error) {
1114	objectMap := make(map[string]interface{})
1115	if vnppf.AllowVirtualNetworkAccess != nil {
1116		objectMap["allowVirtualNetworkAccess"] = vnppf.AllowVirtualNetworkAccess
1117	}
1118	if vnppf.AllowForwardedTraffic != nil {
1119		objectMap["allowForwardedTraffic"] = vnppf.AllowForwardedTraffic
1120	}
1121	if vnppf.AllowGatewayTransit != nil {
1122		objectMap["allowGatewayTransit"] = vnppf.AllowGatewayTransit
1123	}
1124	if vnppf.UseRemoteGateways != nil {
1125		objectMap["useRemoteGateways"] = vnppf.UseRemoteGateways
1126	}
1127	if vnppf.DatabricksVirtualNetwork != nil {
1128		objectMap["databricksVirtualNetwork"] = vnppf.DatabricksVirtualNetwork
1129	}
1130	if vnppf.DatabricksAddressSpace != nil {
1131		objectMap["databricksAddressSpace"] = vnppf.DatabricksAddressSpace
1132	}
1133	if vnppf.RemoteVirtualNetwork != nil {
1134		objectMap["remoteVirtualNetwork"] = vnppf.RemoteVirtualNetwork
1135	}
1136	if vnppf.RemoteAddressSpace != nil {
1137		objectMap["remoteAddressSpace"] = vnppf.RemoteAddressSpace
1138	}
1139	return json.Marshal(objectMap)
1140}
1141
1142// VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork the remote virtual network should be in
1143// the same region. See here to learn more
1144// (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering).
1145type VirtualNetworkPeeringPropertiesFormatDatabricksVirtualNetwork struct {
1146	// ID - The Id of the databricks virtual network.
1147	ID *string `json:"id,omitempty"`
1148}
1149
1150// VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork the remote virtual network should be in the
1151// same region. See here to learn more
1152// (https://docs.microsoft.com/en-us/azure/databricks/administration-guide/cloud-configurations/azure/vnet-peering).
1153type VirtualNetworkPeeringPropertiesFormatRemoteVirtualNetwork struct {
1154	// ID - The Id of the remote virtual network.
1155	ID *string `json:"id,omitempty"`
1156}
1157
1158// VNetPeeringCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1159// long-running operation.
1160type VNetPeeringCreateOrUpdateFuture struct {
1161	azure.FutureAPI
1162	// Result returns the result of the asynchronous operation.
1163	// If the operation has not completed it will return an error.
1164	Result func(VNetPeeringClient) (VirtualNetworkPeering, error)
1165}
1166
1167// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1168func (future *VNetPeeringCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1169	var azFuture azure.Future
1170	if err := json.Unmarshal(body, &azFuture); err != nil {
1171		return err
1172	}
1173	future.FutureAPI = &azFuture
1174	future.Result = future.result
1175	return nil
1176}
1177
1178// result is the default implementation for VNetPeeringCreateOrUpdateFuture.Result.
1179func (future *VNetPeeringCreateOrUpdateFuture) result(client VNetPeeringClient) (vnp VirtualNetworkPeering, err error) {
1180	var done bool
1181	done, err = future.DoneWithContext(context.Background(), client)
1182	if err != nil {
1183		err = autorest.NewErrorWithError(err, "databricks.VNetPeeringCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1184		return
1185	}
1186	if !done {
1187		vnp.Response.Response = future.Response()
1188		err = azure.NewAsyncOpIncompleteError("databricks.VNetPeeringCreateOrUpdateFuture")
1189		return
1190	}
1191	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1192	if vnp.Response.Response, err = future.GetResult(sender); err == nil && vnp.Response.Response.StatusCode != http.StatusNoContent {
1193		vnp, err = client.CreateOrUpdateResponder(vnp.Response.Response)
1194		if err != nil {
1195			err = autorest.NewErrorWithError(err, "databricks.VNetPeeringCreateOrUpdateFuture", "Result", vnp.Response.Response, "Failure responding to request")
1196		}
1197	}
1198	return
1199}
1200
1201// VNetPeeringDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
1202// operation.
1203type VNetPeeringDeleteFuture struct {
1204	azure.FutureAPI
1205	// Result returns the result of the asynchronous operation.
1206	// If the operation has not completed it will return an error.
1207	Result func(VNetPeeringClient) (autorest.Response, error)
1208}
1209
1210// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1211func (future *VNetPeeringDeleteFuture) UnmarshalJSON(body []byte) error {
1212	var azFuture azure.Future
1213	if err := json.Unmarshal(body, &azFuture); err != nil {
1214		return err
1215	}
1216	future.FutureAPI = &azFuture
1217	future.Result = future.result
1218	return nil
1219}
1220
1221// result is the default implementation for VNetPeeringDeleteFuture.Result.
1222func (future *VNetPeeringDeleteFuture) result(client VNetPeeringClient) (ar autorest.Response, err error) {
1223	var done bool
1224	done, err = future.DoneWithContext(context.Background(), client)
1225	if err != nil {
1226		err = autorest.NewErrorWithError(err, "databricks.VNetPeeringDeleteFuture", "Result", future.Response(), "Polling failure")
1227		return
1228	}
1229	if !done {
1230		ar.Response = future.Response()
1231		err = azure.NewAsyncOpIncompleteError("databricks.VNetPeeringDeleteFuture")
1232		return
1233	}
1234	ar.Response = future.Response()
1235	return
1236}
1237
1238// Workspace information about workspace.
1239type Workspace struct {
1240	autorest.Response `json:"-"`
1241	// WorkspaceProperties - The workspace properties.
1242	*WorkspaceProperties `json:"properties,omitempty"`
1243	// Sku - The SKU of the resource.
1244	Sku *Sku `json:"sku,omitempty"`
1245	// SystemData - READ-ONLY; The system metadata relating to this resource
1246	SystemData *SystemData `json:"systemData,omitempty"`
1247	// Tags - Resource tags.
1248	Tags map[string]*string `json:"tags"`
1249	// Location - The geo-location where the resource lives
1250	Location *string `json:"location,omitempty"`
1251	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1252	ID *string `json:"id,omitempty"`
1253	// Name - READ-ONLY; The name of the resource
1254	Name *string `json:"name,omitempty"`
1255	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1256	Type *string `json:"type,omitempty"`
1257}
1258
1259// MarshalJSON is the custom marshaler for Workspace.
1260func (w Workspace) MarshalJSON() ([]byte, error) {
1261	objectMap := make(map[string]interface{})
1262	if w.WorkspaceProperties != nil {
1263		objectMap["properties"] = w.WorkspaceProperties
1264	}
1265	if w.Sku != nil {
1266		objectMap["sku"] = w.Sku
1267	}
1268	if w.Tags != nil {
1269		objectMap["tags"] = w.Tags
1270	}
1271	if w.Location != nil {
1272		objectMap["location"] = w.Location
1273	}
1274	return json.Marshal(objectMap)
1275}
1276
1277// UnmarshalJSON is the custom unmarshaler for Workspace struct.
1278func (w *Workspace) UnmarshalJSON(body []byte) error {
1279	var m map[string]*json.RawMessage
1280	err := json.Unmarshal(body, &m)
1281	if err != nil {
1282		return err
1283	}
1284	for k, v := range m {
1285		switch k {
1286		case "properties":
1287			if v != nil {
1288				var workspaceProperties WorkspaceProperties
1289				err = json.Unmarshal(*v, &workspaceProperties)
1290				if err != nil {
1291					return err
1292				}
1293				w.WorkspaceProperties = &workspaceProperties
1294			}
1295		case "sku":
1296			if v != nil {
1297				var sku Sku
1298				err = json.Unmarshal(*v, &sku)
1299				if err != nil {
1300					return err
1301				}
1302				w.Sku = &sku
1303			}
1304		case "systemData":
1305			if v != nil {
1306				var systemData SystemData
1307				err = json.Unmarshal(*v, &systemData)
1308				if err != nil {
1309					return err
1310				}
1311				w.SystemData = &systemData
1312			}
1313		case "tags":
1314			if v != nil {
1315				var tags map[string]*string
1316				err = json.Unmarshal(*v, &tags)
1317				if err != nil {
1318					return err
1319				}
1320				w.Tags = tags
1321			}
1322		case "location":
1323			if v != nil {
1324				var location string
1325				err = json.Unmarshal(*v, &location)
1326				if err != nil {
1327					return err
1328				}
1329				w.Location = &location
1330			}
1331		case "id":
1332			if v != nil {
1333				var ID string
1334				err = json.Unmarshal(*v, &ID)
1335				if err != nil {
1336					return err
1337				}
1338				w.ID = &ID
1339			}
1340		case "name":
1341			if v != nil {
1342				var name string
1343				err = json.Unmarshal(*v, &name)
1344				if err != nil {
1345					return err
1346				}
1347				w.Name = &name
1348			}
1349		case "type":
1350			if v != nil {
1351				var typeVar string
1352				err = json.Unmarshal(*v, &typeVar)
1353				if err != nil {
1354					return err
1355				}
1356				w.Type = &typeVar
1357			}
1358		}
1359	}
1360
1361	return nil
1362}
1363
1364// WorkspaceCustomBooleanParameter the value which should be used for this field.
1365type WorkspaceCustomBooleanParameter struct {
1366	// Type - The type of variable that this is. Possible values include: 'CustomParameterTypeBool', 'CustomParameterTypeObject', 'CustomParameterTypeString'
1367	Type CustomParameterType `json:"type,omitempty"`
1368	// Value - The value which should be used for this field.
1369	Value *bool `json:"value,omitempty"`
1370}
1371
1372// WorkspaceCustomObjectParameter the value which should be used for this field.
1373type WorkspaceCustomObjectParameter struct {
1374	// Type - The type of variable that this is. Possible values include: 'CustomParameterTypeBool', 'CustomParameterTypeObject', 'CustomParameterTypeString'
1375	Type CustomParameterType `json:"type,omitempty"`
1376	// Value - The value which should be used for this field.
1377	Value interface{} `json:"value,omitempty"`
1378}
1379
1380// WorkspaceCustomParameters custom Parameters used for Cluster Creation.
1381type WorkspaceCustomParameters struct {
1382	// AmlWorkspaceID - The ID of a Azure Machine Learning workspace to link with Databricks workspace
1383	AmlWorkspaceID *WorkspaceCustomStringParameter `json:"amlWorkspaceId,omitempty"`
1384	// CustomVirtualNetworkID - The ID of a Virtual Network where this Databricks Cluster should be created
1385	CustomVirtualNetworkID *WorkspaceCustomStringParameter `json:"customVirtualNetworkId,omitempty"`
1386	// CustomPublicSubnetName - The name of a Public Subnet within the Virtual Network
1387	CustomPublicSubnetName *WorkspaceCustomStringParameter `json:"customPublicSubnetName,omitempty"`
1388	// CustomPrivateSubnetName - The name of the Private Subnet within the Virtual Network
1389	CustomPrivateSubnetName *WorkspaceCustomStringParameter `json:"customPrivateSubnetName,omitempty"`
1390	// EnableNoPublicIP - Should the Public IP be Disabled?
1391	EnableNoPublicIP *WorkspaceCustomBooleanParameter `json:"enableNoPublicIp,omitempty"`
1392	// LoadBalancerBackendPoolName - Name of the outbound Load Balancer Backend Pool for Secure Cluster Connectivity (No Public IP).
1393	LoadBalancerBackendPoolName *WorkspaceCustomStringParameter `json:"loadBalancerBackendPoolName,omitempty"`
1394	// LoadBalancerID - Resource URI of Outbound Load balancer for Secure Cluster Connectivity (No Public IP) workspace.
1395	LoadBalancerID *WorkspaceCustomStringParameter `json:"loadBalancerId,omitempty"`
1396	// NatGatewayName - Name of the NAT gateway for Secure Cluster Connectivity (No Public IP) workspace subnets.
1397	NatGatewayName *WorkspaceCustomStringParameter `json:"natGatewayName,omitempty"`
1398	// PublicIPName - Name of the Public IP for No Public IP workspace with managed vNet.
1399	PublicIPName *WorkspaceCustomStringParameter `json:"publicIpName,omitempty"`
1400	// PrepareEncryption - Prepare the workspace for encryption. Enables the Managed Identity for managed storage account.
1401	PrepareEncryption *WorkspaceCustomBooleanParameter `json:"prepareEncryption,omitempty"`
1402	// Encryption - Contains the encryption details for Customer-Managed Key (CMK) enabled workspace.
1403	Encryption *WorkspaceEncryptionParameter `json:"encryption,omitempty"`
1404	// RequireInfrastructureEncryption - A boolean indicating whether or not the DBFS root file system will be enabled with secondary layer of encryption with platform managed keys for data at rest.
1405	RequireInfrastructureEncryption *WorkspaceCustomBooleanParameter `json:"requireInfrastructureEncryption,omitempty"`
1406	// StorageAccountName - Default DBFS storage account name.
1407	StorageAccountName *WorkspaceCustomStringParameter `json:"storageAccountName,omitempty"`
1408	// StorageAccountSkuName - Storage account SKU name, ex: Standard_GRS, Standard_LRS. Refer https://aka.ms/storageskus for valid inputs.
1409	StorageAccountSkuName *WorkspaceCustomStringParameter `json:"storageAccountSkuName,omitempty"`
1410	// VnetAddressPrefix - Address prefix for Managed virtual network. Default value for this input is 10.139.
1411	VnetAddressPrefix *WorkspaceCustomStringParameter `json:"vnetAddressPrefix,omitempty"`
1412	// ResourceTags - READ-ONLY; Tags applied to resources under Managed resource group. These can be updated by updating tags at workspace level.
1413	ResourceTags *WorkspaceCustomObjectParameter `json:"resourceTags,omitempty"`
1414}
1415
1416// MarshalJSON is the custom marshaler for WorkspaceCustomParameters.
1417func (wcp WorkspaceCustomParameters) MarshalJSON() ([]byte, error) {
1418	objectMap := make(map[string]interface{})
1419	if wcp.AmlWorkspaceID != nil {
1420		objectMap["amlWorkspaceId"] = wcp.AmlWorkspaceID
1421	}
1422	if wcp.CustomVirtualNetworkID != nil {
1423		objectMap["customVirtualNetworkId"] = wcp.CustomVirtualNetworkID
1424	}
1425	if wcp.CustomPublicSubnetName != nil {
1426		objectMap["customPublicSubnetName"] = wcp.CustomPublicSubnetName
1427	}
1428	if wcp.CustomPrivateSubnetName != nil {
1429		objectMap["customPrivateSubnetName"] = wcp.CustomPrivateSubnetName
1430	}
1431	if wcp.EnableNoPublicIP != nil {
1432		objectMap["enableNoPublicIp"] = wcp.EnableNoPublicIP
1433	}
1434	if wcp.LoadBalancerBackendPoolName != nil {
1435		objectMap["loadBalancerBackendPoolName"] = wcp.LoadBalancerBackendPoolName
1436	}
1437	if wcp.LoadBalancerID != nil {
1438		objectMap["loadBalancerId"] = wcp.LoadBalancerID
1439	}
1440	if wcp.NatGatewayName != nil {
1441		objectMap["natGatewayName"] = wcp.NatGatewayName
1442	}
1443	if wcp.PublicIPName != nil {
1444		objectMap["publicIpName"] = wcp.PublicIPName
1445	}
1446	if wcp.PrepareEncryption != nil {
1447		objectMap["prepareEncryption"] = wcp.PrepareEncryption
1448	}
1449	if wcp.Encryption != nil {
1450		objectMap["encryption"] = wcp.Encryption
1451	}
1452	if wcp.RequireInfrastructureEncryption != nil {
1453		objectMap["requireInfrastructureEncryption"] = wcp.RequireInfrastructureEncryption
1454	}
1455	if wcp.StorageAccountName != nil {
1456		objectMap["storageAccountName"] = wcp.StorageAccountName
1457	}
1458	if wcp.StorageAccountSkuName != nil {
1459		objectMap["storageAccountSkuName"] = wcp.StorageAccountSkuName
1460	}
1461	if wcp.VnetAddressPrefix != nil {
1462		objectMap["vnetAddressPrefix"] = wcp.VnetAddressPrefix
1463	}
1464	return json.Marshal(objectMap)
1465}
1466
1467// WorkspaceCustomStringParameter the Value.
1468type WorkspaceCustomStringParameter struct {
1469	// Type - The type of variable that this is. Possible values include: 'CustomParameterTypeBool', 'CustomParameterTypeObject', 'CustomParameterTypeString'
1470	Type CustomParameterType `json:"type,omitempty"`
1471	// Value - The value which should be used for this field.
1472	Value *string `json:"value,omitempty"`
1473}
1474
1475// WorkspaceEncryptionParameter the object that contains details of encryption used on the workspace.
1476type WorkspaceEncryptionParameter struct {
1477	// Type - The type of variable that this is. Possible values include: 'CustomParameterTypeBool', 'CustomParameterTypeObject', 'CustomParameterTypeString'
1478	Type CustomParameterType `json:"type,omitempty"`
1479	// Value - The value which should be used for this field.
1480	Value *Encryption `json:"value,omitempty"`
1481}
1482
1483// WorkspaceListResult list of workspaces.
1484type WorkspaceListResult struct {
1485	autorest.Response `json:"-"`
1486	// Value - The array of workspaces.
1487	Value *[]Workspace `json:"value,omitempty"`
1488	// NextLink - The URL to use for getting the next set of results.
1489	NextLink *string `json:"nextLink,omitempty"`
1490}
1491
1492// WorkspaceListResultIterator provides access to a complete listing of Workspace values.
1493type WorkspaceListResultIterator struct {
1494	i    int
1495	page WorkspaceListResultPage
1496}
1497
1498// NextWithContext advances to the next value.  If there was an error making
1499// the request the iterator does not advance and the error is returned.
1500func (iter *WorkspaceListResultIterator) NextWithContext(ctx context.Context) (err error) {
1501	if tracing.IsEnabled() {
1502		ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultIterator.NextWithContext")
1503		defer func() {
1504			sc := -1
1505			if iter.Response().Response.Response != nil {
1506				sc = iter.Response().Response.Response.StatusCode
1507			}
1508			tracing.EndSpan(ctx, sc, err)
1509		}()
1510	}
1511	iter.i++
1512	if iter.i < len(iter.page.Values()) {
1513		return nil
1514	}
1515	err = iter.page.NextWithContext(ctx)
1516	if err != nil {
1517		iter.i--
1518		return err
1519	}
1520	iter.i = 0
1521	return nil
1522}
1523
1524// Next advances to the next value.  If there was an error making
1525// the request the iterator does not advance and the error is returned.
1526// Deprecated: Use NextWithContext() instead.
1527func (iter *WorkspaceListResultIterator) Next() error {
1528	return iter.NextWithContext(context.Background())
1529}
1530
1531// NotDone returns true if the enumeration should be started or is not yet complete.
1532func (iter WorkspaceListResultIterator) NotDone() bool {
1533	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1534}
1535
1536// Response returns the raw server response from the last page request.
1537func (iter WorkspaceListResultIterator) Response() WorkspaceListResult {
1538	return iter.page.Response()
1539}
1540
1541// Value returns the current value or a zero-initialized value if the
1542// iterator has advanced beyond the end of the collection.
1543func (iter WorkspaceListResultIterator) Value() Workspace {
1544	if !iter.page.NotDone() {
1545		return Workspace{}
1546	}
1547	return iter.page.Values()[iter.i]
1548}
1549
1550// Creates a new instance of the WorkspaceListResultIterator type.
1551func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator {
1552	return WorkspaceListResultIterator{page: page}
1553}
1554
1555// IsEmpty returns true if the ListResult contains no values.
1556func (wlr WorkspaceListResult) IsEmpty() bool {
1557	return wlr.Value == nil || len(*wlr.Value) == 0
1558}
1559
1560// hasNextLink returns true if the NextLink is not empty.
1561func (wlr WorkspaceListResult) hasNextLink() bool {
1562	return wlr.NextLink != nil && len(*wlr.NextLink) != 0
1563}
1564
1565// workspaceListResultPreparer prepares a request to retrieve the next set of results.
1566// It returns nil if no more results exist.
1567func (wlr WorkspaceListResult) workspaceListResultPreparer(ctx context.Context) (*http.Request, error) {
1568	if !wlr.hasNextLink() {
1569		return nil, nil
1570	}
1571	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1572		autorest.AsJSON(),
1573		autorest.AsGet(),
1574		autorest.WithBaseURL(to.String(wlr.NextLink)))
1575}
1576
1577// WorkspaceListResultPage contains a page of Workspace values.
1578type WorkspaceListResultPage struct {
1579	fn  func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)
1580	wlr WorkspaceListResult
1581}
1582
1583// NextWithContext advances to the next page of values.  If there was an error making
1584// the request the page does not advance and the error is returned.
1585func (page *WorkspaceListResultPage) NextWithContext(ctx context.Context) (err error) {
1586	if tracing.IsEnabled() {
1587		ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultPage.NextWithContext")
1588		defer func() {
1589			sc := -1
1590			if page.Response().Response.Response != nil {
1591				sc = page.Response().Response.Response.StatusCode
1592			}
1593			tracing.EndSpan(ctx, sc, err)
1594		}()
1595	}
1596	for {
1597		next, err := page.fn(ctx, page.wlr)
1598		if err != nil {
1599			return err
1600		}
1601		page.wlr = next
1602		if !next.hasNextLink() || !next.IsEmpty() {
1603			break
1604		}
1605	}
1606	return nil
1607}
1608
1609// Next advances to the next page of values.  If there was an error making
1610// the request the page does not advance and the error is returned.
1611// Deprecated: Use NextWithContext() instead.
1612func (page *WorkspaceListResultPage) Next() error {
1613	return page.NextWithContext(context.Background())
1614}
1615
1616// NotDone returns true if the page enumeration should be started or is not yet complete.
1617func (page WorkspaceListResultPage) NotDone() bool {
1618	return !page.wlr.IsEmpty()
1619}
1620
1621// Response returns the raw server response from the last page request.
1622func (page WorkspaceListResultPage) Response() WorkspaceListResult {
1623	return page.wlr
1624}
1625
1626// Values returns the slice of values for the current page or nil if there are no values.
1627func (page WorkspaceListResultPage) Values() []Workspace {
1628	if page.wlr.IsEmpty() {
1629		return nil
1630	}
1631	return *page.wlr.Value
1632}
1633
1634// Creates a new instance of the WorkspaceListResultPage type.
1635func NewWorkspaceListResultPage(cur WorkspaceListResult, getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage {
1636	return WorkspaceListResultPage{
1637		fn:  getNextPage,
1638		wlr: cur,
1639	}
1640}
1641
1642// WorkspaceProperties the workspace properties.
1643type WorkspaceProperties struct {
1644	// ManagedResourceGroupID - The managed resource group Id.
1645	ManagedResourceGroupID *string `json:"managedResourceGroupId,omitempty"`
1646	// Parameters - The workspace's custom parameters.
1647	Parameters *WorkspaceCustomParameters `json:"parameters,omitempty"`
1648	// ProvisioningState - READ-ONLY; The workspace provisioning state. Possible values include: 'ProvisioningStateAccepted', 'ProvisioningStateRunning', 'ProvisioningStateReady', 'ProvisioningStateCreating', 'ProvisioningStateCreated', 'ProvisioningStateDeleting', 'ProvisioningStateDeleted', 'ProvisioningStateCanceled', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating'
1649	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1650	// UIDefinitionURI - The blob URI where the UI definition file is located.
1651	UIDefinitionURI *string `json:"uiDefinitionUri,omitempty"`
1652	// Authorizations - The workspace provider authorizations.
1653	Authorizations *[]WorkspaceProviderAuthorization `json:"authorizations,omitempty"`
1654	// CreatedBy - Indicates the Object ID, PUID and Application ID of entity that created the workspace.
1655	CreatedBy *CreatedBy `json:"createdBy,omitempty"`
1656	// UpdatedBy - Indicates the Object ID, PUID and Application ID of entity that last updated the workspace.
1657	UpdatedBy *CreatedBy `json:"updatedBy,omitempty"`
1658	// CreatedDateTime - Specifies the date and time when the workspace is created.
1659	CreatedDateTime *date.Time `json:"createdDateTime,omitempty"`
1660	// WorkspaceID - READ-ONLY; The unique identifier of the databricks workspace in databricks control plane.
1661	WorkspaceID *string `json:"workspaceId,omitempty"`
1662	// WorkspaceURL - READ-ONLY; The workspace URL which is of the format 'adb-{workspaceId}.{random}.azuredatabricks.net'
1663	WorkspaceURL *string `json:"workspaceUrl,omitempty"`
1664	// StorageAccountIdentity - The details of Managed Identity of Storage Account
1665	StorageAccountIdentity *ManagedIdentityConfiguration `json:"storageAccountIdentity,omitempty"`
1666	// Encryption - Encryption properties for databricks workspace
1667	Encryption *WorkspacePropertiesEncryption `json:"encryption,omitempty"`
1668	// PrivateEndpointConnections - READ-ONLY; Private endpoint connections created on the workspace
1669	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
1670	// PublicNetworkAccess - The network access type for accessing workspace. Set value to disabled to access workspace only via private link. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled'
1671	PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
1672	// RequiredNsgRules - Gets or sets a value indicating whether data plane (clusters) to control plane communication happen over private endpoint. Supported values are 'AllRules' and 'NoAzureDatabricksRules'. 'NoAzureServiceRules' value is for internal use only. Possible values include: 'RequiredNsgRulesAllRules', 'RequiredNsgRulesNoAzureDatabricksRules', 'RequiredNsgRulesNoAzureServiceRules'
1673	RequiredNsgRules RequiredNsgRules `json:"requiredNsgRules,omitempty"`
1674}
1675
1676// MarshalJSON is the custom marshaler for WorkspaceProperties.
1677func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) {
1678	objectMap := make(map[string]interface{})
1679	if wp.ManagedResourceGroupID != nil {
1680		objectMap["managedResourceGroupId"] = wp.ManagedResourceGroupID
1681	}
1682	if wp.Parameters != nil {
1683		objectMap["parameters"] = wp.Parameters
1684	}
1685	if wp.UIDefinitionURI != nil {
1686		objectMap["uiDefinitionUri"] = wp.UIDefinitionURI
1687	}
1688	if wp.Authorizations != nil {
1689		objectMap["authorizations"] = wp.Authorizations
1690	}
1691	if wp.CreatedBy != nil {
1692		objectMap["createdBy"] = wp.CreatedBy
1693	}
1694	if wp.UpdatedBy != nil {
1695		objectMap["updatedBy"] = wp.UpdatedBy
1696	}
1697	if wp.CreatedDateTime != nil {
1698		objectMap["createdDateTime"] = wp.CreatedDateTime
1699	}
1700	if wp.StorageAccountIdentity != nil {
1701		objectMap["storageAccountIdentity"] = wp.StorageAccountIdentity
1702	}
1703	if wp.Encryption != nil {
1704		objectMap["encryption"] = wp.Encryption
1705	}
1706	if wp.PublicNetworkAccess != "" {
1707		objectMap["publicNetworkAccess"] = wp.PublicNetworkAccess
1708	}
1709	if wp.RequiredNsgRules != "" {
1710		objectMap["requiredNsgRules"] = wp.RequiredNsgRules
1711	}
1712	return json.Marshal(objectMap)
1713}
1714
1715// WorkspacePropertiesEncryption encryption properties for databricks workspace
1716type WorkspacePropertiesEncryption struct {
1717	// Entities - Encryption entities definition for the workspace.
1718	Entities *EncryptionEntitiesDefinition `json:"entities,omitempty"`
1719}
1720
1721// WorkspaceProviderAuthorization the workspace provider authorization.
1722type WorkspaceProviderAuthorization struct {
1723	// PrincipalID - The provider's principal identifier. This is the identity that the provider will use to call ARM to manage the workspace resources.
1724	PrincipalID *uuid.UUID `json:"principalId,omitempty"`
1725	// RoleDefinitionID - The provider's role definition identifier. This role will define all the permissions that the provider must have on the workspace's container resource group. This role definition cannot have permission to delete the resource group.
1726	RoleDefinitionID *uuid.UUID `json:"roleDefinitionId,omitempty"`
1727}
1728
1729// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1730// long-running operation.
1731type WorkspacesCreateOrUpdateFuture struct {
1732	azure.FutureAPI
1733	// Result returns the result of the asynchronous operation.
1734	// If the operation has not completed it will return an error.
1735	Result func(WorkspacesClient) (Workspace, error)
1736}
1737
1738// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1739func (future *WorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1740	var azFuture azure.Future
1741	if err := json.Unmarshal(body, &azFuture); err != nil {
1742		return err
1743	}
1744	future.FutureAPI = &azFuture
1745	future.Result = future.result
1746	return nil
1747}
1748
1749// result is the default implementation for WorkspacesCreateOrUpdateFuture.Result.
1750func (future *WorkspacesCreateOrUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) {
1751	var done bool
1752	done, err = future.DoneWithContext(context.Background(), client)
1753	if err != nil {
1754		err = autorest.NewErrorWithError(err, "databricks.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1755		return
1756	}
1757	if !done {
1758		w.Response.Response = future.Response()
1759		err = azure.NewAsyncOpIncompleteError("databricks.WorkspacesCreateOrUpdateFuture")
1760		return
1761	}
1762	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1763	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
1764		w, err = client.CreateOrUpdateResponder(w.Response.Response)
1765		if err != nil {
1766			err = autorest.NewErrorWithError(err, "databricks.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request")
1767		}
1768	}
1769	return
1770}
1771
1772// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
1773// operation.
1774type WorkspacesDeleteFuture struct {
1775	azure.FutureAPI
1776	// Result returns the result of the asynchronous operation.
1777	// If the operation has not completed it will return an error.
1778	Result func(WorkspacesClient) (autorest.Response, error)
1779}
1780
1781// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1782func (future *WorkspacesDeleteFuture) UnmarshalJSON(body []byte) error {
1783	var azFuture azure.Future
1784	if err := json.Unmarshal(body, &azFuture); err != nil {
1785		return err
1786	}
1787	future.FutureAPI = &azFuture
1788	future.Result = future.result
1789	return nil
1790}
1791
1792// result is the default implementation for WorkspacesDeleteFuture.Result.
1793func (future *WorkspacesDeleteFuture) result(client WorkspacesClient) (ar autorest.Response, err error) {
1794	var done bool
1795	done, err = future.DoneWithContext(context.Background(), client)
1796	if err != nil {
1797		err = autorest.NewErrorWithError(err, "databricks.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
1798		return
1799	}
1800	if !done {
1801		ar.Response = future.Response()
1802		err = azure.NewAsyncOpIncompleteError("databricks.WorkspacesDeleteFuture")
1803		return
1804	}
1805	ar.Response = future.Response()
1806	return
1807}
1808
1809// WorkspacesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
1810// operation.
1811type WorkspacesUpdateFuture struct {
1812	azure.FutureAPI
1813	// Result returns the result of the asynchronous operation.
1814	// If the operation has not completed it will return an error.
1815	Result func(WorkspacesClient) (Workspace, error)
1816}
1817
1818// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1819func (future *WorkspacesUpdateFuture) UnmarshalJSON(body []byte) error {
1820	var azFuture azure.Future
1821	if err := json.Unmarshal(body, &azFuture); err != nil {
1822		return err
1823	}
1824	future.FutureAPI = &azFuture
1825	future.Result = future.result
1826	return nil
1827}
1828
1829// result is the default implementation for WorkspacesUpdateFuture.Result.
1830func (future *WorkspacesUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) {
1831	var done bool
1832	done, err = future.DoneWithContext(context.Background(), client)
1833	if err != nil {
1834		err = autorest.NewErrorWithError(err, "databricks.WorkspacesUpdateFuture", "Result", future.Response(), "Polling failure")
1835		return
1836	}
1837	if !done {
1838		w.Response.Response = future.Response()
1839		err = azure.NewAsyncOpIncompleteError("databricks.WorkspacesUpdateFuture")
1840		return
1841	}
1842	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1843	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
1844		w, err = client.UpdateResponder(w.Response.Response)
1845		if err != nil {
1846			err = autorest.NewErrorWithError(err, "databricks.WorkspacesUpdateFuture", "Result", w.Response.Response, "Failure responding to request")
1847		}
1848	}
1849	return
1850}
1851
1852// WorkspaceUpdate an update to a workspace.
1853type WorkspaceUpdate struct {
1854	// Tags - Resource tags.
1855	Tags map[string]*string `json:"tags"`
1856}
1857
1858// MarshalJSON is the custom marshaler for WorkspaceUpdate.
1859func (wu WorkspaceUpdate) MarshalJSON() ([]byte, error) {
1860	objectMap := make(map[string]interface{})
1861	if wu.Tags != nil {
1862		objectMap["tags"] = wu.Tags
1863	}
1864	return json.Marshal(objectMap)
1865}
1866