1package redis
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"encoding/json"
23	"github.com/Azure/go-autorest/autorest"
24	"github.com/Azure/go-autorest/autorest/azure"
25	"github.com/Azure/go-autorest/autorest/date"
26	"github.com/Azure/go-autorest/autorest/to"
27	"github.com/Azure/go-autorest/tracing"
28	"net/http"
29)
30
31// The package's fully qualified name.
32const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/redis/mgmt/2019-07-01-preview/redis"
33
34// AccessKeys redis cache access keys.
35type AccessKeys struct {
36	autorest.Response `json:"-"`
37	// PrimaryKey - READ-ONLY; The current primary key that clients can use to authenticate with Redis cache.
38	PrimaryKey *string `json:"primaryKey,omitempty"`
39	// SecondaryKey - READ-ONLY; The current secondary key that clients can use to authenticate with Redis cache.
40	SecondaryKey *string `json:"secondaryKey,omitempty"`
41}
42
43// CheckNameAvailabilityParameters parameters body to pass for resource name availability check.
44type CheckNameAvailabilityParameters struct {
45	// Name - Resource name.
46	Name *string `json:"name,omitempty"`
47	// Type - Resource type. The only legal value of this property for checking redis cache name availability is 'Microsoft.Cache/redis'.
48	Type *string `json:"type,omitempty"`
49}
50
51// CommonProperties create/Update/Get common properties of the redis cache.
52type CommonProperties struct {
53	// RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc.
54	RedisConfiguration map[string]*string `json:"redisConfiguration"`
55	// EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled.
56	EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"`
57	// ReplicasPerMaster - The number of replicas to be created per master.
58	ReplicasPerMaster *int32 `json:"replicasPerMaster,omitempty"`
59	// TenantSettings - A dictionary of tenant settings
60	TenantSettings map[string]*string `json:"tenantSettings"`
61	// ShardCount - The number of shards to be created on a Premium Cluster Cache.
62	ShardCount *int32 `json:"shardCount,omitempty"`
63	// MinimumTLSVersion - Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo'
64	MinimumTLSVersion TLSVersion `json:"minimumTlsVersion,omitempty"`
65}
66
67// MarshalJSON is the custom marshaler for CommonProperties.
68func (cp CommonProperties) MarshalJSON() ([]byte, error) {
69	objectMap := make(map[string]interface{})
70	if cp.RedisConfiguration != nil {
71		objectMap["redisConfiguration"] = cp.RedisConfiguration
72	}
73	if cp.EnableNonSslPort != nil {
74		objectMap["enableNonSslPort"] = cp.EnableNonSslPort
75	}
76	if cp.ReplicasPerMaster != nil {
77		objectMap["replicasPerMaster"] = cp.ReplicasPerMaster
78	}
79	if cp.TenantSettings != nil {
80		objectMap["tenantSettings"] = cp.TenantSettings
81	}
82	if cp.ShardCount != nil {
83		objectMap["shardCount"] = cp.ShardCount
84	}
85	if cp.MinimumTLSVersion != "" {
86		objectMap["minimumTlsVersion"] = cp.MinimumTLSVersion
87	}
88	return json.Marshal(objectMap)
89}
90
91// CreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
92type CreateFuture struct {
93	azure.FutureAPI
94	// Result returns the result of the asynchronous operation.
95	// If the operation has not completed it will return an error.
96	Result func(Client) (ResourceType, error)
97}
98
99// CreateParameters parameters supplied to the Create Redis operation.
100type CreateParameters struct {
101	// CreateProperties - Redis cache properties.
102	*CreateProperties `json:"properties,omitempty"`
103	// Zones - A list of availability zones denoting where the resource needs to come from.
104	Zones *[]string `json:"zones,omitempty"`
105	// Location - The geo-location where the resource lives
106	Location *string `json:"location,omitempty"`
107	// Tags - Resource tags.
108	Tags map[string]*string `json:"tags"`
109}
110
111// MarshalJSON is the custom marshaler for CreateParameters.
112func (cp CreateParameters) MarshalJSON() ([]byte, error) {
113	objectMap := make(map[string]interface{})
114	if cp.CreateProperties != nil {
115		objectMap["properties"] = cp.CreateProperties
116	}
117	if cp.Zones != nil {
118		objectMap["zones"] = cp.Zones
119	}
120	if cp.Location != nil {
121		objectMap["location"] = cp.Location
122	}
123	if cp.Tags != nil {
124		objectMap["tags"] = cp.Tags
125	}
126	return json.Marshal(objectMap)
127}
128
129// UnmarshalJSON is the custom unmarshaler for CreateParameters struct.
130func (cp *CreateParameters) UnmarshalJSON(body []byte) error {
131	var m map[string]*json.RawMessage
132	err := json.Unmarshal(body, &m)
133	if err != nil {
134		return err
135	}
136	for k, v := range m {
137		switch k {
138		case "properties":
139			if v != nil {
140				var createProperties CreateProperties
141				err = json.Unmarshal(*v, &createProperties)
142				if err != nil {
143					return err
144				}
145				cp.CreateProperties = &createProperties
146			}
147		case "zones":
148			if v != nil {
149				var zones []string
150				err = json.Unmarshal(*v, &zones)
151				if err != nil {
152					return err
153				}
154				cp.Zones = &zones
155			}
156		case "location":
157			if v != nil {
158				var location string
159				err = json.Unmarshal(*v, &location)
160				if err != nil {
161					return err
162				}
163				cp.Location = &location
164			}
165		case "tags":
166			if v != nil {
167				var tags map[string]*string
168				err = json.Unmarshal(*v, &tags)
169				if err != nil {
170					return err
171				}
172				cp.Tags = tags
173			}
174		}
175	}
176
177	return nil
178}
179
180// CreateProperties properties supplied to Create Redis operation.
181type CreateProperties struct {
182	// Sku - The SKU of the Redis cache to deploy.
183	Sku *Sku `json:"sku,omitempty"`
184	// SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1
185	SubnetID *string `json:"subnetId,omitempty"`
186	// StaticIP - Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network.
187	StaticIP *string `json:"staticIP,omitempty"`
188	// RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc.
189	RedisConfiguration map[string]*string `json:"redisConfiguration"`
190	// EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled.
191	EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"`
192	// ReplicasPerMaster - The number of replicas to be created per master.
193	ReplicasPerMaster *int32 `json:"replicasPerMaster,omitempty"`
194	// TenantSettings - A dictionary of tenant settings
195	TenantSettings map[string]*string `json:"tenantSettings"`
196	// ShardCount - The number of shards to be created on a Premium Cluster Cache.
197	ShardCount *int32 `json:"shardCount,omitempty"`
198	// MinimumTLSVersion - Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo'
199	MinimumTLSVersion TLSVersion `json:"minimumTlsVersion,omitempty"`
200}
201
202// MarshalJSON is the custom marshaler for CreateProperties.
203func (cp CreateProperties) MarshalJSON() ([]byte, error) {
204	objectMap := make(map[string]interface{})
205	if cp.Sku != nil {
206		objectMap["sku"] = cp.Sku
207	}
208	if cp.SubnetID != nil {
209		objectMap["subnetId"] = cp.SubnetID
210	}
211	if cp.StaticIP != nil {
212		objectMap["staticIP"] = cp.StaticIP
213	}
214	if cp.RedisConfiguration != nil {
215		objectMap["redisConfiguration"] = cp.RedisConfiguration
216	}
217	if cp.EnableNonSslPort != nil {
218		objectMap["enableNonSslPort"] = cp.EnableNonSslPort
219	}
220	if cp.ReplicasPerMaster != nil {
221		objectMap["replicasPerMaster"] = cp.ReplicasPerMaster
222	}
223	if cp.TenantSettings != nil {
224		objectMap["tenantSettings"] = cp.TenantSettings
225	}
226	if cp.ShardCount != nil {
227		objectMap["shardCount"] = cp.ShardCount
228	}
229	if cp.MinimumTLSVersion != "" {
230		objectMap["minimumTlsVersion"] = cp.MinimumTLSVersion
231	}
232	return json.Marshal(objectMap)
233}
234
235// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
236type DeleteFuture struct {
237	azure.FutureAPI
238	// Result returns the result of the asynchronous operation.
239	// If the operation has not completed it will return an error.
240	Result func(Client) (autorest.Response, error)
241}
242
243// ExportDataFuture an abstraction for monitoring and retrieving the results of a long-running operation.
244type ExportDataFuture struct {
245	azure.FutureAPI
246	// Result returns the result of the asynchronous operation.
247	// If the operation has not completed it will return an error.
248	Result func(Client) (autorest.Response, error)
249}
250
251// ExportRDBParameters parameters for Redis export operation.
252type ExportRDBParameters struct {
253	// Format - File format.
254	Format *string `json:"format,omitempty"`
255	// Prefix - Prefix to use for exported files.
256	Prefix *string `json:"prefix,omitempty"`
257	// Container - Container name to export to.
258	Container *string `json:"container,omitempty"`
259}
260
261// FirewallRule a firewall rule on a redis cache has a name, and describes a contiguous range of IP
262// addresses permitted to connect
263type FirewallRule struct {
264	autorest.Response `json:"-"`
265	// FirewallRuleProperties - redis cache firewall rule properties
266	*FirewallRuleProperties `json:"properties,omitempty"`
267	// ID - READ-ONLY; Resource ID.
268	ID *string `json:"id,omitempty"`
269	// Name - READ-ONLY; Resource name.
270	Name *string `json:"name,omitempty"`
271	// Type - READ-ONLY; Resource type.
272	Type *string `json:"type,omitempty"`
273}
274
275// MarshalJSON is the custom marshaler for FirewallRule.
276func (fr FirewallRule) MarshalJSON() ([]byte, error) {
277	objectMap := make(map[string]interface{})
278	if fr.FirewallRuleProperties != nil {
279		objectMap["properties"] = fr.FirewallRuleProperties
280	}
281	return json.Marshal(objectMap)
282}
283
284// UnmarshalJSON is the custom unmarshaler for FirewallRule struct.
285func (fr *FirewallRule) UnmarshalJSON(body []byte) error {
286	var m map[string]*json.RawMessage
287	err := json.Unmarshal(body, &m)
288	if err != nil {
289		return err
290	}
291	for k, v := range m {
292		switch k {
293		case "properties":
294			if v != nil {
295				var firewallRuleProperties FirewallRuleProperties
296				err = json.Unmarshal(*v, &firewallRuleProperties)
297				if err != nil {
298					return err
299				}
300				fr.FirewallRuleProperties = &firewallRuleProperties
301			}
302		case "id":
303			if v != nil {
304				var ID string
305				err = json.Unmarshal(*v, &ID)
306				if err != nil {
307					return err
308				}
309				fr.ID = &ID
310			}
311		case "name":
312			if v != nil {
313				var name string
314				err = json.Unmarshal(*v, &name)
315				if err != nil {
316					return err
317				}
318				fr.Name = &name
319			}
320		case "type":
321			if v != nil {
322				var typeVar string
323				err = json.Unmarshal(*v, &typeVar)
324				if err != nil {
325					return err
326				}
327				fr.Type = &typeVar
328			}
329		}
330	}
331
332	return nil
333}
334
335// FirewallRuleCreateParameters parameters required for creating a firewall rule on redis cache.
336type FirewallRuleCreateParameters struct {
337	// FirewallRuleProperties - Properties required to create a firewall rule .
338	*FirewallRuleProperties `json:"properties,omitempty"`
339}
340
341// MarshalJSON is the custom marshaler for FirewallRuleCreateParameters.
342func (frcp FirewallRuleCreateParameters) MarshalJSON() ([]byte, error) {
343	objectMap := make(map[string]interface{})
344	if frcp.FirewallRuleProperties != nil {
345		objectMap["properties"] = frcp.FirewallRuleProperties
346	}
347	return json.Marshal(objectMap)
348}
349
350// UnmarshalJSON is the custom unmarshaler for FirewallRuleCreateParameters struct.
351func (frcp *FirewallRuleCreateParameters) UnmarshalJSON(body []byte) error {
352	var m map[string]*json.RawMessage
353	err := json.Unmarshal(body, &m)
354	if err != nil {
355		return err
356	}
357	for k, v := range m {
358		switch k {
359		case "properties":
360			if v != nil {
361				var firewallRuleProperties FirewallRuleProperties
362				err = json.Unmarshal(*v, &firewallRuleProperties)
363				if err != nil {
364					return err
365				}
366				frcp.FirewallRuleProperties = &firewallRuleProperties
367			}
368		}
369	}
370
371	return nil
372}
373
374// FirewallRuleListResult the response of list firewall rules Redis operation.
375type FirewallRuleListResult struct {
376	autorest.Response `json:"-"`
377	// Value - Results of the list firewall rules operation.
378	Value *[]FirewallRule `json:"value,omitempty"`
379	// NextLink - READ-ONLY; Link for next page of results.
380	NextLink *string `json:"nextLink,omitempty"`
381}
382
383// MarshalJSON is the custom marshaler for FirewallRuleListResult.
384func (frlr FirewallRuleListResult) MarshalJSON() ([]byte, error) {
385	objectMap := make(map[string]interface{})
386	if frlr.Value != nil {
387		objectMap["value"] = frlr.Value
388	}
389	return json.Marshal(objectMap)
390}
391
392// FirewallRuleListResultIterator provides access to a complete listing of FirewallRule values.
393type FirewallRuleListResultIterator struct {
394	i    int
395	page FirewallRuleListResultPage
396}
397
398// NextWithContext advances to the next value.  If there was an error making
399// the request the iterator does not advance and the error is returned.
400func (iter *FirewallRuleListResultIterator) NextWithContext(ctx context.Context) (err error) {
401	if tracing.IsEnabled() {
402		ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRuleListResultIterator.NextWithContext")
403		defer func() {
404			sc := -1
405			if iter.Response().Response.Response != nil {
406				sc = iter.Response().Response.Response.StatusCode
407			}
408			tracing.EndSpan(ctx, sc, err)
409		}()
410	}
411	iter.i++
412	if iter.i < len(iter.page.Values()) {
413		return nil
414	}
415	err = iter.page.NextWithContext(ctx)
416	if err != nil {
417		iter.i--
418		return err
419	}
420	iter.i = 0
421	return nil
422}
423
424// Next advances to the next value.  If there was an error making
425// the request the iterator does not advance and the error is returned.
426// Deprecated: Use NextWithContext() instead.
427func (iter *FirewallRuleListResultIterator) Next() error {
428	return iter.NextWithContext(context.Background())
429}
430
431// NotDone returns true if the enumeration should be started or is not yet complete.
432func (iter FirewallRuleListResultIterator) NotDone() bool {
433	return iter.page.NotDone() && iter.i < len(iter.page.Values())
434}
435
436// Response returns the raw server response from the last page request.
437func (iter FirewallRuleListResultIterator) Response() FirewallRuleListResult {
438	return iter.page.Response()
439}
440
441// Value returns the current value or a zero-initialized value if the
442// iterator has advanced beyond the end of the collection.
443func (iter FirewallRuleListResultIterator) Value() FirewallRule {
444	if !iter.page.NotDone() {
445		return FirewallRule{}
446	}
447	return iter.page.Values()[iter.i]
448}
449
450// Creates a new instance of the FirewallRuleListResultIterator type.
451func NewFirewallRuleListResultIterator(page FirewallRuleListResultPage) FirewallRuleListResultIterator {
452	return FirewallRuleListResultIterator{page: page}
453}
454
455// IsEmpty returns true if the ListResult contains no values.
456func (frlr FirewallRuleListResult) IsEmpty() bool {
457	return frlr.Value == nil || len(*frlr.Value) == 0
458}
459
460// hasNextLink returns true if the NextLink is not empty.
461func (frlr FirewallRuleListResult) hasNextLink() bool {
462	return frlr.NextLink != nil && len(*frlr.NextLink) != 0
463}
464
465// firewallRuleListResultPreparer prepares a request to retrieve the next set of results.
466// It returns nil if no more results exist.
467func (frlr FirewallRuleListResult) firewallRuleListResultPreparer(ctx context.Context) (*http.Request, error) {
468	if !frlr.hasNextLink() {
469		return nil, nil
470	}
471	return autorest.Prepare((&http.Request{}).WithContext(ctx),
472		autorest.AsJSON(),
473		autorest.AsGet(),
474		autorest.WithBaseURL(to.String(frlr.NextLink)))
475}
476
477// FirewallRuleListResultPage contains a page of FirewallRule values.
478type FirewallRuleListResultPage struct {
479	fn   func(context.Context, FirewallRuleListResult) (FirewallRuleListResult, error)
480	frlr FirewallRuleListResult
481}
482
483// NextWithContext advances to the next page of values.  If there was an error making
484// the request the page does not advance and the error is returned.
485func (page *FirewallRuleListResultPage) NextWithContext(ctx context.Context) (err error) {
486	if tracing.IsEnabled() {
487		ctx = tracing.StartSpan(ctx, fqdn+"/FirewallRuleListResultPage.NextWithContext")
488		defer func() {
489			sc := -1
490			if page.Response().Response.Response != nil {
491				sc = page.Response().Response.Response.StatusCode
492			}
493			tracing.EndSpan(ctx, sc, err)
494		}()
495	}
496	for {
497		next, err := page.fn(ctx, page.frlr)
498		if err != nil {
499			return err
500		}
501		page.frlr = next
502		if !next.hasNextLink() || !next.IsEmpty() {
503			break
504		}
505	}
506	return nil
507}
508
509// Next advances to the next page of values.  If there was an error making
510// the request the page does not advance and the error is returned.
511// Deprecated: Use NextWithContext() instead.
512func (page *FirewallRuleListResultPage) Next() error {
513	return page.NextWithContext(context.Background())
514}
515
516// NotDone returns true if the page enumeration should be started or is not yet complete.
517func (page FirewallRuleListResultPage) NotDone() bool {
518	return !page.frlr.IsEmpty()
519}
520
521// Response returns the raw server response from the last page request.
522func (page FirewallRuleListResultPage) Response() FirewallRuleListResult {
523	return page.frlr
524}
525
526// Values returns the slice of values for the current page or nil if there are no values.
527func (page FirewallRuleListResultPage) Values() []FirewallRule {
528	if page.frlr.IsEmpty() {
529		return nil
530	}
531	return *page.frlr.Value
532}
533
534// Creates a new instance of the FirewallRuleListResultPage type.
535func NewFirewallRuleListResultPage(cur FirewallRuleListResult, getNextPage func(context.Context, FirewallRuleListResult) (FirewallRuleListResult, error)) FirewallRuleListResultPage {
536	return FirewallRuleListResultPage{
537		fn:   getNextPage,
538		frlr: cur,
539	}
540}
541
542// FirewallRuleProperties specifies a range of IP addresses permitted to connect to the cache
543type FirewallRuleProperties struct {
544	// StartIP - lowest IP address included in the range
545	StartIP *string `json:"startIP,omitempty"`
546	// EndIP - highest IP address included in the range
547	EndIP *string `json:"endIP,omitempty"`
548}
549
550// ForceRebootResponse response to force reboot for Redis cache.
551type ForceRebootResponse struct {
552	autorest.Response `json:"-"`
553	// Message - READ-ONLY; Status message
554	Message *string `json:"message,omitempty"`
555}
556
557// ImportDataFuture an abstraction for monitoring and retrieving the results of a long-running operation.
558type ImportDataFuture struct {
559	azure.FutureAPI
560	// Result returns the result of the asynchronous operation.
561	// If the operation has not completed it will return an error.
562	Result func(Client) (autorest.Response, error)
563}
564
565// ImportRDBParameters parameters for Redis import operation.
566type ImportRDBParameters struct {
567	// Format - File format.
568	Format *string `json:"format,omitempty"`
569	// Files - files to import.
570	Files *[]string `json:"files,omitempty"`
571}
572
573// InstanceDetails details of single instance of redis.
574type InstanceDetails struct {
575	// SslPort - READ-ONLY; Redis instance SSL port.
576	SslPort *int32 `json:"sslPort,omitempty"`
577	// NonSslPort - READ-ONLY; If enableNonSslPort is true, provides Redis instance Non-SSL port.
578	NonSslPort *int32 `json:"nonSslPort,omitempty"`
579	// Zone - READ-ONLY; If the Cache uses availability zones, specifies availability zone where this instance is located.
580	Zone *string `json:"zone,omitempty"`
581	// ShardID - READ-ONLY; If clustering is enabled, the Shard ID of Redis Instance
582	ShardID *int32 `json:"shardId,omitempty"`
583	// IsMaster - READ-ONLY; Specifies whether the instance is a master node.
584	IsMaster *bool `json:"isMaster,omitempty"`
585}
586
587// LinkedServer linked server Id
588type LinkedServer struct {
589	// ID - READ-ONLY; Linked server Id.
590	ID *string `json:"id,omitempty"`
591}
592
593// LinkedServerCreateFuture an abstraction for monitoring and retrieving the results of a long-running
594// operation.
595type LinkedServerCreateFuture struct {
596	azure.FutureAPI
597	// Result returns the result of the asynchronous operation.
598	// If the operation has not completed it will return an error.
599	Result func(LinkedServerClient) (LinkedServerWithProperties, error)
600}
601
602// LinkedServerCreateParameters parameter required for creating a linked server to redis cache.
603type LinkedServerCreateParameters struct {
604	// LinkedServerCreateProperties - Properties required to create a linked server.
605	*LinkedServerCreateProperties `json:"properties,omitempty"`
606}
607
608// MarshalJSON is the custom marshaler for LinkedServerCreateParameters.
609func (lscp LinkedServerCreateParameters) MarshalJSON() ([]byte, error) {
610	objectMap := make(map[string]interface{})
611	if lscp.LinkedServerCreateProperties != nil {
612		objectMap["properties"] = lscp.LinkedServerCreateProperties
613	}
614	return json.Marshal(objectMap)
615}
616
617// UnmarshalJSON is the custom unmarshaler for LinkedServerCreateParameters struct.
618func (lscp *LinkedServerCreateParameters) UnmarshalJSON(body []byte) error {
619	var m map[string]*json.RawMessage
620	err := json.Unmarshal(body, &m)
621	if err != nil {
622		return err
623	}
624	for k, v := range m {
625		switch k {
626		case "properties":
627			if v != nil {
628				var linkedServerCreateProperties LinkedServerCreateProperties
629				err = json.Unmarshal(*v, &linkedServerCreateProperties)
630				if err != nil {
631					return err
632				}
633				lscp.LinkedServerCreateProperties = &linkedServerCreateProperties
634			}
635		}
636	}
637
638	return nil
639}
640
641// LinkedServerCreateProperties create properties for a linked server
642type LinkedServerCreateProperties struct {
643	// LinkedRedisCacheID - Fully qualified resourceId of the linked redis cache.
644	LinkedRedisCacheID *string `json:"linkedRedisCacheId,omitempty"`
645	// LinkedRedisCacheLocation - Location of the linked redis cache.
646	LinkedRedisCacheLocation *string `json:"linkedRedisCacheLocation,omitempty"`
647	// ServerRole - Role of the linked server. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary'
648	ServerRole ReplicationRole `json:"serverRole,omitempty"`
649}
650
651// LinkedServerProperties properties of a linked server to be returned in get/put response
652type LinkedServerProperties struct {
653	// ProvisioningState - READ-ONLY; Terminal state of the link between primary and secondary redis cache.
654	ProvisioningState *string `json:"provisioningState,omitempty"`
655	// LinkedRedisCacheID - Fully qualified resourceId of the linked redis cache.
656	LinkedRedisCacheID *string `json:"linkedRedisCacheId,omitempty"`
657	// LinkedRedisCacheLocation - Location of the linked redis cache.
658	LinkedRedisCacheLocation *string `json:"linkedRedisCacheLocation,omitempty"`
659	// ServerRole - Role of the linked server. Possible values include: 'ReplicationRolePrimary', 'ReplicationRoleSecondary'
660	ServerRole ReplicationRole `json:"serverRole,omitempty"`
661}
662
663// MarshalJSON is the custom marshaler for LinkedServerProperties.
664func (lsp LinkedServerProperties) MarshalJSON() ([]byte, error) {
665	objectMap := make(map[string]interface{})
666	if lsp.LinkedRedisCacheID != nil {
667		objectMap["linkedRedisCacheId"] = lsp.LinkedRedisCacheID
668	}
669	if lsp.LinkedRedisCacheLocation != nil {
670		objectMap["linkedRedisCacheLocation"] = lsp.LinkedRedisCacheLocation
671	}
672	if lsp.ServerRole != "" {
673		objectMap["serverRole"] = lsp.ServerRole
674	}
675	return json.Marshal(objectMap)
676}
677
678// LinkedServerWithProperties response to put/get linked server (with properties) for Redis cache.
679type LinkedServerWithProperties struct {
680	autorest.Response `json:"-"`
681	// LinkedServerProperties - Properties of the linked server.
682	*LinkedServerProperties `json:"properties,omitempty"`
683	// ID - READ-ONLY; Resource ID.
684	ID *string `json:"id,omitempty"`
685	// Name - READ-ONLY; Resource name.
686	Name *string `json:"name,omitempty"`
687	// Type - READ-ONLY; Resource type.
688	Type *string `json:"type,omitempty"`
689}
690
691// MarshalJSON is the custom marshaler for LinkedServerWithProperties.
692func (lswp LinkedServerWithProperties) MarshalJSON() ([]byte, error) {
693	objectMap := make(map[string]interface{})
694	if lswp.LinkedServerProperties != nil {
695		objectMap["properties"] = lswp.LinkedServerProperties
696	}
697	return json.Marshal(objectMap)
698}
699
700// UnmarshalJSON is the custom unmarshaler for LinkedServerWithProperties struct.
701func (lswp *LinkedServerWithProperties) UnmarshalJSON(body []byte) error {
702	var m map[string]*json.RawMessage
703	err := json.Unmarshal(body, &m)
704	if err != nil {
705		return err
706	}
707	for k, v := range m {
708		switch k {
709		case "properties":
710			if v != nil {
711				var linkedServerProperties LinkedServerProperties
712				err = json.Unmarshal(*v, &linkedServerProperties)
713				if err != nil {
714					return err
715				}
716				lswp.LinkedServerProperties = &linkedServerProperties
717			}
718		case "id":
719			if v != nil {
720				var ID string
721				err = json.Unmarshal(*v, &ID)
722				if err != nil {
723					return err
724				}
725				lswp.ID = &ID
726			}
727		case "name":
728			if v != nil {
729				var name string
730				err = json.Unmarshal(*v, &name)
731				if err != nil {
732					return err
733				}
734				lswp.Name = &name
735			}
736		case "type":
737			if v != nil {
738				var typeVar string
739				err = json.Unmarshal(*v, &typeVar)
740				if err != nil {
741					return err
742				}
743				lswp.Type = &typeVar
744			}
745		}
746	}
747
748	return nil
749}
750
751// LinkedServerWithPropertiesList list of linked servers (with properties) of a Redis cache.
752type LinkedServerWithPropertiesList struct {
753	autorest.Response `json:"-"`
754	// Value - List of linked servers (with properties) of a Redis cache.
755	Value *[]LinkedServerWithProperties `json:"value,omitempty"`
756	// NextLink - READ-ONLY; Link for next set.
757	NextLink *string `json:"nextLink,omitempty"`
758}
759
760// MarshalJSON is the custom marshaler for LinkedServerWithPropertiesList.
761func (lswpl LinkedServerWithPropertiesList) MarshalJSON() ([]byte, error) {
762	objectMap := make(map[string]interface{})
763	if lswpl.Value != nil {
764		objectMap["value"] = lswpl.Value
765	}
766	return json.Marshal(objectMap)
767}
768
769// LinkedServerWithPropertiesListIterator provides access to a complete listing of
770// LinkedServerWithProperties values.
771type LinkedServerWithPropertiesListIterator struct {
772	i    int
773	page LinkedServerWithPropertiesListPage
774}
775
776// NextWithContext advances to the next value.  If there was an error making
777// the request the iterator does not advance and the error is returned.
778func (iter *LinkedServerWithPropertiesListIterator) NextWithContext(ctx context.Context) (err error) {
779	if tracing.IsEnabled() {
780		ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServerWithPropertiesListIterator.NextWithContext")
781		defer func() {
782			sc := -1
783			if iter.Response().Response.Response != nil {
784				sc = iter.Response().Response.Response.StatusCode
785			}
786			tracing.EndSpan(ctx, sc, err)
787		}()
788	}
789	iter.i++
790	if iter.i < len(iter.page.Values()) {
791		return nil
792	}
793	err = iter.page.NextWithContext(ctx)
794	if err != nil {
795		iter.i--
796		return err
797	}
798	iter.i = 0
799	return nil
800}
801
802// Next advances to the next value.  If there was an error making
803// the request the iterator does not advance and the error is returned.
804// Deprecated: Use NextWithContext() instead.
805func (iter *LinkedServerWithPropertiesListIterator) Next() error {
806	return iter.NextWithContext(context.Background())
807}
808
809// NotDone returns true if the enumeration should be started or is not yet complete.
810func (iter LinkedServerWithPropertiesListIterator) NotDone() bool {
811	return iter.page.NotDone() && iter.i < len(iter.page.Values())
812}
813
814// Response returns the raw server response from the last page request.
815func (iter LinkedServerWithPropertiesListIterator) Response() LinkedServerWithPropertiesList {
816	return iter.page.Response()
817}
818
819// Value returns the current value or a zero-initialized value if the
820// iterator has advanced beyond the end of the collection.
821func (iter LinkedServerWithPropertiesListIterator) Value() LinkedServerWithProperties {
822	if !iter.page.NotDone() {
823		return LinkedServerWithProperties{}
824	}
825	return iter.page.Values()[iter.i]
826}
827
828// Creates a new instance of the LinkedServerWithPropertiesListIterator type.
829func NewLinkedServerWithPropertiesListIterator(page LinkedServerWithPropertiesListPage) LinkedServerWithPropertiesListIterator {
830	return LinkedServerWithPropertiesListIterator{page: page}
831}
832
833// IsEmpty returns true if the ListResult contains no values.
834func (lswpl LinkedServerWithPropertiesList) IsEmpty() bool {
835	return lswpl.Value == nil || len(*lswpl.Value) == 0
836}
837
838// hasNextLink returns true if the NextLink is not empty.
839func (lswpl LinkedServerWithPropertiesList) hasNextLink() bool {
840	return lswpl.NextLink != nil && len(*lswpl.NextLink) != 0
841}
842
843// linkedServerWithPropertiesListPreparer prepares a request to retrieve the next set of results.
844// It returns nil if no more results exist.
845func (lswpl LinkedServerWithPropertiesList) linkedServerWithPropertiesListPreparer(ctx context.Context) (*http.Request, error) {
846	if !lswpl.hasNextLink() {
847		return nil, nil
848	}
849	return autorest.Prepare((&http.Request{}).WithContext(ctx),
850		autorest.AsJSON(),
851		autorest.AsGet(),
852		autorest.WithBaseURL(to.String(lswpl.NextLink)))
853}
854
855// LinkedServerWithPropertiesListPage contains a page of LinkedServerWithProperties values.
856type LinkedServerWithPropertiesListPage struct {
857	fn    func(context.Context, LinkedServerWithPropertiesList) (LinkedServerWithPropertiesList, error)
858	lswpl LinkedServerWithPropertiesList
859}
860
861// NextWithContext advances to the next page of values.  If there was an error making
862// the request the page does not advance and the error is returned.
863func (page *LinkedServerWithPropertiesListPage) NextWithContext(ctx context.Context) (err error) {
864	if tracing.IsEnabled() {
865		ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServerWithPropertiesListPage.NextWithContext")
866		defer func() {
867			sc := -1
868			if page.Response().Response.Response != nil {
869				sc = page.Response().Response.Response.StatusCode
870			}
871			tracing.EndSpan(ctx, sc, err)
872		}()
873	}
874	for {
875		next, err := page.fn(ctx, page.lswpl)
876		if err != nil {
877			return err
878		}
879		page.lswpl = next
880		if !next.hasNextLink() || !next.IsEmpty() {
881			break
882		}
883	}
884	return nil
885}
886
887// Next advances to the next page of values.  If there was an error making
888// the request the page does not advance and the error is returned.
889// Deprecated: Use NextWithContext() instead.
890func (page *LinkedServerWithPropertiesListPage) Next() error {
891	return page.NextWithContext(context.Background())
892}
893
894// NotDone returns true if the page enumeration should be started or is not yet complete.
895func (page LinkedServerWithPropertiesListPage) NotDone() bool {
896	return !page.lswpl.IsEmpty()
897}
898
899// Response returns the raw server response from the last page request.
900func (page LinkedServerWithPropertiesListPage) Response() LinkedServerWithPropertiesList {
901	return page.lswpl
902}
903
904// Values returns the slice of values for the current page or nil if there are no values.
905func (page LinkedServerWithPropertiesListPage) Values() []LinkedServerWithProperties {
906	if page.lswpl.IsEmpty() {
907		return nil
908	}
909	return *page.lswpl.Value
910}
911
912// Creates a new instance of the LinkedServerWithPropertiesListPage type.
913func NewLinkedServerWithPropertiesListPage(cur LinkedServerWithPropertiesList, getNextPage func(context.Context, LinkedServerWithPropertiesList) (LinkedServerWithPropertiesList, error)) LinkedServerWithPropertiesListPage {
914	return LinkedServerWithPropertiesListPage{
915		fn:    getNextPage,
916		lswpl: cur,
917	}
918}
919
920// ListResult the response of list Redis operation.
921type ListResult struct {
922	autorest.Response `json:"-"`
923	// Value - List of Redis cache instances.
924	Value *[]ResourceType `json:"value,omitempty"`
925	// NextLink - READ-ONLY; Link for next page of results.
926	NextLink *string `json:"nextLink,omitempty"`
927}
928
929// MarshalJSON is the custom marshaler for ListResult.
930func (lr ListResult) MarshalJSON() ([]byte, error) {
931	objectMap := make(map[string]interface{})
932	if lr.Value != nil {
933		objectMap["value"] = lr.Value
934	}
935	return json.Marshal(objectMap)
936}
937
938// ListResultIterator provides access to a complete listing of ResourceType values.
939type ListResultIterator struct {
940	i    int
941	page ListResultPage
942}
943
944// NextWithContext advances to the next value.  If there was an error making
945// the request the iterator does not advance and the error is returned.
946func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) {
947	if tracing.IsEnabled() {
948		ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext")
949		defer func() {
950			sc := -1
951			if iter.Response().Response.Response != nil {
952				sc = iter.Response().Response.Response.StatusCode
953			}
954			tracing.EndSpan(ctx, sc, err)
955		}()
956	}
957	iter.i++
958	if iter.i < len(iter.page.Values()) {
959		return nil
960	}
961	err = iter.page.NextWithContext(ctx)
962	if err != nil {
963		iter.i--
964		return err
965	}
966	iter.i = 0
967	return nil
968}
969
970// Next advances to the next value.  If there was an error making
971// the request the iterator does not advance and the error is returned.
972// Deprecated: Use NextWithContext() instead.
973func (iter *ListResultIterator) Next() error {
974	return iter.NextWithContext(context.Background())
975}
976
977// NotDone returns true if the enumeration should be started or is not yet complete.
978func (iter ListResultIterator) NotDone() bool {
979	return iter.page.NotDone() && iter.i < len(iter.page.Values())
980}
981
982// Response returns the raw server response from the last page request.
983func (iter ListResultIterator) Response() ListResult {
984	return iter.page.Response()
985}
986
987// Value returns the current value or a zero-initialized value if the
988// iterator has advanced beyond the end of the collection.
989func (iter ListResultIterator) Value() ResourceType {
990	if !iter.page.NotDone() {
991		return ResourceType{}
992	}
993	return iter.page.Values()[iter.i]
994}
995
996// Creates a new instance of the ListResultIterator type.
997func NewListResultIterator(page ListResultPage) ListResultIterator {
998	return ListResultIterator{page: page}
999}
1000
1001// IsEmpty returns true if the ListResult contains no values.
1002func (lr ListResult) IsEmpty() bool {
1003	return lr.Value == nil || len(*lr.Value) == 0
1004}
1005
1006// hasNextLink returns true if the NextLink is not empty.
1007func (lr ListResult) hasNextLink() bool {
1008	return lr.NextLink != nil && len(*lr.NextLink) != 0
1009}
1010
1011// listResultPreparer prepares a request to retrieve the next set of results.
1012// It returns nil if no more results exist.
1013func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) {
1014	if !lr.hasNextLink() {
1015		return nil, nil
1016	}
1017	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1018		autorest.AsJSON(),
1019		autorest.AsGet(),
1020		autorest.WithBaseURL(to.String(lr.NextLink)))
1021}
1022
1023// ListResultPage contains a page of ResourceType values.
1024type ListResultPage struct {
1025	fn func(context.Context, ListResult) (ListResult, error)
1026	lr ListResult
1027}
1028
1029// NextWithContext advances to the next page of values.  If there was an error making
1030// the request the page does not advance and the error is returned.
1031func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) {
1032	if tracing.IsEnabled() {
1033		ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext")
1034		defer func() {
1035			sc := -1
1036			if page.Response().Response.Response != nil {
1037				sc = page.Response().Response.Response.StatusCode
1038			}
1039			tracing.EndSpan(ctx, sc, err)
1040		}()
1041	}
1042	for {
1043		next, err := page.fn(ctx, page.lr)
1044		if err != nil {
1045			return err
1046		}
1047		page.lr = next
1048		if !next.hasNextLink() || !next.IsEmpty() {
1049			break
1050		}
1051	}
1052	return nil
1053}
1054
1055// Next advances to the next page of values.  If there was an error making
1056// the request the page does not advance and the error is returned.
1057// Deprecated: Use NextWithContext() instead.
1058func (page *ListResultPage) Next() error {
1059	return page.NextWithContext(context.Background())
1060}
1061
1062// NotDone returns true if the page enumeration should be started or is not yet complete.
1063func (page ListResultPage) NotDone() bool {
1064	return !page.lr.IsEmpty()
1065}
1066
1067// Response returns the raw server response from the last page request.
1068func (page ListResultPage) Response() ListResult {
1069	return page.lr
1070}
1071
1072// Values returns the slice of values for the current page or nil if there are no values.
1073func (page ListResultPage) Values() []ResourceType {
1074	if page.lr.IsEmpty() {
1075		return nil
1076	}
1077	return *page.lr.Value
1078}
1079
1080// Creates a new instance of the ListResultPage type.
1081func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
1082	return ListResultPage{
1083		fn: getNextPage,
1084		lr: cur,
1085	}
1086}
1087
1088// NotificationListResponse the response of listUpgradeNotifications.
1089type NotificationListResponse struct {
1090	autorest.Response `json:"-"`
1091	// Value - List of all notifications.
1092	Value *[]UpgradeNotification `json:"value,omitempty"`
1093	// NextLink - READ-ONLY; Link for next set of notifications.
1094	NextLink *string `json:"nextLink,omitempty"`
1095}
1096
1097// MarshalJSON is the custom marshaler for NotificationListResponse.
1098func (nlr NotificationListResponse) MarshalJSON() ([]byte, error) {
1099	objectMap := make(map[string]interface{})
1100	if nlr.Value != nil {
1101		objectMap["value"] = nlr.Value
1102	}
1103	return json.Marshal(objectMap)
1104}
1105
1106// Operation REST API operation
1107type Operation struct {
1108	// Name - Operation name: {provider}/{resource}/{operation}
1109	Name *string `json:"name,omitempty"`
1110	// Display - The object that describes the operation.
1111	Display *OperationDisplay `json:"display,omitempty"`
1112}
1113
1114// OperationDisplay the object that describes the operation.
1115type OperationDisplay struct {
1116	// Provider - Friendly name of the resource provider
1117	Provider *string `json:"provider,omitempty"`
1118	// Operation - Operation type: read, write, delete, listKeys/action, etc.
1119	Operation *string `json:"operation,omitempty"`
1120	// Resource - Resource type on which the operation is performed.
1121	Resource *string `json:"resource,omitempty"`
1122	// Description - Friendly name of the operation
1123	Description *string `json:"description,omitempty"`
1124}
1125
1126// OperationListResult result of the request to list REST API operations. It contains a list of operations
1127// and a URL nextLink to get the next set of results.
1128type OperationListResult struct {
1129	autorest.Response `json:"-"`
1130	// Value - List of operations supported by the resource provider.
1131	Value *[]Operation `json:"value,omitempty"`
1132	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
1133	NextLink *string `json:"nextLink,omitempty"`
1134}
1135
1136// MarshalJSON is the custom marshaler for OperationListResult.
1137func (olr OperationListResult) MarshalJSON() ([]byte, error) {
1138	objectMap := make(map[string]interface{})
1139	if olr.Value != nil {
1140		objectMap["value"] = olr.Value
1141	}
1142	return json.Marshal(objectMap)
1143}
1144
1145// OperationListResultIterator provides access to a complete listing of Operation values.
1146type OperationListResultIterator struct {
1147	i    int
1148	page OperationListResultPage
1149}
1150
1151// NextWithContext advances to the next value.  If there was an error making
1152// the request the iterator does not advance and the error is returned.
1153func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1154	if tracing.IsEnabled() {
1155		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1156		defer func() {
1157			sc := -1
1158			if iter.Response().Response.Response != nil {
1159				sc = iter.Response().Response.Response.StatusCode
1160			}
1161			tracing.EndSpan(ctx, sc, err)
1162		}()
1163	}
1164	iter.i++
1165	if iter.i < len(iter.page.Values()) {
1166		return nil
1167	}
1168	err = iter.page.NextWithContext(ctx)
1169	if err != nil {
1170		iter.i--
1171		return err
1172	}
1173	iter.i = 0
1174	return nil
1175}
1176
1177// Next advances to the next value.  If there was an error making
1178// the request the iterator does not advance and the error is returned.
1179// Deprecated: Use NextWithContext() instead.
1180func (iter *OperationListResultIterator) Next() error {
1181	return iter.NextWithContext(context.Background())
1182}
1183
1184// NotDone returns true if the enumeration should be started or is not yet complete.
1185func (iter OperationListResultIterator) NotDone() bool {
1186	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1187}
1188
1189// Response returns the raw server response from the last page request.
1190func (iter OperationListResultIterator) Response() OperationListResult {
1191	return iter.page.Response()
1192}
1193
1194// Value returns the current value or a zero-initialized value if the
1195// iterator has advanced beyond the end of the collection.
1196func (iter OperationListResultIterator) Value() Operation {
1197	if !iter.page.NotDone() {
1198		return Operation{}
1199	}
1200	return iter.page.Values()[iter.i]
1201}
1202
1203// Creates a new instance of the OperationListResultIterator type.
1204func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1205	return OperationListResultIterator{page: page}
1206}
1207
1208// IsEmpty returns true if the ListResult contains no values.
1209func (olr OperationListResult) IsEmpty() bool {
1210	return olr.Value == nil || len(*olr.Value) == 0
1211}
1212
1213// hasNextLink returns true if the NextLink is not empty.
1214func (olr OperationListResult) hasNextLink() bool {
1215	return olr.NextLink != nil && len(*olr.NextLink) != 0
1216}
1217
1218// operationListResultPreparer prepares a request to retrieve the next set of results.
1219// It returns nil if no more results exist.
1220func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1221	if !olr.hasNextLink() {
1222		return nil, nil
1223	}
1224	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1225		autorest.AsJSON(),
1226		autorest.AsGet(),
1227		autorest.WithBaseURL(to.String(olr.NextLink)))
1228}
1229
1230// OperationListResultPage contains a page of Operation values.
1231type OperationListResultPage struct {
1232	fn  func(context.Context, OperationListResult) (OperationListResult, error)
1233	olr OperationListResult
1234}
1235
1236// NextWithContext advances to the next page of values.  If there was an error making
1237// the request the page does not advance and the error is returned.
1238func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1239	if tracing.IsEnabled() {
1240		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1241		defer func() {
1242			sc := -1
1243			if page.Response().Response.Response != nil {
1244				sc = page.Response().Response.Response.StatusCode
1245			}
1246			tracing.EndSpan(ctx, sc, err)
1247		}()
1248	}
1249	for {
1250		next, err := page.fn(ctx, page.olr)
1251		if err != nil {
1252			return err
1253		}
1254		page.olr = next
1255		if !next.hasNextLink() || !next.IsEmpty() {
1256			break
1257		}
1258	}
1259	return nil
1260}
1261
1262// Next advances to the next page of values.  If there was an error making
1263// the request the page does not advance and the error is returned.
1264// Deprecated: Use NextWithContext() instead.
1265func (page *OperationListResultPage) Next() error {
1266	return page.NextWithContext(context.Background())
1267}
1268
1269// NotDone returns true if the page enumeration should be started or is not yet complete.
1270func (page OperationListResultPage) NotDone() bool {
1271	return !page.olr.IsEmpty()
1272}
1273
1274// Response returns the raw server response from the last page request.
1275func (page OperationListResultPage) Response() OperationListResult {
1276	return page.olr
1277}
1278
1279// Values returns the slice of values for the current page or nil if there are no values.
1280func (page OperationListResultPage) Values() []Operation {
1281	if page.olr.IsEmpty() {
1282		return nil
1283	}
1284	return *page.olr.Value
1285}
1286
1287// Creates a new instance of the OperationListResultPage type.
1288func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
1289	return OperationListResultPage{
1290		fn:  getNextPage,
1291		olr: cur,
1292	}
1293}
1294
1295// PatchSchedule response to put/get patch schedules for Redis cache.
1296type PatchSchedule struct {
1297	autorest.Response `json:"-"`
1298	// ScheduleEntries - List of patch schedules for a Redis cache.
1299	*ScheduleEntries `json:"properties,omitempty"`
1300	// ID - READ-ONLY; Resource ID.
1301	ID *string `json:"id,omitempty"`
1302	// Name - READ-ONLY; Resource name.
1303	Name *string `json:"name,omitempty"`
1304	// Type - READ-ONLY; Resource type.
1305	Type *string `json:"type,omitempty"`
1306}
1307
1308// MarshalJSON is the custom marshaler for PatchSchedule.
1309func (ps PatchSchedule) MarshalJSON() ([]byte, error) {
1310	objectMap := make(map[string]interface{})
1311	if ps.ScheduleEntries != nil {
1312		objectMap["properties"] = ps.ScheduleEntries
1313	}
1314	return json.Marshal(objectMap)
1315}
1316
1317// UnmarshalJSON is the custom unmarshaler for PatchSchedule struct.
1318func (ps *PatchSchedule) UnmarshalJSON(body []byte) error {
1319	var m map[string]*json.RawMessage
1320	err := json.Unmarshal(body, &m)
1321	if err != nil {
1322		return err
1323	}
1324	for k, v := range m {
1325		switch k {
1326		case "properties":
1327			if v != nil {
1328				var scheduleEntries ScheduleEntries
1329				err = json.Unmarshal(*v, &scheduleEntries)
1330				if err != nil {
1331					return err
1332				}
1333				ps.ScheduleEntries = &scheduleEntries
1334			}
1335		case "id":
1336			if v != nil {
1337				var ID string
1338				err = json.Unmarshal(*v, &ID)
1339				if err != nil {
1340					return err
1341				}
1342				ps.ID = &ID
1343			}
1344		case "name":
1345			if v != nil {
1346				var name string
1347				err = json.Unmarshal(*v, &name)
1348				if err != nil {
1349					return err
1350				}
1351				ps.Name = &name
1352			}
1353		case "type":
1354			if v != nil {
1355				var typeVar string
1356				err = json.Unmarshal(*v, &typeVar)
1357				if err != nil {
1358					return err
1359				}
1360				ps.Type = &typeVar
1361			}
1362		}
1363	}
1364
1365	return nil
1366}
1367
1368// PatchScheduleListResult the response of list patch schedules Redis operation.
1369type PatchScheduleListResult struct {
1370	autorest.Response `json:"-"`
1371	// Value - Results of the list patch schedules operation.
1372	Value *[]PatchSchedule `json:"value,omitempty"`
1373	// NextLink - READ-ONLY; Link for next page of results.
1374	NextLink *string `json:"nextLink,omitempty"`
1375}
1376
1377// MarshalJSON is the custom marshaler for PatchScheduleListResult.
1378func (pslr PatchScheduleListResult) MarshalJSON() ([]byte, error) {
1379	objectMap := make(map[string]interface{})
1380	if pslr.Value != nil {
1381		objectMap["value"] = pslr.Value
1382	}
1383	return json.Marshal(objectMap)
1384}
1385
1386// PatchScheduleListResultIterator provides access to a complete listing of PatchSchedule values.
1387type PatchScheduleListResultIterator struct {
1388	i    int
1389	page PatchScheduleListResultPage
1390}
1391
1392// NextWithContext advances to the next value.  If there was an error making
1393// the request the iterator does not advance and the error is returned.
1394func (iter *PatchScheduleListResultIterator) NextWithContext(ctx context.Context) (err error) {
1395	if tracing.IsEnabled() {
1396		ctx = tracing.StartSpan(ctx, fqdn+"/PatchScheduleListResultIterator.NextWithContext")
1397		defer func() {
1398			sc := -1
1399			if iter.Response().Response.Response != nil {
1400				sc = iter.Response().Response.Response.StatusCode
1401			}
1402			tracing.EndSpan(ctx, sc, err)
1403		}()
1404	}
1405	iter.i++
1406	if iter.i < len(iter.page.Values()) {
1407		return nil
1408	}
1409	err = iter.page.NextWithContext(ctx)
1410	if err != nil {
1411		iter.i--
1412		return err
1413	}
1414	iter.i = 0
1415	return nil
1416}
1417
1418// Next advances to the next value.  If there was an error making
1419// the request the iterator does not advance and the error is returned.
1420// Deprecated: Use NextWithContext() instead.
1421func (iter *PatchScheduleListResultIterator) Next() error {
1422	return iter.NextWithContext(context.Background())
1423}
1424
1425// NotDone returns true if the enumeration should be started or is not yet complete.
1426func (iter PatchScheduleListResultIterator) NotDone() bool {
1427	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1428}
1429
1430// Response returns the raw server response from the last page request.
1431func (iter PatchScheduleListResultIterator) Response() PatchScheduleListResult {
1432	return iter.page.Response()
1433}
1434
1435// Value returns the current value or a zero-initialized value if the
1436// iterator has advanced beyond the end of the collection.
1437func (iter PatchScheduleListResultIterator) Value() PatchSchedule {
1438	if !iter.page.NotDone() {
1439		return PatchSchedule{}
1440	}
1441	return iter.page.Values()[iter.i]
1442}
1443
1444// Creates a new instance of the PatchScheduleListResultIterator type.
1445func NewPatchScheduleListResultIterator(page PatchScheduleListResultPage) PatchScheduleListResultIterator {
1446	return PatchScheduleListResultIterator{page: page}
1447}
1448
1449// IsEmpty returns true if the ListResult contains no values.
1450func (pslr PatchScheduleListResult) IsEmpty() bool {
1451	return pslr.Value == nil || len(*pslr.Value) == 0
1452}
1453
1454// hasNextLink returns true if the NextLink is not empty.
1455func (pslr PatchScheduleListResult) hasNextLink() bool {
1456	return pslr.NextLink != nil && len(*pslr.NextLink) != 0
1457}
1458
1459// patchScheduleListResultPreparer prepares a request to retrieve the next set of results.
1460// It returns nil if no more results exist.
1461func (pslr PatchScheduleListResult) patchScheduleListResultPreparer(ctx context.Context) (*http.Request, error) {
1462	if !pslr.hasNextLink() {
1463		return nil, nil
1464	}
1465	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1466		autorest.AsJSON(),
1467		autorest.AsGet(),
1468		autorest.WithBaseURL(to.String(pslr.NextLink)))
1469}
1470
1471// PatchScheduleListResultPage contains a page of PatchSchedule values.
1472type PatchScheduleListResultPage struct {
1473	fn   func(context.Context, PatchScheduleListResult) (PatchScheduleListResult, error)
1474	pslr PatchScheduleListResult
1475}
1476
1477// NextWithContext advances to the next page of values.  If there was an error making
1478// the request the page does not advance and the error is returned.
1479func (page *PatchScheduleListResultPage) NextWithContext(ctx context.Context) (err error) {
1480	if tracing.IsEnabled() {
1481		ctx = tracing.StartSpan(ctx, fqdn+"/PatchScheduleListResultPage.NextWithContext")
1482		defer func() {
1483			sc := -1
1484			if page.Response().Response.Response != nil {
1485				sc = page.Response().Response.Response.StatusCode
1486			}
1487			tracing.EndSpan(ctx, sc, err)
1488		}()
1489	}
1490	for {
1491		next, err := page.fn(ctx, page.pslr)
1492		if err != nil {
1493			return err
1494		}
1495		page.pslr = next
1496		if !next.hasNextLink() || !next.IsEmpty() {
1497			break
1498		}
1499	}
1500	return nil
1501}
1502
1503// Next advances to the next page of values.  If there was an error making
1504// the request the page does not advance and the error is returned.
1505// Deprecated: Use NextWithContext() instead.
1506func (page *PatchScheduleListResultPage) Next() error {
1507	return page.NextWithContext(context.Background())
1508}
1509
1510// NotDone returns true if the page enumeration should be started or is not yet complete.
1511func (page PatchScheduleListResultPage) NotDone() bool {
1512	return !page.pslr.IsEmpty()
1513}
1514
1515// Response returns the raw server response from the last page request.
1516func (page PatchScheduleListResultPage) Response() PatchScheduleListResult {
1517	return page.pslr
1518}
1519
1520// Values returns the slice of values for the current page or nil if there are no values.
1521func (page PatchScheduleListResultPage) Values() []PatchSchedule {
1522	if page.pslr.IsEmpty() {
1523		return nil
1524	}
1525	return *page.pslr.Value
1526}
1527
1528// Creates a new instance of the PatchScheduleListResultPage type.
1529func NewPatchScheduleListResultPage(cur PatchScheduleListResult, getNextPage func(context.Context, PatchScheduleListResult) (PatchScheduleListResult, error)) PatchScheduleListResultPage {
1530	return PatchScheduleListResultPage{
1531		fn:   getNextPage,
1532		pslr: cur,
1533	}
1534}
1535
1536// Properties properties of the redis cache.
1537type Properties struct {
1538	// RedisVersion - READ-ONLY; Redis version.
1539	RedisVersion *string `json:"redisVersion,omitempty"`
1540	// ProvisioningState - READ-ONLY; Redis instance provisioning status. Possible values include: 'Creating', 'Deleting', 'Disabled', 'Failed', 'Linking', 'Provisioning', 'RecoveringScaleFailure', 'Scaling', 'Succeeded', 'Unlinking', 'Unprovisioning', 'Updating'
1541	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1542	// HostName - READ-ONLY; Redis host name.
1543	HostName *string `json:"hostName,omitempty"`
1544	// Port - READ-ONLY; Redis non-SSL port.
1545	Port *int32 `json:"port,omitempty"`
1546	// SslPort - READ-ONLY; Redis SSL port.
1547	SslPort *int32 `json:"sslPort,omitempty"`
1548	// AccessKeys - READ-ONLY; The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache
1549	AccessKeys *AccessKeys `json:"accessKeys,omitempty"`
1550	// LinkedServers - READ-ONLY; List of the linked servers associated with the cache
1551	LinkedServers *[]LinkedServer `json:"linkedServers,omitempty"`
1552	// Instances - READ-ONLY; List of the Redis instances associated with the cache
1553	Instances *[]InstanceDetails `json:"instances,omitempty"`
1554	// Sku - The SKU of the Redis cache to deploy.
1555	Sku *Sku `json:"sku,omitempty"`
1556	// SubnetID - The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1
1557	SubnetID *string `json:"subnetId,omitempty"`
1558	// StaticIP - Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network.
1559	StaticIP *string `json:"staticIP,omitempty"`
1560	// RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc.
1561	RedisConfiguration map[string]*string `json:"redisConfiguration"`
1562	// EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled.
1563	EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"`
1564	// ReplicasPerMaster - The number of replicas to be created per master.
1565	ReplicasPerMaster *int32 `json:"replicasPerMaster,omitempty"`
1566	// TenantSettings - A dictionary of tenant settings
1567	TenantSettings map[string]*string `json:"tenantSettings"`
1568	// ShardCount - The number of shards to be created on a Premium Cluster Cache.
1569	ShardCount *int32 `json:"shardCount,omitempty"`
1570	// MinimumTLSVersion - Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo'
1571	MinimumTLSVersion TLSVersion `json:"minimumTlsVersion,omitempty"`
1572}
1573
1574// MarshalJSON is the custom marshaler for Properties.
1575func (p Properties) MarshalJSON() ([]byte, error) {
1576	objectMap := make(map[string]interface{})
1577	if p.Sku != nil {
1578		objectMap["sku"] = p.Sku
1579	}
1580	if p.SubnetID != nil {
1581		objectMap["subnetId"] = p.SubnetID
1582	}
1583	if p.StaticIP != nil {
1584		objectMap["staticIP"] = p.StaticIP
1585	}
1586	if p.RedisConfiguration != nil {
1587		objectMap["redisConfiguration"] = p.RedisConfiguration
1588	}
1589	if p.EnableNonSslPort != nil {
1590		objectMap["enableNonSslPort"] = p.EnableNonSslPort
1591	}
1592	if p.ReplicasPerMaster != nil {
1593		objectMap["replicasPerMaster"] = p.ReplicasPerMaster
1594	}
1595	if p.TenantSettings != nil {
1596		objectMap["tenantSettings"] = p.TenantSettings
1597	}
1598	if p.ShardCount != nil {
1599		objectMap["shardCount"] = p.ShardCount
1600	}
1601	if p.MinimumTLSVersion != "" {
1602		objectMap["minimumTlsVersion"] = p.MinimumTLSVersion
1603	}
1604	return json.Marshal(objectMap)
1605}
1606
1607// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
1608// required location and tags
1609type ProxyResource struct {
1610	// ID - READ-ONLY; Resource ID.
1611	ID *string `json:"id,omitempty"`
1612	// Name - READ-ONLY; Resource name.
1613	Name *string `json:"name,omitempty"`
1614	// Type - READ-ONLY; Resource type.
1615	Type *string `json:"type,omitempty"`
1616}
1617
1618// RebootParameters specifies which Redis node(s) to reboot.
1619type RebootParameters struct {
1620	// RebootType - Which Redis node(s) to reboot. Depending on this value data loss is possible. Possible values include: 'PrimaryNode', 'SecondaryNode', 'AllNodes'
1621	RebootType RebootType `json:"rebootType,omitempty"`
1622	// ShardID - If clustering is enabled, the ID of the shard to be rebooted.
1623	ShardID *int32 `json:"shardId,omitempty"`
1624	// Ports - A list of redis instances to reboot, specified by per-instance SSL ports or non-SSL ports.
1625	Ports *[]int32 `json:"ports,omitempty"`
1626}
1627
1628// RegenerateKeyParameters specifies which Redis access keys to reset.
1629type RegenerateKeyParameters struct {
1630	// KeyType - The Redis access key to regenerate. Possible values include: 'Primary', 'Secondary'
1631	KeyType KeyType `json:"keyType,omitempty"`
1632}
1633
1634// Resource the Resource definition.
1635type Resource struct {
1636	// ID - READ-ONLY; Resource ID.
1637	ID *string `json:"id,omitempty"`
1638	// Name - READ-ONLY; Resource name.
1639	Name *string `json:"name,omitempty"`
1640	// Type - READ-ONLY; Resource type.
1641	Type *string `json:"type,omitempty"`
1642}
1643
1644// ResourceType a single Redis item in List or Get Operation.
1645type ResourceType struct {
1646	autorest.Response `json:"-"`
1647	// Properties - Redis cache properties.
1648	*Properties `json:"properties,omitempty"`
1649	// Zones - A list of availability zones denoting where the resource needs to come from.
1650	Zones *[]string `json:"zones,omitempty"`
1651	// Tags - Resource tags.
1652	Tags map[string]*string `json:"tags"`
1653	// Location - The geo-location where the resource lives
1654	Location *string `json:"location,omitempty"`
1655	// ID - READ-ONLY; Resource ID.
1656	ID *string `json:"id,omitempty"`
1657	// Name - READ-ONLY; Resource name.
1658	Name *string `json:"name,omitempty"`
1659	// Type - READ-ONLY; Resource type.
1660	Type *string `json:"type,omitempty"`
1661}
1662
1663// MarshalJSON is the custom marshaler for ResourceType.
1664func (rt ResourceType) MarshalJSON() ([]byte, error) {
1665	objectMap := make(map[string]interface{})
1666	if rt.Properties != nil {
1667		objectMap["properties"] = rt.Properties
1668	}
1669	if rt.Zones != nil {
1670		objectMap["zones"] = rt.Zones
1671	}
1672	if rt.Tags != nil {
1673		objectMap["tags"] = rt.Tags
1674	}
1675	if rt.Location != nil {
1676		objectMap["location"] = rt.Location
1677	}
1678	return json.Marshal(objectMap)
1679}
1680
1681// UnmarshalJSON is the custom unmarshaler for ResourceType struct.
1682func (rt *ResourceType) UnmarshalJSON(body []byte) error {
1683	var m map[string]*json.RawMessage
1684	err := json.Unmarshal(body, &m)
1685	if err != nil {
1686		return err
1687	}
1688	for k, v := range m {
1689		switch k {
1690		case "properties":
1691			if v != nil {
1692				var properties Properties
1693				err = json.Unmarshal(*v, &properties)
1694				if err != nil {
1695					return err
1696				}
1697				rt.Properties = &properties
1698			}
1699		case "zones":
1700			if v != nil {
1701				var zones []string
1702				err = json.Unmarshal(*v, &zones)
1703				if err != nil {
1704					return err
1705				}
1706				rt.Zones = &zones
1707			}
1708		case "tags":
1709			if v != nil {
1710				var tags map[string]*string
1711				err = json.Unmarshal(*v, &tags)
1712				if err != nil {
1713					return err
1714				}
1715				rt.Tags = tags
1716			}
1717		case "location":
1718			if v != nil {
1719				var location string
1720				err = json.Unmarshal(*v, &location)
1721				if err != nil {
1722					return err
1723				}
1724				rt.Location = &location
1725			}
1726		case "id":
1727			if v != nil {
1728				var ID string
1729				err = json.Unmarshal(*v, &ID)
1730				if err != nil {
1731					return err
1732				}
1733				rt.ID = &ID
1734			}
1735		case "name":
1736			if v != nil {
1737				var name string
1738				err = json.Unmarshal(*v, &name)
1739				if err != nil {
1740					return err
1741				}
1742				rt.Name = &name
1743			}
1744		case "type":
1745			if v != nil {
1746				var typeVar string
1747				err = json.Unmarshal(*v, &typeVar)
1748				if err != nil {
1749					return err
1750				}
1751				rt.Type = &typeVar
1752			}
1753		}
1754	}
1755
1756	return nil
1757}
1758
1759// ScheduleEntries list of patch schedules for a Redis cache.
1760type ScheduleEntries struct {
1761	// ScheduleEntries - List of patch schedules for a Redis cache.
1762	ScheduleEntries *[]ScheduleEntry `json:"scheduleEntries,omitempty"`
1763}
1764
1765// ScheduleEntry patch schedule entry for a Premium Redis Cache.
1766type ScheduleEntry struct {
1767	// DayOfWeek - Day of the week when a cache can be patched. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Everyday', 'Weekend'
1768	DayOfWeek DayOfWeek `json:"dayOfWeek,omitempty"`
1769	// StartHourUtc - Start hour after which cache patching can start.
1770	StartHourUtc *int32 `json:"startHourUtc,omitempty"`
1771	// MaintenanceWindow - ISO8601 timespan specifying how much time cache patching can take.
1772	MaintenanceWindow *string `json:"maintenanceWindow,omitempty"`
1773}
1774
1775// Sku SKU parameters supplied to the create Redis operation.
1776type Sku struct {
1777	// Name - The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium). Possible values include: 'Basic', 'Standard', 'Premium'
1778	Name SkuName `json:"name,omitempty"`
1779	// Family - The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). Possible values include: 'C', 'P'
1780	Family SkuFamily `json:"family,omitempty"`
1781	// Capacity - The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4, 5).
1782	Capacity *int32 `json:"capacity,omitempty"`
1783}
1784
1785// TrackedResource the resource model definition for a ARM tracked top level resource
1786type TrackedResource struct {
1787	// Tags - Resource tags.
1788	Tags map[string]*string `json:"tags"`
1789	// Location - The geo-location where the resource lives
1790	Location *string `json:"location,omitempty"`
1791	// ID - READ-ONLY; Resource ID.
1792	ID *string `json:"id,omitempty"`
1793	// Name - READ-ONLY; Resource name.
1794	Name *string `json:"name,omitempty"`
1795	// Type - READ-ONLY; Resource type.
1796	Type *string `json:"type,omitempty"`
1797}
1798
1799// MarshalJSON is the custom marshaler for TrackedResource.
1800func (tr TrackedResource) MarshalJSON() ([]byte, error) {
1801	objectMap := make(map[string]interface{})
1802	if tr.Tags != nil {
1803		objectMap["tags"] = tr.Tags
1804	}
1805	if tr.Location != nil {
1806		objectMap["location"] = tr.Location
1807	}
1808	return json.Marshal(objectMap)
1809}
1810
1811// UpdateParameters parameters supplied to the Update Redis operation.
1812type UpdateParameters struct {
1813	// UpdateProperties - Redis cache properties.
1814	*UpdateProperties `json:"properties,omitempty"`
1815	// Tags - Resource tags.
1816	Tags map[string]*string `json:"tags"`
1817}
1818
1819// MarshalJSON is the custom marshaler for UpdateParameters.
1820func (up UpdateParameters) MarshalJSON() ([]byte, error) {
1821	objectMap := make(map[string]interface{})
1822	if up.UpdateProperties != nil {
1823		objectMap["properties"] = up.UpdateProperties
1824	}
1825	if up.Tags != nil {
1826		objectMap["tags"] = up.Tags
1827	}
1828	return json.Marshal(objectMap)
1829}
1830
1831// UnmarshalJSON is the custom unmarshaler for UpdateParameters struct.
1832func (up *UpdateParameters) UnmarshalJSON(body []byte) error {
1833	var m map[string]*json.RawMessage
1834	err := json.Unmarshal(body, &m)
1835	if err != nil {
1836		return err
1837	}
1838	for k, v := range m {
1839		switch k {
1840		case "properties":
1841			if v != nil {
1842				var updateProperties UpdateProperties
1843				err = json.Unmarshal(*v, &updateProperties)
1844				if err != nil {
1845					return err
1846				}
1847				up.UpdateProperties = &updateProperties
1848			}
1849		case "tags":
1850			if v != nil {
1851				var tags map[string]*string
1852				err = json.Unmarshal(*v, &tags)
1853				if err != nil {
1854					return err
1855				}
1856				up.Tags = tags
1857			}
1858		}
1859	}
1860
1861	return nil
1862}
1863
1864// UpdateProperties patchable properties of the redis cache.
1865type UpdateProperties struct {
1866	// Sku - The SKU of the Redis cache to deploy.
1867	Sku *Sku `json:"sku,omitempty"`
1868	// RedisConfiguration - All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value etc.
1869	RedisConfiguration map[string]*string `json:"redisConfiguration"`
1870	// EnableNonSslPort - Specifies whether the non-ssl Redis server port (6379) is enabled.
1871	EnableNonSslPort *bool `json:"enableNonSslPort,omitempty"`
1872	// ReplicasPerMaster - The number of replicas to be created per master.
1873	ReplicasPerMaster *int32 `json:"replicasPerMaster,omitempty"`
1874	// TenantSettings - A dictionary of tenant settings
1875	TenantSettings map[string]*string `json:"tenantSettings"`
1876	// ShardCount - The number of shards to be created on a Premium Cluster Cache.
1877	ShardCount *int32 `json:"shardCount,omitempty"`
1878	// MinimumTLSVersion - Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2'). Possible values include: 'OneFullStopZero', 'OneFullStopOne', 'OneFullStopTwo'
1879	MinimumTLSVersion TLSVersion `json:"minimumTlsVersion,omitempty"`
1880}
1881
1882// MarshalJSON is the custom marshaler for UpdateProperties.
1883func (up UpdateProperties) MarshalJSON() ([]byte, error) {
1884	objectMap := make(map[string]interface{})
1885	if up.Sku != nil {
1886		objectMap["sku"] = up.Sku
1887	}
1888	if up.RedisConfiguration != nil {
1889		objectMap["redisConfiguration"] = up.RedisConfiguration
1890	}
1891	if up.EnableNonSslPort != nil {
1892		objectMap["enableNonSslPort"] = up.EnableNonSslPort
1893	}
1894	if up.ReplicasPerMaster != nil {
1895		objectMap["replicasPerMaster"] = up.ReplicasPerMaster
1896	}
1897	if up.TenantSettings != nil {
1898		objectMap["tenantSettings"] = up.TenantSettings
1899	}
1900	if up.ShardCount != nil {
1901		objectMap["shardCount"] = up.ShardCount
1902	}
1903	if up.MinimumTLSVersion != "" {
1904		objectMap["minimumTlsVersion"] = up.MinimumTLSVersion
1905	}
1906	return json.Marshal(objectMap)
1907}
1908
1909// UpgradeNotification properties of upgrade notification.
1910type UpgradeNotification struct {
1911	// Name - READ-ONLY; Name of upgrade notification.
1912	Name *string `json:"name,omitempty"`
1913	// Timestamp - READ-ONLY; Timestamp when upgrade notification occurred.
1914	Timestamp *date.Time `json:"timestamp,omitempty"`
1915	// UpsellNotification - READ-ONLY; Details about this upgrade notification
1916	UpsellNotification map[string]*string `json:"upsellNotification"`
1917}
1918
1919// MarshalJSON is the custom marshaler for UpgradeNotification.
1920func (un UpgradeNotification) MarshalJSON() ([]byte, error) {
1921	objectMap := make(map[string]interface{})
1922	return json.Marshal(objectMap)
1923}
1924