1package dns
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	"encoding/json"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/azure"
24	"github.com/Azure/go-autorest/autorest/to"
25	"net/http"
26)
27
28// RecordType enumerates the values for record type.
29type RecordType string
30
31const (
32	// A ...
33	A RecordType = "A"
34	// AAAA ...
35	AAAA RecordType = "AAAA"
36	// CAA ...
37	CAA RecordType = "CAA"
38	// CNAME ...
39	CNAME RecordType = "CNAME"
40	// MX ...
41	MX RecordType = "MX"
42	// NS ...
43	NS RecordType = "NS"
44	// PTR ...
45	PTR RecordType = "PTR"
46	// SOA ...
47	SOA RecordType = "SOA"
48	// SRV ...
49	SRV RecordType = "SRV"
50	// TXT ...
51	TXT RecordType = "TXT"
52)
53
54// PossibleRecordTypeValues returns an array of possible values for the RecordType const type.
55func PossibleRecordTypeValues() []RecordType {
56	return []RecordType{A, AAAA, CAA, CNAME, MX, NS, PTR, SOA, SRV, TXT}
57}
58
59// AaaaRecord an AAAA record.
60type AaaaRecord struct {
61	// Ipv6Address - The IPv6 address of this AAAA record.
62	Ipv6Address *string `json:"ipv6Address,omitempty"`
63}
64
65// ARecord an A record.
66type ARecord struct {
67	// Ipv4Address - The IPv4 address of this A record.
68	Ipv4Address *string `json:"ipv4Address,omitempty"`
69}
70
71// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag.
72type AzureEntityResource struct {
73	// Etag - Resource Etag.
74	Etag *string `json:"etag,omitempty"`
75	// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
76	ID *string `json:"id,omitempty"`
77	// Name - The name of the resource
78	Name *string `json:"name,omitempty"`
79	// Type - The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
80	Type *string `json:"type,omitempty"`
81}
82
83// CaaRecord a CAA record.
84type CaaRecord struct {
85	// Flags - The flags for this CAA record as an integer between 0 and 255.
86	Flags *int32 `json:"flags,omitempty"`
87	// Tag - The tag for this CAA record.
88	Tag *string `json:"tag,omitempty"`
89	// Value - The value for this CAA record.
90	Value *string `json:"value,omitempty"`
91}
92
93// CloudError an error message
94type CloudError struct {
95	// Error - The error message body
96	Error *CloudErrorBody `json:"error,omitempty"`
97}
98
99// CloudErrorBody the body of an error message
100type CloudErrorBody struct {
101	// Code - The error code
102	Code *string `json:"code,omitempty"`
103	// Message - A description of what caused the error
104	Message *string `json:"message,omitempty"`
105	// Target - The target resource of the error message
106	Target *string `json:"target,omitempty"`
107	// Details - Extra error information
108	Details *[]CloudErrorBody `json:"details,omitempty"`
109}
110
111// CnameRecord a CNAME record.
112type CnameRecord struct {
113	// Cname - The canonical name for this CNAME record.
114	Cname *string `json:"cname,omitempty"`
115}
116
117// MxRecord an MX record.
118type MxRecord struct {
119	// Preference - The preference value for this MX record.
120	Preference *int32 `json:"preference,omitempty"`
121	// Exchange - The domain name of the mail host for this MX record.
122	Exchange *string `json:"exchange,omitempty"`
123}
124
125// NsRecord an NS record.
126type NsRecord struct {
127	// Nsdname - The name server name for this NS record.
128	Nsdname *string `json:"nsdname,omitempty"`
129}
130
131// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
132// required location and tags
133type ProxyResource struct {
134	// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
135	ID *string `json:"id,omitempty"`
136	// Name - The name of the resource
137	Name *string `json:"name,omitempty"`
138	// Type - The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
139	Type *string `json:"type,omitempty"`
140}
141
142// PtrRecord a PTR record.
143type PtrRecord struct {
144	// Ptrdname - The PTR target domain name for this PTR record.
145	Ptrdname *string `json:"ptrdname,omitempty"`
146}
147
148// RecordSet describes a DNS record set (a collection of DNS records with the same name and type).
149type RecordSet struct {
150	autorest.Response `json:"-"`
151	// ID - The ID of the record set.
152	ID *string `json:"id,omitempty"`
153	// Name - The name of the record set.
154	Name *string `json:"name,omitempty"`
155	// Type - The type of the record set.
156	Type *string `json:"type,omitempty"`
157	// Etag - The etag of the record set.
158	Etag *string `json:"etag,omitempty"`
159	// RecordSetProperties - The properties of the record set.
160	*RecordSetProperties `json:"properties,omitempty"`
161}
162
163// MarshalJSON is the custom marshaler for RecordSet.
164func (rs RecordSet) MarshalJSON() ([]byte, error) {
165	objectMap := make(map[string]interface{})
166	if rs.ID != nil {
167		objectMap["id"] = rs.ID
168	}
169	if rs.Name != nil {
170		objectMap["name"] = rs.Name
171	}
172	if rs.Type != nil {
173		objectMap["type"] = rs.Type
174	}
175	if rs.Etag != nil {
176		objectMap["etag"] = rs.Etag
177	}
178	if rs.RecordSetProperties != nil {
179		objectMap["properties"] = rs.RecordSetProperties
180	}
181	return json.Marshal(objectMap)
182}
183
184// UnmarshalJSON is the custom unmarshaler for RecordSet struct.
185func (rs *RecordSet) UnmarshalJSON(body []byte) error {
186	var m map[string]*json.RawMessage
187	err := json.Unmarshal(body, &m)
188	if err != nil {
189		return err
190	}
191	for k, v := range m {
192		switch k {
193		case "id":
194			if v != nil {
195				var ID string
196				err = json.Unmarshal(*v, &ID)
197				if err != nil {
198					return err
199				}
200				rs.ID = &ID
201			}
202		case "name":
203			if v != nil {
204				var name string
205				err = json.Unmarshal(*v, &name)
206				if err != nil {
207					return err
208				}
209				rs.Name = &name
210			}
211		case "type":
212			if v != nil {
213				var typeVar string
214				err = json.Unmarshal(*v, &typeVar)
215				if err != nil {
216					return err
217				}
218				rs.Type = &typeVar
219			}
220		case "etag":
221			if v != nil {
222				var etag string
223				err = json.Unmarshal(*v, &etag)
224				if err != nil {
225					return err
226				}
227				rs.Etag = &etag
228			}
229		case "properties":
230			if v != nil {
231				var recordSetProperties RecordSetProperties
232				err = json.Unmarshal(*v, &recordSetProperties)
233				if err != nil {
234					return err
235				}
236				rs.RecordSetProperties = &recordSetProperties
237			}
238		}
239	}
240
241	return nil
242}
243
244// RecordSetListResult the response to a record set List operation.
245type RecordSetListResult struct {
246	autorest.Response `json:"-"`
247	// Value - Information about the record sets in the response.
248	Value *[]RecordSet `json:"value,omitempty"`
249	// NextLink - The continuation token for the next page of results.
250	NextLink *string `json:"nextLink,omitempty"`
251}
252
253// RecordSetListResultIterator provides access to a complete listing of RecordSet values.
254type RecordSetListResultIterator struct {
255	i    int
256	page RecordSetListResultPage
257}
258
259// Next advances to the next value.  If there was an error making
260// the request the iterator does not advance and the error is returned.
261func (iter *RecordSetListResultIterator) Next() error {
262	iter.i++
263	if iter.i < len(iter.page.Values()) {
264		return nil
265	}
266	err := iter.page.Next()
267	if err != nil {
268		iter.i--
269		return err
270	}
271	iter.i = 0
272	return nil
273}
274
275// NotDone returns true if the enumeration should be started or is not yet complete.
276func (iter RecordSetListResultIterator) NotDone() bool {
277	return iter.page.NotDone() && iter.i < len(iter.page.Values())
278}
279
280// Response returns the raw server response from the last page request.
281func (iter RecordSetListResultIterator) Response() RecordSetListResult {
282	return iter.page.Response()
283}
284
285// Value returns the current value or a zero-initialized value if the
286// iterator has advanced beyond the end of the collection.
287func (iter RecordSetListResultIterator) Value() RecordSet {
288	if !iter.page.NotDone() {
289		return RecordSet{}
290	}
291	return iter.page.Values()[iter.i]
292}
293
294// IsEmpty returns true if the ListResult contains no values.
295func (rslr RecordSetListResult) IsEmpty() bool {
296	return rslr.Value == nil || len(*rslr.Value) == 0
297}
298
299// recordSetListResultPreparer prepares a request to retrieve the next set of results.
300// It returns nil if no more results exist.
301func (rslr RecordSetListResult) recordSetListResultPreparer() (*http.Request, error) {
302	if rslr.NextLink == nil || len(to.String(rslr.NextLink)) < 1 {
303		return nil, nil
304	}
305	return autorest.Prepare(&http.Request{},
306		autorest.AsJSON(),
307		autorest.AsGet(),
308		autorest.WithBaseURL(to.String(rslr.NextLink)))
309}
310
311// RecordSetListResultPage contains a page of RecordSet values.
312type RecordSetListResultPage struct {
313	fn   func(RecordSetListResult) (RecordSetListResult, error)
314	rslr RecordSetListResult
315}
316
317// Next advances to the next page of values.  If there was an error making
318// the request the page does not advance and the error is returned.
319func (page *RecordSetListResultPage) Next() error {
320	next, err := page.fn(page.rslr)
321	if err != nil {
322		return err
323	}
324	page.rslr = next
325	return nil
326}
327
328// NotDone returns true if the page enumeration should be started or is not yet complete.
329func (page RecordSetListResultPage) NotDone() bool {
330	return !page.rslr.IsEmpty()
331}
332
333// Response returns the raw server response from the last page request.
334func (page RecordSetListResultPage) Response() RecordSetListResult {
335	return page.rslr
336}
337
338// Values returns the slice of values for the current page or nil if there are no values.
339func (page RecordSetListResultPage) Values() []RecordSet {
340	if page.rslr.IsEmpty() {
341		return nil
342	}
343	return *page.rslr.Value
344}
345
346// RecordSetProperties represents the properties of the records in the record set.
347type RecordSetProperties struct {
348	// Metadata - The metadata attached to the record set.
349	Metadata map[string]*string `json:"metadata"`
350	// TTL - The TTL (time-to-live) of the records in the record set.
351	TTL *int64 `json:"TTL,omitempty"`
352	// Fqdn - Fully qualified domain name of the record set.
353	Fqdn *string `json:"fqdn,omitempty"`
354	// ARecords - The list of A records in the record set.
355	ARecords *[]ARecord `json:"ARecords,omitempty"`
356	// AaaaRecords - The list of AAAA records in the record set.
357	AaaaRecords *[]AaaaRecord `json:"AAAARecords,omitempty"`
358	// MxRecords - The list of MX records in the record set.
359	MxRecords *[]MxRecord `json:"MXRecords,omitempty"`
360	// NsRecords - The list of NS records in the record set.
361	NsRecords *[]NsRecord `json:"NSRecords,omitempty"`
362	// PtrRecords - The list of PTR records in the record set.
363	PtrRecords *[]PtrRecord `json:"PTRRecords,omitempty"`
364	// SrvRecords - The list of SRV records in the record set.
365	SrvRecords *[]SrvRecord `json:"SRVRecords,omitempty"`
366	// TxtRecords - The list of TXT records in the record set.
367	TxtRecords *[]TxtRecord `json:"TXTRecords,omitempty"`
368	// CnameRecord - The CNAME record in the  record set.
369	CnameRecord *CnameRecord `json:"CNAMERecord,omitempty"`
370	// SoaRecord - The SOA record in the record set.
371	SoaRecord *SoaRecord `json:"SOARecord,omitempty"`
372	// CaaRecords - The list of CAA records in the record set.
373	CaaRecords *[]CaaRecord `json:"caaRecords,omitempty"`
374}
375
376// MarshalJSON is the custom marshaler for RecordSetProperties.
377func (rsp RecordSetProperties) MarshalJSON() ([]byte, error) {
378	objectMap := make(map[string]interface{})
379	if rsp.Metadata != nil {
380		objectMap["metadata"] = rsp.Metadata
381	}
382	if rsp.TTL != nil {
383		objectMap["TTL"] = rsp.TTL
384	}
385	if rsp.Fqdn != nil {
386		objectMap["fqdn"] = rsp.Fqdn
387	}
388	if rsp.ARecords != nil {
389		objectMap["ARecords"] = rsp.ARecords
390	}
391	if rsp.AaaaRecords != nil {
392		objectMap["AAAARecords"] = rsp.AaaaRecords
393	}
394	if rsp.MxRecords != nil {
395		objectMap["MXRecords"] = rsp.MxRecords
396	}
397	if rsp.NsRecords != nil {
398		objectMap["NSRecords"] = rsp.NsRecords
399	}
400	if rsp.PtrRecords != nil {
401		objectMap["PTRRecords"] = rsp.PtrRecords
402	}
403	if rsp.SrvRecords != nil {
404		objectMap["SRVRecords"] = rsp.SrvRecords
405	}
406	if rsp.TxtRecords != nil {
407		objectMap["TXTRecords"] = rsp.TxtRecords
408	}
409	if rsp.CnameRecord != nil {
410		objectMap["CNAMERecord"] = rsp.CnameRecord
411	}
412	if rsp.SoaRecord != nil {
413		objectMap["SOARecord"] = rsp.SoaRecord
414	}
415	if rsp.CaaRecords != nil {
416		objectMap["caaRecords"] = rsp.CaaRecords
417	}
418	return json.Marshal(objectMap)
419}
420
421// RecordSetUpdateParameters parameters supplied to update a record set.
422type RecordSetUpdateParameters struct {
423	// RecordSet - Specifies information about the record set being updated.
424	RecordSet *RecordSet `json:"RecordSet,omitempty"`
425}
426
427// Resource ...
428type Resource struct {
429	// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
430	ID *string `json:"id,omitempty"`
431	// Name - The name of the resource
432	Name *string `json:"name,omitempty"`
433	// Type - The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
434	Type *string `json:"type,omitempty"`
435}
436
437// SoaRecord an SOA record.
438type SoaRecord struct {
439	// Host - The domain name of the authoritative name server for this SOA record.
440	Host *string `json:"host,omitempty"`
441	// Email - The email contact for this SOA record.
442	Email *string `json:"email,omitempty"`
443	// SerialNumber - The serial number for this SOA record.
444	SerialNumber *int64 `json:"serialNumber,omitempty"`
445	// RefreshTime - The refresh value for this SOA record.
446	RefreshTime *int64 `json:"refreshTime,omitempty"`
447	// RetryTime - The retry time for this SOA record.
448	RetryTime *int64 `json:"retryTime,omitempty"`
449	// ExpireTime - The expire time for this SOA record.
450	ExpireTime *int64 `json:"expireTime,omitempty"`
451	// MinimumTTL - The minimum value for this SOA record. By convention this is used to determine the negative caching duration.
452	MinimumTTL *int64 `json:"minimumTTL,omitempty"`
453}
454
455// SrvRecord an SRV record.
456type SrvRecord struct {
457	// Priority - The priority value for this SRV record.
458	Priority *int32 `json:"priority,omitempty"`
459	// Weight - The weight value for this SRV record.
460	Weight *int32 `json:"weight,omitempty"`
461	// Port - The port value for this SRV record.
462	Port *int32 `json:"port,omitempty"`
463	// Target - The target domain name for this SRV record.
464	Target *string `json:"target,omitempty"`
465}
466
467// SubResource a reference to a another resource
468type SubResource struct {
469	// ID - Resource Id.
470	ID *string `json:"id,omitempty"`
471}
472
473// TrackedResource the resource model definition for a ARM tracked top level resource
474type TrackedResource struct {
475	// Tags - Resource tags.
476	Tags map[string]*string `json:"tags"`
477	// Location - The geo-location where the resource lives
478	Location *string `json:"location,omitempty"`
479	// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
480	ID *string `json:"id,omitempty"`
481	// Name - The name of the resource
482	Name *string `json:"name,omitempty"`
483	// Type - The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
484	Type *string `json:"type,omitempty"`
485}
486
487// MarshalJSON is the custom marshaler for TrackedResource.
488func (tr TrackedResource) MarshalJSON() ([]byte, error) {
489	objectMap := make(map[string]interface{})
490	if tr.Tags != nil {
491		objectMap["tags"] = tr.Tags
492	}
493	if tr.Location != nil {
494		objectMap["location"] = tr.Location
495	}
496	if tr.ID != nil {
497		objectMap["id"] = tr.ID
498	}
499	if tr.Name != nil {
500		objectMap["name"] = tr.Name
501	}
502	if tr.Type != nil {
503		objectMap["type"] = tr.Type
504	}
505	return json.Marshal(objectMap)
506}
507
508// TxtRecord a TXT record.
509type TxtRecord struct {
510	// Value - The text value of this TXT record.
511	Value *[]string `json:"value,omitempty"`
512}
513
514// Zone describes a DNS zone.
515type Zone struct {
516	autorest.Response `json:"-"`
517	// Etag - The etag of the zone.
518	Etag *string `json:"etag,omitempty"`
519	// ZoneProperties - The properties of the zone.
520	*ZoneProperties `json:"properties,omitempty"`
521	// Tags - Resource tags.
522	Tags map[string]*string `json:"tags"`
523	// Location - The geo-location where the resource lives
524	Location *string `json:"location,omitempty"`
525	// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
526	ID *string `json:"id,omitempty"`
527	// Name - The name of the resource
528	Name *string `json:"name,omitempty"`
529	// Type - The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
530	Type *string `json:"type,omitempty"`
531}
532
533// MarshalJSON is the custom marshaler for Zone.
534func (z Zone) MarshalJSON() ([]byte, error) {
535	objectMap := make(map[string]interface{})
536	if z.Etag != nil {
537		objectMap["etag"] = z.Etag
538	}
539	if z.ZoneProperties != nil {
540		objectMap["properties"] = z.ZoneProperties
541	}
542	if z.Tags != nil {
543		objectMap["tags"] = z.Tags
544	}
545	if z.Location != nil {
546		objectMap["location"] = z.Location
547	}
548	if z.ID != nil {
549		objectMap["id"] = z.ID
550	}
551	if z.Name != nil {
552		objectMap["name"] = z.Name
553	}
554	if z.Type != nil {
555		objectMap["type"] = z.Type
556	}
557	return json.Marshal(objectMap)
558}
559
560// UnmarshalJSON is the custom unmarshaler for Zone struct.
561func (z *Zone) UnmarshalJSON(body []byte) error {
562	var m map[string]*json.RawMessage
563	err := json.Unmarshal(body, &m)
564	if err != nil {
565		return err
566	}
567	for k, v := range m {
568		switch k {
569		case "etag":
570			if v != nil {
571				var etag string
572				err = json.Unmarshal(*v, &etag)
573				if err != nil {
574					return err
575				}
576				z.Etag = &etag
577			}
578		case "properties":
579			if v != nil {
580				var zoneProperties ZoneProperties
581				err = json.Unmarshal(*v, &zoneProperties)
582				if err != nil {
583					return err
584				}
585				z.ZoneProperties = &zoneProperties
586			}
587		case "tags":
588			if v != nil {
589				var tags map[string]*string
590				err = json.Unmarshal(*v, &tags)
591				if err != nil {
592					return err
593				}
594				z.Tags = tags
595			}
596		case "location":
597			if v != nil {
598				var location string
599				err = json.Unmarshal(*v, &location)
600				if err != nil {
601					return err
602				}
603				z.Location = &location
604			}
605		case "id":
606			if v != nil {
607				var ID string
608				err = json.Unmarshal(*v, &ID)
609				if err != nil {
610					return err
611				}
612				z.ID = &ID
613			}
614		case "name":
615			if v != nil {
616				var name string
617				err = json.Unmarshal(*v, &name)
618				if err != nil {
619					return err
620				}
621				z.Name = &name
622			}
623		case "type":
624			if v != nil {
625				var typeVar string
626				err = json.Unmarshal(*v, &typeVar)
627				if err != nil {
628					return err
629				}
630				z.Type = &typeVar
631			}
632		}
633	}
634
635	return nil
636}
637
638// ZoneListResult the response to a Zone List or ListAll operation.
639type ZoneListResult struct {
640	autorest.Response `json:"-"`
641	// Value - Information about the DNS zones.
642	Value *[]Zone `json:"value,omitempty"`
643	// NextLink - The continuation token for the next page of results.
644	NextLink *string `json:"nextLink,omitempty"`
645}
646
647// ZoneListResultIterator provides access to a complete listing of Zone values.
648type ZoneListResultIterator struct {
649	i    int
650	page ZoneListResultPage
651}
652
653// Next advances to the next value.  If there was an error making
654// the request the iterator does not advance and the error is returned.
655func (iter *ZoneListResultIterator) Next() error {
656	iter.i++
657	if iter.i < len(iter.page.Values()) {
658		return nil
659	}
660	err := iter.page.Next()
661	if err != nil {
662		iter.i--
663		return err
664	}
665	iter.i = 0
666	return nil
667}
668
669// NotDone returns true if the enumeration should be started or is not yet complete.
670func (iter ZoneListResultIterator) NotDone() bool {
671	return iter.page.NotDone() && iter.i < len(iter.page.Values())
672}
673
674// Response returns the raw server response from the last page request.
675func (iter ZoneListResultIterator) Response() ZoneListResult {
676	return iter.page.Response()
677}
678
679// Value returns the current value or a zero-initialized value if the
680// iterator has advanced beyond the end of the collection.
681func (iter ZoneListResultIterator) Value() Zone {
682	if !iter.page.NotDone() {
683		return Zone{}
684	}
685	return iter.page.Values()[iter.i]
686}
687
688// IsEmpty returns true if the ListResult contains no values.
689func (zlr ZoneListResult) IsEmpty() bool {
690	return zlr.Value == nil || len(*zlr.Value) == 0
691}
692
693// zoneListResultPreparer prepares a request to retrieve the next set of results.
694// It returns nil if no more results exist.
695func (zlr ZoneListResult) zoneListResultPreparer() (*http.Request, error) {
696	if zlr.NextLink == nil || len(to.String(zlr.NextLink)) < 1 {
697		return nil, nil
698	}
699	return autorest.Prepare(&http.Request{},
700		autorest.AsJSON(),
701		autorest.AsGet(),
702		autorest.WithBaseURL(to.String(zlr.NextLink)))
703}
704
705// ZoneListResultPage contains a page of Zone values.
706type ZoneListResultPage struct {
707	fn  func(ZoneListResult) (ZoneListResult, error)
708	zlr ZoneListResult
709}
710
711// Next advances to the next page of values.  If there was an error making
712// the request the page does not advance and the error is returned.
713func (page *ZoneListResultPage) Next() error {
714	next, err := page.fn(page.zlr)
715	if err != nil {
716		return err
717	}
718	page.zlr = next
719	return nil
720}
721
722// NotDone returns true if the page enumeration should be started or is not yet complete.
723func (page ZoneListResultPage) NotDone() bool {
724	return !page.zlr.IsEmpty()
725}
726
727// Response returns the raw server response from the last page request.
728func (page ZoneListResultPage) Response() ZoneListResult {
729	return page.zlr
730}
731
732// Values returns the slice of values for the current page or nil if there are no values.
733func (page ZoneListResultPage) Values() []Zone {
734	if page.zlr.IsEmpty() {
735		return nil
736	}
737	return *page.zlr.Value
738}
739
740// ZoneProperties represents the properties of the zone.
741type ZoneProperties struct {
742	// MaxNumberOfRecordSets - The maximum number of record sets that can be created in this DNS zone.  This is a read-only property and any attempt to set this value will be ignored.
743	MaxNumberOfRecordSets *int64 `json:"maxNumberOfRecordSets,omitempty"`
744	// NumberOfRecordSets - The current number of record sets in this DNS zone.  This is a read-only property and any attempt to set this value will be ignored.
745	NumberOfRecordSets *int64 `json:"numberOfRecordSets,omitempty"`
746	// NameServers - The name servers for this DNS zone. This is a read-only property and any attempt to set this value will be ignored.
747	NameServers *[]string `json:"nameServers,omitempty"`
748}
749
750// ZonesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
751type ZonesDeleteFuture struct {
752	azure.Future
753}
754
755// Result returns the result of the asynchronous operation.
756// If the operation has not completed it will return an error.
757func (future *ZonesDeleteFuture) Result(client ZonesClient) (ar autorest.Response, err error) {
758	var done bool
759	done, err = future.Done(client)
760	if err != nil {
761		err = autorest.NewErrorWithError(err, "dns.ZonesDeleteFuture", "Result", future.Response(), "Polling failure")
762		return
763	}
764	if !done {
765		err = azure.NewAsyncOpIncompleteError("dns.ZonesDeleteFuture")
766		return
767	}
768	ar.Response = future.Response()
769	return
770}
771