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