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-04-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 SignalR resource, which controls the SignalR 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}
1103
1104// MarshalJSON is the custom marshaler for Properties.
1105func (p Properties) MarshalJSON() ([]byte, error) {
1106	objectMap := make(map[string]interface{})
1107	if p.TLS != nil {
1108		objectMap["tls"] = p.TLS
1109	}
1110	if p.Features != nil {
1111		objectMap["features"] = p.Features
1112	}
1113	if p.Cors != nil {
1114		objectMap["cors"] = p.Cors
1115	}
1116	if p.Upstream != nil {
1117		objectMap["upstream"] = p.Upstream
1118	}
1119	if p.NetworkACLs != nil {
1120		objectMap["networkACLs"] = p.NetworkACLs
1121	}
1122	return json.Marshal(objectMap)
1123}
1124
1125// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
1126// required location and tags
1127type ProxyResource struct {
1128	// ID - READ-ONLY; Fully qualified resource Id for the resource.
1129	ID *string `json:"id,omitempty"`
1130	// Name - READ-ONLY; The name of the resource.
1131	Name *string `json:"name,omitempty"`
1132	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
1133	Type *string `json:"type,omitempty"`
1134}
1135
1136// MarshalJSON is the custom marshaler for ProxyResource.
1137func (pr ProxyResource) MarshalJSON() ([]byte, error) {
1138	objectMap := make(map[string]interface{})
1139	return json.Marshal(objectMap)
1140}
1141
1142// RegenerateKeyFuture an abstraction for monitoring and retrieving the results of a long-running
1143// operation.
1144type RegenerateKeyFuture struct {
1145	azure.FutureAPI
1146	// Result returns the result of the asynchronous operation.
1147	// If the operation has not completed it will return an error.
1148	Result func(Client) (Keys, error)
1149}
1150
1151// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1152func (future *RegenerateKeyFuture) UnmarshalJSON(body []byte) error {
1153	var azFuture azure.Future
1154	if err := json.Unmarshal(body, &azFuture); err != nil {
1155		return err
1156	}
1157	future.FutureAPI = &azFuture
1158	future.Result = future.result
1159	return nil
1160}
1161
1162// result is the default implementation for RegenerateKeyFuture.Result.
1163func (future *RegenerateKeyFuture) result(client Client) (kVar Keys, err error) {
1164	var done bool
1165	done, err = future.DoneWithContext(context.Background(), client)
1166	if err != nil {
1167		err = autorest.NewErrorWithError(err, "signalr.RegenerateKeyFuture", "Result", future.Response(), "Polling failure")
1168		return
1169	}
1170	if !done {
1171		kVar.Response.Response = future.Response()
1172		err = azure.NewAsyncOpIncompleteError("signalr.RegenerateKeyFuture")
1173		return
1174	}
1175	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1176	if kVar.Response.Response, err = future.GetResult(sender); err == nil && kVar.Response.Response.StatusCode != http.StatusNoContent {
1177		kVar, err = client.RegenerateKeyResponder(kVar.Response.Response)
1178		if err != nil {
1179			err = autorest.NewErrorWithError(err, "signalr.RegenerateKeyFuture", "Result", kVar.Response.Response, "Failure responding to request")
1180		}
1181	}
1182	return
1183}
1184
1185// RegenerateKeyParameters parameters describes the request to regenerate access keys
1186type RegenerateKeyParameters struct {
1187	// KeyType - The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'KeyTypePrimary', 'KeyTypeSecondary'
1188	KeyType KeyType `json:"keyType,omitempty"`
1189}
1190
1191// Resource the core properties of ARM resources.
1192type Resource struct {
1193	// ID - READ-ONLY; Fully qualified resource Id for the resource.
1194	ID *string `json:"id,omitempty"`
1195	// Name - READ-ONLY; The name of the resource.
1196	Name *string `json:"name,omitempty"`
1197	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
1198	Type *string `json:"type,omitempty"`
1199}
1200
1201// MarshalJSON is the custom marshaler for Resource.
1202func (r Resource) MarshalJSON() ([]byte, error) {
1203	objectMap := make(map[string]interface{})
1204	return json.Marshal(objectMap)
1205}
1206
1207// ResourceList object that includes an array of resources and a possible link for next set.
1208type ResourceList struct {
1209	autorest.Response `json:"-"`
1210	// Value - List of the resources
1211	Value *[]ResourceType `json:"value,omitempty"`
1212	// NextLink - The URL the client should use to fetch the next page (per server side paging).
1213	// It's null for now, added for future use.
1214	NextLink *string `json:"nextLink,omitempty"`
1215}
1216
1217// ResourceListIterator provides access to a complete listing of ResourceType values.
1218type ResourceListIterator struct {
1219	i    int
1220	page ResourceListPage
1221}
1222
1223// NextWithContext advances to the next value.  If there was an error making
1224// the request the iterator does not advance and the error is returned.
1225func (iter *ResourceListIterator) NextWithContext(ctx context.Context) (err error) {
1226	if tracing.IsEnabled() {
1227		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListIterator.NextWithContext")
1228		defer func() {
1229			sc := -1
1230			if iter.Response().Response.Response != nil {
1231				sc = iter.Response().Response.Response.StatusCode
1232			}
1233			tracing.EndSpan(ctx, sc, err)
1234		}()
1235	}
1236	iter.i++
1237	if iter.i < len(iter.page.Values()) {
1238		return nil
1239	}
1240	err = iter.page.NextWithContext(ctx)
1241	if err != nil {
1242		iter.i--
1243		return err
1244	}
1245	iter.i = 0
1246	return nil
1247}
1248
1249// Next advances to the next value.  If there was an error making
1250// the request the iterator does not advance and the error is returned.
1251// Deprecated: Use NextWithContext() instead.
1252func (iter *ResourceListIterator) Next() error {
1253	return iter.NextWithContext(context.Background())
1254}
1255
1256// NotDone returns true if the enumeration should be started or is not yet complete.
1257func (iter ResourceListIterator) NotDone() bool {
1258	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1259}
1260
1261// Response returns the raw server response from the last page request.
1262func (iter ResourceListIterator) Response() ResourceList {
1263	return iter.page.Response()
1264}
1265
1266// Value returns the current value or a zero-initialized value if the
1267// iterator has advanced beyond the end of the collection.
1268func (iter ResourceListIterator) Value() ResourceType {
1269	if !iter.page.NotDone() {
1270		return ResourceType{}
1271	}
1272	return iter.page.Values()[iter.i]
1273}
1274
1275// Creates a new instance of the ResourceListIterator type.
1276func NewResourceListIterator(page ResourceListPage) ResourceListIterator {
1277	return ResourceListIterator{page: page}
1278}
1279
1280// IsEmpty returns true if the ListResult contains no values.
1281func (rl ResourceList) IsEmpty() bool {
1282	return rl.Value == nil || len(*rl.Value) == 0
1283}
1284
1285// hasNextLink returns true if the NextLink is not empty.
1286func (rl ResourceList) hasNextLink() bool {
1287	return rl.NextLink != nil && len(*rl.NextLink) != 0
1288}
1289
1290// resourceListPreparer prepares a request to retrieve the next set of results.
1291// It returns nil if no more results exist.
1292func (rl ResourceList) resourceListPreparer(ctx context.Context) (*http.Request, error) {
1293	if !rl.hasNextLink() {
1294		return nil, nil
1295	}
1296	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1297		autorest.AsJSON(),
1298		autorest.AsGet(),
1299		autorest.WithBaseURL(to.String(rl.NextLink)))
1300}
1301
1302// ResourceListPage contains a page of ResourceType values.
1303type ResourceListPage struct {
1304	fn func(context.Context, ResourceList) (ResourceList, error)
1305	rl ResourceList
1306}
1307
1308// NextWithContext advances to the next page of values.  If there was an error making
1309// the request the page does not advance and the error is returned.
1310func (page *ResourceListPage) NextWithContext(ctx context.Context) (err error) {
1311	if tracing.IsEnabled() {
1312		ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListPage.NextWithContext")
1313		defer func() {
1314			sc := -1
1315			if page.Response().Response.Response != nil {
1316				sc = page.Response().Response.Response.StatusCode
1317			}
1318			tracing.EndSpan(ctx, sc, err)
1319		}()
1320	}
1321	for {
1322		next, err := page.fn(ctx, page.rl)
1323		if err != nil {
1324			return err
1325		}
1326		page.rl = next
1327		if !next.hasNextLink() || !next.IsEmpty() {
1328			break
1329		}
1330	}
1331	return nil
1332}
1333
1334// Next advances to the next page of values.  If there was an error making
1335// the request the page does not advance and the error is returned.
1336// Deprecated: Use NextWithContext() instead.
1337func (page *ResourceListPage) Next() error {
1338	return page.NextWithContext(context.Background())
1339}
1340
1341// NotDone returns true if the page enumeration should be started or is not yet complete.
1342func (page ResourceListPage) NotDone() bool {
1343	return !page.rl.IsEmpty()
1344}
1345
1346// Response returns the raw server response from the last page request.
1347func (page ResourceListPage) Response() ResourceList {
1348	return page.rl
1349}
1350
1351// Values returns the slice of values for the current page or nil if there are no values.
1352func (page ResourceListPage) Values() []ResourceType {
1353	if page.rl.IsEmpty() {
1354		return nil
1355	}
1356	return *page.rl.Value
1357}
1358
1359// Creates a new instance of the ResourceListPage type.
1360func NewResourceListPage(cur ResourceList, getNextPage func(context.Context, ResourceList) (ResourceList, error)) ResourceListPage {
1361	return ResourceListPage{
1362		fn: getNextPage,
1363		rl: cur,
1364	}
1365}
1366
1367// ResourceSku the billing information of the resource.
1368type ResourceSku struct {
1369	// Name - The name of the SKU. Required.
1370	//
1371	// Allowed values: Standard_S1, Free_F1
1372	Name *string `json:"name,omitempty"`
1373	// Tier - Optional tier of this particular SKU. 'Standard' or 'Free'.
1374	//
1375	// `Basic` is deprecated, use `Standard` instead. Possible values include: 'SkuTierFree', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium'
1376	Tier SkuTier `json:"tier,omitempty"`
1377	// Size - READ-ONLY; Not used. Retained for future use.
1378	Size *string `json:"size,omitempty"`
1379	// Family - READ-ONLY; Not used. Retained for future use.
1380	Family *string `json:"family,omitempty"`
1381	// Capacity - Optional, integer. The unit count of the resource. 1 by default.
1382	//
1383	// If present, following values are allowed:
1384	//     Free: 1
1385	//     Standard: 1,2,5,10,20,50,100
1386	Capacity *int32 `json:"capacity,omitempty"`
1387}
1388
1389// MarshalJSON is the custom marshaler for ResourceSku.
1390func (rs ResourceSku) MarshalJSON() ([]byte, error) {
1391	objectMap := make(map[string]interface{})
1392	if rs.Name != nil {
1393		objectMap["name"] = rs.Name
1394	}
1395	if rs.Tier != "" {
1396		objectMap["tier"] = rs.Tier
1397	}
1398	if rs.Capacity != nil {
1399		objectMap["capacity"] = rs.Capacity
1400	}
1401	return json.Marshal(objectMap)
1402}
1403
1404// ResourceType a class represent a resource.
1405type ResourceType struct {
1406	autorest.Response `json:"-"`
1407	// Sku - The billing information of the resource.(e.g. Free, Standard)
1408	Sku *ResourceSku `json:"sku,omitempty"`
1409	// Properties - Settings used to provision or configure the resource
1410	*Properties `json:"properties,omitempty"`
1411	// Kind - The kind of the service - e.g. "SignalR" for "Microsoft.SignalRService/SignalR". Possible values include: 'ServiceKindSignalR', 'ServiceKindRawWebSockets'
1412	Kind ServiceKind `json:"kind,omitempty"`
1413	// Identity - The managed identity response
1414	Identity *ManagedIdentity `json:"identity,omitempty"`
1415	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
1416	SystemData *SystemData `json:"systemData,omitempty"`
1417	// Location - The GEO location of the resource. e.g. West US | East US | North Central US | South Central US.
1418	Location *string `json:"location,omitempty"`
1419	// Tags - Tags of the service which is a list of key value pairs that describe the resource.
1420	Tags map[string]*string `json:"tags"`
1421	// ID - READ-ONLY; Fully qualified resource Id for the resource.
1422	ID *string `json:"id,omitempty"`
1423	// Name - READ-ONLY; The name of the resource.
1424	Name *string `json:"name,omitempty"`
1425	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
1426	Type *string `json:"type,omitempty"`
1427}
1428
1429// MarshalJSON is the custom marshaler for ResourceType.
1430func (rt ResourceType) MarshalJSON() ([]byte, error) {
1431	objectMap := make(map[string]interface{})
1432	if rt.Sku != nil {
1433		objectMap["sku"] = rt.Sku
1434	}
1435	if rt.Properties != nil {
1436		objectMap["properties"] = rt.Properties
1437	}
1438	if rt.Kind != "" {
1439		objectMap["kind"] = rt.Kind
1440	}
1441	if rt.Identity != nil {
1442		objectMap["identity"] = rt.Identity
1443	}
1444	if rt.Location != nil {
1445		objectMap["location"] = rt.Location
1446	}
1447	if rt.Tags != nil {
1448		objectMap["tags"] = rt.Tags
1449	}
1450	return json.Marshal(objectMap)
1451}
1452
1453// UnmarshalJSON is the custom unmarshaler for ResourceType struct.
1454func (rt *ResourceType) UnmarshalJSON(body []byte) error {
1455	var m map[string]*json.RawMessage
1456	err := json.Unmarshal(body, &m)
1457	if err != nil {
1458		return err
1459	}
1460	for k, v := range m {
1461		switch k {
1462		case "sku":
1463			if v != nil {
1464				var sku ResourceSku
1465				err = json.Unmarshal(*v, &sku)
1466				if err != nil {
1467					return err
1468				}
1469				rt.Sku = &sku
1470			}
1471		case "properties":
1472			if v != nil {
1473				var properties Properties
1474				err = json.Unmarshal(*v, &properties)
1475				if err != nil {
1476					return err
1477				}
1478				rt.Properties = &properties
1479			}
1480		case "kind":
1481			if v != nil {
1482				var kind ServiceKind
1483				err = json.Unmarshal(*v, &kind)
1484				if err != nil {
1485					return err
1486				}
1487				rt.Kind = kind
1488			}
1489		case "identity":
1490			if v != nil {
1491				var identity ManagedIdentity
1492				err = json.Unmarshal(*v, &identity)
1493				if err != nil {
1494					return err
1495				}
1496				rt.Identity = &identity
1497			}
1498		case "systemData":
1499			if v != nil {
1500				var systemData SystemData
1501				err = json.Unmarshal(*v, &systemData)
1502				if err != nil {
1503					return err
1504				}
1505				rt.SystemData = &systemData
1506			}
1507		case "location":
1508			if v != nil {
1509				var location string
1510				err = json.Unmarshal(*v, &location)
1511				if err != nil {
1512					return err
1513				}
1514				rt.Location = &location
1515			}
1516		case "tags":
1517			if v != nil {
1518				var tags map[string]*string
1519				err = json.Unmarshal(*v, &tags)
1520				if err != nil {
1521					return err
1522				}
1523				rt.Tags = tags
1524			}
1525		case "id":
1526			if v != nil {
1527				var ID string
1528				err = json.Unmarshal(*v, &ID)
1529				if err != nil {
1530					return err
1531				}
1532				rt.ID = &ID
1533			}
1534		case "name":
1535			if v != nil {
1536				var name string
1537				err = json.Unmarshal(*v, &name)
1538				if err != nil {
1539					return err
1540				}
1541				rt.Name = &name
1542			}
1543		case "type":
1544			if v != nil {
1545				var typeVar string
1546				err = json.Unmarshal(*v, &typeVar)
1547				if err != nil {
1548					return err
1549				}
1550				rt.Type = &typeVar
1551			}
1552		}
1553	}
1554
1555	return nil
1556}
1557
1558// RestartFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1559type RestartFuture struct {
1560	azure.FutureAPI
1561	// Result returns the result of the asynchronous operation.
1562	// If the operation has not completed it will return an error.
1563	Result func(Client) (autorest.Response, error)
1564}
1565
1566// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1567func (future *RestartFuture) UnmarshalJSON(body []byte) error {
1568	var azFuture azure.Future
1569	if err := json.Unmarshal(body, &azFuture); err != nil {
1570		return err
1571	}
1572	future.FutureAPI = &azFuture
1573	future.Result = future.result
1574	return nil
1575}
1576
1577// result is the default implementation for RestartFuture.Result.
1578func (future *RestartFuture) result(client Client) (ar autorest.Response, err error) {
1579	var done bool
1580	done, err = future.DoneWithContext(context.Background(), client)
1581	if err != nil {
1582		err = autorest.NewErrorWithError(err, "signalr.RestartFuture", "Result", future.Response(), "Polling failure")
1583		return
1584	}
1585	if !done {
1586		ar.Response = future.Response()
1587		err = azure.NewAsyncOpIncompleteError("signalr.RestartFuture")
1588		return
1589	}
1590	ar.Response = future.Response()
1591	return
1592}
1593
1594// ServerlessUpstreamSettings the settings for the Upstream when the service is in server-less mode.
1595type ServerlessUpstreamSettings struct {
1596	// Templates - Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects.
1597	Templates *[]UpstreamTemplate `json:"templates,omitempty"`
1598}
1599
1600// ServiceSpecification an object that describes a specification.
1601type ServiceSpecification struct {
1602	// MetricSpecifications - Specifications of the Metrics for Azure Monitoring.
1603	MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"`
1604	// LogSpecifications - Specifications of the Logs for Azure Monitoring.
1605	LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"`
1606}
1607
1608// ShareablePrivateLinkResourceProperties describes the properties of a resource type that has been
1609// onboarded to private link service
1610type ShareablePrivateLinkResourceProperties struct {
1611	// Description - The description of the resource type that has been onboarded to private link service
1612	Description *string `json:"description,omitempty"`
1613	// GroupID - The resource provider group id for the resource that has been onboarded to private link service
1614	GroupID *string `json:"groupId,omitempty"`
1615	// Type - The resource provider type for the resource that has been onboarded to private link service
1616	Type *string `json:"type,omitempty"`
1617}
1618
1619// ShareablePrivateLinkResourceType describes a  resource type that has been onboarded to private link
1620// service
1621type ShareablePrivateLinkResourceType struct {
1622	// Name - The name of the resource type that has been onboarded to private link service
1623	Name *string `json:"name,omitempty"`
1624	// Properties - Describes the properties of a resource type that has been onboarded to private link service
1625	Properties *ShareablePrivateLinkResourceProperties `json:"properties,omitempty"`
1626}
1627
1628// SharedPrivateLinkResource describes a Shared Private Link Resource
1629type SharedPrivateLinkResource struct {
1630	autorest.Response `json:"-"`
1631	// SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource.
1632	SystemData *SystemData `json:"systemData,omitempty"`
1633	// SharedPrivateLinkResourceProperties - Describes the properties of a Shared Private Link Resource
1634	*SharedPrivateLinkResourceProperties `json:"properties,omitempty"`
1635	// ID - READ-ONLY; Fully qualified resource Id for the resource.
1636	ID *string `json:"id,omitempty"`
1637	// Name - READ-ONLY; The name of the resource.
1638	Name *string `json:"name,omitempty"`
1639	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
1640	Type *string `json:"type,omitempty"`
1641}
1642
1643// MarshalJSON is the custom marshaler for SharedPrivateLinkResource.
1644func (splr SharedPrivateLinkResource) MarshalJSON() ([]byte, error) {
1645	objectMap := make(map[string]interface{})
1646	if splr.SharedPrivateLinkResourceProperties != nil {
1647		objectMap["properties"] = splr.SharedPrivateLinkResourceProperties
1648	}
1649	return json.Marshal(objectMap)
1650}
1651
1652// UnmarshalJSON is the custom unmarshaler for SharedPrivateLinkResource struct.
1653func (splr *SharedPrivateLinkResource) UnmarshalJSON(body []byte) error {
1654	var m map[string]*json.RawMessage
1655	err := json.Unmarshal(body, &m)
1656	if err != nil {
1657		return err
1658	}
1659	for k, v := range m {
1660		switch k {
1661		case "systemData":
1662			if v != nil {
1663				var systemData SystemData
1664				err = json.Unmarshal(*v, &systemData)
1665				if err != nil {
1666					return err
1667				}
1668				splr.SystemData = &systemData
1669			}
1670		case "properties":
1671			if v != nil {
1672				var sharedPrivateLinkResourceProperties SharedPrivateLinkResourceProperties
1673				err = json.Unmarshal(*v, &sharedPrivateLinkResourceProperties)
1674				if err != nil {
1675					return err
1676				}
1677				splr.SharedPrivateLinkResourceProperties = &sharedPrivateLinkResourceProperties
1678			}
1679		case "id":
1680			if v != nil {
1681				var ID string
1682				err = json.Unmarshal(*v, &ID)
1683				if err != nil {
1684					return err
1685				}
1686				splr.ID = &ID
1687			}
1688		case "name":
1689			if v != nil {
1690				var name string
1691				err = json.Unmarshal(*v, &name)
1692				if err != nil {
1693					return err
1694				}
1695				splr.Name = &name
1696			}
1697		case "type":
1698			if v != nil {
1699				var typeVar string
1700				err = json.Unmarshal(*v, &typeVar)
1701				if err != nil {
1702					return err
1703				}
1704				splr.Type = &typeVar
1705			}
1706		}
1707	}
1708
1709	return nil
1710}
1711
1712// SharedPrivateLinkResourceList a list of shared private link resources
1713type SharedPrivateLinkResourceList struct {
1714	autorest.Response `json:"-"`
1715	// Value - The list of the shared private link resources
1716	Value *[]SharedPrivateLinkResource `json:"value,omitempty"`
1717	// 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.
1718	NextLink *string `json:"nextLink,omitempty"`
1719}
1720
1721// SharedPrivateLinkResourceListIterator provides access to a complete listing of SharedPrivateLinkResource
1722// values.
1723type SharedPrivateLinkResourceListIterator struct {
1724	i    int
1725	page SharedPrivateLinkResourceListPage
1726}
1727
1728// NextWithContext advances to the next value.  If there was an error making
1729// the request the iterator does not advance and the error is returned.
1730func (iter *SharedPrivateLinkResourceListIterator) NextWithContext(ctx context.Context) (err error) {
1731	if tracing.IsEnabled() {
1732		ctx = tracing.StartSpan(ctx, fqdn+"/SharedPrivateLinkResourceListIterator.NextWithContext")
1733		defer func() {
1734			sc := -1
1735			if iter.Response().Response.Response != nil {
1736				sc = iter.Response().Response.Response.StatusCode
1737			}
1738			tracing.EndSpan(ctx, sc, err)
1739		}()
1740	}
1741	iter.i++
1742	if iter.i < len(iter.page.Values()) {
1743		return nil
1744	}
1745	err = iter.page.NextWithContext(ctx)
1746	if err != nil {
1747		iter.i--
1748		return err
1749	}
1750	iter.i = 0
1751	return nil
1752}
1753
1754// Next advances to the next value.  If there was an error making
1755// the request the iterator does not advance and the error is returned.
1756// Deprecated: Use NextWithContext() instead.
1757func (iter *SharedPrivateLinkResourceListIterator) Next() error {
1758	return iter.NextWithContext(context.Background())
1759}
1760
1761// NotDone returns true if the enumeration should be started or is not yet complete.
1762func (iter SharedPrivateLinkResourceListIterator) NotDone() bool {
1763	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1764}
1765
1766// Response returns the raw server response from the last page request.
1767func (iter SharedPrivateLinkResourceListIterator) Response() SharedPrivateLinkResourceList {
1768	return iter.page.Response()
1769}
1770
1771// Value returns the current value or a zero-initialized value if the
1772// iterator has advanced beyond the end of the collection.
1773func (iter SharedPrivateLinkResourceListIterator) Value() SharedPrivateLinkResource {
1774	if !iter.page.NotDone() {
1775		return SharedPrivateLinkResource{}
1776	}
1777	return iter.page.Values()[iter.i]
1778}
1779
1780// Creates a new instance of the SharedPrivateLinkResourceListIterator type.
1781func NewSharedPrivateLinkResourceListIterator(page SharedPrivateLinkResourceListPage) SharedPrivateLinkResourceListIterator {
1782	return SharedPrivateLinkResourceListIterator{page: page}
1783}
1784
1785// IsEmpty returns true if the ListResult contains no values.
1786func (splrl SharedPrivateLinkResourceList) IsEmpty() bool {
1787	return splrl.Value == nil || len(*splrl.Value) == 0
1788}
1789
1790// hasNextLink returns true if the NextLink is not empty.
1791func (splrl SharedPrivateLinkResourceList) hasNextLink() bool {
1792	return splrl.NextLink != nil && len(*splrl.NextLink) != 0
1793}
1794
1795// sharedPrivateLinkResourceListPreparer prepares a request to retrieve the next set of results.
1796// It returns nil if no more results exist.
1797func (splrl SharedPrivateLinkResourceList) sharedPrivateLinkResourceListPreparer(ctx context.Context) (*http.Request, error) {
1798	if !splrl.hasNextLink() {
1799		return nil, nil
1800	}
1801	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1802		autorest.AsJSON(),
1803		autorest.AsGet(),
1804		autorest.WithBaseURL(to.String(splrl.NextLink)))
1805}
1806
1807// SharedPrivateLinkResourceListPage contains a page of SharedPrivateLinkResource values.
1808type SharedPrivateLinkResourceListPage struct {
1809	fn    func(context.Context, SharedPrivateLinkResourceList) (SharedPrivateLinkResourceList, error)
1810	splrl SharedPrivateLinkResourceList
1811}
1812
1813// NextWithContext advances to the next page of values.  If there was an error making
1814// the request the page does not advance and the error is returned.
1815func (page *SharedPrivateLinkResourceListPage) NextWithContext(ctx context.Context) (err error) {
1816	if tracing.IsEnabled() {
1817		ctx = tracing.StartSpan(ctx, fqdn+"/SharedPrivateLinkResourceListPage.NextWithContext")
1818		defer func() {
1819			sc := -1
1820			if page.Response().Response.Response != nil {
1821				sc = page.Response().Response.Response.StatusCode
1822			}
1823			tracing.EndSpan(ctx, sc, err)
1824		}()
1825	}
1826	for {
1827		next, err := page.fn(ctx, page.splrl)
1828		if err != nil {
1829			return err
1830		}
1831		page.splrl = next
1832		if !next.hasNextLink() || !next.IsEmpty() {
1833			break
1834		}
1835	}
1836	return nil
1837}
1838
1839// Next advances to the next page of values.  If there was an error making
1840// the request the page does not advance and the error is returned.
1841// Deprecated: Use NextWithContext() instead.
1842func (page *SharedPrivateLinkResourceListPage) Next() error {
1843	return page.NextWithContext(context.Background())
1844}
1845
1846// NotDone returns true if the page enumeration should be started or is not yet complete.
1847func (page SharedPrivateLinkResourceListPage) NotDone() bool {
1848	return !page.splrl.IsEmpty()
1849}
1850
1851// Response returns the raw server response from the last page request.
1852func (page SharedPrivateLinkResourceListPage) Response() SharedPrivateLinkResourceList {
1853	return page.splrl
1854}
1855
1856// Values returns the slice of values for the current page or nil if there are no values.
1857func (page SharedPrivateLinkResourceListPage) Values() []SharedPrivateLinkResource {
1858	if page.splrl.IsEmpty() {
1859		return nil
1860	}
1861	return *page.splrl.Value
1862}
1863
1864// Creates a new instance of the SharedPrivateLinkResourceListPage type.
1865func NewSharedPrivateLinkResourceListPage(cur SharedPrivateLinkResourceList, getNextPage func(context.Context, SharedPrivateLinkResourceList) (SharedPrivateLinkResourceList, error)) SharedPrivateLinkResourceListPage {
1866	return SharedPrivateLinkResourceListPage{
1867		fn:    getNextPage,
1868		splrl: cur,
1869	}
1870}
1871
1872// SharedPrivateLinkResourceProperties describes the properties of an existing Shared Private Link Resource
1873type SharedPrivateLinkResourceProperties struct {
1874	// GroupID - The group id from the provider of resource the shared private link resource is for
1875	GroupID *string `json:"groupId,omitempty"`
1876	// PrivateLinkResourceID - The resource id of the resource the shared private link resource is for
1877	PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"`
1878	// ProvisioningState - READ-ONLY; Provisioning state of the shared private link resource. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateMoving'
1879	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1880	// RequestMessage - The request message for requesting approval of the shared private link resource
1881	RequestMessage *string `json:"requestMessage,omitempty"`
1882	// Status - READ-ONLY; Status of the shared private link resource. Possible values include: 'SharedPrivateLinkResourceStatusPending', 'SharedPrivateLinkResourceStatusApproved', 'SharedPrivateLinkResourceStatusRejected', 'SharedPrivateLinkResourceStatusDisconnected', 'SharedPrivateLinkResourceStatusTimeout'
1883	Status SharedPrivateLinkResourceStatus `json:"status,omitempty"`
1884}
1885
1886// MarshalJSON is the custom marshaler for SharedPrivateLinkResourceProperties.
1887func (splrp SharedPrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
1888	objectMap := make(map[string]interface{})
1889	if splrp.GroupID != nil {
1890		objectMap["groupId"] = splrp.GroupID
1891	}
1892	if splrp.PrivateLinkResourceID != nil {
1893		objectMap["privateLinkResourceId"] = splrp.PrivateLinkResourceID
1894	}
1895	if splrp.RequestMessage != nil {
1896		objectMap["requestMessage"] = splrp.RequestMessage
1897	}
1898	return json.Marshal(objectMap)
1899}
1900
1901// SharedPrivateLinkResourcesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
1902// of a long-running operation.
1903type SharedPrivateLinkResourcesCreateOrUpdateFuture struct {
1904	azure.FutureAPI
1905	// Result returns the result of the asynchronous operation.
1906	// If the operation has not completed it will return an error.
1907	Result func(SharedPrivateLinkResourcesClient) (SharedPrivateLinkResource, error)
1908}
1909
1910// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1911func (future *SharedPrivateLinkResourcesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1912	var azFuture azure.Future
1913	if err := json.Unmarshal(body, &azFuture); err != nil {
1914		return err
1915	}
1916	future.FutureAPI = &azFuture
1917	future.Result = future.result
1918	return nil
1919}
1920
1921// result is the default implementation for SharedPrivateLinkResourcesCreateOrUpdateFuture.Result.
1922func (future *SharedPrivateLinkResourcesCreateOrUpdateFuture) result(client SharedPrivateLinkResourcesClient) (splr SharedPrivateLinkResource, err error) {
1923	var done bool
1924	done, err = future.DoneWithContext(context.Background(), client)
1925	if err != nil {
1926		err = autorest.NewErrorWithError(err, "signalr.SharedPrivateLinkResourcesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1927		return
1928	}
1929	if !done {
1930		splr.Response.Response = future.Response()
1931		err = azure.NewAsyncOpIncompleteError("signalr.SharedPrivateLinkResourcesCreateOrUpdateFuture")
1932		return
1933	}
1934	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1935	if splr.Response.Response, err = future.GetResult(sender); err == nil && splr.Response.Response.StatusCode != http.StatusNoContent {
1936		splr, err = client.CreateOrUpdateResponder(splr.Response.Response)
1937		if err != nil {
1938			err = autorest.NewErrorWithError(err, "signalr.SharedPrivateLinkResourcesCreateOrUpdateFuture", "Result", splr.Response.Response, "Failure responding to request")
1939		}
1940	}
1941	return
1942}
1943
1944// SharedPrivateLinkResourcesDeleteFuture an abstraction for monitoring and retrieving the results of a
1945// long-running operation.
1946type SharedPrivateLinkResourcesDeleteFuture struct {
1947	azure.FutureAPI
1948	// Result returns the result of the asynchronous operation.
1949	// If the operation has not completed it will return an error.
1950	Result func(SharedPrivateLinkResourcesClient) (autorest.Response, error)
1951}
1952
1953// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1954func (future *SharedPrivateLinkResourcesDeleteFuture) UnmarshalJSON(body []byte) error {
1955	var azFuture azure.Future
1956	if err := json.Unmarshal(body, &azFuture); err != nil {
1957		return err
1958	}
1959	future.FutureAPI = &azFuture
1960	future.Result = future.result
1961	return nil
1962}
1963
1964// result is the default implementation for SharedPrivateLinkResourcesDeleteFuture.Result.
1965func (future *SharedPrivateLinkResourcesDeleteFuture) result(client SharedPrivateLinkResourcesClient) (ar autorest.Response, err error) {
1966	var done bool
1967	done, err = future.DoneWithContext(context.Background(), client)
1968	if err != nil {
1969		err = autorest.NewErrorWithError(err, "signalr.SharedPrivateLinkResourcesDeleteFuture", "Result", future.Response(), "Polling failure")
1970		return
1971	}
1972	if !done {
1973		ar.Response = future.Response()
1974		err = azure.NewAsyncOpIncompleteError("signalr.SharedPrivateLinkResourcesDeleteFuture")
1975		return
1976	}
1977	ar.Response = future.Response()
1978	return
1979}
1980
1981// SystemData metadata pertaining to creation and last modification of the resource.
1982type SystemData struct {
1983	// CreatedBy - The identity that created the resource.
1984	CreatedBy *string `json:"createdBy,omitempty"`
1985	// CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
1986	CreatedByType CreatedByType `json:"createdByType,omitempty"`
1987	// CreatedAt - The timestamp of resource creation (UTC).
1988	CreatedAt *date.Time `json:"createdAt,omitempty"`
1989	// LastModifiedBy - The identity that last modified the resource.
1990	LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
1991	// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey'
1992	LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
1993	// LastModifiedAt - The timestamp of resource last modification (UTC)
1994	LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
1995}
1996
1997// TLSSettings TLS settings for the resource
1998type TLSSettings struct {
1999	// ClientCertEnabled - Request client certificate during TLS handshake if enabled
2000	ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"`
2001}
2002
2003// TrackedResource the resource model definition for a ARM tracked top level resource.
2004type TrackedResource struct {
2005	// Location - The GEO location of the resource. e.g. West US | East US | North Central US | South Central US.
2006	Location *string `json:"location,omitempty"`
2007	// Tags - Tags of the service which is a list of key value pairs that describe the resource.
2008	Tags map[string]*string `json:"tags"`
2009	// ID - READ-ONLY; Fully qualified resource Id for the resource.
2010	ID *string `json:"id,omitempty"`
2011	// Name - READ-ONLY; The name of the resource.
2012	Name *string `json:"name,omitempty"`
2013	// Type - READ-ONLY; The type of the resource - e.g. "Microsoft.SignalRService/SignalR"
2014	Type *string `json:"type,omitempty"`
2015}
2016
2017// MarshalJSON is the custom marshaler for TrackedResource.
2018func (tr TrackedResource) MarshalJSON() ([]byte, error) {
2019	objectMap := make(map[string]interface{})
2020	if tr.Location != nil {
2021		objectMap["location"] = tr.Location
2022	}
2023	if tr.Tags != nil {
2024		objectMap["tags"] = tr.Tags
2025	}
2026	return json.Marshal(objectMap)
2027}
2028
2029// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2030type UpdateFuture struct {
2031	azure.FutureAPI
2032	// Result returns the result of the asynchronous operation.
2033	// If the operation has not completed it will return an error.
2034	Result func(Client) (ResourceType, error)
2035}
2036
2037// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2038func (future *UpdateFuture) UnmarshalJSON(body []byte) error {
2039	var azFuture azure.Future
2040	if err := json.Unmarshal(body, &azFuture); err != nil {
2041		return err
2042	}
2043	future.FutureAPI = &azFuture
2044	future.Result = future.result
2045	return nil
2046}
2047
2048// result is the default implementation for UpdateFuture.Result.
2049func (future *UpdateFuture) result(client Client) (rt ResourceType, err error) {
2050	var done bool
2051	done, err = future.DoneWithContext(context.Background(), client)
2052	if err != nil {
2053		err = autorest.NewErrorWithError(err, "signalr.UpdateFuture", "Result", future.Response(), "Polling failure")
2054		return
2055	}
2056	if !done {
2057		rt.Response.Response = future.Response()
2058		err = azure.NewAsyncOpIncompleteError("signalr.UpdateFuture")
2059		return
2060	}
2061	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2062	if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent {
2063		rt, err = client.UpdateResponder(rt.Response.Response)
2064		if err != nil {
2065			err = autorest.NewErrorWithError(err, "signalr.UpdateFuture", "Result", rt.Response.Response, "Failure responding to request")
2066		}
2067	}
2068	return
2069}
2070
2071// UpstreamAuthSettings upstream auth settings.
2072type UpstreamAuthSettings struct {
2073	// Type - Gets or sets the type of auth. None or ManagedIdentity is supported now. Possible values include: 'UpstreamAuthTypeNone', 'UpstreamAuthTypeManagedIdentity'
2074	Type UpstreamAuthType `json:"type,omitempty"`
2075	// ManagedIdentity - Gets or sets the managed identity settings. It's required if the auth type is set to ManagedIdentity.
2076	ManagedIdentity *ManagedIdentitySettings `json:"managedIdentity,omitempty"`
2077}
2078
2079// UpstreamTemplate upstream template item settings. It defines the Upstream URL of the incoming requests.
2080// The template defines the pattern of the event, the hub or the category of the incoming request that
2081// matches current URL template.
2082type UpstreamTemplate struct {
2083	// HubPattern - Gets or sets the matching pattern for hub names. If not set, it matches any hub.
2084	// There are 3 kind of patterns supported:
2085	//     1. "*", it to matches any hub name
2086	//     2. Combine multiple hubs with ",", for example "hub1,hub2", it matches "hub1" and "hub2"
2087	//     3. The single hub name, for example, "hub1", it matches "hub1"
2088	HubPattern *string `json:"hubPattern,omitempty"`
2089	// EventPattern - Gets or sets the matching pattern for event names. If not set, it matches any event.
2090	// There are 3 kind of patterns supported:
2091	//     1. "*", it to matches any event name
2092	//     2. Combine multiple events with ",", for example "connect,disconnect", it matches event "connect" and "disconnect"
2093	//     3. The single event name, for example, "connect", it matches "connect"
2094	EventPattern *string `json:"eventPattern,omitempty"`
2095	// CategoryPattern - Gets or sets the matching pattern for category names. If not set, it matches any category.
2096	// There are 3 kind of patterns supported:
2097	//     1. "*", it to matches any category name
2098	//     2. Combine multiple categories with ",", for example "connections,messages", it matches category "connections" and "messages"
2099	//     3. The single category name, for example, "connections", it matches the category "connections"
2100	CategoryPattern *string `json:"categoryPattern,omitempty"`
2101	// 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.
2102	// 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`.
2103	URLTemplate *string `json:"urlTemplate,omitempty"`
2104	// Auth - Gets or sets the auth settings for an upstream. If not set, no auth is used for upstream messages.
2105	Auth *UpstreamAuthSettings `json:"auth,omitempty"`
2106}
2107
2108// Usage object that describes a specific usage of the resources.
2109type Usage struct {
2110	// ID - Fully qualified ARM resource id
2111	ID *string `json:"id,omitempty"`
2112	// CurrentValue - Current value for the usage quota.
2113	CurrentValue *int64 `json:"currentValue,omitempty"`
2114	// Limit - The maximum permitted value for the usage quota. If there is no limit, this value will be -1.
2115	Limit *int64 `json:"limit,omitempty"`
2116	// Name - Localizable String object containing the name and a localized value.
2117	Name *UsageName `json:"name,omitempty"`
2118	// Unit - Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond.
2119	Unit *string `json:"unit,omitempty"`
2120}
2121
2122// UsageList object that includes an array of the resource usages and a possible link for next set.
2123type UsageList struct {
2124	autorest.Response `json:"-"`
2125	// Value - List of the resource usages
2126	Value *[]Usage `json:"value,omitempty"`
2127	// NextLink - The URL the client should use to fetch the next page (per server side paging).
2128	// It's null for now, added for future use.
2129	NextLink *string `json:"nextLink,omitempty"`
2130}
2131
2132// UsageListIterator provides access to a complete listing of Usage values.
2133type UsageListIterator struct {
2134	i    int
2135	page UsageListPage
2136}
2137
2138// NextWithContext advances to the next value.  If there was an error making
2139// the request the iterator does not advance and the error is returned.
2140func (iter *UsageListIterator) NextWithContext(ctx context.Context) (err error) {
2141	if tracing.IsEnabled() {
2142		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListIterator.NextWithContext")
2143		defer func() {
2144			sc := -1
2145			if iter.Response().Response.Response != nil {
2146				sc = iter.Response().Response.Response.StatusCode
2147			}
2148			tracing.EndSpan(ctx, sc, err)
2149		}()
2150	}
2151	iter.i++
2152	if iter.i < len(iter.page.Values()) {
2153		return nil
2154	}
2155	err = iter.page.NextWithContext(ctx)
2156	if err != nil {
2157		iter.i--
2158		return err
2159	}
2160	iter.i = 0
2161	return nil
2162}
2163
2164// Next advances to the next value.  If there was an error making
2165// the request the iterator does not advance and the error is returned.
2166// Deprecated: Use NextWithContext() instead.
2167func (iter *UsageListIterator) Next() error {
2168	return iter.NextWithContext(context.Background())
2169}
2170
2171// NotDone returns true if the enumeration should be started or is not yet complete.
2172func (iter UsageListIterator) NotDone() bool {
2173	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2174}
2175
2176// Response returns the raw server response from the last page request.
2177func (iter UsageListIterator) Response() UsageList {
2178	return iter.page.Response()
2179}
2180
2181// Value returns the current value or a zero-initialized value if the
2182// iterator has advanced beyond the end of the collection.
2183func (iter UsageListIterator) Value() Usage {
2184	if !iter.page.NotDone() {
2185		return Usage{}
2186	}
2187	return iter.page.Values()[iter.i]
2188}
2189
2190// Creates a new instance of the UsageListIterator type.
2191func NewUsageListIterator(page UsageListPage) UsageListIterator {
2192	return UsageListIterator{page: page}
2193}
2194
2195// IsEmpty returns true if the ListResult contains no values.
2196func (ul UsageList) IsEmpty() bool {
2197	return ul.Value == nil || len(*ul.Value) == 0
2198}
2199
2200// hasNextLink returns true if the NextLink is not empty.
2201func (ul UsageList) hasNextLink() bool {
2202	return ul.NextLink != nil && len(*ul.NextLink) != 0
2203}
2204
2205// usageListPreparer prepares a request to retrieve the next set of results.
2206// It returns nil if no more results exist.
2207func (ul UsageList) usageListPreparer(ctx context.Context) (*http.Request, error) {
2208	if !ul.hasNextLink() {
2209		return nil, nil
2210	}
2211	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2212		autorest.AsJSON(),
2213		autorest.AsGet(),
2214		autorest.WithBaseURL(to.String(ul.NextLink)))
2215}
2216
2217// UsageListPage contains a page of Usage values.
2218type UsageListPage struct {
2219	fn func(context.Context, UsageList) (UsageList, error)
2220	ul UsageList
2221}
2222
2223// NextWithContext advances to the next page of values.  If there was an error making
2224// the request the page does not advance and the error is returned.
2225func (page *UsageListPage) NextWithContext(ctx context.Context) (err error) {
2226	if tracing.IsEnabled() {
2227		ctx = tracing.StartSpan(ctx, fqdn+"/UsageListPage.NextWithContext")
2228		defer func() {
2229			sc := -1
2230			if page.Response().Response.Response != nil {
2231				sc = page.Response().Response.Response.StatusCode
2232			}
2233			tracing.EndSpan(ctx, sc, err)
2234		}()
2235	}
2236	for {
2237		next, err := page.fn(ctx, page.ul)
2238		if err != nil {
2239			return err
2240		}
2241		page.ul = next
2242		if !next.hasNextLink() || !next.IsEmpty() {
2243			break
2244		}
2245	}
2246	return nil
2247}
2248
2249// Next advances to the next page of values.  If there was an error making
2250// the request the page does not advance and the error is returned.
2251// Deprecated: Use NextWithContext() instead.
2252func (page *UsageListPage) Next() error {
2253	return page.NextWithContext(context.Background())
2254}
2255
2256// NotDone returns true if the page enumeration should be started or is not yet complete.
2257func (page UsageListPage) NotDone() bool {
2258	return !page.ul.IsEmpty()
2259}
2260
2261// Response returns the raw server response from the last page request.
2262func (page UsageListPage) Response() UsageList {
2263	return page.ul
2264}
2265
2266// Values returns the slice of values for the current page or nil if there are no values.
2267func (page UsageListPage) Values() []Usage {
2268	if page.ul.IsEmpty() {
2269		return nil
2270	}
2271	return *page.ul.Value
2272}
2273
2274// Creates a new instance of the UsageListPage type.
2275func NewUsageListPage(cur UsageList, getNextPage func(context.Context, UsageList) (UsageList, error)) UsageListPage {
2276	return UsageListPage{
2277		fn: getNextPage,
2278		ul: cur,
2279	}
2280}
2281
2282// UsageName localizable String object containing the name and a localized value.
2283type UsageName struct {
2284	// Value - The identifier of the usage.
2285	Value *string `json:"value,omitempty"`
2286	// LocalizedValue - Localized name of the usage.
2287	LocalizedValue *string `json:"localizedValue,omitempty"`
2288}
2289
2290// UserAssignedIdentityProperty properties of user assigned identity.
2291type UserAssignedIdentityProperty struct {
2292	// PrincipalID - READ-ONLY; Get the principal id for the user assigned identity
2293	PrincipalID *string `json:"principalId,omitempty"`
2294	// ClientID - READ-ONLY; Get the client id for the user assigned identity
2295	ClientID *string `json:"clientId,omitempty"`
2296}
2297
2298// MarshalJSON is the custom marshaler for UserAssignedIdentityProperty.
2299func (uaip UserAssignedIdentityProperty) MarshalJSON() ([]byte, error) {
2300	objectMap := make(map[string]interface{})
2301	return json.Marshal(objectMap)
2302}
2303