1package signalr
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	"net/http"
18)
19
20// The package's fully qualified name.
21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/signalr/mgmt/2021-06-01-preview/signalr"
22
23// CorsSettings cross-Origin Resource Sharing (CORS) settings.
24type CorsSettings struct {
25	// AllowedOrigins - Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all. If omitted, allow all by default.
26	AllowedOrigins *[]string `json:"allowedOrigins,omitempty"`
27}
28
29// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
30// operation.
31type CreateOrUpdateFuture struct {
32	azure.FutureAPI
33	// Result returns the result of the asynchronous operation.
34	// If the operation has not completed it will return an error.
35	Result func(Client) (ResourceType, error)
36}
37
38// UnmarshalJSON is the custom unmarshaller for CreateFuture.
39func (future *CreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
40	var azFuture azure.Future
41	if err := json.Unmarshal(body, &azFuture); err != nil {
42		return err
43	}
44	future.FutureAPI = &azFuture
45	future.Result = future.result
46	return nil
47}
48
49// result is the default implementation for CreateOrUpdateFuture.Result.
50func (future *CreateOrUpdateFuture) result(client Client) (rt ResourceType, err error) {
51	var done bool
52	done, err = future.DoneWithContext(context.Background(), client)
53	if err != nil {
54		err = autorest.NewErrorWithError(err, "signalr.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
55		return
56	}
57	if !done {
58		rt.Response.Response = future.Response()
59		err = azure.NewAsyncOpIncompleteError("signalr.CreateOrUpdateFuture")
60		return
61	}
62	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
63	if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent {
64		rt, err = client.CreateOrUpdateResponder(rt.Response.Response)
65		if err != nil {
66			err = autorest.NewErrorWithError(err, "signalr.CreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request")
67		}
68	}
69	return
70}
71
72// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
73type DeleteFuture struct {
74	azure.FutureAPI
75	// Result returns the result of the asynchronous operation.
76	// If the operation has not completed it will return an error.
77	Result func(Client) (autorest.Response, error)
78}
79
80// UnmarshalJSON is the custom unmarshaller for CreateFuture.
81func (future *DeleteFuture) UnmarshalJSON(body []byte) error {
82	var azFuture azure.Future
83	if err := json.Unmarshal(body, &azFuture); err != nil {
84		return err
85	}
86	future.FutureAPI = &azFuture
87	future.Result = future.result
88	return nil
89}
90
91// result is the default implementation for DeleteFuture.Result.
92func (future *DeleteFuture) result(client Client) (ar autorest.Response, err error) {
93	var done bool
94	done, err = future.DoneWithContext(context.Background(), client)
95	if err != nil {
96		err = autorest.NewErrorWithError(err, "signalr.DeleteFuture", "Result", future.Response(), "Polling failure")
97		return
98	}
99	if !done {
100		ar.Response = future.Response()
101		err = azure.NewAsyncOpIncompleteError("signalr.DeleteFuture")
102		return
103	}
104	ar.Response = future.Response()
105	return
106}
107
108// Dimension specifications of the Dimension of metrics.
109type Dimension struct {
110	// Name - The public facing name of the dimension.
111	Name *string `json:"name,omitempty"`
112	// DisplayName - Localized friendly display name of the dimension.
113	DisplayName *string `json:"displayName,omitempty"`
114	// InternalName - Name of the dimension as it appears in MDM.
115	InternalName *string `json:"internalName,omitempty"`
116	// ToBeExportedForShoebox - A Boolean flag indicating whether this dimension should be included for the shoebox export scenario.
117	ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"`
118}
119
120// ErrorAdditionalInfo the resource management error additional info.
121type ErrorAdditionalInfo struct {
122	// Type - READ-ONLY; The additional info type.
123	Type *string `json:"type,omitempty"`
124	// Info - READ-ONLY; The additional info.
125	Info interface{} `json:"info,omitempty"`
126}
127
128// MarshalJSON is the custom marshaler for ErrorAdditionalInfo.
129func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) {
130	objectMap := make(map[string]interface{})
131	return json.Marshal(objectMap)
132}
133
134// ErrorDetail the error detail.
135type ErrorDetail struct {
136	// Code - READ-ONLY; The error code.
137	Code *string `json:"code,omitempty"`
138	// Message - READ-ONLY; The error message.
139	Message *string `json:"message,omitempty"`
140	// Target - READ-ONLY; The error target.
141	Target *string `json:"target,omitempty"`
142	// Details - READ-ONLY; The error details.
143	Details *[]ErrorDetail `json:"details,omitempty"`
144	// AdditionalInfo - READ-ONLY; The error additional info.
145	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
146}
147
148// MarshalJSON is the custom marshaler for ErrorDetail.
149func (ed ErrorDetail) MarshalJSON() ([]byte, error) {
150	objectMap := make(map[string]interface{})
151	return json.Marshal(objectMap)
152}
153
154// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for
155// failed operations. (This also follows the OData error response format.).
156type ErrorResponse struct {
157	// Error - The error object.
158	Error *ErrorDetail `json:"error,omitempty"`
159}
160
161// Feature feature of a resource, which controls the runtime behavior.
162type Feature struct {
163	// Flag - FeatureFlags is the supported features of Azure SignalR service.
164	// - ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your application doesn't have a backend server; "Classic": for backward compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use.
165	// - EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category respectively.
166	// - EnableMessagingLogs: "true"/"false", to enable/disable the connectivity log category respectively.
167	// - EnableLiveTrace: Live Trace allows you to know what's happening inside Azure SignalR service, it will give you live traces in real time, it will be helpful when you developing your own Azure SignalR based web application or self-troubleshooting some issues. Please note that live traces are counted as outbound messages that will be charged. Values allowed: "true"/"false", to enable/disable live trace feature. Possible values include: 'FeatureFlagsServiceMode', 'FeatureFlagsEnableConnectivityLogs', 'FeatureFlagsEnableMessagingLogs', 'FeatureFlagsEnableLiveTrace'
168	Flag FeatureFlags `json:"flag,omitempty"`
169	// Value - Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/azure/azure-signalr/ for allowed values.
170	Value *string `json:"value,omitempty"`
171	// Properties - Optional properties related to this feature.
172	Properties map[string]*string `json:"properties"`
173}
174
175// MarshalJSON is the custom marshaler for Feature.
176func (f Feature) MarshalJSON() ([]byte, error) {
177	objectMap := make(map[string]interface{})
178	if f.Flag != "" {
179		objectMap["flag"] = f.Flag
180	}
181	if f.Value != nil {
182		objectMap["value"] = f.Value
183	}
184	if f.Properties != nil {
185		objectMap["properties"] = f.Properties
186	}
187	return json.Marshal(objectMap)
188}
189
190// Keys a class represents the access keys of the resource.
191type Keys struct {
192	autorest.Response `json:"-"`
193	// PrimaryKey - The primary access key.
194	PrimaryKey *string `json:"primaryKey,omitempty"`
195	// SecondaryKey - The secondary access key.
196	SecondaryKey *string `json:"secondaryKey,omitempty"`
197	// PrimaryConnectionString - Connection string constructed via the primaryKey
198	PrimaryConnectionString *string `json:"primaryConnectionString,omitempty"`
199	// SecondaryConnectionString - Connection string constructed via the secondaryKey
200	SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"`
201}
202
203// LogSpecification specifications of the Logs for Azure Monitoring.
204type LogSpecification struct {
205	// Name - Name of the log.
206	Name *string `json:"name,omitempty"`
207	// DisplayName - Localized friendly display name of the log.
208	DisplayName *string `json:"displayName,omitempty"`
209}
210
211// ManagedIdentity a class represent managed identities used for request and response
212type ManagedIdentity struct {
213	// Type - Represent the identity type: systemAssigned, userAssigned, None. Possible values include: 'ManagedIdentityTypeNone', 'ManagedIdentityTypeSystemAssigned', 'ManagedIdentityTypeUserAssigned'
214	Type ManagedIdentityType `json:"type,omitempty"`
215	// UserAssignedIdentities - Get or set the user assigned identities
216	UserAssignedIdentities map[string]*UserAssignedIdentityProperty `json:"userAssignedIdentities"`
217	// PrincipalID - READ-ONLY; Get the principal id for the system assigned identity.
218	// Only be used in response.
219	PrincipalID *string `json:"principalId,omitempty"`
220	// TenantID - READ-ONLY; Get the tenant id for the system assigned identity.
221	// Only be used in response
222	TenantID *string `json:"tenantId,omitempty"`
223}
224
225// MarshalJSON is the custom marshaler for ManagedIdentity.
226func (mi ManagedIdentity) MarshalJSON() ([]byte, error) {
227	objectMap := make(map[string]interface{})
228	if mi.Type != "" {
229		objectMap["type"] = mi.Type
230	}
231	if mi.UserAssignedIdentities != nil {
232		objectMap["userAssignedIdentities"] = mi.UserAssignedIdentities
233	}
234	return json.Marshal(objectMap)
235}
236
237// ManagedIdentitySettings managed identity settings for upstream.
238type ManagedIdentitySettings struct {
239	// Resource - The Resource indicating the App ID URI of the target resource.
240	// It also appears in the aud (audience) claim of the issued token.
241	Resource *string `json:"resource,omitempty"`
242}
243
244// MetricSpecification specifications of the Metrics for Azure Monitoring.
245type MetricSpecification struct {
246	// Name - Name of the metric.
247	Name *string `json:"name,omitempty"`
248	// DisplayName - Localized friendly display name of the metric.
249	DisplayName *string `json:"displayName,omitempty"`
250	// DisplayDescription - Localized friendly description of the metric.
251	DisplayDescription *string `json:"displayDescription,omitempty"`
252	// Unit - The unit that makes sense for the metric.
253	Unit *string `json:"unit,omitempty"`
254	// AggregationType - Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count.
255	AggregationType *string `json:"aggregationType,omitempty"`
256	// FillGapWithZero - Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published.
257	// Ex. a metric that returns the number of times a particular error code was emitted. The error code may not appear
258	// often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where nothing was emitted.
259	FillGapWithZero *string `json:"fillGapWithZero,omitempty"`
260	// Category - The name of the metric category that the metric belongs to. A metric can only belong to a single category.
261	Category *string `json:"category,omitempty"`
262	// Dimensions - The dimensions of the metrics.
263	Dimensions *[]Dimension `json:"dimensions,omitempty"`
264}
265
266// NameAvailability result of the request to check name availability. It contains a flag and possible
267// reason of failure.
268type NameAvailability struct {
269	autorest.Response `json:"-"`
270	// NameAvailable - Indicates whether the name is available or not.
271	NameAvailable *bool `json:"nameAvailable,omitempty"`
272	// Reason - The reason of the availability. Required if name is not available.
273	Reason *string `json:"reason,omitempty"`
274	// Message - The message of the operation.
275	Message *string `json:"message,omitempty"`
276}
277
278// NameAvailabilityParameters data POST-ed to the nameAvailability action
279type NameAvailabilityParameters struct {
280	// Type - The resource type. Can be "Microsoft.SignalRService/SignalR" or "Microsoft.SignalRService/webPubSub"
281	Type *string `json:"type,omitempty"`
282	// Name - The resource name to validate. e.g."my-resource-name"
283	Name *string `json:"name,omitempty"`
284}
285
286// NetworkACL network ACL
287type NetworkACL struct {
288	// Allow - Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI.
289	Allow *[]RequestType `json:"allow,omitempty"`
290	// Deny - Denied request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI.
291	Deny *[]RequestType `json:"deny,omitempty"`
292}
293
294// NetworkACLs network ACLs for the resource
295type NetworkACLs struct {
296	// DefaultAction - Default action when no other rule matches. Possible values include: 'ACLActionAllow', 'ACLActionDeny'
297	DefaultAction ACLAction `json:"defaultAction,omitempty"`
298	// PublicNetwork - ACL for requests from public network
299	PublicNetwork *NetworkACL `json:"publicNetwork,omitempty"`
300	// PrivateEndpoints - ACLs for requests from private endpoints
301	PrivateEndpoints *[]PrivateEndpointACL `json:"privateEndpoints,omitempty"`
302}
303
304// Operation REST API operation supported by resource provider.
305type Operation struct {
306	// Name - Name of the operation with format: {provider}/{resource}/{operation}
307	Name *string `json:"name,omitempty"`
308	// IsDataAction - If the operation is a data action. (for data plane rbac)
309	IsDataAction *bool `json:"isDataAction,omitempty"`
310	// Display - The object that describes the operation.
311	Display *OperationDisplay `json:"display,omitempty"`
312	// Origin - Optional. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX.
313	Origin *string `json:"origin,omitempty"`
314	// Properties - Extra properties for the operation.
315	Properties *OperationProperties `json:"properties,omitempty"`
316}
317
318// OperationDisplay the object that describes a operation.
319type OperationDisplay struct {
320	// Provider - Friendly name of the resource provider
321	Provider *string `json:"provider,omitempty"`
322	// Resource - Resource type on which the operation is performed.
323	Resource *string `json:"resource,omitempty"`
324	// Operation - The localized friendly name for the operation.
325	Operation *string `json:"operation,omitempty"`
326	// Description - The localized friendly description for the operation
327	Description *string `json:"description,omitempty"`
328}
329
330// OperationList result of the request to list REST API operations. It contains a list of operations.
331type OperationList struct {
332	autorest.Response `json:"-"`
333	// Value - List of operations supported by the resource provider.
334	Value *[]Operation `json:"value,omitempty"`
335	// NextLink - The URL the client should use to fetch the next page (per server side paging).
336	// It's null for now, added for future use.
337	NextLink *string `json:"nextLink,omitempty"`
338}
339
340// OperationListIterator provides access to a complete listing of Operation values.
341type OperationListIterator struct {
342	i    int
343	page OperationListPage
344}
345
346// NextWithContext advances to the next value.  If there was an error making
347// the request the iterator does not advance and the error is returned.
348func (iter *OperationListIterator) NextWithContext(ctx context.Context) (err error) {
349	if tracing.IsEnabled() {
350		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.NextWithContext")
351		defer func() {
352			sc := -1
353			if iter.Response().Response.Response != nil {
354				sc = iter.Response().Response.Response.StatusCode
355			}
356			tracing.EndSpan(ctx, sc, err)
357		}()
358	}
359	iter.i++
360	if iter.i < len(iter.page.Values()) {
361		return nil
362	}
363	err = iter.page.NextWithContext(ctx)
364	if err != nil {
365		iter.i--
366		return err
367	}
368	iter.i = 0
369	return nil
370}
371
372// Next advances to the next value.  If there was an error making
373// the request the iterator does not advance and the error is returned.
374// Deprecated: Use NextWithContext() instead.
375func (iter *OperationListIterator) Next() error {
376	return iter.NextWithContext(context.Background())
377}
378
379// NotDone returns true if the enumeration should be started or is not yet complete.
380func (iter OperationListIterator) NotDone() bool {
381	return iter.page.NotDone() && iter.i < len(iter.page.Values())
382}
383
384// Response returns the raw server response from the last page request.
385func (iter OperationListIterator) Response() OperationList {
386	return iter.page.Response()
387}
388
389// Value returns the current value or a zero-initialized value if the
390// iterator has advanced beyond the end of the collection.
391func (iter OperationListIterator) Value() Operation {
392	if !iter.page.NotDone() {
393		return Operation{}
394	}
395	return iter.page.Values()[iter.i]
396}
397
398// Creates a new instance of the OperationListIterator type.
399func NewOperationListIterator(page OperationListPage) OperationListIterator {
400	return OperationListIterator{page: page}
401}
402
403// IsEmpty returns true if the ListResult contains no values.
404func (ol OperationList) IsEmpty() bool {
405	return ol.Value == nil || len(*ol.Value) == 0
406}
407
408// hasNextLink returns true if the NextLink is not empty.
409func (ol OperationList) hasNextLink() bool {
410	return ol.NextLink != nil && len(*ol.NextLink) != 0
411}
412
413// operationListPreparer prepares a request to retrieve the next set of results.
414// It returns nil if no more results exist.
415func (ol OperationList) operationListPreparer(ctx context.Context) (*http.Request, error) {
416	if !ol.hasNextLink() {
417		return nil, nil
418	}
419	return autorest.Prepare((&http.Request{}).WithContext(ctx),
420		autorest.AsJSON(),
421		autorest.AsGet(),
422		autorest.WithBaseURL(to.String(ol.NextLink)))
423}
424
425// OperationListPage contains a page of Operation values.
426type OperationListPage struct {
427	fn func(context.Context, OperationList) (OperationList, error)
428	ol OperationList
429}
430
431// NextWithContext advances to the next page of values.  If there was an error making
432// the request the page does not advance and the error is returned.
433func (page *OperationListPage) NextWithContext(ctx context.Context) (err error) {
434	if tracing.IsEnabled() {
435		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.NextWithContext")
436		defer func() {
437			sc := -1
438			if page.Response().Response.Response != nil {
439				sc = page.Response().Response.Response.StatusCode
440			}
441			tracing.EndSpan(ctx, sc, err)
442		}()
443	}
444	for {
445		next, err := page.fn(ctx, page.ol)
446		if err != nil {
447			return err
448		}
449		page.ol = next
450		if !next.hasNextLink() || !next.IsEmpty() {
451			break
452		}
453	}
454	return nil
455}
456
457// Next advances to the next page of values.  If there was an error making
458// the request the page does not advance and the error is returned.
459// Deprecated: Use NextWithContext() instead.
460func (page *OperationListPage) Next() error {
461	return page.NextWithContext(context.Background())
462}
463
464// NotDone returns true if the page enumeration should be started or is not yet complete.
465func (page OperationListPage) NotDone() bool {
466	return !page.ol.IsEmpty()
467}
468
469// Response returns the raw server response from the last page request.
470func (page OperationListPage) Response() OperationList {
471	return page.ol
472}
473
474// Values returns the slice of values for the current page or nil if there are no values.
475func (page OperationListPage) Values() []Operation {
476	if page.ol.IsEmpty() {
477		return nil
478	}
479	return *page.ol.Value
480}
481
482// Creates a new instance of the OperationListPage type.
483func NewOperationListPage(cur OperationList, getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage {
484	return OperationListPage{
485		fn: getNextPage,
486		ol: cur,
487	}
488}
489
490// OperationProperties extra Operation properties.
491type OperationProperties struct {
492	// ServiceSpecification - The service specifications.
493	ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"`
494}
495
496// PrivateEndpoint private endpoint
497type PrivateEndpoint struct {
498	// ID - Full qualified Id of the private endpoint
499	ID *string `json:"id,omitempty"`
500}
501
502// PrivateEndpointACL ACL for a private endpoint
503type PrivateEndpointACL struct {
504	// Name - Name of the private endpoint connection
505	Name *string `json:"name,omitempty"`
506	// Allow - Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI.
507	Allow *[]RequestType `json:"allow,omitempty"`
508	// Deny - Denied request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI.
509	Deny *[]RequestType `json:"deny,omitempty"`
510}
511
512// PrivateEndpointConnection a private endpoint connection to an azure resource
513type PrivateEndpointConnection struct {
514	autorest.Response `json:"-"`
515	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
516	SystemData *SystemData `json:"systemData,omitempty"`
517	// PrivateEndpointConnectionProperties - Properties of the private endpoint connection
518	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
519	// ID - READ-ONLY; Fully qualified resource Id for the resource.
520	ID *string `json:"id,omitempty"`
521	// Name - READ-ONLY; The name of the resource.
522	Name *string `json:"name,omitempty"`
523	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
524	Type *string `json:"type,omitempty"`
525}
526
527// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
528func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
529	objectMap := make(map[string]interface{})
530	if pec.PrivateEndpointConnectionProperties != nil {
531		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
532	}
533	return json.Marshal(objectMap)
534}
535
536// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
537func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
538	var m map[string]*json.RawMessage
539	err := json.Unmarshal(body, &m)
540	if err != nil {
541		return err
542	}
543	for k, v := range m {
544		switch k {
545		case "systemData":
546			if v != nil {
547				var systemData SystemData
548				err = json.Unmarshal(*v, &systemData)
549				if err != nil {
550					return err
551				}
552				pec.SystemData = &systemData
553			}
554		case "properties":
555			if v != nil {
556				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
557				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
558				if err != nil {
559					return err
560				}
561				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
562			}
563		case "id":
564			if v != nil {
565				var ID string
566				err = json.Unmarshal(*v, &ID)
567				if err != nil {
568					return err
569				}
570				pec.ID = &ID
571			}
572		case "name":
573			if v != nil {
574				var name string
575				err = json.Unmarshal(*v, &name)
576				if err != nil {
577					return err
578				}
579				pec.Name = &name
580			}
581		case "type":
582			if v != nil {
583				var typeVar string
584				err = json.Unmarshal(*v, &typeVar)
585				if err != nil {
586					return err
587				}
588				pec.Type = &typeVar
589			}
590		}
591	}
592
593	return nil
594}
595
596// PrivateEndpointConnectionList a list of private endpoint connections
597type PrivateEndpointConnectionList struct {
598	autorest.Response `json:"-"`
599	// Value - The list of the private endpoint connections
600	Value *[]PrivateEndpointConnection `json:"value,omitempty"`
601	// NextLink - Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested private endpoint connections exceed maximum page size.
602	NextLink *string `json:"nextLink,omitempty"`
603}
604
605// PrivateEndpointConnectionListIterator provides access to a complete listing of PrivateEndpointConnection
606// values.
607type PrivateEndpointConnectionListIterator struct {
608	i    int
609	page PrivateEndpointConnectionListPage
610}
611
612// NextWithContext advances to the next value.  If there was an error making
613// the request the iterator does not advance and the error is returned.
614func (iter *PrivateEndpointConnectionListIterator) NextWithContext(ctx context.Context) (err error) {
615	if tracing.IsEnabled() {
616		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListIterator.NextWithContext")
617		defer func() {
618			sc := -1
619			if iter.Response().Response.Response != nil {
620				sc = iter.Response().Response.Response.StatusCode
621			}
622			tracing.EndSpan(ctx, sc, err)
623		}()
624	}
625	iter.i++
626	if iter.i < len(iter.page.Values()) {
627		return nil
628	}
629	err = iter.page.NextWithContext(ctx)
630	if err != nil {
631		iter.i--
632		return err
633	}
634	iter.i = 0
635	return nil
636}
637
638// Next advances to the next value.  If there was an error making
639// the request the iterator does not advance and the error is returned.
640// Deprecated: Use NextWithContext() instead.
641func (iter *PrivateEndpointConnectionListIterator) Next() error {
642	return iter.NextWithContext(context.Background())
643}
644
645// NotDone returns true if the enumeration should be started or is not yet complete.
646func (iter PrivateEndpointConnectionListIterator) NotDone() bool {
647	return iter.page.NotDone() && iter.i < len(iter.page.Values())
648}
649
650// Response returns the raw server response from the last page request.
651func (iter PrivateEndpointConnectionListIterator) Response() PrivateEndpointConnectionList {
652	return iter.page.Response()
653}
654
655// Value returns the current value or a zero-initialized value if the
656// iterator has advanced beyond the end of the collection.
657func (iter PrivateEndpointConnectionListIterator) Value() PrivateEndpointConnection {
658	if !iter.page.NotDone() {
659		return PrivateEndpointConnection{}
660	}
661	return iter.page.Values()[iter.i]
662}
663
664// Creates a new instance of the PrivateEndpointConnectionListIterator type.
665func NewPrivateEndpointConnectionListIterator(page PrivateEndpointConnectionListPage) PrivateEndpointConnectionListIterator {
666	return PrivateEndpointConnectionListIterator{page: page}
667}
668
669// IsEmpty returns true if the ListResult contains no values.
670func (pecl PrivateEndpointConnectionList) IsEmpty() bool {
671	return pecl.Value == nil || len(*pecl.Value) == 0
672}
673
674// hasNextLink returns true if the NextLink is not empty.
675func (pecl PrivateEndpointConnectionList) hasNextLink() bool {
676	return pecl.NextLink != nil && len(*pecl.NextLink) != 0
677}
678
679// privateEndpointConnectionListPreparer prepares a request to retrieve the next set of results.
680// It returns nil if no more results exist.
681func (pecl PrivateEndpointConnectionList) privateEndpointConnectionListPreparer(ctx context.Context) (*http.Request, error) {
682	if !pecl.hasNextLink() {
683		return nil, nil
684	}
685	return autorest.Prepare((&http.Request{}).WithContext(ctx),
686		autorest.AsJSON(),
687		autorest.AsGet(),
688		autorest.WithBaseURL(to.String(pecl.NextLink)))
689}
690
691// PrivateEndpointConnectionListPage contains a page of PrivateEndpointConnection values.
692type PrivateEndpointConnectionListPage struct {
693	fn   func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error)
694	pecl PrivateEndpointConnectionList
695}
696
697// NextWithContext advances to the next page of values.  If there was an error making
698// the request the page does not advance and the error is returned.
699func (page *PrivateEndpointConnectionListPage) NextWithContext(ctx context.Context) (err error) {
700	if tracing.IsEnabled() {
701		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListPage.NextWithContext")
702		defer func() {
703			sc := -1
704			if page.Response().Response.Response != nil {
705				sc = page.Response().Response.Response.StatusCode
706			}
707			tracing.EndSpan(ctx, sc, err)
708		}()
709	}
710	for {
711		next, err := page.fn(ctx, page.pecl)
712		if err != nil {
713			return err
714		}
715		page.pecl = next
716		if !next.hasNextLink() || !next.IsEmpty() {
717			break
718		}
719	}
720	return nil
721}
722
723// Next advances to the next page of values.  If there was an error making
724// the request the page does not advance and the error is returned.
725// Deprecated: Use NextWithContext() instead.
726func (page *PrivateEndpointConnectionListPage) Next() error {
727	return page.NextWithContext(context.Background())
728}
729
730// NotDone returns true if the page enumeration should be started or is not yet complete.
731func (page PrivateEndpointConnectionListPage) NotDone() bool {
732	return !page.pecl.IsEmpty()
733}
734
735// Response returns the raw server response from the last page request.
736func (page PrivateEndpointConnectionListPage) Response() PrivateEndpointConnectionList {
737	return page.pecl
738}
739
740// Values returns the slice of values for the current page or nil if there are no values.
741func (page PrivateEndpointConnectionListPage) Values() []PrivateEndpointConnection {
742	if page.pecl.IsEmpty() {
743		return nil
744	}
745	return *page.pecl.Value
746}
747
748// Creates a new instance of the PrivateEndpointConnectionListPage type.
749func NewPrivateEndpointConnectionListPage(cur PrivateEndpointConnectionList, getNextPage func(context.Context, PrivateEndpointConnectionList) (PrivateEndpointConnectionList, error)) PrivateEndpointConnectionListPage {
750	return PrivateEndpointConnectionListPage{
751		fn:   getNextPage,
752		pecl: cur,
753	}
754}
755
756// PrivateEndpointConnectionProperties private endpoint connection properties
757type PrivateEndpointConnectionProperties struct {
758	// ProvisioningState - READ-ONLY; Provisioning state of the private endpoint connection. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateMoving'
759	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
760	// PrivateEndpoint - Private endpoint associated with the private endpoint connection
761	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
762	// PrivateLinkServiceConnectionState - Connection state
763	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
764}
765
766// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties.
767func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) {
768	objectMap := make(map[string]interface{})
769	if pecp.PrivateEndpoint != nil {
770		objectMap["privateEndpoint"] = pecp.PrivateEndpoint
771	}
772	if pecp.PrivateLinkServiceConnectionState != nil {
773		objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState
774	}
775	return json.Marshal(objectMap)
776}
777
778// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
779// long-running operation.
780type PrivateEndpointConnectionsDeleteFuture struct {
781	azure.FutureAPI
782	// Result returns the result of the asynchronous operation.
783	// If the operation has not completed it will return an error.
784	Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
785}
786
787// UnmarshalJSON is the custom unmarshaller for CreateFuture.
788func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
789	var azFuture azure.Future
790	if err := json.Unmarshal(body, &azFuture); err != nil {
791		return err
792	}
793	future.FutureAPI = &azFuture
794	future.Result = future.result
795	return nil
796}
797
798// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result.
799func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
800	var done bool
801	done, err = future.DoneWithContext(context.Background(), client)
802	if err != nil {
803		err = autorest.NewErrorWithError(err, "signalr.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
804		return
805	}
806	if !done {
807		ar.Response = future.Response()
808		err = azure.NewAsyncOpIncompleteError("signalr.PrivateEndpointConnectionsDeleteFuture")
809		return
810	}
811	ar.Response = future.Response()
812	return
813}
814
815// PrivateLinkResource private link resource
816type PrivateLinkResource struct {
817	// PrivateLinkResourceProperties - Properties of a private link resource
818	*PrivateLinkResourceProperties `json:"properties,omitempty"`
819	// ID - READ-ONLY; Fully qualified resource Id for the resource.
820	ID *string `json:"id,omitempty"`
821	// Name - READ-ONLY; The name of the resource.
822	Name *string `json:"name,omitempty"`
823	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
824	Type *string `json:"type,omitempty"`
825}
826
827// MarshalJSON is the custom marshaler for PrivateLinkResource.
828func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
829	objectMap := make(map[string]interface{})
830	if plr.PrivateLinkResourceProperties != nil {
831		objectMap["properties"] = plr.PrivateLinkResourceProperties
832	}
833	return json.Marshal(objectMap)
834}
835
836// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
837func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
838	var m map[string]*json.RawMessage
839	err := json.Unmarshal(body, &m)
840	if err != nil {
841		return err
842	}
843	for k, v := range m {
844		switch k {
845		case "properties":
846			if v != nil {
847				var privateLinkResourceProperties PrivateLinkResourceProperties
848				err = json.Unmarshal(*v, &privateLinkResourceProperties)
849				if err != nil {
850					return err
851				}
852				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
853			}
854		case "id":
855			if v != nil {
856				var ID string
857				err = json.Unmarshal(*v, &ID)
858				if err != nil {
859					return err
860				}
861				plr.ID = &ID
862			}
863		case "name":
864			if v != nil {
865				var name string
866				err = json.Unmarshal(*v, &name)
867				if err != nil {
868					return err
869				}
870				plr.Name = &name
871			}
872		case "type":
873			if v != nil {
874				var typeVar string
875				err = json.Unmarshal(*v, &typeVar)
876				if err != nil {
877					return err
878				}
879				plr.Type = &typeVar
880			}
881		}
882	}
883
884	return nil
885}
886
887// PrivateLinkResourceList contains a list of PrivateLinkResource and a possible link to query more results
888type PrivateLinkResourceList struct {
889	autorest.Response `json:"-"`
890	// Value - List of PrivateLinkResource
891	Value *[]PrivateLinkResource `json:"value,omitempty"`
892	// NextLink - The URL the client should use to fetch the next page (per server side paging).
893	// It's null for now, added for future use.
894	NextLink *string `json:"nextLink,omitempty"`
895}
896
897// PrivateLinkResourceListIterator provides access to a complete listing of PrivateLinkResource values.
898type PrivateLinkResourceListIterator struct {
899	i    int
900	page PrivateLinkResourceListPage
901}
902
903// NextWithContext advances to the next value.  If there was an error making
904// the request the iterator does not advance and the error is returned.
905func (iter *PrivateLinkResourceListIterator) NextWithContext(ctx context.Context) (err error) {
906	if tracing.IsEnabled() {
907		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListIterator.NextWithContext")
908		defer func() {
909			sc := -1
910			if iter.Response().Response.Response != nil {
911				sc = iter.Response().Response.Response.StatusCode
912			}
913			tracing.EndSpan(ctx, sc, err)
914		}()
915	}
916	iter.i++
917	if iter.i < len(iter.page.Values()) {
918		return nil
919	}
920	err = iter.page.NextWithContext(ctx)
921	if err != nil {
922		iter.i--
923		return err
924	}
925	iter.i = 0
926	return nil
927}
928
929// Next advances to the next value.  If there was an error making
930// the request the iterator does not advance and the error is returned.
931// Deprecated: Use NextWithContext() instead.
932func (iter *PrivateLinkResourceListIterator) Next() error {
933	return iter.NextWithContext(context.Background())
934}
935
936// NotDone returns true if the enumeration should be started or is not yet complete.
937func (iter PrivateLinkResourceListIterator) NotDone() bool {
938	return iter.page.NotDone() && iter.i < len(iter.page.Values())
939}
940
941// Response returns the raw server response from the last page request.
942func (iter PrivateLinkResourceListIterator) Response() PrivateLinkResourceList {
943	return iter.page.Response()
944}
945
946// Value returns the current value or a zero-initialized value if the
947// iterator has advanced beyond the end of the collection.
948func (iter PrivateLinkResourceListIterator) Value() PrivateLinkResource {
949	if !iter.page.NotDone() {
950		return PrivateLinkResource{}
951	}
952	return iter.page.Values()[iter.i]
953}
954
955// Creates a new instance of the PrivateLinkResourceListIterator type.
956func NewPrivateLinkResourceListIterator(page PrivateLinkResourceListPage) PrivateLinkResourceListIterator {
957	return PrivateLinkResourceListIterator{page: page}
958}
959
960// IsEmpty returns true if the ListResult contains no values.
961func (plrl PrivateLinkResourceList) IsEmpty() bool {
962	return plrl.Value == nil || len(*plrl.Value) == 0
963}
964
965// hasNextLink returns true if the NextLink is not empty.
966func (plrl PrivateLinkResourceList) hasNextLink() bool {
967	return plrl.NextLink != nil && len(*plrl.NextLink) != 0
968}
969
970// privateLinkResourceListPreparer prepares a request to retrieve the next set of results.
971// It returns nil if no more results exist.
972func (plrl PrivateLinkResourceList) privateLinkResourceListPreparer(ctx context.Context) (*http.Request, error) {
973	if !plrl.hasNextLink() {
974		return nil, nil
975	}
976	return autorest.Prepare((&http.Request{}).WithContext(ctx),
977		autorest.AsJSON(),
978		autorest.AsGet(),
979		autorest.WithBaseURL(to.String(plrl.NextLink)))
980}
981
982// PrivateLinkResourceListPage contains a page of PrivateLinkResource values.
983type PrivateLinkResourceListPage struct {
984	fn   func(context.Context, PrivateLinkResourceList) (PrivateLinkResourceList, error)
985	plrl PrivateLinkResourceList
986}
987
988// NextWithContext advances to the next page of values.  If there was an error making
989// the request the page does not advance and the error is returned.
990func (page *PrivateLinkResourceListPage) NextWithContext(ctx context.Context) (err error) {
991	if tracing.IsEnabled() {
992		ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListPage.NextWithContext")
993		defer func() {
994			sc := -1
995			if page.Response().Response.Response != nil {
996				sc = page.Response().Response.Response.StatusCode
997			}
998			tracing.EndSpan(ctx, sc, err)
999		}()
1000	}
1001	for {
1002		next, err := page.fn(ctx, page.plrl)
1003		if err != nil {
1004			return err
1005		}
1006		page.plrl = next
1007		if !next.hasNextLink() || !next.IsEmpty() {
1008			break
1009		}
1010	}
1011	return nil
1012}
1013
1014// Next advances to the next page of values.  If there was an error making
1015// the request the page does not advance and the error is returned.
1016// Deprecated: Use NextWithContext() instead.
1017func (page *PrivateLinkResourceListPage) Next() error {
1018	return page.NextWithContext(context.Background())
1019}
1020
1021// NotDone returns true if the page enumeration should be started or is not yet complete.
1022func (page PrivateLinkResourceListPage) NotDone() bool {
1023	return !page.plrl.IsEmpty()
1024}
1025
1026// Response returns the raw server response from the last page request.
1027func (page PrivateLinkResourceListPage) Response() PrivateLinkResourceList {
1028	return page.plrl
1029}
1030
1031// Values returns the slice of values for the current page or nil if there are no values.
1032func (page PrivateLinkResourceListPage) Values() []PrivateLinkResource {
1033	if page.plrl.IsEmpty() {
1034		return nil
1035	}
1036	return *page.plrl.Value
1037}
1038
1039// Creates a new instance of the PrivateLinkResourceListPage type.
1040func NewPrivateLinkResourceListPage(cur PrivateLinkResourceList, getNextPage func(context.Context, PrivateLinkResourceList) (PrivateLinkResourceList, error)) PrivateLinkResourceListPage {
1041	return PrivateLinkResourceListPage{
1042		fn:   getNextPage,
1043		plrl: cur,
1044	}
1045}
1046
1047// PrivateLinkResourceProperties private link resource properties
1048type PrivateLinkResourceProperties struct {
1049	// GroupID - Group Id of the private link resource
1050	GroupID *string `json:"groupId,omitempty"`
1051	// RequiredMembers - Required members of the private link resource
1052	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
1053	// RequiredZoneNames - Required private DNS zone names
1054	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
1055	// ShareablePrivateLinkResourceTypes - The list of resources that are onboarded to private link service
1056	ShareablePrivateLinkResourceTypes *[]ShareablePrivateLinkResourceType `json:"shareablePrivateLinkResourceTypes,omitempty"`
1057}
1058
1059// PrivateLinkServiceConnectionState connection state of the private endpoint connection
1060type PrivateLinkServiceConnectionState struct {
1061	// Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'PrivateLinkServiceConnectionStatusPending', 'PrivateLinkServiceConnectionStatusApproved', 'PrivateLinkServiceConnectionStatusRejected', 'PrivateLinkServiceConnectionStatusDisconnected'
1062	Status PrivateLinkServiceConnectionStatus `json:"status,omitempty"`
1063	// Description - The reason for approval/rejection of the connection.
1064	Description *string `json:"description,omitempty"`
1065	// ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.
1066	ActionsRequired *string `json:"actionsRequired,omitempty"`
1067}
1068
1069// Properties a class that describes the properties of the resource
1070type Properties struct {
1071	// ProvisioningState - READ-ONLY; Provisioning state of the resource. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateMoving'
1072	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1073	// ExternalIP - READ-ONLY; The publicly accessible IP of the resource.
1074	ExternalIP *string `json:"externalIP,omitempty"`
1075	// HostName - READ-ONLY; FQDN of the service instance.
1076	HostName *string `json:"hostName,omitempty"`
1077	// PublicPort - READ-ONLY; The publicly accessible port of the resource which is designed for browser/client side usage.
1078	PublicPort *int32 `json:"publicPort,omitempty"`
1079	// ServerPort - READ-ONLY; The publicly accessible port of the resource which is designed for customer server side usage.
1080	ServerPort *int32 `json:"serverPort,omitempty"`
1081	// Version - READ-ONLY; Version of the resource. Probably you need the same or higher version of client SDKs.
1082	Version *string `json:"version,omitempty"`
1083	// PrivateEndpointConnections - READ-ONLY; Private endpoint connections to the resource.
1084	PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"`
1085	// SharedPrivateLinkResources - READ-ONLY; The list of shared private link resources.
1086	SharedPrivateLinkResources *[]SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty"`
1087	// TLS - TLS settings.
1088	TLS *TLSSettings `json:"tls,omitempty"`
1089	// Features - List of the featureFlags.
1090	//
1091	// FeatureFlags that are not included in the parameters for the update operation will not be modified.
1092	// And the response will only include featureFlags that are explicitly set.
1093	// When a featureFlag is not explicitly set, its globally default value will be used
1094	// But keep in mind, the default value doesn't mean "false". It varies in terms of different FeatureFlags.
1095	Features *[]Feature `json:"features,omitempty"`
1096	// Cors - Cross-Origin Resource Sharing (CORS) settings.
1097	Cors *CorsSettings `json:"cors,omitempty"`
1098	// Upstream - Upstream settings when the service is in server-less mode.
1099	Upstream *ServerlessUpstreamSettings `json:"upstream,omitempty"`
1100	// NetworkACLs - Network ACLs
1101	NetworkACLs *NetworkACLs `json:"networkACLs,omitempty"`
1102	// PublicNetworkAccess - Enable or disable public network access. Default to "Enabled".
1103	// When it's Enabled, network ACLs still apply.
1104	// When it's Disabled, public network access is always disabled no matter what you set in network ACLs.
1105	PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"`
1106	// DisableLocalAuth - DisableLocalAuth
1107	// Enable or disable local auth with AccessKey
1108	// When set as true, connection with AccessKey=xxx won't work.
1109	DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"`
1110	// DisableAadAuth - disableAadAuth
1111	// Enable or disable aad auth
1112	// When set as true, connection with AuthType=aad won't work.
1113	DisableAadAuth *bool `json:"disableAadAuth,omitempty"`
1114}
1115
1116// MarshalJSON is the custom marshaler for Properties.
1117func (p Properties) MarshalJSON() ([]byte, error) {
1118	objectMap := make(map[string]interface{})
1119	if p.TLS != nil {
1120		objectMap["tls"] = p.TLS
1121	}
1122	if p.Features != nil {
1123		objectMap["features"] = p.Features
1124	}
1125	if p.Cors != nil {
1126		objectMap["cors"] = p.Cors
1127	}
1128	if p.Upstream != nil {
1129		objectMap["upstream"] = p.Upstream
1130	}
1131	if p.NetworkACLs != nil {
1132		objectMap["networkACLs"] = p.NetworkACLs
1133	}
1134	if p.PublicNetworkAccess != nil {
1135		objectMap["publicNetworkAccess"] = p.PublicNetworkAccess
1136	}
1137	if p.DisableLocalAuth != nil {
1138		objectMap["disableLocalAuth"] = p.DisableLocalAuth
1139	}
1140	if p.DisableAadAuth != nil {
1141		objectMap["disableAadAuth"] = p.DisableAadAuth
1142	}
1143	return json.Marshal(objectMap)
1144}
1145
1146// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
1147// required location and tags
1148type ProxyResource struct {
1149	// ID - READ-ONLY; Fully qualified resource Id for the resource.
1150	ID *string `json:"id,omitempty"`
1151	// Name - READ-ONLY; The name of the resource.
1152	Name *string `json:"name,omitempty"`
1153	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
1154	Type *string `json:"type,omitempty"`
1155}
1156
1157// MarshalJSON is the custom marshaler for ProxyResource.
1158func (pr ProxyResource) MarshalJSON() ([]byte, error) {
1159	objectMap := make(map[string]interface{})
1160	return json.Marshal(objectMap)
1161}
1162
1163// RegenerateKeyFuture an abstraction for monitoring and retrieving the results of a long-running
1164// operation.
1165type RegenerateKeyFuture struct {
1166	azure.FutureAPI
1167	// Result returns the result of the asynchronous operation.
1168	// If the operation has not completed it will return an error.
1169	Result func(Client) (Keys, error)
1170}
1171
1172// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1173func (future *RegenerateKeyFuture) UnmarshalJSON(body []byte) error {
1174	var azFuture azure.Future
1175	if err := json.Unmarshal(body, &azFuture); err != nil {
1176		return err
1177	}
1178	future.FutureAPI = &azFuture
1179	future.Result = future.result
1180	return nil
1181}
1182
1183// result is the default implementation for RegenerateKeyFuture.Result.
1184func (future *RegenerateKeyFuture) result(client Client) (kVar Keys, err error) {
1185	var done bool
1186	done, err = future.DoneWithContext(context.Background(), client)
1187	if err != nil {
1188		err = autorest.NewErrorWithError(err, "signalr.RegenerateKeyFuture", "Result", future.Response(), "Polling failure")
1189		return
1190	}
1191	if !done {
1192		kVar.Response.Response = future.Response()
1193		err = azure.NewAsyncOpIncompleteError("signalr.RegenerateKeyFuture")
1194		return
1195	}
1196	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1197	if kVar.Response.Response, err = future.GetResult(sender); err == nil && kVar.Response.Response.StatusCode != http.StatusNoContent {
1198		kVar, err = client.RegenerateKeyResponder(kVar.Response.Response)
1199		if err != nil {
1200			err = autorest.NewErrorWithError(err, "signalr.RegenerateKeyFuture", "Result", kVar.Response.Response, "Failure responding to request")
1201		}
1202	}
1203	return
1204}
1205
1206// RegenerateKeyParameters parameters describes the request to regenerate access keys
1207type RegenerateKeyParameters struct {
1208	// KeyType - The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'KeyTypePrimary', 'KeyTypeSecondary'
1209	KeyType KeyType `json:"keyType,omitempty"`
1210}
1211
1212// Resource the core properties of ARM resources.
1213type Resource struct {
1214	// ID - READ-ONLY; Fully qualified resource Id for the resource.
1215	ID *string `json:"id,omitempty"`
1216	// Name - READ-ONLY; The name of the resource.
1217	Name *string `json:"name,omitempty"`
1218	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
1219	Type *string `json:"type,omitempty"`
1220}
1221
1222// MarshalJSON is the custom marshaler for Resource.
1223func (r Resource) MarshalJSON() ([]byte, error) {
1224	objectMap := make(map[string]interface{})
1225	return json.Marshal(objectMap)
1226}
1227
1228// ResourceList object that includes an array of resources and a possible link for next set.
1229type ResourceList struct {
1230	autorest.Response `json:"-"`
1231	// Value - List of the resources
1232	Value *[]ResourceType `json:"value,omitempty"`
1233	// NextLink - The URL the client should use to fetch the next page (per server side paging).
1234	// It's null for now, added for future use.
1235	NextLink *string `json:"nextLink,omitempty"`
1236}
1237
1238// ResourceListIterator provides access to a complete listing of ResourceType values.
1239type ResourceListIterator struct {
1240	i    int
1241	page ResourceListPage
1242}
1243
1244// NextWithContext advances to the next value.  If there was an error making
1245// the request the iterator does not advance and the error is returned.
1246func (iter *ResourceListIterator) NextWithContext(ctx context.Context) (err error) {
1247	if tracing.IsEnabled() {
1248		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListIterator.NextWithContext")
1249		defer func() {
1250			sc := -1
1251			if iter.Response().Response.Response != nil {
1252				sc = iter.Response().Response.Response.StatusCode
1253			}
1254			tracing.EndSpan(ctx, sc, err)
1255		}()
1256	}
1257	iter.i++
1258	if iter.i < len(iter.page.Values()) {
1259		return nil
1260	}
1261	err = iter.page.NextWithContext(ctx)
1262	if err != nil {
1263		iter.i--
1264		return err
1265	}
1266	iter.i = 0
1267	return nil
1268}
1269
1270// Next advances to the next value.  If there was an error making
1271// the request the iterator does not advance and the error is returned.
1272// Deprecated: Use NextWithContext() instead.
1273func (iter *ResourceListIterator) Next() error {
1274	return iter.NextWithContext(context.Background())
1275}
1276
1277// NotDone returns true if the enumeration should be started or is not yet complete.
1278func (iter ResourceListIterator) NotDone() bool {
1279	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1280}
1281
1282// Response returns the raw server response from the last page request.
1283func (iter ResourceListIterator) Response() ResourceList {
1284	return iter.page.Response()
1285}
1286
1287// Value returns the current value or a zero-initialized value if the
1288// iterator has advanced beyond the end of the collection.
1289func (iter ResourceListIterator) Value() ResourceType {
1290	if !iter.page.NotDone() {
1291		return ResourceType{}
1292	}
1293	return iter.page.Values()[iter.i]
1294}
1295
1296// Creates a new instance of the ResourceListIterator type.
1297func NewResourceListIterator(page ResourceListPage) ResourceListIterator {
1298	return ResourceListIterator{page: page}
1299}
1300
1301// IsEmpty returns true if the ListResult contains no values.
1302func (rl ResourceList) IsEmpty() bool {
1303	return rl.Value == nil || len(*rl.Value) == 0
1304}
1305
1306// hasNextLink returns true if the NextLink is not empty.
1307func (rl ResourceList) hasNextLink() bool {
1308	return rl.NextLink != nil && len(*rl.NextLink) != 0
1309}
1310
1311// resourceListPreparer prepares a request to retrieve the next set of results.
1312// It returns nil if no more results exist.
1313func (rl ResourceList) resourceListPreparer(ctx context.Context) (*http.Request, error) {
1314	if !rl.hasNextLink() {
1315		return nil, nil
1316	}
1317	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1318		autorest.AsJSON(),
1319		autorest.AsGet(),
1320		autorest.WithBaseURL(to.String(rl.NextLink)))
1321}
1322
1323// ResourceListPage contains a page of ResourceType values.
1324type ResourceListPage struct {
1325	fn func(context.Context, ResourceList) (ResourceList, error)
1326	rl ResourceList
1327}
1328
1329// NextWithContext advances to the next page of values.  If there was an error making
1330// the request the page does not advance and the error is returned.
1331func (page *ResourceListPage) NextWithContext(ctx context.Context) (err error) {
1332	if tracing.IsEnabled() {
1333		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListPage.NextWithContext")
1334		defer func() {
1335			sc := -1
1336			if page.Response().Response.Response != nil {
1337				sc = page.Response().Response.Response.StatusCode
1338			}
1339			tracing.EndSpan(ctx, sc, err)
1340		}()
1341	}
1342	for {
1343		next, err := page.fn(ctx, page.rl)
1344		if err != nil {
1345			return err
1346		}
1347		page.rl = next
1348		if !next.hasNextLink() || !next.IsEmpty() {
1349			break
1350		}
1351	}
1352	return nil
1353}
1354
1355// Next advances to the next page of values.  If there was an error making
1356// the request the page does not advance and the error is returned.
1357// Deprecated: Use NextWithContext() instead.
1358func (page *ResourceListPage) Next() error {
1359	return page.NextWithContext(context.Background())
1360}
1361
1362// NotDone returns true if the page enumeration should be started or is not yet complete.
1363func (page ResourceListPage) NotDone() bool {
1364	return !page.rl.IsEmpty()
1365}
1366
1367// Response returns the raw server response from the last page request.
1368func (page ResourceListPage) Response() ResourceList {
1369	return page.rl
1370}
1371
1372// Values returns the slice of values for the current page or nil if there are no values.
1373func (page ResourceListPage) Values() []ResourceType {
1374	if page.rl.IsEmpty() {
1375		return nil
1376	}
1377	return *page.rl.Value
1378}
1379
1380// Creates a new instance of the ResourceListPage type.
1381func NewResourceListPage(cur ResourceList, getNextPage func(context.Context, ResourceList) (ResourceList, error)) ResourceListPage {
1382	return ResourceListPage{
1383		fn: getNextPage,
1384		rl: cur,
1385	}
1386}
1387
1388// ResourceSku the billing information of the resource.
1389type ResourceSku struct {
1390	// Name - The name of the SKU. Required.
1391	//
1392	// Allowed values: Standard_S1, Free_F1
1393	Name *string `json:"name,omitempty"`
1394	// Tier - Optional tier of this particular SKU. 'Standard' or 'Free'.
1395	//
1396	// `Basic` is deprecated, use `Standard` instead. Possible values include: 'SkuTierFree', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium'
1397	Tier SkuTier `json:"tier,omitempty"`
1398	// Size - READ-ONLY; Not used. Retained for future use.
1399	Size *string `json:"size,omitempty"`
1400	// Family - READ-ONLY; Not used. Retained for future use.
1401	Family *string `json:"family,omitempty"`
1402	// Capacity - Optional, integer. The unit count of the resource. 1 by default.
1403	//
1404	// If present, following values are allowed:
1405	//     Free: 1
1406	//     Standard: 1,2,5,10,20,50,100
1407	Capacity *int32 `json:"capacity,omitempty"`
1408}
1409
1410// MarshalJSON is the custom marshaler for ResourceSku.
1411func (rs ResourceSku) MarshalJSON() ([]byte, error) {
1412	objectMap := make(map[string]interface{})
1413	if rs.Name != nil {
1414		objectMap["name"] = rs.Name
1415	}
1416	if rs.Tier != "" {
1417		objectMap["tier"] = rs.Tier
1418	}
1419	if rs.Capacity != nil {
1420		objectMap["capacity"] = rs.Capacity
1421	}
1422	return json.Marshal(objectMap)
1423}
1424
1425// ResourceType a class represent a resource.
1426type ResourceType struct {
1427	autorest.Response `json:"-"`
1428	// Sku - The billing information of the resource.(e.g. Free, Standard)
1429	Sku *ResourceSku `json:"sku,omitempty"`
1430	// Properties - Settings used to provision or configure the resource
1431	*Properties `json:"properties,omitempty"`
1432	// Kind - The kind of the service - e.g. "SignalR" for "Microsoft.SignalRService/SignalR". Possible values include: 'ServiceKindSignalR', 'ServiceKindRawWebSockets'
1433	Kind ServiceKind `json:"kind,omitempty"`
1434	// Identity - The managed identity response
1435	Identity *ManagedIdentity `json:"identity,omitempty"`
1436	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
1437	SystemData *SystemData `json:"systemData,omitempty"`
1438	// Location - The GEO location of the resource. e.g. West US | East US | North Central US | South Central US.
1439	Location *string `json:"location,omitempty"`
1440	// Tags - Tags of the service which is a list of key value pairs that describe the resource.
1441	Tags map[string]*string `json:"tags"`
1442	// ID - READ-ONLY; Fully qualified resource Id for the resource.
1443	ID *string `json:"id,omitempty"`
1444	// Name - READ-ONLY; The name of the resource.
1445	Name *string `json:"name,omitempty"`
1446	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
1447	Type *string `json:"type,omitempty"`
1448}
1449
1450// MarshalJSON is the custom marshaler for ResourceType.
1451func (rt ResourceType) MarshalJSON() ([]byte, error) {
1452	objectMap := make(map[string]interface{})
1453	if rt.Sku != nil {
1454		objectMap["sku"] = rt.Sku
1455	}
1456	if rt.Properties != nil {
1457		objectMap["properties"] = rt.Properties
1458	}
1459	if rt.Kind != "" {
1460		objectMap["kind"] = rt.Kind
1461	}
1462	if rt.Identity != nil {
1463		objectMap["identity"] = rt.Identity
1464	}
1465	if rt.Location != nil {
1466		objectMap["location"] = rt.Location
1467	}
1468	if rt.Tags != nil {
1469		objectMap["tags"] = rt.Tags
1470	}
1471	return json.Marshal(objectMap)
1472}
1473
1474// UnmarshalJSON is the custom unmarshaler for ResourceType struct.
1475func (rt *ResourceType) UnmarshalJSON(body []byte) error {
1476	var m map[string]*json.RawMessage
1477	err := json.Unmarshal(body, &m)
1478	if err != nil {
1479		return err
1480	}
1481	for k, v := range m {
1482		switch k {
1483		case "sku":
1484			if v != nil {
1485				var sku ResourceSku
1486				err = json.Unmarshal(*v, &sku)
1487				if err != nil {
1488					return err
1489				}
1490				rt.Sku = &sku
1491			}
1492		case "properties":
1493			if v != nil {
1494				var properties Properties
1495				err = json.Unmarshal(*v, &properties)
1496				if err != nil {
1497					return err
1498				}
1499				rt.Properties = &properties
1500			}
1501		case "kind":
1502			if v != nil {
1503				var kind ServiceKind
1504				err = json.Unmarshal(*v, &kind)
1505				if err != nil {
1506					return err
1507				}
1508				rt.Kind = kind
1509			}
1510		case "identity":
1511			if v != nil {
1512				var identity ManagedIdentity
1513				err = json.Unmarshal(*v, &identity)
1514				if err != nil {
1515					return err
1516				}
1517				rt.Identity = &identity
1518			}
1519		case "systemData":
1520			if v != nil {
1521				var systemData SystemData
1522				err = json.Unmarshal(*v, &systemData)
1523				if err != nil {
1524					return err
1525				}
1526				rt.SystemData = &systemData
1527			}
1528		case "location":
1529			if v != nil {
1530				var location string
1531				err = json.Unmarshal(*v, &location)
1532				if err != nil {
1533					return err
1534				}
1535				rt.Location = &location
1536			}
1537		case "tags":
1538			if v != nil {
1539				var tags map[string]*string
1540				err = json.Unmarshal(*v, &tags)
1541				if err != nil {
1542					return err
1543				}
1544				rt.Tags = tags
1545			}
1546		case "id":
1547			if v != nil {
1548				var ID string
1549				err = json.Unmarshal(*v, &ID)
1550				if err != nil {
1551					return err
1552				}
1553				rt.ID = &ID
1554			}
1555		case "name":
1556			if v != nil {
1557				var name string
1558				err = json.Unmarshal(*v, &name)
1559				if err != nil {
1560					return err
1561				}
1562				rt.Name = &name
1563			}
1564		case "type":
1565			if v != nil {
1566				var typeVar string
1567				err = json.Unmarshal(*v, &typeVar)
1568				if err != nil {
1569					return err
1570				}
1571				rt.Type = &typeVar
1572			}
1573		}
1574	}
1575
1576	return nil
1577}
1578
1579// RestartFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1580type RestartFuture struct {
1581	azure.FutureAPI
1582	// Result returns the result of the asynchronous operation.
1583	// If the operation has not completed it will return an error.
1584	Result func(Client) (autorest.Response, error)
1585}
1586
1587// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1588func (future *RestartFuture) UnmarshalJSON(body []byte) error {
1589	var azFuture azure.Future
1590	if err := json.Unmarshal(body, &azFuture); err != nil {
1591		return err
1592	}
1593	future.FutureAPI = &azFuture
1594	future.Result = future.result
1595	return nil
1596}
1597
1598// result is the default implementation for RestartFuture.Result.
1599func (future *RestartFuture) result(client Client) (ar autorest.Response, err error) {
1600	var done bool
1601	done, err = future.DoneWithContext(context.Background(), client)
1602	if err != nil {
1603		err = autorest.NewErrorWithError(err, "signalr.RestartFuture", "Result", future.Response(), "Polling failure")
1604		return
1605	}
1606	if !done {
1607		ar.Response = future.Response()
1608		err = azure.NewAsyncOpIncompleteError("signalr.RestartFuture")
1609		return
1610	}
1611	ar.Response = future.Response()
1612	return
1613}
1614
1615// ServerlessUpstreamSettings the settings for the Upstream when the service is in server-less mode.
1616type ServerlessUpstreamSettings struct {
1617	// Templates - Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects.
1618	Templates *[]UpstreamTemplate `json:"templates,omitempty"`
1619}
1620
1621// ServiceSpecification an object that describes a specification.
1622type ServiceSpecification struct {
1623	// MetricSpecifications - Specifications of the Metrics for Azure Monitoring.
1624	MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
1625	// LogSpecifications - Specifications of the Logs for Azure Monitoring.
1626	LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
1627}
1628
1629// ShareablePrivateLinkResourceProperties describes the properties of a resource type that has been
1630// onboarded to private link service
1631type ShareablePrivateLinkResourceProperties struct {
1632	// Description - The description of the resource type that has been onboarded to private link service
1633	Description *string `json:"description,omitempty"`
1634	// GroupID - The resource provider group id for the resource that has been onboarded to private link service
1635	GroupID *string `json:"groupId,omitempty"`
1636	// Type - The resource provider type for the resource that has been onboarded to private link service
1637	Type *string `json:"type,omitempty"`
1638}
1639
1640// ShareablePrivateLinkResourceType describes a  resource type that has been onboarded to private link
1641// service
1642type ShareablePrivateLinkResourceType struct {
1643	// Name - The name of the resource type that has been onboarded to private link service
1644	Name *string `json:"name,omitempty"`
1645	// Properties - Describes the properties of a resource type that has been onboarded to private link service
1646	Properties *ShareablePrivateLinkResourceProperties `json:"properties,omitempty"`
1647}
1648
1649// SharedPrivateLinkResource describes a Shared Private Link Resource
1650type SharedPrivateLinkResource struct {
1651	autorest.Response `json:"-"`
1652	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
1653	SystemData *SystemData `json:"systemData,omitempty"`
1654	// SharedPrivateLinkResourceProperties - Describes the properties of a Shared Private Link Resource
1655	*SharedPrivateLinkResourceProperties `json:"properties,omitempty"`
1656	// ID - READ-ONLY; Fully qualified resource Id for the resource.
1657	ID *string `json:"id,omitempty"`
1658	// Name - READ-ONLY; The name of the resource.
1659	Name *string `json:"name,omitempty"`
1660	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
1661	Type *string `json:"type,omitempty"`
1662}
1663
1664// MarshalJSON is the custom marshaler for SharedPrivateLinkResource.
1665func (splr SharedPrivateLinkResource) MarshalJSON() ([]byte, error) {
1666	objectMap := make(map[string]interface{})
1667	if splr.SharedPrivateLinkResourceProperties != nil {
1668		objectMap["properties"] = splr.SharedPrivateLinkResourceProperties
1669	}
1670	return json.Marshal(objectMap)
1671}
1672
1673// UnmarshalJSON is the custom unmarshaler for SharedPrivateLinkResource struct.
1674func (splr *SharedPrivateLinkResource) UnmarshalJSON(body []byte) error {
1675	var m map[string]*json.RawMessage
1676	err := json.Unmarshal(body, &m)
1677	if err != nil {
1678		return err
1679	}
1680	for k, v := range m {
1681		switch k {
1682		case "systemData":
1683			if v != nil {
1684				var systemData SystemData
1685				err = json.Unmarshal(*v, &systemData)
1686				if err != nil {
1687					return err
1688				}
1689				splr.SystemData = &systemData
1690			}
1691		case "properties":
1692			if v != nil {
1693				var sharedPrivateLinkResourceProperties SharedPrivateLinkResourceProperties
1694				err = json.Unmarshal(*v, &sharedPrivateLinkResourceProperties)
1695				if err != nil {
1696					return err
1697				}
1698				splr.SharedPrivateLinkResourceProperties = &sharedPrivateLinkResourceProperties
1699			}
1700		case "id":
1701			if v != nil {
1702				var ID string
1703				err = json.Unmarshal(*v, &ID)
1704				if err != nil {
1705					return err
1706				}
1707				splr.ID = &ID
1708			}
1709		case "name":
1710			if v != nil {
1711				var name string
1712				err = json.Unmarshal(*v, &name)
1713				if err != nil {
1714					return err
1715				}
1716				splr.Name = &name
1717			}
1718		case "type":
1719			if v != nil {
1720				var typeVar string
1721				err = json.Unmarshal(*v, &typeVar)
1722				if err != nil {
1723					return err
1724				}
1725				splr.Type = &typeVar
1726			}
1727		}
1728	}
1729
1730	return nil
1731}
1732
1733// SharedPrivateLinkResourceList a list of shared private link resources
1734type SharedPrivateLinkResourceList struct {
1735	autorest.Response `json:"-"`
1736	// Value - The list of the shared private link resources
1737	Value *[]SharedPrivateLinkResource `json:"value,omitempty"`
1738	// NextLink - Request URL that can be used to query next page of private endpoint connections. Returned when the total number of requested private endpoint connections exceed maximum page size.
1739	NextLink *string `json:"nextLink,omitempty"`
1740}
1741
1742// SharedPrivateLinkResourceListIterator provides access to a complete listing of SharedPrivateLinkResource
1743// values.
1744type SharedPrivateLinkResourceListIterator struct {
1745	i    int
1746	page SharedPrivateLinkResourceListPage
1747}
1748
1749// NextWithContext advances to the next value.  If there was an error making
1750// the request the iterator does not advance and the error is returned.
1751func (iter *SharedPrivateLinkResourceListIterator) NextWithContext(ctx context.Context) (err error) {
1752	if tracing.IsEnabled() {
1753		ctx = tracing.StartSpan(ctx, fqdn+"/SharedPrivateLinkResourceListIterator.NextWithContext")
1754		defer func() {
1755			sc := -1
1756			if iter.Response().Response.Response != nil {
1757				sc = iter.Response().Response.Response.StatusCode
1758			}
1759			tracing.EndSpan(ctx, sc, err)
1760		}()
1761	}
1762	iter.i++
1763	if iter.i < len(iter.page.Values()) {
1764		return nil
1765	}
1766	err = iter.page.NextWithContext(ctx)
1767	if err != nil {
1768		iter.i--
1769		return err
1770	}
1771	iter.i = 0
1772	return nil
1773}
1774
1775// Next advances to the next value.  If there was an error making
1776// the request the iterator does not advance and the error is returned.
1777// Deprecated: Use NextWithContext() instead.
1778func (iter *SharedPrivateLinkResourceListIterator) Next() error {
1779	return iter.NextWithContext(context.Background())
1780}
1781
1782// NotDone returns true if the enumeration should be started or is not yet complete.
1783func (iter SharedPrivateLinkResourceListIterator) NotDone() bool {
1784	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1785}
1786
1787// Response returns the raw server response from the last page request.
1788func (iter SharedPrivateLinkResourceListIterator) Response() SharedPrivateLinkResourceList {
1789	return iter.page.Response()
1790}
1791
1792// Value returns the current value or a zero-initialized value if the
1793// iterator has advanced beyond the end of the collection.
1794func (iter SharedPrivateLinkResourceListIterator) Value() SharedPrivateLinkResource {
1795	if !iter.page.NotDone() {
1796		return SharedPrivateLinkResource{}
1797	}
1798	return iter.page.Values()[iter.i]
1799}
1800
1801// Creates a new instance of the SharedPrivateLinkResourceListIterator type.
1802func NewSharedPrivateLinkResourceListIterator(page SharedPrivateLinkResourceListPage) SharedPrivateLinkResourceListIterator {
1803	return SharedPrivateLinkResourceListIterator{page: page}
1804}
1805
1806// IsEmpty returns true if the ListResult contains no values.
1807func (splrl SharedPrivateLinkResourceList) IsEmpty() bool {
1808	return splrl.Value == nil || len(*splrl.Value) == 0
1809}
1810
1811// hasNextLink returns true if the NextLink is not empty.
1812func (splrl SharedPrivateLinkResourceList) hasNextLink() bool {
1813	return splrl.NextLink != nil && len(*splrl.NextLink) != 0
1814}
1815
1816// sharedPrivateLinkResourceListPreparer prepares a request to retrieve the next set of results.
1817// It returns nil if no more results exist.
1818func (splrl SharedPrivateLinkResourceList) sharedPrivateLinkResourceListPreparer(ctx context.Context) (*http.Request, error) {
1819	if !splrl.hasNextLink() {
1820		return nil, nil
1821	}
1822	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1823		autorest.AsJSON(),
1824		autorest.AsGet(),
1825		autorest.WithBaseURL(to.String(splrl.NextLink)))
1826}
1827
1828// SharedPrivateLinkResourceListPage contains a page of SharedPrivateLinkResource values.
1829type SharedPrivateLinkResourceListPage struct {
1830	fn    func(context.Context, SharedPrivateLinkResourceList) (SharedPrivateLinkResourceList, error)
1831	splrl SharedPrivateLinkResourceList
1832}
1833
1834// NextWithContext advances to the next page of values.  If there was an error making
1835// the request the page does not advance and the error is returned.
1836func (page *SharedPrivateLinkResourceListPage) NextWithContext(ctx context.Context) (err error) {
1837	if tracing.IsEnabled() {
1838		ctx = tracing.StartSpan(ctx, fqdn+"/SharedPrivateLinkResourceListPage.NextWithContext")
1839		defer func() {
1840			sc := -1
1841			if page.Response().Response.Response != nil {
1842				sc = page.Response().Response.Response.StatusCode
1843			}
1844			tracing.EndSpan(ctx, sc, err)
1845		}()
1846	}
1847	for {
1848		next, err := page.fn(ctx, page.splrl)
1849		if err != nil {
1850			return err
1851		}
1852		page.splrl = next
1853		if !next.hasNextLink() || !next.IsEmpty() {
1854			break
1855		}
1856	}
1857	return nil
1858}
1859
1860// Next advances to the next page of values.  If there was an error making
1861// the request the page does not advance and the error is returned.
1862// Deprecated: Use NextWithContext() instead.
1863func (page *SharedPrivateLinkResourceListPage) Next() error {
1864	return page.NextWithContext(context.Background())
1865}
1866
1867// NotDone returns true if the page enumeration should be started or is not yet complete.
1868func (page SharedPrivateLinkResourceListPage) NotDone() bool {
1869	return !page.splrl.IsEmpty()
1870}
1871
1872// Response returns the raw server response from the last page request.
1873func (page SharedPrivateLinkResourceListPage) Response() SharedPrivateLinkResourceList {
1874	return page.splrl
1875}
1876
1877// Values returns the slice of values for the current page or nil if there are no values.
1878func (page SharedPrivateLinkResourceListPage) Values() []SharedPrivateLinkResource {
1879	if page.splrl.IsEmpty() {
1880		return nil
1881	}
1882	return *page.splrl.Value
1883}
1884
1885// Creates a new instance of the SharedPrivateLinkResourceListPage type.
1886func NewSharedPrivateLinkResourceListPage(cur SharedPrivateLinkResourceList, getNextPage func(context.Context, SharedPrivateLinkResourceList) (SharedPrivateLinkResourceList, error)) SharedPrivateLinkResourceListPage {
1887	return SharedPrivateLinkResourceListPage{
1888		fn:    getNextPage,
1889		splrl: cur,
1890	}
1891}
1892
1893// SharedPrivateLinkResourceProperties describes the properties of an existing Shared Private Link Resource
1894type SharedPrivateLinkResourceProperties struct {
1895	// GroupID - The group id from the provider of resource the shared private link resource is for
1896	GroupID *string `json:"groupId,omitempty"`
1897	// PrivateLinkResourceID - The resource id of the resource the shared private link resource is for
1898	PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"`
1899	// ProvisioningState - READ-ONLY; Provisioning state of the shared private link resource. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateMoving'
1900	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1901	// RequestMessage - The request message for requesting approval of the shared private link resource
1902	RequestMessage *string `json:"requestMessage,omitempty"`
1903	// Status - READ-ONLY; Status of the shared private link resource. Possible values include: 'SharedPrivateLinkResourceStatusPending', 'SharedPrivateLinkResourceStatusApproved', 'SharedPrivateLinkResourceStatusRejected', 'SharedPrivateLinkResourceStatusDisconnected', 'SharedPrivateLinkResourceStatusTimeout'
1904	Status SharedPrivateLinkResourceStatus `json:"status,omitempty"`
1905}
1906
1907// MarshalJSON is the custom marshaler for SharedPrivateLinkResourceProperties.
1908func (splrp SharedPrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
1909	objectMap := make(map[string]interface{})
1910	if splrp.GroupID != nil {
1911		objectMap["groupId"] = splrp.GroupID
1912	}
1913	if splrp.PrivateLinkResourceID != nil {
1914		objectMap["privateLinkResourceId"] = splrp.PrivateLinkResourceID
1915	}
1916	if splrp.RequestMessage != nil {
1917		objectMap["requestMessage"] = splrp.RequestMessage
1918	}
1919	return json.Marshal(objectMap)
1920}
1921
1922// SharedPrivateLinkResourcesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
1923// of a long-running operation.
1924type SharedPrivateLinkResourcesCreateOrUpdateFuture struct {
1925	azure.FutureAPI
1926	// Result returns the result of the asynchronous operation.
1927	// If the operation has not completed it will return an error.
1928	Result func(SharedPrivateLinkResourcesClient) (SharedPrivateLinkResource, error)
1929}
1930
1931// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1932func (future *SharedPrivateLinkResourcesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1933	var azFuture azure.Future
1934	if err := json.Unmarshal(body, &azFuture); err != nil {
1935		return err
1936	}
1937	future.FutureAPI = &azFuture
1938	future.Result = future.result
1939	return nil
1940}
1941
1942// result is the default implementation for SharedPrivateLinkResourcesCreateOrUpdateFuture.Result.
1943func (future *SharedPrivateLinkResourcesCreateOrUpdateFuture) result(client SharedPrivateLinkResourcesClient) (splr SharedPrivateLinkResource, err error) {
1944	var done bool
1945	done, err = future.DoneWithContext(context.Background(), client)
1946	if err != nil {
1947		err = autorest.NewErrorWithError(err, "signalr.SharedPrivateLinkResourcesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1948		return
1949	}
1950	if !done {
1951		splr.Response.Response = future.Response()
1952		err = azure.NewAsyncOpIncompleteError("signalr.SharedPrivateLinkResourcesCreateOrUpdateFuture")
1953		return
1954	}
1955	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1956	if splr.Response.Response, err = future.GetResult(sender); err == nil && splr.Response.Response.StatusCode != http.StatusNoContent {
1957		splr, err = client.CreateOrUpdateResponder(splr.Response.Response)
1958		if err != nil {
1959			err = autorest.NewErrorWithError(err, "signalr.SharedPrivateLinkResourcesCreateOrUpdateFuture", "Result", splr.Response.Response, "Failure responding to request")
1960		}
1961	}
1962	return
1963}
1964
1965// SharedPrivateLinkResourcesDeleteFuture an abstraction for monitoring and retrieving the results of a
1966// long-running operation.
1967type SharedPrivateLinkResourcesDeleteFuture struct {
1968	azure.FutureAPI
1969	// Result returns the result of the asynchronous operation.
1970	// If the operation has not completed it will return an error.
1971	Result func(SharedPrivateLinkResourcesClient) (autorest.Response, error)
1972}
1973
1974// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1975func (future *SharedPrivateLinkResourcesDeleteFuture) UnmarshalJSON(body []byte) error {
1976	var azFuture azure.Future
1977	if err := json.Unmarshal(body, &azFuture); err != nil {
1978		return err
1979	}
1980	future.FutureAPI = &azFuture
1981	future.Result = future.result
1982	return nil
1983}
1984
1985// result is the default implementation for SharedPrivateLinkResourcesDeleteFuture.Result.
1986func (future *SharedPrivateLinkResourcesDeleteFuture) result(client SharedPrivateLinkResourcesClient) (ar autorest.Response, err error) {
1987	var done bool
1988	done, err = future.DoneWithContext(context.Background(), client)
1989	if err != nil {
1990		err = autorest.NewErrorWithError(err, "signalr.SharedPrivateLinkResourcesDeleteFuture", "Result", future.Response(), "Polling failure")
1991		return
1992	}
1993	if !done {
1994		ar.Response = future.Response()
1995		err = azure.NewAsyncOpIncompleteError("signalr.SharedPrivateLinkResourcesDeleteFuture")
1996		return
1997	}
1998	ar.Response = future.Response()
1999	return
2000}
2001
2002// SystemData metadata pertaining to creation and last modification of the resource.
2003type SystemData struct {
2004	// CreatedBy - The identity that created the resource.
2005	CreatedBy *string `json:"createdBy,omitempty"`
2006	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
2007	CreatedByType CreatedByType `json:"createdByType,omitempty"`
2008	// CreatedAt - The timestamp of resource creation (UTC).
2009	CreatedAt *date.Time `json:"createdAt,omitempty"`
2010	// LastModifiedBy - The identity that last modified the resource.
2011	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
2012	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
2013	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
2014	// LastModifiedAt - The timestamp of resource last modification (UTC)
2015	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
2016}
2017
2018// TLSSettings TLS settings for the resource
2019type TLSSettings struct {
2020	// ClientCertEnabled - Request client certificate during TLS handshake if enabled
2021	ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"`
2022}
2023
2024// TrackedResource the resource model definition for a ARM tracked top level resource.
2025type TrackedResource struct {
2026	// Location - The GEO location of the resource. e.g. West US | East US | North Central US | South Central US.
2027	Location *string `json:"location,omitempty"`
2028	// Tags - Tags of the service which is a list of key value pairs that describe the resource.
2029	Tags map[string]*string `json:"tags"`
2030	// ID - READ-ONLY; Fully qualified resource Id for the resource.
2031	ID *string `json:"id,omitempty"`
2032	// Name - READ-ONLY; The name of the resource.
2033	Name *string `json:"name,omitempty"`
2034	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
2035	Type *string `json:"type,omitempty"`
2036}
2037
2038// MarshalJSON is the custom marshaler for TrackedResource.
2039func (tr TrackedResource) MarshalJSON() ([]byte, error) {
2040	objectMap := make(map[string]interface{})
2041	if tr.Location != nil {
2042		objectMap["location"] = tr.Location
2043	}
2044	if tr.Tags != nil {
2045		objectMap["tags"] = tr.Tags
2046	}
2047	return json.Marshal(objectMap)
2048}
2049
2050// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2051type UpdateFuture struct {
2052	azure.FutureAPI
2053	// Result returns the result of the asynchronous operation.
2054	// If the operation has not completed it will return an error.
2055	Result func(Client) (ResourceType, error)
2056}
2057
2058// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2059func (future *UpdateFuture) UnmarshalJSON(body []byte) error {
2060	var azFuture azure.Future
2061	if err := json.Unmarshal(body, &azFuture); err != nil {
2062		return err
2063	}
2064	future.FutureAPI = &azFuture
2065	future.Result = future.result
2066	return nil
2067}
2068
2069// result is the default implementation for UpdateFuture.Result.
2070func (future *UpdateFuture) result(client Client) (rt ResourceType, err error) {
2071	var done bool
2072	done, err = future.DoneWithContext(context.Background(), client)
2073	if err != nil {
2074		err = autorest.NewErrorWithError(err, "signalr.UpdateFuture", "Result", future.Response(), "Polling failure")
2075		return
2076	}
2077	if !done {
2078		rt.Response.Response = future.Response()
2079		err = azure.NewAsyncOpIncompleteError("signalr.UpdateFuture")
2080		return
2081	}
2082	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2083	if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent {
2084		rt, err = client.UpdateResponder(rt.Response.Response)
2085		if err != nil {
2086			err = autorest.NewErrorWithError(err, "signalr.UpdateFuture", "Result", rt.Response.Response, "Failure responding to request")
2087		}
2088	}
2089	return
2090}
2091
2092// UpstreamAuthSettings upstream auth settings.
2093type UpstreamAuthSettings struct {
2094	// Type - Gets or sets the type of auth. None or ManagedIdentity is supported now. Possible values include: 'UpstreamAuthTypeNone', 'UpstreamAuthTypeManagedIdentity'
2095	Type UpstreamAuthType `json:"type,omitempty"`
2096	// ManagedIdentity - Gets or sets the managed identity settings. It's required if the auth type is set to ManagedIdentity.
2097	ManagedIdentity *ManagedIdentitySettings `json:"managedIdentity,omitempty"`
2098}
2099
2100// UpstreamTemplate upstream template item settings. It defines the Upstream URL of the incoming requests.
2101// The template defines the pattern of the event, the hub or the category of the incoming request that
2102// matches current URL template.
2103type UpstreamTemplate struct {
2104	// HubPattern - Gets or sets the matching pattern for hub names. If not set, it matches any hub.
2105	// There are 3 kind of patterns supported:
2106	//     1. "*", it to matches any hub name
2107	//     2. Combine multiple hubs with ",", for example "hub1,hub2", it matches "hub1" and "hub2"
2108	//     3. The single hub name, for example, "hub1", it matches "hub1"
2109	HubPattern *string `json:"hubPattern,omitempty"`
2110	// EventPattern - Gets or sets the matching pattern for event names. If not set, it matches any event.
2111	// There are 3 kind of patterns supported:
2112	//     1. "*", it to matches any event name
2113	//     2. Combine multiple events with ",", for example "connect,disconnect", it matches event "connect" and "disconnect"
2114	//     3. The single event name, for example, "connect", it matches "connect"
2115	EventPattern *string `json:"eventPattern,omitempty"`
2116	// CategoryPattern - Gets or sets the matching pattern for category names. If not set, it matches any category.
2117	// There are 3 kind of patterns supported:
2118	//     1. "*", it to matches any category name
2119	//     2. Combine multiple categories with ",", for example "connections,messages", it matches category "connections" and "messages"
2120	//     3. The single category name, for example, "connections", it matches the category "connections"
2121	CategoryPattern *string `json:"categoryPattern,omitempty"`
2122	// URLTemplate - Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} {event} inside the template, the value of the Upstream URL is dynamically calculated when the client request comes in.
2123	// For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`.
2124	URLTemplate *string `json:"urlTemplate,omitempty"`
2125	// Auth - Gets or sets the auth settings for an upstream. If not set, no auth is used for upstream messages.
2126	Auth *UpstreamAuthSettings `json:"auth,omitempty"`
2127}
2128
2129// Usage object that describes a specific usage of the resources.
2130type Usage struct {
2131	// ID - Fully qualified ARM resource id
2132	ID *string `json:"id,omitempty"`
2133	// CurrentValue - Current value for the usage quota.
2134	CurrentValue *int64 `json:"currentValue,omitempty"`
2135	// Limit - The maximum permitted value for the usage quota. If there is no limit, this value will be -1.
2136	Limit *int64 `json:"limit,omitempty"`
2137	// Name - Localizable String object containing the name and a localized value.
2138	Name *UsageName `json:"name,omitempty"`
2139	// Unit - Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond.
2140	Unit *string `json:"unit,omitempty"`
2141}
2142
2143// UsageList object that includes an array of the resource usages and a possible link for next set.
2144type UsageList struct {
2145	autorest.Response `json:"-"`
2146	// Value - List of the resource usages
2147	Value *[]Usage `json:"value,omitempty"`
2148	// NextLink - The URL the client should use to fetch the next page (per server side paging).
2149	// It's null for now, added for future use.
2150	NextLink *string `json:"nextLink,omitempty"`
2151}
2152
2153// UsageListIterator provides access to a complete listing of Usage values.
2154type UsageListIterator struct {
2155	i    int
2156	page UsageListPage
2157}
2158
2159// NextWithContext advances to the next value.  If there was an error making
2160// the request the iterator does not advance and the error is returned.
2161func (iter *UsageListIterator) NextWithContext(ctx context.Context) (err error) {
2162	if tracing.IsEnabled() {
2163		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListIterator.NextWithContext")
2164		defer func() {
2165			sc := -1
2166			if iter.Response().Response.Response != nil {
2167				sc = iter.Response().Response.Response.StatusCode
2168			}
2169			tracing.EndSpan(ctx, sc, err)
2170		}()
2171	}
2172	iter.i++
2173	if iter.i < len(iter.page.Values()) {
2174		return nil
2175	}
2176	err = iter.page.NextWithContext(ctx)
2177	if err != nil {
2178		iter.i--
2179		return err
2180	}
2181	iter.i = 0
2182	return nil
2183}
2184
2185// Next advances to the next value.  If there was an error making
2186// the request the iterator does not advance and the error is returned.
2187// Deprecated: Use NextWithContext() instead.
2188func (iter *UsageListIterator) Next() error {
2189	return iter.NextWithContext(context.Background())
2190}
2191
2192// NotDone returns true if the enumeration should be started or is not yet complete.
2193func (iter UsageListIterator) NotDone() bool {
2194	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2195}
2196
2197// Response returns the raw server response from the last page request.
2198func (iter UsageListIterator) Response() UsageList {
2199	return iter.page.Response()
2200}
2201
2202// Value returns the current value or a zero-initialized value if the
2203// iterator has advanced beyond the end of the collection.
2204func (iter UsageListIterator) Value() Usage {
2205	if !iter.page.NotDone() {
2206		return Usage{}
2207	}
2208	return iter.page.Values()[iter.i]
2209}
2210
2211// Creates a new instance of the UsageListIterator type.
2212func NewUsageListIterator(page UsageListPage) UsageListIterator {
2213	return UsageListIterator{page: page}
2214}
2215
2216// IsEmpty returns true if the ListResult contains no values.
2217func (ul UsageList) IsEmpty() bool {
2218	return ul.Value == nil || len(*ul.Value) == 0
2219}
2220
2221// hasNextLink returns true if the NextLink is not empty.
2222func (ul UsageList) hasNextLink() bool {
2223	return ul.NextLink != nil && len(*ul.NextLink) != 0
2224}
2225
2226// usageListPreparer prepares a request to retrieve the next set of results.
2227// It returns nil if no more results exist.
2228func (ul UsageList) usageListPreparer(ctx context.Context) (*http.Request, error) {
2229	if !ul.hasNextLink() {
2230		return nil, nil
2231	}
2232	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2233		autorest.AsJSON(),
2234		autorest.AsGet(),
2235		autorest.WithBaseURL(to.String(ul.NextLink)))
2236}
2237
2238// UsageListPage contains a page of Usage values.
2239type UsageListPage struct {
2240	fn func(context.Context, UsageList) (UsageList, error)
2241	ul UsageList
2242}
2243
2244// NextWithContext advances to the next page of values.  If there was an error making
2245// the request the page does not advance and the error is returned.
2246func (page *UsageListPage) NextWithContext(ctx context.Context) (err error) {
2247	if tracing.IsEnabled() {
2248		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListPage.NextWithContext")
2249		defer func() {
2250			sc := -1
2251			if page.Response().Response.Response != nil {
2252				sc = page.Response().Response.Response.StatusCode
2253			}
2254			tracing.EndSpan(ctx, sc, err)
2255		}()
2256	}
2257	for {
2258		next, err := page.fn(ctx, page.ul)
2259		if err != nil {
2260			return err
2261		}
2262		page.ul = next
2263		if !next.hasNextLink() || !next.IsEmpty() {
2264			break
2265		}
2266	}
2267	return nil
2268}
2269
2270// Next advances to the next page of values.  If there was an error making
2271// the request the page does not advance and the error is returned.
2272// Deprecated: Use NextWithContext() instead.
2273func (page *UsageListPage) Next() error {
2274	return page.NextWithContext(context.Background())
2275}
2276
2277// NotDone returns true if the page enumeration should be started or is not yet complete.
2278func (page UsageListPage) NotDone() bool {
2279	return !page.ul.IsEmpty()
2280}
2281
2282// Response returns the raw server response from the last page request.
2283func (page UsageListPage) Response() UsageList {
2284	return page.ul
2285}
2286
2287// Values returns the slice of values for the current page or nil if there are no values.
2288func (page UsageListPage) Values() []Usage {
2289	if page.ul.IsEmpty() {
2290		return nil
2291	}
2292	return *page.ul.Value
2293}
2294
2295// Creates a new instance of the UsageListPage type.
2296func NewUsageListPage(cur UsageList, getNextPage func(context.Context, UsageList) (UsageList, error)) UsageListPage {
2297	return UsageListPage{
2298		fn: getNextPage,
2299		ul: cur,
2300	}
2301}
2302
2303// UsageName localizable String object containing the name and a localized value.
2304type UsageName struct {
2305	// Value - The identifier of the usage.
2306	Value *string `json:"value,omitempty"`
2307	// LocalizedValue - Localized name of the usage.
2308	LocalizedValue *string `json:"localizedValue,omitempty"`
2309}
2310
2311// UserAssignedIdentityProperty properties of user assigned identity.
2312type UserAssignedIdentityProperty struct {
2313	// PrincipalID - READ-ONLY; Get the principal id for the user assigned identity
2314	PrincipalID *string `json:"principalId,omitempty"`
2315	// ClientID - READ-ONLY; Get the client id for the user assigned identity
2316	ClientID *string `json:"clientId,omitempty"`
2317}
2318
2319// MarshalJSON is the custom marshaler for UserAssignedIdentityProperty.
2320func (uaip UserAssignedIdentityProperty) MarshalJSON() ([]byte, error) {
2321	objectMap := make(map[string]interface{})
2322	return json.Marshal(objectMap)
2323}
2324