1
// Package dns provides access to the Google Cloud DNS API.
3
// See https://developers.google.com/cloud-dns
7
// import "google.golang.org/api/dns/v1beta1"
9
// dnsService, err := dns.New(oauthHttpClient)
17
"google.golang.org/api/googleapi"
25
// Always reference these packages, just in case the auto-generated code
27
var _ = bytes.NewBuffer
30
var _ = json.NewDecoder
33
var _ = googleapi.Version
35
var _ = strings.Replace
37
const apiId = "dns:v1beta1"
39
const apiVersion = "v1beta1"
40
const basePath = "https://www.googleapis.com/dns/v1beta1/projects/"
42
// OAuth2 scopes used by this API.
44
// View and manage your data across Google Cloud Platform services
45
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
47
// View your DNS records hosted by Google Cloud DNS
48
NdevClouddnsReadonlyScope = "https://www.googleapis.com/auth/ndev.clouddns.readonly"
50
// View and manage your DNS records hosted by Google Cloud DNS
51
NdevClouddnsReadwriteScope = "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
54
func New(client *http.Client) (*Service, error) {
56
return nil, errors.New("client is nil")
58
s := &Service{client: client, BasePath: basePath}
59
s.Changes = NewChangesService(s)
60
s.ManagedZones = NewManagedZonesService(s)
61
s.Projects = NewProjectsService(s)
62
s.ResourceRecordSets = NewResourceRecordSetsService(s)
68
BasePath string // API endpoint base URL
70
Changes *ChangesService
72
ManagedZones *ManagedZonesService
74
Projects *ProjectsService
76
ResourceRecordSets *ResourceRecordSetsService
79
func NewChangesService(s *Service) *ChangesService {
80
rs := &ChangesService{s: s}
84
type ChangesService struct {
88
func NewManagedZonesService(s *Service) *ManagedZonesService {
89
rs := &ManagedZonesService{s: s}
93
type ManagedZonesService struct {
97
func NewProjectsService(s *Service) *ProjectsService {
98
rs := &ProjectsService{s: s}
102
type ProjectsService struct {
106
func NewResourceRecordSetsService(s *Service) *ResourceRecordSetsService {
107
rs := &ResourceRecordSetsService{s: s}
111
type ResourceRecordSetsService struct {
116
// Additions: Which ResourceRecordSets to add?
117
Additions []*ResourceRecordSet `json:"additions,omitempty"`
119
// Deletions: Which ResourceRecordSets to remove? Must match existing
121
Deletions []*ResourceRecordSet `json:"deletions,omitempty"`
123
// Id: Unique identifier for the resource; defined by the server (output
125
Id string `json:"id,omitempty"`
127
// Kind: Identifies what kind of resource this is. Value: the fixed
128
// string "dns#change".
129
Kind string `json:"kind,omitempty"`
131
// StartTime: The time that this operation was started by the server.
132
// This is in RFC3339 text format.
133
StartTime string `json:"startTime,omitempty"`
135
// Status: Status of the operation. Can be one of the following:
136
// "PENDING" or "DONE" (output only).
137
Status string `json:"status,omitempty"`
140
type ChangesListResponse struct {
141
// Changes: The requested changes.
142
Changes []*Change `json:"changes,omitempty"`
144
// Kind: Type of resource.
145
Kind string `json:"kind,omitempty"`
147
// NextPageToken: The presence of this field indicates that there exist
148
// more results following your last page of results in pagination order.
149
// To fetch them, make another list request using this value as your
152
// In this way you can retrieve the complete contents
153
// of even very large collections one page at a time. However, if the
154
// contents of the collection change between the first and last
155
// paginated list request, the set of all elements returned will be an
156
// inconsistent view of the collection. There is no way to retrieve a
157
// "snapshot" of collections larger than the maximum page size.
158
NextPageToken string `json:"nextPageToken,omitempty"`
161
type ManagedZone struct {
162
// CreationTime: The time that this resource was created on the server.
163
// This is in RFC3339 text format. Output only.
164
CreationTime string `json:"creationTime,omitempty"`
166
// Description: A string to associate with this resource for the user's
167
// convenience. Has no effect on the managed zone's function.
168
Description string `json:"description,omitempty"`
170
// DnsName: The DNS name of this managed zone, for instance
172
DnsName string `json:"dnsName,omitempty"`
174
// Id: Unique identifier for the resource; defined by the server (output
176
Id uint64 `json:"id,omitempty,string"`
178
// Kind: Identifies what kind of resource this is. Value: the fixed
179
// string "dns#managedZone".
180
Kind string `json:"kind,omitempty"`
182
// Name: User assigned name for this resource. Must be unique within the
184
Name string `json:"name,omitempty"`
186
// NameServers: Delegate your managed_zone to these virtual name
187
// servers; defined by the server (output only)
188
NameServers []string `json:"nameServers,omitempty"`
191
type ManagedZonesListResponse struct {
192
// Kind: Type of resource.
193
Kind string `json:"kind,omitempty"`
195
// ManagedZones: The managed zone resources.
196
ManagedZones []*ManagedZone `json:"managedZones,omitempty"`
198
// NextPageToken: The presence of this field indicates that there exist
199
// more results following your last page of results in pagination order.
200
// To fetch them, make another list request using this value as your
203
// In this way you can retrieve the complete contents of
204
// even very large collections one page at a time. However, if the
205
// contents of the collection change between the first and last
206
// paginated list request, the set of all elements returned will be an
207
// inconsistent view of the collection. There is no way to retrieve a
208
// consistent snapshot of a collection larger than the maximum page
210
NextPageToken string `json:"nextPageToken,omitempty"`
213
type Project struct {
214
// Id: User assigned unique identifier for the resource (output only).
215
Id string `json:"id,omitempty"`
217
// Kind: Identifies what kind of resource this is. Value: the fixed
218
// string "dns#project".
219
Kind string `json:"kind,omitempty"`
221
// Number: Unique numeric identifier for the resource; defined by the
222
// server (output only).
223
Number uint64 `json:"number,omitempty,string"`
225
// Quota: Quotas assigned to this project (output only).
226
Quota *Quota `json:"quota,omitempty"`
230
// Kind: Identifies what kind of resource this is. Value: the fixed
231
// string "dns#quota".
232
Kind string `json:"kind,omitempty"`
234
// ManagedZones: Maximum allowed number of managed zones in the project.
235
ManagedZones int64 `json:"managedZones,omitempty"`
237
// ResourceRecordsPerRrset: Maximum allowed number of ResourceRecords
238
// per ResourceRecordSet.
239
ResourceRecordsPerRrset int64 `json:"resourceRecordsPerRrset,omitempty"`
241
// RrsetAdditionsPerChange: Maximum allowed number of ResourceRecordSets
242
// to add per ChangesCreateRequest.
243
RrsetAdditionsPerChange int64 `json:"rrsetAdditionsPerChange,omitempty"`
245
// RrsetDeletionsPerChange: Maximum allowed number of ResourceRecordSets
246
// to delete per ChangesCreateRequest.
247
RrsetDeletionsPerChange int64 `json:"rrsetDeletionsPerChange,omitempty"`
249
// RrsetsPerManagedZone: Maximum allowed number of ResourceRecordSets
250
// per zone in the project.
251
RrsetsPerManagedZone int64 `json:"rrsetsPerManagedZone,omitempty"`
253
// TotalRrdataSizePerChange: Maximum allowed size for total rrdata in
254
// one ChangesCreateRequest in bytes.
255
TotalRrdataSizePerChange int64 `json:"totalRrdataSizePerChange,omitempty"`
258
type ResourceRecordSet struct {
259
// Kind: Identifies what kind of resource this is. Value: the fixed
260
// string "dns#resourceRecordSet".
261
Kind string `json:"kind,omitempty"`
263
// Name: For example, www.example.com.
264
Name string `json:"name,omitempty"`
266
// Rrdatas: As defined in RFC 1035 (section 5) and RFC 1034 (section
268
Rrdatas []string `json:"rrdatas,omitempty"`
270
// Ttl: Number of seconds that this ResourceRecordSet can be cached by
272
Ttl int64 `json:"ttl,omitempty"`
274
// Type: One of A, AAAA, SOA, MX, NS, TXT
275
Type string `json:"type,omitempty"`
278
type ResourceRecordSetsListResponse struct {
279
// Kind: Type of resource.
280
Kind string `json:"kind,omitempty"`
282
// NextPageToken: The presence of this field indicates that there exist
283
// more results following your last page of results in pagination order.
284
// To fetch them, make another list request using this value as your
287
// In this way you can retrieve the complete contents
288
// of even very large collections one page at a time. However, if the
289
// contents of the collection change between the first and last
290
// paginated list request, the set of all elements returned will be an
291
// inconsistent view of the collection. There is no way to retrieve a
292
// consistent snapshot of a collection larger than the maximum page
294
NextPageToken string `json:"nextPageToken,omitempty"`
296
// Rrsets: The resource record set resources.
297
Rrsets []*ResourceRecordSet `json:"rrsets,omitempty"`
300
// method id "dns.changes.create":
302
type ChangesCreateCall struct {
307
opt_ map[string]interface{}
310
// Create: Atomically update the ResourceRecordSet collection.
311
func (r *ChangesService) Create(project string, managedZone string, change *Change) *ChangesCreateCall {
312
c := &ChangesCreateCall{s: r.s, opt_: make(map[string]interface{})}
314
c.managedZone = managedZone
319
// Fields allows partial responses to be retrieved.
320
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
321
// for more information.
322
func (c *ChangesCreateCall) Fields(s ...googleapi.Field) *ChangesCreateCall {
323
c.opt_["fields"] = googleapi.CombineFields(s)
327
func (c *ChangesCreateCall) Do() (*Change, error) {
328
var body io.Reader = nil
329
body, err := googleapi.WithoutDataWrapper.JSONReader(c.change)
333
ctype := "application/json"
334
params := make(url.Values)
335
params.Set("alt", "json")
336
if v, ok := c.opt_["fields"]; ok {
337
params.Set("fields", fmt.Sprintf("%v", v))
339
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
340
urls += "?" + params.Encode()
341
req, _ := http.NewRequest("POST", urls, body)
342
googleapi.Expand(req.URL, map[string]string{
343
"project": c.project,
344
"managedZone": c.managedZone,
346
req.Header.Set("Content-Type", ctype)
347
req.Header.Set("User-Agent", "google-api-go-client/0.5")
348
res, err := c.s.client.Do(req)
352
defer googleapi.CloseBody(res)
353
if err := googleapi.CheckResponse(res); err != nil {
357
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
362
// "description": "Atomically update the ResourceRecordSet collection.",
363
// "httpMethod": "POST",
364
// "id": "dns.changes.create",
365
// "parameterOrder": [
371
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
372
// "location": "path",
377
// "description": "Identifies the project addressed by this request.",
378
// "location": "path",
383
// "path": "{project}/managedZones/{managedZone}/changes",
391
// "https://www.googleapis.com/auth/cloud-platform",
392
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
398
// method id "dns.changes.get":
400
type ChangesGetCall struct {
405
opt_ map[string]interface{}
408
// Get: Fetch the representation of an existing Change.
409
func (r *ChangesService) Get(project string, managedZone string, changeId string) *ChangesGetCall {
410
c := &ChangesGetCall{s: r.s, opt_: make(map[string]interface{})}
412
c.managedZone = managedZone
413
c.changeId = changeId
417
// Fields allows partial responses to be retrieved.
418
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
419
// for more information.
420
func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall {
421
c.opt_["fields"] = googleapi.CombineFields(s)
425
func (c *ChangesGetCall) Do() (*Change, error) {
426
var body io.Reader = nil
427
params := make(url.Values)
428
params.Set("alt", "json")
429
if v, ok := c.opt_["fields"]; ok {
430
params.Set("fields", fmt.Sprintf("%v", v))
432
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes/{changeId}")
433
urls += "?" + params.Encode()
434
req, _ := http.NewRequest("GET", urls, body)
435
googleapi.Expand(req.URL, map[string]string{
436
"project": c.project,
437
"managedZone": c.managedZone,
438
"changeId": c.changeId,
440
req.Header.Set("User-Agent", "google-api-go-client/0.5")
441
res, err := c.s.client.Do(req)
445
defer googleapi.CloseBody(res)
446
if err := googleapi.CheckResponse(res); err != nil {
450
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
455
// "description": "Fetch the representation of an existing Change.",
456
// "httpMethod": "GET",
457
// "id": "dns.changes.get",
458
// "parameterOrder": [
465
// "description": "The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.",
466
// "location": "path",
471
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
472
// "location": "path",
477
// "description": "Identifies the project addressed by this request.",
478
// "location": "path",
483
// "path": "{project}/managedZones/{managedZone}/changes/{changeId}",
488
// "https://www.googleapis.com/auth/cloud-platform",
489
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
490
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
496
// method id "dns.changes.list":
498
type ChangesListCall struct {
502
opt_ map[string]interface{}
505
// List: Enumerate Changes to a ResourceRecordSet collection.
506
func (r *ChangesService) List(project string, managedZone string) *ChangesListCall {
507
c := &ChangesListCall{s: r.s, opt_: make(map[string]interface{})}
509
c.managedZone = managedZone
513
// MaxResults sets the optional parameter "maxResults": Maximum number
514
// of results to be returned. If unspecified, the server will decide how
515
// many results to return.
516
func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall {
517
c.opt_["maxResults"] = maxResults
521
// PageToken sets the optional parameter "pageToken": A tag returned by
522
// a previous list request that was truncated. Use this parameter to
523
// continue a previous list request.
524
func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall {
525
c.opt_["pageToken"] = pageToken
529
// SortBy sets the optional parameter "sortBy": Sorting criterion. The
530
// only supported value is change sequence.
531
func (c *ChangesListCall) SortBy(sortBy string) *ChangesListCall {
532
c.opt_["sortBy"] = sortBy
536
// SortOrder sets the optional parameter "sortOrder": Sorting order
537
// direction: 'ascending' or 'descending'.
538
func (c *ChangesListCall) SortOrder(sortOrder string) *ChangesListCall {
539
c.opt_["sortOrder"] = sortOrder
543
// Fields allows partial responses to be retrieved.
544
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
545
// for more information.
546
func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall {
547
c.opt_["fields"] = googleapi.CombineFields(s)
551
func (c *ChangesListCall) Do() (*ChangesListResponse, error) {
552
var body io.Reader = nil
553
params := make(url.Values)
554
params.Set("alt", "json")
555
if v, ok := c.opt_["maxResults"]; ok {
556
params.Set("maxResults", fmt.Sprintf("%v", v))
558
if v, ok := c.opt_["pageToken"]; ok {
559
params.Set("pageToken", fmt.Sprintf("%v", v))
561
if v, ok := c.opt_["sortBy"]; ok {
562
params.Set("sortBy", fmt.Sprintf("%v", v))
564
if v, ok := c.opt_["sortOrder"]; ok {
565
params.Set("sortOrder", fmt.Sprintf("%v", v))
567
if v, ok := c.opt_["fields"]; ok {
568
params.Set("fields", fmt.Sprintf("%v", v))
570
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
571
urls += "?" + params.Encode()
572
req, _ := http.NewRequest("GET", urls, body)
573
googleapi.Expand(req.URL, map[string]string{
574
"project": c.project,
575
"managedZone": c.managedZone,
577
req.Header.Set("User-Agent", "google-api-go-client/0.5")
578
res, err := c.s.client.Do(req)
582
defer googleapi.CloseBody(res)
583
if err := googleapi.CheckResponse(res); err != nil {
586
var ret *ChangesListResponse
587
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
592
// "description": "Enumerate Changes to a ResourceRecordSet collection.",
593
// "httpMethod": "GET",
594
// "id": "dns.changes.list",
595
// "parameterOrder": [
601
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
602
// "location": "path",
607
// "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
608
// "format": "int32",
609
// "location": "query",
613
// "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
614
// "location": "query",
618
// "description": "Identifies the project addressed by this request.",
619
// "location": "path",
624
// "default": "changeSequence",
625
// "description": "Sorting criterion. The only supported value is change sequence.",
629
// "enumDescriptions": [
632
// "location": "query",
636
// "description": "Sorting order direction: 'ascending' or 'descending'.",
637
// "location": "query",
641
// "path": "{project}/managedZones/{managedZone}/changes",
643
// "$ref": "ChangesListResponse"
646
// "https://www.googleapis.com/auth/cloud-platform",
647
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
648
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
654
// method id "dns.managedZones.create":
656
type ManagedZonesCreateCall struct {
659
managedzone *ManagedZone
660
opt_ map[string]interface{}
663
// Create: Create a new ManagedZone.
664
func (r *ManagedZonesService) Create(project string, managedzone *ManagedZone) *ManagedZonesCreateCall {
665
c := &ManagedZonesCreateCall{s: r.s, opt_: make(map[string]interface{})}
667
c.managedzone = managedzone
671
// Fields allows partial responses to be retrieved.
672
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
673
// for more information.
674
func (c *ManagedZonesCreateCall) Fields(s ...googleapi.Field) *ManagedZonesCreateCall {
675
c.opt_["fields"] = googleapi.CombineFields(s)
679
func (c *ManagedZonesCreateCall) Do() (*ManagedZone, error) {
680
var body io.Reader = nil
681
body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
685
ctype := "application/json"
686
params := make(url.Values)
687
params.Set("alt", "json")
688
if v, ok := c.opt_["fields"]; ok {
689
params.Set("fields", fmt.Sprintf("%v", v))
691
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
692
urls += "?" + params.Encode()
693
req, _ := http.NewRequest("POST", urls, body)
694
googleapi.Expand(req.URL, map[string]string{
695
"project": c.project,
697
req.Header.Set("Content-Type", ctype)
698
req.Header.Set("User-Agent", "google-api-go-client/0.5")
699
res, err := c.s.client.Do(req)
703
defer googleapi.CloseBody(res)
704
if err := googleapi.CheckResponse(res); err != nil {
708
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
713
// "description": "Create a new ManagedZone.",
714
// "httpMethod": "POST",
715
// "id": "dns.managedZones.create",
716
// "parameterOrder": [
721
// "description": "Identifies the project addressed by this request.",
722
// "location": "path",
727
// "path": "{project}/managedZones",
729
// "$ref": "ManagedZone"
732
// "$ref": "ManagedZone"
735
// "https://www.googleapis.com/auth/cloud-platform",
736
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
742
// method id "dns.managedZones.delete":
744
type ManagedZonesDeleteCall struct {
748
opt_ map[string]interface{}
751
// Delete: Delete a previously created ManagedZone.
752
func (r *ManagedZonesService) Delete(project string, managedZone string) *ManagedZonesDeleteCall {
753
c := &ManagedZonesDeleteCall{s: r.s, opt_: make(map[string]interface{})}
755
c.managedZone = managedZone
759
// Fields allows partial responses to be retrieved.
760
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
761
// for more information.
762
func (c *ManagedZonesDeleteCall) Fields(s ...googleapi.Field) *ManagedZonesDeleteCall {
763
c.opt_["fields"] = googleapi.CombineFields(s)
767
func (c *ManagedZonesDeleteCall) Do() error {
768
var body io.Reader = nil
769
params := make(url.Values)
770
params.Set("alt", "json")
771
if v, ok := c.opt_["fields"]; ok {
772
params.Set("fields", fmt.Sprintf("%v", v))
774
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
775
urls += "?" + params.Encode()
776
req, _ := http.NewRequest("DELETE", urls, body)
777
googleapi.Expand(req.URL, map[string]string{
778
"project": c.project,
779
"managedZone": c.managedZone,
781
req.Header.Set("User-Agent", "google-api-go-client/0.5")
782
res, err := c.s.client.Do(req)
786
defer googleapi.CloseBody(res)
787
if err := googleapi.CheckResponse(res); err != nil {
792
// "description": "Delete a previously created ManagedZone.",
793
// "httpMethod": "DELETE",
794
// "id": "dns.managedZones.delete",
795
// "parameterOrder": [
801
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
802
// "location": "path",
807
// "description": "Identifies the project addressed by this request.",
808
// "location": "path",
813
// "path": "{project}/managedZones/{managedZone}",
815
// "https://www.googleapis.com/auth/cloud-platform",
816
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
822
// method id "dns.managedZones.get":
824
type ManagedZonesGetCall struct {
828
opt_ map[string]interface{}
831
// Get: Fetch the representation of an existing ManagedZone.
832
func (r *ManagedZonesService) Get(project string, managedZone string) *ManagedZonesGetCall {
833
c := &ManagedZonesGetCall{s: r.s, opt_: make(map[string]interface{})}
835
c.managedZone = managedZone
839
// Fields allows partial responses to be retrieved.
840
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
841
// for more information.
842
func (c *ManagedZonesGetCall) Fields(s ...googleapi.Field) *ManagedZonesGetCall {
843
c.opt_["fields"] = googleapi.CombineFields(s)
847
func (c *ManagedZonesGetCall) Do() (*ManagedZone, error) {
848
var body io.Reader = nil
849
params := make(url.Values)
850
params.Set("alt", "json")
851
if v, ok := c.opt_["fields"]; ok {
852
params.Set("fields", fmt.Sprintf("%v", v))
854
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
855
urls += "?" + params.Encode()
856
req, _ := http.NewRequest("GET", urls, body)
857
googleapi.Expand(req.URL, map[string]string{
858
"project": c.project,
859
"managedZone": c.managedZone,
861
req.Header.Set("User-Agent", "google-api-go-client/0.5")
862
res, err := c.s.client.Do(req)
866
defer googleapi.CloseBody(res)
867
if err := googleapi.CheckResponse(res); err != nil {
871
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
876
// "description": "Fetch the representation of an existing ManagedZone.",
877
// "httpMethod": "GET",
878
// "id": "dns.managedZones.get",
879
// "parameterOrder": [
885
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
886
// "location": "path",
891
// "description": "Identifies the project addressed by this request.",
892
// "location": "path",
897
// "path": "{project}/managedZones/{managedZone}",
899
// "$ref": "ManagedZone"
902
// "https://www.googleapis.com/auth/cloud-platform",
903
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
904
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
910
// method id "dns.managedZones.list":
912
type ManagedZonesListCall struct {
915
opt_ map[string]interface{}
918
// List: Enumerate ManagedZones that have been created but not yet
920
func (r *ManagedZonesService) List(project string) *ManagedZonesListCall {
921
c := &ManagedZonesListCall{s: r.s, opt_: make(map[string]interface{})}
926
// MaxResults sets the optional parameter "maxResults": Maximum number
927
// of results to be returned. If unspecified, the server will decide how
928
// many results to return.
929
func (c *ManagedZonesListCall) MaxResults(maxResults int64) *ManagedZonesListCall {
930
c.opt_["maxResults"] = maxResults
934
// PageToken sets the optional parameter "pageToken": A tag returned by
935
// a previous list request that was truncated. Use this parameter to
936
// continue a previous list request.
937
func (c *ManagedZonesListCall) PageToken(pageToken string) *ManagedZonesListCall {
938
c.opt_["pageToken"] = pageToken
942
// Fields allows partial responses to be retrieved.
943
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
944
// for more information.
945
func (c *ManagedZonesListCall) Fields(s ...googleapi.Field) *ManagedZonesListCall {
946
c.opt_["fields"] = googleapi.CombineFields(s)
950
func (c *ManagedZonesListCall) Do() (*ManagedZonesListResponse, error) {
951
var body io.Reader = nil
952
params := make(url.Values)
953
params.Set("alt", "json")
954
if v, ok := c.opt_["maxResults"]; ok {
955
params.Set("maxResults", fmt.Sprintf("%v", v))
957
if v, ok := c.opt_["pageToken"]; ok {
958
params.Set("pageToken", fmt.Sprintf("%v", v))
960
if v, ok := c.opt_["fields"]; ok {
961
params.Set("fields", fmt.Sprintf("%v", v))
963
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
964
urls += "?" + params.Encode()
965
req, _ := http.NewRequest("GET", urls, body)
966
googleapi.Expand(req.URL, map[string]string{
967
"project": c.project,
969
req.Header.Set("User-Agent", "google-api-go-client/0.5")
970
res, err := c.s.client.Do(req)
974
defer googleapi.CloseBody(res)
975
if err := googleapi.CheckResponse(res); err != nil {
978
var ret *ManagedZonesListResponse
979
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
984
// "description": "Enumerate ManagedZones that have been created but not yet deleted.",
985
// "httpMethod": "GET",
986
// "id": "dns.managedZones.list",
987
// "parameterOrder": [
992
// "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
993
// "format": "int32",
994
// "location": "query",
998
// "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
999
// "location": "query",
1003
// "description": "Identifies the project addressed by this request.",
1004
// "location": "path",
1005
// "required": true,
1009
// "path": "{project}/managedZones",
1011
// "$ref": "ManagedZonesListResponse"
1014
// "https://www.googleapis.com/auth/cloud-platform",
1015
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
1016
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
1022
// method id "dns.projects.get":
1024
type ProjectsGetCall struct {
1027
opt_ map[string]interface{}
1030
// Get: Fetch the representation of an existing Project.
1031
func (r *ProjectsService) Get(project string) *ProjectsGetCall {
1032
c := &ProjectsGetCall{s: r.s, opt_: make(map[string]interface{})}
1037
// Fields allows partial responses to be retrieved.
1038
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1039
// for more information.
1040
func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
1041
c.opt_["fields"] = googleapi.CombineFields(s)
1045
func (c *ProjectsGetCall) Do() (*Project, error) {
1046
var body io.Reader = nil
1047
params := make(url.Values)
1048
params.Set("alt", "json")
1049
if v, ok := c.opt_["fields"]; ok {
1050
params.Set("fields", fmt.Sprintf("%v", v))
1052
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
1053
urls += "?" + params.Encode()
1054
req, _ := http.NewRequest("GET", urls, body)
1055
googleapi.Expand(req.URL, map[string]string{
1056
"project": c.project,
1058
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1059
res, err := c.s.client.Do(req)
1063
defer googleapi.CloseBody(res)
1064
if err := googleapi.CheckResponse(res); err != nil {
1068
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1073
// "description": "Fetch the representation of an existing Project.",
1074
// "httpMethod": "GET",
1075
// "id": "dns.projects.get",
1076
// "parameterOrder": [
1081
// "description": "Identifies the project addressed by this request.",
1082
// "location": "path",
1083
// "required": true,
1087
// "path": "{project}",
1089
// "$ref": "Project"
1092
// "https://www.googleapis.com/auth/cloud-platform",
1093
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
1094
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
1100
// method id "dns.resourceRecordSets.list":
1102
type ResourceRecordSetsListCall struct {
1106
opt_ map[string]interface{}
1109
// List: Enumerate ResourceRecordSets that have been created but not yet
1111
func (r *ResourceRecordSetsService) List(project string, managedZone string) *ResourceRecordSetsListCall {
1112
c := &ResourceRecordSetsListCall{s: r.s, opt_: make(map[string]interface{})}
1114
c.managedZone = managedZone
1118
// MaxResults sets the optional parameter "maxResults": Maximum number
1119
// of results to be returned. If unspecified, the server will decide how
1120
// many results to return.
1121
func (c *ResourceRecordSetsListCall) MaxResults(maxResults int64) *ResourceRecordSetsListCall {
1122
c.opt_["maxResults"] = maxResults
1126
// Name sets the optional parameter "name": Restricts the list to return
1127
// only records with this fully qualified domain name.
1128
func (c *ResourceRecordSetsListCall) Name(name string) *ResourceRecordSetsListCall {
1129
c.opt_["name"] = name
1133
// PageToken sets the optional parameter "pageToken": A tag returned by
1134
// a previous list request that was truncated. Use this parameter to
1135
// continue a previous list request.
1136
func (c *ResourceRecordSetsListCall) PageToken(pageToken string) *ResourceRecordSetsListCall {
1137
c.opt_["pageToken"] = pageToken
1141
// Type sets the optional parameter "type": Restricts the list to return
1142
// only records of this type. If present, the "name" parameter must also
1144
func (c *ResourceRecordSetsListCall) Type(type_ string) *ResourceRecordSetsListCall {
1145
c.opt_["type"] = type_
1149
// Fields allows partial responses to be retrieved.
1150
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1151
// for more information.
1152
func (c *ResourceRecordSetsListCall) Fields(s ...googleapi.Field) *ResourceRecordSetsListCall {
1153
c.opt_["fields"] = googleapi.CombineFields(s)
1157
func (c *ResourceRecordSetsListCall) Do() (*ResourceRecordSetsListResponse, error) {
1158
var body io.Reader = nil
1159
params := make(url.Values)
1160
params.Set("alt", "json")
1161
if v, ok := c.opt_["maxResults"]; ok {
1162
params.Set("maxResults", fmt.Sprintf("%v", v))
1164
if v, ok := c.opt_["name"]; ok {
1165
params.Set("name", fmt.Sprintf("%v", v))
1167
if v, ok := c.opt_["pageToken"]; ok {
1168
params.Set("pageToken", fmt.Sprintf("%v", v))
1170
if v, ok := c.opt_["type"]; ok {
1171
params.Set("type", fmt.Sprintf("%v", v))
1173
if v, ok := c.opt_["fields"]; ok {
1174
params.Set("fields", fmt.Sprintf("%v", v))
1176
urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/rrsets")
1177
urls += "?" + params.Encode()
1178
req, _ := http.NewRequest("GET", urls, body)
1179
googleapi.Expand(req.URL, map[string]string{
1180
"project": c.project,
1181
"managedZone": c.managedZone,
1183
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1184
res, err := c.s.client.Do(req)
1188
defer googleapi.CloseBody(res)
1189
if err := googleapi.CheckResponse(res); err != nil {
1192
var ret *ResourceRecordSetsListResponse
1193
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1198
// "description": "Enumerate ResourceRecordSets that have been created but not yet deleted.",
1199
// "httpMethod": "GET",
1200
// "id": "dns.resourceRecordSets.list",
1201
// "parameterOrder": [
1207
// "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
1208
// "location": "path",
1209
// "required": true,
1213
// "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
1214
// "format": "int32",
1215
// "location": "query",
1216
// "type": "integer"
1219
// "description": "Restricts the list to return only records with this fully qualified domain name.",
1220
// "location": "query",
1224
// "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
1225
// "location": "query",
1229
// "description": "Identifies the project addressed by this request.",
1230
// "location": "path",
1231
// "required": true,
1235
// "description": "Restricts the list to return only records of this type. If present, the \"name\" parameter must also be present.",
1236
// "location": "query",
1240
// "path": "{project}/managedZones/{managedZone}/rrsets",
1242
// "$ref": "ResourceRecordSetsListResponse"
1245
// "https://www.googleapis.com/auth/cloud-platform",
1246
// "https://www.googleapis.com/auth/ndev.clouddns.readonly",
1247
// "https://www.googleapis.com/auth/ndev.clouddns.readwrite"