forked from googleapis/google-api-go-client
/
dns-gen.go
1260 lines (1137 loc) · 38.4 KB
/
dns-gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Package dns provides access to the Google Cloud DNS API.
//
// See https://developers.google.com/cloud-dns
//
// Usage example:
//
// import "google.golang.org/api/dns/v1beta1"
// ...
// dnsService, err := dns.New(oauthHttpClient)
package dns
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/context"
"google.golang.org/api/googleapi"
"io"
"net/http"
"net/url"
"strconv"
"strings"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Background
const apiId = "dns:v1beta1"
const apiName = "dns"
const apiVersion = "v1beta1"
const basePath = "https://www.googleapis.com/dns/v1beta1/projects/"
// OAuth2 scopes used by this API.
const (
// View and manage your data across Google Cloud Platform services
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
// View your DNS records hosted by Google Cloud DNS
NdevClouddnsReadonlyScope = "https://www.googleapis.com/auth/ndev.clouddns.readonly"
// View and manage your DNS records hosted by Google Cloud DNS
NdevClouddnsReadwriteScope = "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
)
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Changes = NewChangesService(s)
s.ManagedZones = NewManagedZonesService(s)
s.Projects = NewProjectsService(s)
s.ResourceRecordSets = NewResourceRecordSetsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
Changes *ChangesService
ManagedZones *ManagedZonesService
Projects *ProjectsService
ResourceRecordSets *ResourceRecordSetsService
}
func NewChangesService(s *Service) *ChangesService {
rs := &ChangesService{s: s}
return rs
}
type ChangesService struct {
s *Service
}
func NewManagedZonesService(s *Service) *ManagedZonesService {
rs := &ManagedZonesService{s: s}
return rs
}
type ManagedZonesService struct {
s *Service
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
return rs
}
type ProjectsService struct {
s *Service
}
func NewResourceRecordSetsService(s *Service) *ResourceRecordSetsService {
rs := &ResourceRecordSetsService{s: s}
return rs
}
type ResourceRecordSetsService struct {
s *Service
}
type Change struct {
// Additions: Which ResourceRecordSets to add?
Additions []*ResourceRecordSet `json:"additions,omitempty"`
// Deletions: Which ResourceRecordSets to remove? Must match existing
// data exactly.
Deletions []*ResourceRecordSet `json:"deletions,omitempty"`
// Id: Unique identifier for the resource; defined by the server (output
// only).
Id string `json:"id,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "dns#change".
Kind string `json:"kind,omitempty"`
// StartTime: The time that this operation was started by the server.
// This is in RFC3339 text format.
StartTime string `json:"startTime,omitempty"`
// Status: Status of the operation. Can be one of the following:
// "PENDING" or "DONE" (output only).
Status string `json:"status,omitempty"`
}
type ChangesListResponse struct {
// Changes: The requested changes.
Changes []*Change `json:"changes,omitempty"`
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
// NextPageToken: The presence of this field indicates that there exist
// more results following your last page of results in pagination order.
// To fetch them, make another list request using this value as your
// pagination token.
//
// In this way you can retrieve the complete contents
// of even very large collections one page at a time. However, if the
// contents of the collection change between the first and last
// paginated list request, the set of all elements returned will be an
// inconsistent view of the collection. There is no way to retrieve a
// "snapshot" of collections larger than the maximum page size.
NextPageToken string `json:"nextPageToken,omitempty"`
}
type ManagedZone struct {
// CreationTime: The time that this resource was created on the server.
// This is in RFC3339 text format. Output only.
CreationTime string `json:"creationTime,omitempty"`
// Description: A string to associate with this resource for the user's
// convenience. Has no effect on the managed zone's function.
Description string `json:"description,omitempty"`
// DnsName: The DNS name of this managed zone, for instance
// "example.com.".
DnsName string `json:"dnsName,omitempty"`
// Id: Unique identifier for the resource; defined by the server (output
// only)
Id uint64 `json:"id,omitempty,string"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "dns#managedZone".
Kind string `json:"kind,omitempty"`
// Name: User assigned name for this resource. Must be unique within the
// project. The name must be 1-32 characters long, must begin with a
// letter, end with a letter or digit, and only contain lowercase
// letters, digits or dashes.
Name string `json:"name,omitempty"`
// NameServerSet: Optionally specifies the NameServerSet for this
// ManagedZone. A NameServerSet is a set of DNS name servers that all
// host the same ManagedZones. Most users will leave this field unset.
NameServerSet string `json:"nameServerSet,omitempty"`
// NameServers: Delegate your managed_zone to these virtual name
// servers; defined by the server (output only)
NameServers []string `json:"nameServers,omitempty"`
}
type ManagedZonesListResponse struct {
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
// ManagedZones: The managed zone resources.
ManagedZones []*ManagedZone `json:"managedZones,omitempty"`
// NextPageToken: The presence of this field indicates that there exist
// more results following your last page of results in pagination order.
// To fetch them, make another list request using this value as your
// page token.
//
// In this way you can retrieve the complete contents of
// even very large collections one page at a time. However, if the
// contents of the collection change between the first and last
// paginated list request, the set of all elements returned will be an
// inconsistent view of the collection. There is no way to retrieve a
// consistent snapshot of a collection larger than the maximum page
// size.
NextPageToken string `json:"nextPageToken,omitempty"`
}
type Project struct {
// Id: User assigned unique identifier for the resource (output only).
Id string `json:"id,omitempty"`
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "dns#project".
Kind string `json:"kind,omitempty"`
// Number: Unique numeric identifier for the resource; defined by the
// server (output only).
Number uint64 `json:"number,omitempty,string"`
// Quota: Quotas assigned to this project (output only).
Quota *Quota `json:"quota,omitempty"`
}
type Quota struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "dns#quota".
Kind string `json:"kind,omitempty"`
// ManagedZones: Maximum allowed number of managed zones in the project.
ManagedZones int64 `json:"managedZones,omitempty"`
// ResourceRecordsPerRrset: Maximum allowed number of ResourceRecords
// per ResourceRecordSet.
ResourceRecordsPerRrset int64 `json:"resourceRecordsPerRrset,omitempty"`
// RrsetAdditionsPerChange: Maximum allowed number of ResourceRecordSets
// to add per ChangesCreateRequest.
RrsetAdditionsPerChange int64 `json:"rrsetAdditionsPerChange,omitempty"`
// RrsetDeletionsPerChange: Maximum allowed number of ResourceRecordSets
// to delete per ChangesCreateRequest.
RrsetDeletionsPerChange int64 `json:"rrsetDeletionsPerChange,omitempty"`
// RrsetsPerManagedZone: Maximum allowed number of ResourceRecordSets
// per zone in the project.
RrsetsPerManagedZone int64 `json:"rrsetsPerManagedZone,omitempty"`
// TotalRrdataSizePerChange: Maximum allowed size for total rrdata in
// one ChangesCreateRequest in bytes.
TotalRrdataSizePerChange int64 `json:"totalRrdataSizePerChange,omitempty"`
}
type ResourceRecordSet struct {
// Kind: Identifies what kind of resource this is. Value: the fixed
// string "dns#resourceRecordSet".
Kind string `json:"kind,omitempty"`
// Name: For example, www.example.com.
Name string `json:"name,omitempty"`
// Rrdatas: As defined in RFC 1035 (section 5) and RFC 1034 (section
// 3.6.1)
Rrdatas []string `json:"rrdatas,omitempty"`
// Ttl: Number of seconds that this ResourceRecordSet can be cached by
// resolvers.
Ttl int64 `json:"ttl,omitempty"`
// Type: One of A, AAAA, SOA, MX, NS, TXT
Type string `json:"type,omitempty"`
}
type ResourceRecordSetsListResponse struct {
// Kind: Type of resource.
Kind string `json:"kind,omitempty"`
// NextPageToken: The presence of this field indicates that there exist
// more results following your last page of results in pagination order.
// To fetch them, make another list request using this value as your
// pagination token.
//
// In this way you can retrieve the complete contents
// of even very large collections one page at a time. However, if the
// contents of the collection change between the first and last
// paginated list request, the set of all elements returned will be an
// inconsistent view of the collection. There is no way to retrieve a
// consistent snapshot of a collection larger than the maximum page
// size.
NextPageToken string `json:"nextPageToken,omitempty"`
// Rrsets: The resource record set resources.
Rrsets []*ResourceRecordSet `json:"rrsets,omitempty"`
}
// method id "dns.changes.create":
type ChangesCreateCall struct {
s *Service
project string
managedZone string
change *Change
opt_ map[string]interface{}
}
// Create: Atomically update the ResourceRecordSet collection.
func (r *ChangesService) Create(project string, managedZone string, change *Change) *ChangesCreateCall {
c := &ChangesCreateCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.managedZone = managedZone
c.change = change
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ChangesCreateCall) Fields(s ...googleapi.Field) *ChangesCreateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ChangesCreateCall) Do() (*Change, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.change)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"managedZone": c.managedZone,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Change
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Atomically update the ResourceRecordSet collection.",
// "httpMethod": "POST",
// "id": "dns.changes.create",
// "parameterOrder": [
// "project",
// "managedZone"
// ],
// "parameters": {
// "managedZone": {
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Identifies the project addressed by this request.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/managedZones/{managedZone}/changes",
// "request": {
// "$ref": "Change"
// },
// "response": {
// "$ref": "Change"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
// ]
// }
}
// method id "dns.changes.get":
type ChangesGetCall struct {
s *Service
project string
managedZone string
changeId string
opt_ map[string]interface{}
}
// Get: Fetch the representation of an existing Change.
func (r *ChangesService) Get(project string, managedZone string, changeId string) *ChangesGetCall {
c := &ChangesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.managedZone = managedZone
c.changeId = changeId
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ChangesGetCall) Do() (*Change, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes/{changeId}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"managedZone": c.managedZone,
"changeId": c.changeId,
})
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *Change
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Fetch the representation of an existing Change.",
// "httpMethod": "GET",
// "id": "dns.changes.get",
// "parameterOrder": [
// "project",
// "managedZone",
// "changeId"
// ],
// "parameters": {
// "changeId": {
// "description": "The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "managedZone": {
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Identifies the project addressed by this request.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/managedZones/{managedZone}/changes/{changeId}",
// "response": {
// "$ref": "Change"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
// ]
// }
}
// method id "dns.changes.list":
type ChangesListCall struct {
s *Service
project string
managedZone string
opt_ map[string]interface{}
}
// List: Enumerate Changes to a ResourceRecordSet collection.
func (r *ChangesService) List(project string, managedZone string) *ChangesListCall {
c := &ChangesListCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.managedZone = managedZone
return c
}
// MaxResults sets the optional parameter "maxResults": Maximum number
// of results to be returned. If unspecified, the server will decide how
// many results to return.
func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall {
c.opt_["maxResults"] = maxResults
return c
}
// PageToken sets the optional parameter "pageToken": A tag returned by
// a previous list request that was truncated. Use this parameter to
// continue a previous list request.
func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall {
c.opt_["pageToken"] = pageToken
return c
}
// SortBy sets the optional parameter "sortBy": Sorting criterion. The
// only supported value is change sequence.
func (c *ChangesListCall) SortBy(sortBy string) *ChangesListCall {
c.opt_["sortBy"] = sortBy
return c
}
// SortOrder sets the optional parameter "sortOrder": Sorting order
// direction: 'ascending' or 'descending'.
func (c *ChangesListCall) SortOrder(sortOrder string) *ChangesListCall {
c.opt_["sortOrder"] = sortOrder
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ChangesListCall) Do() (*ChangesListResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["maxResults"]; ok {
params.Set("maxResults", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["sortBy"]; ok {
params.Set("sortBy", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["sortOrder"]; ok {
params.Set("sortOrder", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"managedZone": c.managedZone,
})
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ChangesListResponse
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Enumerate Changes to a ResourceRecordSet collection.",
// "httpMethod": "GET",
// "id": "dns.changes.list",
// "parameterOrder": [
// "project",
// "managedZone"
// ],
// "parameters": {
// "managedZone": {
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "maxResults": {
// "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
// "format": "int32",
// "location": "query",
// "type": "integer"
// },
// "pageToken": {
// "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
// "location": "query",
// "type": "string"
// },
// "project": {
// "description": "Identifies the project addressed by this request.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "sortBy": {
// "default": "changeSequence",
// "description": "Sorting criterion. The only supported value is change sequence.",
// "enum": [
// "changeSequence"
// ],
// "enumDescriptions": [
// ""
// ],
// "location": "query",
// "type": "string"
// },
// "sortOrder": {
// "description": "Sorting order direction: 'ascending' or 'descending'.",
// "location": "query",
// "type": "string"
// }
// },
// "path": "{project}/managedZones/{managedZone}/changes",
// "response": {
// "$ref": "ChangesListResponse"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
// ]
// }
}
// method id "dns.managedZones.create":
type ManagedZonesCreateCall struct {
s *Service
project string
managedzone *ManagedZone
opt_ map[string]interface{}
}
// Create: Create a new ManagedZone.
func (r *ManagedZonesService) Create(project string, managedzone *ManagedZone) *ManagedZonesCreateCall {
c := &ManagedZonesCreateCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.managedzone = managedzone
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ManagedZonesCreateCall) Fields(s ...googleapi.Field) *ManagedZonesCreateCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ManagedZonesCreateCall) Do() (*ManagedZone, error) {
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
if err != nil {
return nil, err
}
ctype := "application/json"
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
urls += "?" + params.Encode()
req, _ := http.NewRequest("POST", urls, body)
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
})
req.Header.Set("Content-Type", ctype)
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ManagedZone
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Create a new ManagedZone.",
// "httpMethod": "POST",
// "id": "dns.managedZones.create",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "project": {
// "description": "Identifies the project addressed by this request.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/managedZones",
// "request": {
// "$ref": "ManagedZone"
// },
// "response": {
// "$ref": "ManagedZone"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
// ]
// }
}
// method id "dns.managedZones.delete":
type ManagedZonesDeleteCall struct {
s *Service
project string
managedZone string
opt_ map[string]interface{}
}
// Delete: Delete a previously created ManagedZone.
func (r *ManagedZonesService) Delete(project string, managedZone string) *ManagedZonesDeleteCall {
c := &ManagedZonesDeleteCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.managedZone = managedZone
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ManagedZonesDeleteCall) Fields(s ...googleapi.Field) *ManagedZonesDeleteCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ManagedZonesDeleteCall) Do() error {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("DELETE", urls, body)
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"managedZone": c.managedZone,
})
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return err
}
return nil
// {
// "description": "Delete a previously created ManagedZone.",
// "httpMethod": "DELETE",
// "id": "dns.managedZones.delete",
// "parameterOrder": [
// "project",
// "managedZone"
// ],
// "parameters": {
// "managedZone": {
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Identifies the project addressed by this request.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/managedZones/{managedZone}",
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
// ]
// }
}
// method id "dns.managedZones.get":
type ManagedZonesGetCall struct {
s *Service
project string
managedZone string
opt_ map[string]interface{}
}
// Get: Fetch the representation of an existing ManagedZone.
func (r *ManagedZonesService) Get(project string, managedZone string) *ManagedZonesGetCall {
c := &ManagedZonesGetCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
c.managedZone = managedZone
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ManagedZonesGetCall) Fields(s ...googleapi.Field) *ManagedZonesGetCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ManagedZonesGetCall) Do() (*ManagedZone, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
"managedZone": c.managedZone,
})
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ManagedZone
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Fetch the representation of an existing ManagedZone.",
// "httpMethod": "GET",
// "id": "dns.managedZones.get",
// "parameterOrder": [
// "project",
// "managedZone"
// ],
// "parameters": {
// "managedZone": {
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
// "location": "path",
// "required": true,
// "type": "string"
// },
// "project": {
// "description": "Identifies the project addressed by this request.",
// "location": "path",
// "required": true,
// "type": "string"
// }
// },
// "path": "{project}/managedZones/{managedZone}",
// "response": {
// "$ref": "ManagedZone"
// },
// "scopes": [
// "https://www.googleapis.com/auth/cloud-platform",
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
// ]
// }
}
// method id "dns.managedZones.list":
type ManagedZonesListCall struct {
s *Service
project string
opt_ map[string]interface{}
}
// List: Enumerate ManagedZones that have been created but not yet
// deleted.
func (r *ManagedZonesService) List(project string) *ManagedZonesListCall {
c := &ManagedZonesListCall{s: r.s, opt_: make(map[string]interface{})}
c.project = project
return c
}
// MaxResults sets the optional parameter "maxResults": Maximum number
// of results to be returned. If unspecified, the server will decide how
// many results to return.
func (c *ManagedZonesListCall) MaxResults(maxResults int64) *ManagedZonesListCall {
c.opt_["maxResults"] = maxResults
return c
}
// PageToken sets the optional parameter "pageToken": A tag returned by
// a previous list request that was truncated. Use this parameter to
// continue a previous list request.
func (c *ManagedZonesListCall) PageToken(pageToken string) *ManagedZonesListCall {
c.opt_["pageToken"] = pageToken
return c
}
// Fields allows partial responses to be retrieved.
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
// for more information.
func (c *ManagedZonesListCall) Fields(s ...googleapi.Field) *ManagedZonesListCall {
c.opt_["fields"] = googleapi.CombineFields(s)
return c
}
func (c *ManagedZonesListCall) Do() (*ManagedZonesListResponse, error) {
var body io.Reader = nil
params := make(url.Values)
params.Set("alt", "json")
if v, ok := c.opt_["maxResults"]; ok {
params.Set("maxResults", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["pageToken"]; ok {
params.Set("pageToken", fmt.Sprintf("%v", v))
}
if v, ok := c.opt_["fields"]; ok {
params.Set("fields", fmt.Sprintf("%v", v))
}
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
urls += "?" + params.Encode()
req, _ := http.NewRequest("GET", urls, body)
googleapi.Expand(req.URL, map[string]string{
"project": c.project,
})
req.Header.Set("User-Agent", "google-api-go-client/0.5")
res, err := c.s.client.Do(req)
if err != nil {
return nil, err
}
defer googleapi.CloseBody(res)
if err := googleapi.CheckResponse(res); err != nil {
return nil, err
}
var ret *ManagedZonesListResponse
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
return nil, err
}
return ret, nil
// {
// "description": "Enumerate ManagedZones that have been created but not yet deleted.",
// "httpMethod": "GET",
// "id": "dns.managedZones.list",
// "parameterOrder": [
// "project"
// ],
// "parameters": {
// "maxResults": {