dns-gen.go 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846
  1. // Package dns provides access to the Google Cloud DNS API.
  2. //
  3. // See https://developers.google.com/cloud-dns
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/dns/v1beta1"
  8. // ...
  9. // dnsService, err := dns.New(oauthHttpClient)
  10. package dns // import "google.golang.org/api/dns/v1beta1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "dns:v1beta1"
  41. const apiName = "dns"
  42. const apiVersion = "v1beta1"
  43. const basePath = "https://www.googleapis.com/dns/v1beta1/projects/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View your data across Google Cloud Platform services
  49. CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
  50. // View your DNS records hosted by Google Cloud DNS
  51. NdevClouddnsReadonlyScope = "https://www.googleapis.com/auth/ndev.clouddns.readonly"
  52. // View and manage your DNS records hosted by Google Cloud DNS
  53. NdevClouddnsReadwriteScope = "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  54. )
  55. func New(client *http.Client) (*Service, error) {
  56. if client == nil {
  57. return nil, errors.New("client is nil")
  58. }
  59. s := &Service{client: client, BasePath: basePath}
  60. s.Changes = NewChangesService(s)
  61. s.ManagedZones = NewManagedZonesService(s)
  62. s.Projects = NewProjectsService(s)
  63. s.ResourceRecordSets = NewResourceRecordSetsService(s)
  64. return s, nil
  65. }
  66. type Service struct {
  67. client *http.Client
  68. BasePath string // API endpoint base URL
  69. UserAgent string // optional additional User-Agent fragment
  70. Changes *ChangesService
  71. ManagedZones *ManagedZonesService
  72. Projects *ProjectsService
  73. ResourceRecordSets *ResourceRecordSetsService
  74. }
  75. func (s *Service) userAgent() string {
  76. if s.UserAgent == "" {
  77. return googleapi.UserAgent
  78. }
  79. return googleapi.UserAgent + " " + s.UserAgent
  80. }
  81. func NewChangesService(s *Service) *ChangesService {
  82. rs := &ChangesService{s: s}
  83. return rs
  84. }
  85. type ChangesService struct {
  86. s *Service
  87. }
  88. func NewManagedZonesService(s *Service) *ManagedZonesService {
  89. rs := &ManagedZonesService{s: s}
  90. return rs
  91. }
  92. type ManagedZonesService struct {
  93. s *Service
  94. }
  95. func NewProjectsService(s *Service) *ProjectsService {
  96. rs := &ProjectsService{s: s}
  97. return rs
  98. }
  99. type ProjectsService struct {
  100. s *Service
  101. }
  102. func NewResourceRecordSetsService(s *Service) *ResourceRecordSetsService {
  103. rs := &ResourceRecordSetsService{s: s}
  104. return rs
  105. }
  106. type ResourceRecordSetsService struct {
  107. s *Service
  108. }
  109. // Change: An atomic update to a collection of ResourceRecordSets.
  110. type Change struct {
  111. // Additions: Which ResourceRecordSets to add?
  112. Additions []*ResourceRecordSet `json:"additions,omitempty"`
  113. // Deletions: Which ResourceRecordSets to remove? Must match existing
  114. // data exactly.
  115. Deletions []*ResourceRecordSet `json:"deletions,omitempty"`
  116. // Id: Unique identifier for the resource; defined by the server (output
  117. // only).
  118. Id string `json:"id,omitempty"`
  119. // Kind: Identifies what kind of resource this is. Value: the fixed
  120. // string "dns#change".
  121. Kind string `json:"kind,omitempty"`
  122. // StartTime: The time that this operation was started by the server.
  123. // This is in RFC3339 text format.
  124. StartTime string `json:"startTime,omitempty"`
  125. // Status: Status of the operation (output only).
  126. Status string `json:"status,omitempty"`
  127. // ServerResponse contains the HTTP response code and headers from the
  128. // server.
  129. googleapi.ServerResponse `json:"-"`
  130. // ForceSendFields is a list of field names (e.g. "Additions") to
  131. // unconditionally include in API requests. By default, fields with
  132. // empty values are omitted from API requests. However, any non-pointer,
  133. // non-interface field appearing in ForceSendFields will be sent to the
  134. // server regardless of whether the field is empty or not. This may be
  135. // used to include empty fields in Patch requests.
  136. ForceSendFields []string `json:"-"`
  137. }
  138. func (s *Change) MarshalJSON() ([]byte, error) {
  139. type noMethod Change
  140. raw := noMethod(*s)
  141. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  142. }
  143. // ChangesListResponse: The response to a request to enumerate Changes
  144. // to a ResourceRecordSets collection.
  145. type ChangesListResponse struct {
  146. // Changes: The requested changes.
  147. Changes []*Change `json:"changes,omitempty"`
  148. // Kind: Type of resource.
  149. Kind string `json:"kind,omitempty"`
  150. // NextPageToken: The presence of this field indicates that there exist
  151. // more results following your last page of results in pagination order.
  152. // To fetch them, make another list request using this value as your
  153. // pagination token.
  154. //
  155. // In this way you can retrieve the complete contents of even very large
  156. // collections one page at a time. However, if the contents of the
  157. // collection change between the first and last paginated list request,
  158. // the set of all elements returned will be an inconsistent view of the
  159. // collection. There is no way to retrieve a "snapshot" of collections
  160. // larger than the maximum page size.
  161. NextPageToken string `json:"nextPageToken,omitempty"`
  162. // ServerResponse contains the HTTP response code and headers from the
  163. // server.
  164. googleapi.ServerResponse `json:"-"`
  165. // ForceSendFields is a list of field names (e.g. "Changes") to
  166. // unconditionally include in API requests. By default, fields with
  167. // empty values are omitted from API requests. However, any non-pointer,
  168. // non-interface field appearing in ForceSendFields will be sent to the
  169. // server regardless of whether the field is empty or not. This may be
  170. // used to include empty fields in Patch requests.
  171. ForceSendFields []string `json:"-"`
  172. }
  173. func (s *ChangesListResponse) MarshalJSON() ([]byte, error) {
  174. type noMethod ChangesListResponse
  175. raw := noMethod(*s)
  176. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  177. }
  178. // ManagedZone: A zone is a subtree of the DNS namespace under one
  179. // administrative responsibility. A ManagedZone is a resource that
  180. // represents a DNS zone hosted by the Cloud DNS service.
  181. type ManagedZone struct {
  182. // CreationTime: The time that this resource was created on the server.
  183. // This is in RFC3339 text format. Output only.
  184. CreationTime string `json:"creationTime,omitempty"`
  185. // Description: A mutable string of at most 1024 characters associated
  186. // with this resource for the user's convenience. Has no effect on the
  187. // managed zone's function.
  188. Description string `json:"description,omitempty"`
  189. // DnsName: The DNS name of this managed zone, for instance
  190. // "example.com.".
  191. DnsName string `json:"dnsName,omitempty"`
  192. // Id: Unique identifier for the resource; defined by the server (output
  193. // only)
  194. Id uint64 `json:"id,omitempty,string"`
  195. // Kind: Identifies what kind of resource this is. Value: the fixed
  196. // string "dns#managedZone".
  197. Kind string `json:"kind,omitempty"`
  198. // Name: User assigned name for this resource. Must be unique within the
  199. // project. The name must be 1-32 characters long, must begin with a
  200. // letter, end with a letter or digit, and only contain lowercase
  201. // letters, digits or dashes.
  202. Name string `json:"name,omitempty"`
  203. // NameServerSet: Optionally specifies the NameServerSet for this
  204. // ManagedZone. A NameServerSet is a set of DNS name servers that all
  205. // host the same ManagedZones. Most users will leave this field unset.
  206. NameServerSet string `json:"nameServerSet,omitempty"`
  207. // NameServers: Delegate your managed_zone to these virtual name
  208. // servers; defined by the server (output only)
  209. NameServers []string `json:"nameServers,omitempty"`
  210. // ServerResponse contains the HTTP response code and headers from the
  211. // server.
  212. googleapi.ServerResponse `json:"-"`
  213. // ForceSendFields is a list of field names (e.g. "CreationTime") to
  214. // unconditionally include in API requests. By default, fields with
  215. // empty values are omitted from API requests. However, any non-pointer,
  216. // non-interface field appearing in ForceSendFields will be sent to the
  217. // server regardless of whether the field is empty or not. This may be
  218. // used to include empty fields in Patch requests.
  219. ForceSendFields []string `json:"-"`
  220. }
  221. func (s *ManagedZone) MarshalJSON() ([]byte, error) {
  222. type noMethod ManagedZone
  223. raw := noMethod(*s)
  224. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  225. }
  226. type ManagedZonesListResponse struct {
  227. // Kind: Type of resource.
  228. Kind string `json:"kind,omitempty"`
  229. // ManagedZones: The managed zone resources.
  230. ManagedZones []*ManagedZone `json:"managedZones,omitempty"`
  231. // NextPageToken: The presence of this field indicates that there exist
  232. // more results following your last page of results in pagination order.
  233. // To fetch them, make another list request using this value as your
  234. // page token.
  235. //
  236. // In this way you can retrieve the complete contents of even very large
  237. // collections one page at a time. However, if the contents of the
  238. // collection change between the first and last paginated list request,
  239. // the set of all elements returned will be an inconsistent view of the
  240. // collection. There is no way to retrieve a consistent snapshot of a
  241. // collection larger than the maximum page size.
  242. NextPageToken string `json:"nextPageToken,omitempty"`
  243. // ServerResponse contains the HTTP response code and headers from the
  244. // server.
  245. googleapi.ServerResponse `json:"-"`
  246. // ForceSendFields is a list of field names (e.g. "Kind") to
  247. // unconditionally include in API requests. By default, fields with
  248. // empty values are omitted from API requests. However, any non-pointer,
  249. // non-interface field appearing in ForceSendFields will be sent to the
  250. // server regardless of whether the field is empty or not. This may be
  251. // used to include empty fields in Patch requests.
  252. ForceSendFields []string `json:"-"`
  253. }
  254. func (s *ManagedZonesListResponse) MarshalJSON() ([]byte, error) {
  255. type noMethod ManagedZonesListResponse
  256. raw := noMethod(*s)
  257. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  258. }
  259. // Project: A project resource. The project is a top level container for
  260. // resources including Cloud DNS ManagedZones. Projects can be created
  261. // only in the APIs console.
  262. type Project struct {
  263. // Id: User assigned unique identifier for the resource (output only).
  264. Id string `json:"id,omitempty"`
  265. // Kind: Identifies what kind of resource this is. Value: the fixed
  266. // string "dns#project".
  267. Kind string `json:"kind,omitempty"`
  268. // Number: Unique numeric identifier for the resource; defined by the
  269. // server (output only).
  270. Number uint64 `json:"number,omitempty,string"`
  271. // Quota: Quotas assigned to this project (output only).
  272. Quota *Quota `json:"quota,omitempty"`
  273. // ServerResponse contains the HTTP response code and headers from the
  274. // server.
  275. googleapi.ServerResponse `json:"-"`
  276. // ForceSendFields is a list of field names (e.g. "Id") to
  277. // unconditionally include in API requests. By default, fields with
  278. // empty values are omitted from API requests. However, any non-pointer,
  279. // non-interface field appearing in ForceSendFields will be sent to the
  280. // server regardless of whether the field is empty or not. This may be
  281. // used to include empty fields in Patch requests.
  282. ForceSendFields []string `json:"-"`
  283. }
  284. func (s *Project) MarshalJSON() ([]byte, error) {
  285. type noMethod Project
  286. raw := noMethod(*s)
  287. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  288. }
  289. // Quota: Limits associated with a Project.
  290. type Quota struct {
  291. // Kind: Identifies what kind of resource this is. Value: the fixed
  292. // string "dns#quota".
  293. Kind string `json:"kind,omitempty"`
  294. // ManagedZones: Maximum allowed number of managed zones in the project.
  295. ManagedZones int64 `json:"managedZones,omitempty"`
  296. // ResourceRecordsPerRrset: Maximum allowed number of ResourceRecords
  297. // per ResourceRecordSet.
  298. ResourceRecordsPerRrset int64 `json:"resourceRecordsPerRrset,omitempty"`
  299. // RrsetAdditionsPerChange: Maximum allowed number of ResourceRecordSets
  300. // to add per ChangesCreateRequest.
  301. RrsetAdditionsPerChange int64 `json:"rrsetAdditionsPerChange,omitempty"`
  302. // RrsetDeletionsPerChange: Maximum allowed number of ResourceRecordSets
  303. // to delete per ChangesCreateRequest.
  304. RrsetDeletionsPerChange int64 `json:"rrsetDeletionsPerChange,omitempty"`
  305. // RrsetsPerManagedZone: Maximum allowed number of ResourceRecordSets
  306. // per zone in the project.
  307. RrsetsPerManagedZone int64 `json:"rrsetsPerManagedZone,omitempty"`
  308. // TotalRrdataSizePerChange: Maximum allowed size for total rrdata in
  309. // one ChangesCreateRequest in bytes.
  310. TotalRrdataSizePerChange int64 `json:"totalRrdataSizePerChange,omitempty"`
  311. // ForceSendFields is a list of field names (e.g. "Kind") to
  312. // unconditionally include in API requests. By default, fields with
  313. // empty values are omitted from API requests. However, any non-pointer,
  314. // non-interface field appearing in ForceSendFields will be sent to the
  315. // server regardless of whether the field is empty or not. This may be
  316. // used to include empty fields in Patch requests.
  317. ForceSendFields []string `json:"-"`
  318. }
  319. func (s *Quota) MarshalJSON() ([]byte, error) {
  320. type noMethod Quota
  321. raw := noMethod(*s)
  322. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  323. }
  324. // ResourceRecordSet: A unit of data that will be returned by the DNS
  325. // servers.
  326. type ResourceRecordSet struct {
  327. // Kind: Identifies what kind of resource this is. Value: the fixed
  328. // string "dns#resourceRecordSet".
  329. Kind string `json:"kind,omitempty"`
  330. // Name: For example, www.example.com.
  331. Name string `json:"name,omitempty"`
  332. // Rrdatas: As defined in RFC 1035 (section 5) and RFC 1034 (section
  333. // 3.6.1).
  334. Rrdatas []string `json:"rrdatas,omitempty"`
  335. // Ttl: Number of seconds that this ResourceRecordSet can be cached by
  336. // resolvers.
  337. Ttl int64 `json:"ttl,omitempty"`
  338. // Type: The identifier of a supported record type, for example, A,
  339. // AAAA, MX, TXT, and so on.
  340. Type string `json:"type,omitempty"`
  341. // ForceSendFields is a list of field names (e.g. "Kind") to
  342. // unconditionally include in API requests. By default, fields with
  343. // empty values are omitted from API requests. However, any non-pointer,
  344. // non-interface field appearing in ForceSendFields will be sent to the
  345. // server regardless of whether the field is empty or not. This may be
  346. // used to include empty fields in Patch requests.
  347. ForceSendFields []string `json:"-"`
  348. }
  349. func (s *ResourceRecordSet) MarshalJSON() ([]byte, error) {
  350. type noMethod ResourceRecordSet
  351. raw := noMethod(*s)
  352. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  353. }
  354. type ResourceRecordSetsListResponse struct {
  355. // Kind: Type of resource.
  356. Kind string `json:"kind,omitempty"`
  357. // NextPageToken: The presence of this field indicates that there exist
  358. // more results following your last page of results in pagination order.
  359. // To fetch them, make another list request using this value as your
  360. // pagination token.
  361. //
  362. // In this way you can retrieve the complete contents of even very large
  363. // collections one page at a time. However, if the contents of the
  364. // collection change between the first and last paginated list request,
  365. // the set of all elements returned will be an inconsistent view of the
  366. // collection. There is no way to retrieve a consistent snapshot of a
  367. // collection larger than the maximum page size.
  368. NextPageToken string `json:"nextPageToken,omitempty"`
  369. // Rrsets: The resource record set resources.
  370. Rrsets []*ResourceRecordSet `json:"rrsets,omitempty"`
  371. // ServerResponse contains the HTTP response code and headers from the
  372. // server.
  373. googleapi.ServerResponse `json:"-"`
  374. // ForceSendFields is a list of field names (e.g. "Kind") to
  375. // unconditionally include in API requests. By default, fields with
  376. // empty values are omitted from API requests. However, any non-pointer,
  377. // non-interface field appearing in ForceSendFields will be sent to the
  378. // server regardless of whether the field is empty or not. This may be
  379. // used to include empty fields in Patch requests.
  380. ForceSendFields []string `json:"-"`
  381. }
  382. func (s *ResourceRecordSetsListResponse) MarshalJSON() ([]byte, error) {
  383. type noMethod ResourceRecordSetsListResponse
  384. raw := noMethod(*s)
  385. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  386. }
  387. // method id "dns.changes.create":
  388. type ChangesCreateCall struct {
  389. s *Service
  390. project string
  391. managedZone string
  392. change *Change
  393. urlParams_ gensupport.URLParams
  394. ctx_ context.Context
  395. }
  396. // Create: Atomically update the ResourceRecordSet collection.
  397. func (r *ChangesService) Create(project string, managedZone string, change *Change) *ChangesCreateCall {
  398. c := &ChangesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  399. c.project = project
  400. c.managedZone = managedZone
  401. c.change = change
  402. return c
  403. }
  404. // Fields allows partial responses to be retrieved. See
  405. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  406. // for more information.
  407. func (c *ChangesCreateCall) Fields(s ...googleapi.Field) *ChangesCreateCall {
  408. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  409. return c
  410. }
  411. // Context sets the context to be used in this call's Do method. Any
  412. // pending HTTP request will be aborted if the provided context is
  413. // canceled.
  414. func (c *ChangesCreateCall) Context(ctx context.Context) *ChangesCreateCall {
  415. c.ctx_ = ctx
  416. return c
  417. }
  418. func (c *ChangesCreateCall) doRequest(alt string) (*http.Response, error) {
  419. var body io.Reader = nil
  420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.change)
  421. if err != nil {
  422. return nil, err
  423. }
  424. ctype := "application/json"
  425. c.urlParams_.Set("alt", alt)
  426. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
  427. urls += "?" + c.urlParams_.Encode()
  428. req, _ := http.NewRequest("POST", urls, body)
  429. googleapi.Expand(req.URL, map[string]string{
  430. "project": c.project,
  431. "managedZone": c.managedZone,
  432. })
  433. req.Header.Set("Content-Type", ctype)
  434. req.Header.Set("User-Agent", c.s.userAgent())
  435. if c.ctx_ != nil {
  436. return ctxhttp.Do(c.ctx_, c.s.client, req)
  437. }
  438. return c.s.client.Do(req)
  439. }
  440. // Do executes the "dns.changes.create" call.
  441. // Exactly one of *Change or error will be non-nil. Any non-2xx status
  442. // code is an error. Response headers are in either
  443. // *Change.ServerResponse.Header or (if a response was returned at all)
  444. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  445. // check whether the returned error was because http.StatusNotModified
  446. // was returned.
  447. func (c *ChangesCreateCall) Do(opts ...googleapi.CallOption) (*Change, error) {
  448. gensupport.SetOptions(c.urlParams_, opts...)
  449. res, err := c.doRequest("json")
  450. if res != nil && res.StatusCode == http.StatusNotModified {
  451. if res.Body != nil {
  452. res.Body.Close()
  453. }
  454. return nil, &googleapi.Error{
  455. Code: res.StatusCode,
  456. Header: res.Header,
  457. }
  458. }
  459. if err != nil {
  460. return nil, err
  461. }
  462. defer googleapi.CloseBody(res)
  463. if err := googleapi.CheckResponse(res); err != nil {
  464. return nil, err
  465. }
  466. ret := &Change{
  467. ServerResponse: googleapi.ServerResponse{
  468. Header: res.Header,
  469. HTTPStatusCode: res.StatusCode,
  470. },
  471. }
  472. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  473. return nil, err
  474. }
  475. return ret, nil
  476. // {
  477. // "description": "Atomically update the ResourceRecordSet collection.",
  478. // "httpMethod": "POST",
  479. // "id": "dns.changes.create",
  480. // "parameterOrder": [
  481. // "project",
  482. // "managedZone"
  483. // ],
  484. // "parameters": {
  485. // "managedZone": {
  486. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  487. // "location": "path",
  488. // "required": true,
  489. // "type": "string"
  490. // },
  491. // "project": {
  492. // "description": "Identifies the project addressed by this request.",
  493. // "location": "path",
  494. // "required": true,
  495. // "type": "string"
  496. // }
  497. // },
  498. // "path": "{project}/managedZones/{managedZone}/changes",
  499. // "request": {
  500. // "$ref": "Change"
  501. // },
  502. // "response": {
  503. // "$ref": "Change"
  504. // },
  505. // "scopes": [
  506. // "https://www.googleapis.com/auth/cloud-platform",
  507. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  508. // ]
  509. // }
  510. }
  511. // method id "dns.changes.get":
  512. type ChangesGetCall struct {
  513. s *Service
  514. project string
  515. managedZone string
  516. changeId string
  517. urlParams_ gensupport.URLParams
  518. ifNoneMatch_ string
  519. ctx_ context.Context
  520. }
  521. // Get: Fetch the representation of an existing Change.
  522. func (r *ChangesService) Get(project string, managedZone string, changeId string) *ChangesGetCall {
  523. c := &ChangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  524. c.project = project
  525. c.managedZone = managedZone
  526. c.changeId = changeId
  527. return c
  528. }
  529. // Fields allows partial responses to be retrieved. See
  530. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  531. // for more information.
  532. func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall {
  533. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  534. return c
  535. }
  536. // IfNoneMatch sets the optional parameter which makes the operation
  537. // fail if the object's ETag matches the given value. This is useful for
  538. // getting updates only after the object has changed since the last
  539. // request. Use googleapi.IsNotModified to check whether the response
  540. // error from Do is the result of In-None-Match.
  541. func (c *ChangesGetCall) IfNoneMatch(entityTag string) *ChangesGetCall {
  542. c.ifNoneMatch_ = entityTag
  543. return c
  544. }
  545. // Context sets the context to be used in this call's Do method. Any
  546. // pending HTTP request will be aborted if the provided context is
  547. // canceled.
  548. func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall {
  549. c.ctx_ = ctx
  550. return c
  551. }
  552. func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) {
  553. var body io.Reader = nil
  554. c.urlParams_.Set("alt", alt)
  555. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes/{changeId}")
  556. urls += "?" + c.urlParams_.Encode()
  557. req, _ := http.NewRequest("GET", urls, body)
  558. googleapi.Expand(req.URL, map[string]string{
  559. "project": c.project,
  560. "managedZone": c.managedZone,
  561. "changeId": c.changeId,
  562. })
  563. req.Header.Set("User-Agent", c.s.userAgent())
  564. if c.ifNoneMatch_ != "" {
  565. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  566. }
  567. if c.ctx_ != nil {
  568. return ctxhttp.Do(c.ctx_, c.s.client, req)
  569. }
  570. return c.s.client.Do(req)
  571. }
  572. // Do executes the "dns.changes.get" call.
  573. // Exactly one of *Change or error will be non-nil. Any non-2xx status
  574. // code is an error. Response headers are in either
  575. // *Change.ServerResponse.Header or (if a response was returned at all)
  576. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  577. // check whether the returned error was because http.StatusNotModified
  578. // was returned.
  579. func (c *ChangesGetCall) Do(opts ...googleapi.CallOption) (*Change, error) {
  580. gensupport.SetOptions(c.urlParams_, opts...)
  581. res, err := c.doRequest("json")
  582. if res != nil && res.StatusCode == http.StatusNotModified {
  583. if res.Body != nil {
  584. res.Body.Close()
  585. }
  586. return nil, &googleapi.Error{
  587. Code: res.StatusCode,
  588. Header: res.Header,
  589. }
  590. }
  591. if err != nil {
  592. return nil, err
  593. }
  594. defer googleapi.CloseBody(res)
  595. if err := googleapi.CheckResponse(res); err != nil {
  596. return nil, err
  597. }
  598. ret := &Change{
  599. ServerResponse: googleapi.ServerResponse{
  600. Header: res.Header,
  601. HTTPStatusCode: res.StatusCode,
  602. },
  603. }
  604. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  605. return nil, err
  606. }
  607. return ret, nil
  608. // {
  609. // "description": "Fetch the representation of an existing Change.",
  610. // "httpMethod": "GET",
  611. // "id": "dns.changes.get",
  612. // "parameterOrder": [
  613. // "project",
  614. // "managedZone",
  615. // "changeId"
  616. // ],
  617. // "parameters": {
  618. // "changeId": {
  619. // "description": "The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.",
  620. // "location": "path",
  621. // "required": true,
  622. // "type": "string"
  623. // },
  624. // "managedZone": {
  625. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  626. // "location": "path",
  627. // "required": true,
  628. // "type": "string"
  629. // },
  630. // "project": {
  631. // "description": "Identifies the project addressed by this request.",
  632. // "location": "path",
  633. // "required": true,
  634. // "type": "string"
  635. // }
  636. // },
  637. // "path": "{project}/managedZones/{managedZone}/changes/{changeId}",
  638. // "response": {
  639. // "$ref": "Change"
  640. // },
  641. // "scopes": [
  642. // "https://www.googleapis.com/auth/cloud-platform",
  643. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  644. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  645. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  646. // ]
  647. // }
  648. }
  649. // method id "dns.changes.list":
  650. type ChangesListCall struct {
  651. s *Service
  652. project string
  653. managedZone string
  654. urlParams_ gensupport.URLParams
  655. ifNoneMatch_ string
  656. ctx_ context.Context
  657. }
  658. // List: Enumerate Changes to a ResourceRecordSet collection.
  659. func (r *ChangesService) List(project string, managedZone string) *ChangesListCall {
  660. c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  661. c.project = project
  662. c.managedZone = managedZone
  663. return c
  664. }
  665. // MaxResults sets the optional parameter "maxResults": Maximum number
  666. // of results to be returned. If unspecified, the server will decide how
  667. // many results to return.
  668. func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall {
  669. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  670. return c
  671. }
  672. // PageToken sets the optional parameter "pageToken": A tag returned by
  673. // a previous list request that was truncated. Use this parameter to
  674. // continue a previous list request.
  675. func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall {
  676. c.urlParams_.Set("pageToken", pageToken)
  677. return c
  678. }
  679. // SortBy sets the optional parameter "sortBy": Sorting criterion. The
  680. // only supported value is change sequence.
  681. //
  682. // Possible values:
  683. // "changeSequence" (default)
  684. func (c *ChangesListCall) SortBy(sortBy string) *ChangesListCall {
  685. c.urlParams_.Set("sortBy", sortBy)
  686. return c
  687. }
  688. // SortOrder sets the optional parameter "sortOrder": Sorting order
  689. // direction: 'ascending' or 'descending'.
  690. func (c *ChangesListCall) SortOrder(sortOrder string) *ChangesListCall {
  691. c.urlParams_.Set("sortOrder", sortOrder)
  692. return c
  693. }
  694. // Fields allows partial responses to be retrieved. See
  695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  696. // for more information.
  697. func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall {
  698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  699. return c
  700. }
  701. // IfNoneMatch sets the optional parameter which makes the operation
  702. // fail if the object's ETag matches the given value. This is useful for
  703. // getting updates only after the object has changed since the last
  704. // request. Use googleapi.IsNotModified to check whether the response
  705. // error from Do is the result of In-None-Match.
  706. func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall {
  707. c.ifNoneMatch_ = entityTag
  708. return c
  709. }
  710. // Context sets the context to be used in this call's Do method. Any
  711. // pending HTTP request will be aborted if the provided context is
  712. // canceled.
  713. func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall {
  714. c.ctx_ = ctx
  715. return c
  716. }
  717. func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) {
  718. var body io.Reader = nil
  719. c.urlParams_.Set("alt", alt)
  720. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
  721. urls += "?" + c.urlParams_.Encode()
  722. req, _ := http.NewRequest("GET", urls, body)
  723. googleapi.Expand(req.URL, map[string]string{
  724. "project": c.project,
  725. "managedZone": c.managedZone,
  726. })
  727. req.Header.Set("User-Agent", c.s.userAgent())
  728. if c.ifNoneMatch_ != "" {
  729. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  730. }
  731. if c.ctx_ != nil {
  732. return ctxhttp.Do(c.ctx_, c.s.client, req)
  733. }
  734. return c.s.client.Do(req)
  735. }
  736. // Do executes the "dns.changes.list" call.
  737. // Exactly one of *ChangesListResponse or error will be non-nil. Any
  738. // non-2xx status code is an error. Response headers are in either
  739. // *ChangesListResponse.ServerResponse.Header or (if a response was
  740. // returned at all) in error.(*googleapi.Error).Header. Use
  741. // googleapi.IsNotModified to check whether the returned error was
  742. // because http.StatusNotModified was returned.
  743. func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangesListResponse, error) {
  744. gensupport.SetOptions(c.urlParams_, opts...)
  745. res, err := c.doRequest("json")
  746. if res != nil && res.StatusCode == http.StatusNotModified {
  747. if res.Body != nil {
  748. res.Body.Close()
  749. }
  750. return nil, &googleapi.Error{
  751. Code: res.StatusCode,
  752. Header: res.Header,
  753. }
  754. }
  755. if err != nil {
  756. return nil, err
  757. }
  758. defer googleapi.CloseBody(res)
  759. if err := googleapi.CheckResponse(res); err != nil {
  760. return nil, err
  761. }
  762. ret := &ChangesListResponse{
  763. ServerResponse: googleapi.ServerResponse{
  764. Header: res.Header,
  765. HTTPStatusCode: res.StatusCode,
  766. },
  767. }
  768. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  769. return nil, err
  770. }
  771. return ret, nil
  772. // {
  773. // "description": "Enumerate Changes to a ResourceRecordSet collection.",
  774. // "httpMethod": "GET",
  775. // "id": "dns.changes.list",
  776. // "parameterOrder": [
  777. // "project",
  778. // "managedZone"
  779. // ],
  780. // "parameters": {
  781. // "managedZone": {
  782. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  783. // "location": "path",
  784. // "required": true,
  785. // "type": "string"
  786. // },
  787. // "maxResults": {
  788. // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
  789. // "format": "int32",
  790. // "location": "query",
  791. // "type": "integer"
  792. // },
  793. // "pageToken": {
  794. // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
  795. // "location": "query",
  796. // "type": "string"
  797. // },
  798. // "project": {
  799. // "description": "Identifies the project addressed by this request.",
  800. // "location": "path",
  801. // "required": true,
  802. // "type": "string"
  803. // },
  804. // "sortBy": {
  805. // "default": "changeSequence",
  806. // "description": "Sorting criterion. The only supported value is change sequence.",
  807. // "enum": [
  808. // "changeSequence"
  809. // ],
  810. // "enumDescriptions": [
  811. // ""
  812. // ],
  813. // "location": "query",
  814. // "type": "string"
  815. // },
  816. // "sortOrder": {
  817. // "description": "Sorting order direction: 'ascending' or 'descending'.",
  818. // "location": "query",
  819. // "type": "string"
  820. // }
  821. // },
  822. // "path": "{project}/managedZones/{managedZone}/changes",
  823. // "response": {
  824. // "$ref": "ChangesListResponse"
  825. // },
  826. // "scopes": [
  827. // "https://www.googleapis.com/auth/cloud-platform",
  828. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  829. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  830. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  831. // ]
  832. // }
  833. }
  834. // Pages invokes f for each page of results.
  835. // A non-nil error returned from f will halt the iteration.
  836. // The provided context supersedes any context provided to the Context method.
  837. func (c *ChangesListCall) Pages(ctx context.Context, f func(*ChangesListResponse) error) error {
  838. c.ctx_ = ctx
  839. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  840. for {
  841. x, err := c.Do()
  842. if err != nil {
  843. return err
  844. }
  845. if err := f(x); err != nil {
  846. return err
  847. }
  848. if x.NextPageToken == "" {
  849. return nil
  850. }
  851. c.PageToken(x.NextPageToken)
  852. }
  853. }
  854. // method id "dns.managedZones.create":
  855. type ManagedZonesCreateCall struct {
  856. s *Service
  857. project string
  858. managedzone *ManagedZone
  859. urlParams_ gensupport.URLParams
  860. ctx_ context.Context
  861. }
  862. // Create: Create a new ManagedZone.
  863. func (r *ManagedZonesService) Create(project string, managedzone *ManagedZone) *ManagedZonesCreateCall {
  864. c := &ManagedZonesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  865. c.project = project
  866. c.managedzone = managedzone
  867. return c
  868. }
  869. // Fields allows partial responses to be retrieved. See
  870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  871. // for more information.
  872. func (c *ManagedZonesCreateCall) Fields(s ...googleapi.Field) *ManagedZonesCreateCall {
  873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  874. return c
  875. }
  876. // Context sets the context to be used in this call's Do method. Any
  877. // pending HTTP request will be aborted if the provided context is
  878. // canceled.
  879. func (c *ManagedZonesCreateCall) Context(ctx context.Context) *ManagedZonesCreateCall {
  880. c.ctx_ = ctx
  881. return c
  882. }
  883. func (c *ManagedZonesCreateCall) doRequest(alt string) (*http.Response, error) {
  884. var body io.Reader = nil
  885. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
  886. if err != nil {
  887. return nil, err
  888. }
  889. ctype := "application/json"
  890. c.urlParams_.Set("alt", alt)
  891. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
  892. urls += "?" + c.urlParams_.Encode()
  893. req, _ := http.NewRequest("POST", urls, body)
  894. googleapi.Expand(req.URL, map[string]string{
  895. "project": c.project,
  896. })
  897. req.Header.Set("Content-Type", ctype)
  898. req.Header.Set("User-Agent", c.s.userAgent())
  899. if c.ctx_ != nil {
  900. return ctxhttp.Do(c.ctx_, c.s.client, req)
  901. }
  902. return c.s.client.Do(req)
  903. }
  904. // Do executes the "dns.managedZones.create" call.
  905. // Exactly one of *ManagedZone or error will be non-nil. Any non-2xx
  906. // status code is an error. Response headers are in either
  907. // *ManagedZone.ServerResponse.Header or (if a response was returned at
  908. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  909. // to check whether the returned error was because
  910. // http.StatusNotModified was returned.
  911. func (c *ManagedZonesCreateCall) Do(opts ...googleapi.CallOption) (*ManagedZone, error) {
  912. gensupport.SetOptions(c.urlParams_, opts...)
  913. res, err := c.doRequest("json")
  914. if res != nil && res.StatusCode == http.StatusNotModified {
  915. if res.Body != nil {
  916. res.Body.Close()
  917. }
  918. return nil, &googleapi.Error{
  919. Code: res.StatusCode,
  920. Header: res.Header,
  921. }
  922. }
  923. if err != nil {
  924. return nil, err
  925. }
  926. defer googleapi.CloseBody(res)
  927. if err := googleapi.CheckResponse(res); err != nil {
  928. return nil, err
  929. }
  930. ret := &ManagedZone{
  931. ServerResponse: googleapi.ServerResponse{
  932. Header: res.Header,
  933. HTTPStatusCode: res.StatusCode,
  934. },
  935. }
  936. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  937. return nil, err
  938. }
  939. return ret, nil
  940. // {
  941. // "description": "Create a new ManagedZone.",
  942. // "httpMethod": "POST",
  943. // "id": "dns.managedZones.create",
  944. // "parameterOrder": [
  945. // "project"
  946. // ],
  947. // "parameters": {
  948. // "project": {
  949. // "description": "Identifies the project addressed by this request.",
  950. // "location": "path",
  951. // "required": true,
  952. // "type": "string"
  953. // }
  954. // },
  955. // "path": "{project}/managedZones",
  956. // "request": {
  957. // "$ref": "ManagedZone"
  958. // },
  959. // "response": {
  960. // "$ref": "ManagedZone"
  961. // },
  962. // "scopes": [
  963. // "https://www.googleapis.com/auth/cloud-platform",
  964. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  965. // ]
  966. // }
  967. }
  968. // method id "dns.managedZones.delete":
  969. type ManagedZonesDeleteCall struct {
  970. s *Service
  971. project string
  972. managedZone string
  973. urlParams_ gensupport.URLParams
  974. ctx_ context.Context
  975. }
  976. // Delete: Delete a previously created ManagedZone.
  977. func (r *ManagedZonesService) Delete(project string, managedZone string) *ManagedZonesDeleteCall {
  978. c := &ManagedZonesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  979. c.project = project
  980. c.managedZone = managedZone
  981. return c
  982. }
  983. // Fields allows partial responses to be retrieved. See
  984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  985. // for more information.
  986. func (c *ManagedZonesDeleteCall) Fields(s ...googleapi.Field) *ManagedZonesDeleteCall {
  987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  988. return c
  989. }
  990. // Context sets the context to be used in this call's Do method. Any
  991. // pending HTTP request will be aborted if the provided context is
  992. // canceled.
  993. func (c *ManagedZonesDeleteCall) Context(ctx context.Context) *ManagedZonesDeleteCall {
  994. c.ctx_ = ctx
  995. return c
  996. }
  997. func (c *ManagedZonesDeleteCall) doRequest(alt string) (*http.Response, error) {
  998. var body io.Reader = nil
  999. c.urlParams_.Set("alt", alt)
  1000. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  1001. urls += "?" + c.urlParams_.Encode()
  1002. req, _ := http.NewRequest("DELETE", urls, body)
  1003. googleapi.Expand(req.URL, map[string]string{
  1004. "project": c.project,
  1005. "managedZone": c.managedZone,
  1006. })
  1007. req.Header.Set("User-Agent", c.s.userAgent())
  1008. if c.ctx_ != nil {
  1009. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1010. }
  1011. return c.s.client.Do(req)
  1012. }
  1013. // Do executes the "dns.managedZones.delete" call.
  1014. func (c *ManagedZonesDeleteCall) Do(opts ...googleapi.CallOption) error {
  1015. gensupport.SetOptions(c.urlParams_, opts...)
  1016. res, err := c.doRequest("json")
  1017. if err != nil {
  1018. return err
  1019. }
  1020. defer googleapi.CloseBody(res)
  1021. if err := googleapi.CheckResponse(res); err != nil {
  1022. return err
  1023. }
  1024. return nil
  1025. // {
  1026. // "description": "Delete a previously created ManagedZone.",
  1027. // "httpMethod": "DELETE",
  1028. // "id": "dns.managedZones.delete",
  1029. // "parameterOrder": [
  1030. // "project",
  1031. // "managedZone"
  1032. // ],
  1033. // "parameters": {
  1034. // "managedZone": {
  1035. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  1036. // "location": "path",
  1037. // "required": true,
  1038. // "type": "string"
  1039. // },
  1040. // "project": {
  1041. // "description": "Identifies the project addressed by this request.",
  1042. // "location": "path",
  1043. // "required": true,
  1044. // "type": "string"
  1045. // }
  1046. // },
  1047. // "path": "{project}/managedZones/{managedZone}",
  1048. // "scopes": [
  1049. // "https://www.googleapis.com/auth/cloud-platform",
  1050. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1051. // ]
  1052. // }
  1053. }
  1054. // method id "dns.managedZones.get":
  1055. type ManagedZonesGetCall struct {
  1056. s *Service
  1057. project string
  1058. managedZone string
  1059. urlParams_ gensupport.URLParams
  1060. ifNoneMatch_ string
  1061. ctx_ context.Context
  1062. }
  1063. // Get: Fetch the representation of an existing ManagedZone.
  1064. func (r *ManagedZonesService) Get(project string, managedZone string) *ManagedZonesGetCall {
  1065. c := &ManagedZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1066. c.project = project
  1067. c.managedZone = managedZone
  1068. return c
  1069. }
  1070. // Fields allows partial responses to be retrieved. See
  1071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1072. // for more information.
  1073. func (c *ManagedZonesGetCall) Fields(s ...googleapi.Field) *ManagedZonesGetCall {
  1074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1075. return c
  1076. }
  1077. // IfNoneMatch sets the optional parameter which makes the operation
  1078. // fail if the object's ETag matches the given value. This is useful for
  1079. // getting updates only after the object has changed since the last
  1080. // request. Use googleapi.IsNotModified to check whether the response
  1081. // error from Do is the result of In-None-Match.
  1082. func (c *ManagedZonesGetCall) IfNoneMatch(entityTag string) *ManagedZonesGetCall {
  1083. c.ifNoneMatch_ = entityTag
  1084. return c
  1085. }
  1086. // Context sets the context to be used in this call's Do method. Any
  1087. // pending HTTP request will be aborted if the provided context is
  1088. // canceled.
  1089. func (c *ManagedZonesGetCall) Context(ctx context.Context) *ManagedZonesGetCall {
  1090. c.ctx_ = ctx
  1091. return c
  1092. }
  1093. func (c *ManagedZonesGetCall) doRequest(alt string) (*http.Response, error) {
  1094. var body io.Reader = nil
  1095. c.urlParams_.Set("alt", alt)
  1096. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  1097. urls += "?" + c.urlParams_.Encode()
  1098. req, _ := http.NewRequest("GET", urls, body)
  1099. googleapi.Expand(req.URL, map[string]string{
  1100. "project": c.project,
  1101. "managedZone": c.managedZone,
  1102. })
  1103. req.Header.Set("User-Agent", c.s.userAgent())
  1104. if c.ifNoneMatch_ != "" {
  1105. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1106. }
  1107. if c.ctx_ != nil {
  1108. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1109. }
  1110. return c.s.client.Do(req)
  1111. }
  1112. // Do executes the "dns.managedZones.get" call.
  1113. // Exactly one of *ManagedZone or error will be non-nil. Any non-2xx
  1114. // status code is an error. Response headers are in either
  1115. // *ManagedZone.ServerResponse.Header or (if a response was returned at
  1116. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1117. // to check whether the returned error was because
  1118. // http.StatusNotModified was returned.
  1119. func (c *ManagedZonesGetCall) Do(opts ...googleapi.CallOption) (*ManagedZone, error) {
  1120. gensupport.SetOptions(c.urlParams_, opts...)
  1121. res, err := c.doRequest("json")
  1122. if res != nil && res.StatusCode == http.StatusNotModified {
  1123. if res.Body != nil {
  1124. res.Body.Close()
  1125. }
  1126. return nil, &googleapi.Error{
  1127. Code: res.StatusCode,
  1128. Header: res.Header,
  1129. }
  1130. }
  1131. if err != nil {
  1132. return nil, err
  1133. }
  1134. defer googleapi.CloseBody(res)
  1135. if err := googleapi.CheckResponse(res); err != nil {
  1136. return nil, err
  1137. }
  1138. ret := &ManagedZone{
  1139. ServerResponse: googleapi.ServerResponse{
  1140. Header: res.Header,
  1141. HTTPStatusCode: res.StatusCode,
  1142. },
  1143. }
  1144. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1145. return nil, err
  1146. }
  1147. return ret, nil
  1148. // {
  1149. // "description": "Fetch the representation of an existing ManagedZone.",
  1150. // "httpMethod": "GET",
  1151. // "id": "dns.managedZones.get",
  1152. // "parameterOrder": [
  1153. // "project",
  1154. // "managedZone"
  1155. // ],
  1156. // "parameters": {
  1157. // "managedZone": {
  1158. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  1159. // "location": "path",
  1160. // "required": true,
  1161. // "type": "string"
  1162. // },
  1163. // "project": {
  1164. // "description": "Identifies the project addressed by this request.",
  1165. // "location": "path",
  1166. // "required": true,
  1167. // "type": "string"
  1168. // }
  1169. // },
  1170. // "path": "{project}/managedZones/{managedZone}",
  1171. // "response": {
  1172. // "$ref": "ManagedZone"
  1173. // },
  1174. // "scopes": [
  1175. // "https://www.googleapis.com/auth/cloud-platform",
  1176. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1177. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1178. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1179. // ]
  1180. // }
  1181. }
  1182. // method id "dns.managedZones.list":
  1183. type ManagedZonesListCall struct {
  1184. s *Service
  1185. project string
  1186. urlParams_ gensupport.URLParams
  1187. ifNoneMatch_ string
  1188. ctx_ context.Context
  1189. }
  1190. // List: Enumerate ManagedZones that have been created but not yet
  1191. // deleted.
  1192. func (r *ManagedZonesService) List(project string) *ManagedZonesListCall {
  1193. c := &ManagedZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1194. c.project = project
  1195. return c
  1196. }
  1197. // DnsName sets the optional parameter "dnsName": Restricts the list to
  1198. // return only zones with this domain name.
  1199. func (c *ManagedZonesListCall) DnsName(dnsName string) *ManagedZonesListCall {
  1200. c.urlParams_.Set("dnsName", dnsName)
  1201. return c
  1202. }
  1203. // MaxResults sets the optional parameter "maxResults": Maximum number
  1204. // of results to be returned. If unspecified, the server will decide how
  1205. // many results to return.
  1206. func (c *ManagedZonesListCall) MaxResults(maxResults int64) *ManagedZonesListCall {
  1207. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1208. return c
  1209. }
  1210. // PageToken sets the optional parameter "pageToken": A tag returned by
  1211. // a previous list request that was truncated. Use this parameter to
  1212. // continue a previous list request.
  1213. func (c *ManagedZonesListCall) PageToken(pageToken string) *ManagedZonesListCall {
  1214. c.urlParams_.Set("pageToken", pageToken)
  1215. return c
  1216. }
  1217. // Fields allows partial responses to be retrieved. See
  1218. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1219. // for more information.
  1220. func (c *ManagedZonesListCall) Fields(s ...googleapi.Field) *ManagedZonesListCall {
  1221. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1222. return c
  1223. }
  1224. // IfNoneMatch sets the optional parameter which makes the operation
  1225. // fail if the object's ETag matches the given value. This is useful for
  1226. // getting updates only after the object has changed since the last
  1227. // request. Use googleapi.IsNotModified to check whether the response
  1228. // error from Do is the result of In-None-Match.
  1229. func (c *ManagedZonesListCall) IfNoneMatch(entityTag string) *ManagedZonesListCall {
  1230. c.ifNoneMatch_ = entityTag
  1231. return c
  1232. }
  1233. // Context sets the context to be used in this call's Do method. Any
  1234. // pending HTTP request will be aborted if the provided context is
  1235. // canceled.
  1236. func (c *ManagedZonesListCall) Context(ctx context.Context) *ManagedZonesListCall {
  1237. c.ctx_ = ctx
  1238. return c
  1239. }
  1240. func (c *ManagedZonesListCall) doRequest(alt string) (*http.Response, error) {
  1241. var body io.Reader = nil
  1242. c.urlParams_.Set("alt", alt)
  1243. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
  1244. urls += "?" + c.urlParams_.Encode()
  1245. req, _ := http.NewRequest("GET", urls, body)
  1246. googleapi.Expand(req.URL, map[string]string{
  1247. "project": c.project,
  1248. })
  1249. req.Header.Set("User-Agent", c.s.userAgent())
  1250. if c.ifNoneMatch_ != "" {
  1251. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1252. }
  1253. if c.ctx_ != nil {
  1254. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1255. }
  1256. return c.s.client.Do(req)
  1257. }
  1258. // Do executes the "dns.managedZones.list" call.
  1259. // Exactly one of *ManagedZonesListResponse or error will be non-nil.
  1260. // Any non-2xx status code is an error. Response headers are in either
  1261. // *ManagedZonesListResponse.ServerResponse.Header or (if a response was
  1262. // returned at all) in error.(*googleapi.Error).Header. Use
  1263. // googleapi.IsNotModified to check whether the returned error was
  1264. // because http.StatusNotModified was returned.
  1265. func (c *ManagedZonesListCall) Do(opts ...googleapi.CallOption) (*ManagedZonesListResponse, error) {
  1266. gensupport.SetOptions(c.urlParams_, opts...)
  1267. res, err := c.doRequest("json")
  1268. if res != nil && res.StatusCode == http.StatusNotModified {
  1269. if res.Body != nil {
  1270. res.Body.Close()
  1271. }
  1272. return nil, &googleapi.Error{
  1273. Code: res.StatusCode,
  1274. Header: res.Header,
  1275. }
  1276. }
  1277. if err != nil {
  1278. return nil, err
  1279. }
  1280. defer googleapi.CloseBody(res)
  1281. if err := googleapi.CheckResponse(res); err != nil {
  1282. return nil, err
  1283. }
  1284. ret := &ManagedZonesListResponse{
  1285. ServerResponse: googleapi.ServerResponse{
  1286. Header: res.Header,
  1287. HTTPStatusCode: res.StatusCode,
  1288. },
  1289. }
  1290. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1291. return nil, err
  1292. }
  1293. return ret, nil
  1294. // {
  1295. // "description": "Enumerate ManagedZones that have been created but not yet deleted.",
  1296. // "httpMethod": "GET",
  1297. // "id": "dns.managedZones.list",
  1298. // "parameterOrder": [
  1299. // "project"
  1300. // ],
  1301. // "parameters": {
  1302. // "dnsName": {
  1303. // "description": "Restricts the list to return only zones with this domain name.",
  1304. // "location": "query",
  1305. // "type": "string"
  1306. // },
  1307. // "maxResults": {
  1308. // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
  1309. // "format": "int32",
  1310. // "location": "query",
  1311. // "type": "integer"
  1312. // },
  1313. // "pageToken": {
  1314. // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
  1315. // "location": "query",
  1316. // "type": "string"
  1317. // },
  1318. // "project": {
  1319. // "description": "Identifies the project addressed by this request.",
  1320. // "location": "path",
  1321. // "required": true,
  1322. // "type": "string"
  1323. // }
  1324. // },
  1325. // "path": "{project}/managedZones",
  1326. // "response": {
  1327. // "$ref": "ManagedZonesListResponse"
  1328. // },
  1329. // "scopes": [
  1330. // "https://www.googleapis.com/auth/cloud-platform",
  1331. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1332. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1333. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1334. // ]
  1335. // }
  1336. }
  1337. // Pages invokes f for each page of results.
  1338. // A non-nil error returned from f will halt the iteration.
  1339. // The provided context supersedes any context provided to the Context method.
  1340. func (c *ManagedZonesListCall) Pages(ctx context.Context, f func(*ManagedZonesListResponse) error) error {
  1341. c.ctx_ = ctx
  1342. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1343. for {
  1344. x, err := c.Do()
  1345. if err != nil {
  1346. return err
  1347. }
  1348. if err := f(x); err != nil {
  1349. return err
  1350. }
  1351. if x.NextPageToken == "" {
  1352. return nil
  1353. }
  1354. c.PageToken(x.NextPageToken)
  1355. }
  1356. }
  1357. // method id "dns.projects.get":
  1358. type ProjectsGetCall struct {
  1359. s *Service
  1360. project string
  1361. urlParams_ gensupport.URLParams
  1362. ifNoneMatch_ string
  1363. ctx_ context.Context
  1364. }
  1365. // Get: Fetch the representation of an existing Project.
  1366. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  1367. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1368. c.project = project
  1369. return c
  1370. }
  1371. // Fields allows partial responses to be retrieved. See
  1372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1373. // for more information.
  1374. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  1375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1376. return c
  1377. }
  1378. // IfNoneMatch sets the optional parameter which makes the operation
  1379. // fail if the object's ETag matches the given value. This is useful for
  1380. // getting updates only after the object has changed since the last
  1381. // request. Use googleapi.IsNotModified to check whether the response
  1382. // error from Do is the result of In-None-Match.
  1383. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  1384. c.ifNoneMatch_ = entityTag
  1385. return c
  1386. }
  1387. // Context sets the context to be used in this call's Do method. Any
  1388. // pending HTTP request will be aborted if the provided context is
  1389. // canceled.
  1390. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  1391. c.ctx_ = ctx
  1392. return c
  1393. }
  1394. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  1395. var body io.Reader = nil
  1396. c.urlParams_.Set("alt", alt)
  1397. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  1398. urls += "?" + c.urlParams_.Encode()
  1399. req, _ := http.NewRequest("GET", urls, body)
  1400. googleapi.Expand(req.URL, map[string]string{
  1401. "project": c.project,
  1402. })
  1403. req.Header.Set("User-Agent", c.s.userAgent())
  1404. if c.ifNoneMatch_ != "" {
  1405. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1406. }
  1407. if c.ctx_ != nil {
  1408. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1409. }
  1410. return c.s.client.Do(req)
  1411. }
  1412. // Do executes the "dns.projects.get" call.
  1413. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  1414. // code is an error. Response headers are in either
  1415. // *Project.ServerResponse.Header or (if a response was returned at all)
  1416. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1417. // check whether the returned error was because http.StatusNotModified
  1418. // was returned.
  1419. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  1420. gensupport.SetOptions(c.urlParams_, opts...)
  1421. res, err := c.doRequest("json")
  1422. if res != nil && res.StatusCode == http.StatusNotModified {
  1423. if res.Body != nil {
  1424. res.Body.Close()
  1425. }
  1426. return nil, &googleapi.Error{
  1427. Code: res.StatusCode,
  1428. Header: res.Header,
  1429. }
  1430. }
  1431. if err != nil {
  1432. return nil, err
  1433. }
  1434. defer googleapi.CloseBody(res)
  1435. if err := googleapi.CheckResponse(res); err != nil {
  1436. return nil, err
  1437. }
  1438. ret := &Project{
  1439. ServerResponse: googleapi.ServerResponse{
  1440. Header: res.Header,
  1441. HTTPStatusCode: res.StatusCode,
  1442. },
  1443. }
  1444. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1445. return nil, err
  1446. }
  1447. return ret, nil
  1448. // {
  1449. // "description": "Fetch the representation of an existing Project.",
  1450. // "httpMethod": "GET",
  1451. // "id": "dns.projects.get",
  1452. // "parameterOrder": [
  1453. // "project"
  1454. // ],
  1455. // "parameters": {
  1456. // "project": {
  1457. // "description": "Identifies the project addressed by this request.",
  1458. // "location": "path",
  1459. // "required": true,
  1460. // "type": "string"
  1461. // }
  1462. // },
  1463. // "path": "{project}",
  1464. // "response": {
  1465. // "$ref": "Project"
  1466. // },
  1467. // "scopes": [
  1468. // "https://www.googleapis.com/auth/cloud-platform",
  1469. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1470. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1471. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1472. // ]
  1473. // }
  1474. }
  1475. // method id "dns.resourceRecordSets.list":
  1476. type ResourceRecordSetsListCall struct {
  1477. s *Service
  1478. project string
  1479. managedZone string
  1480. urlParams_ gensupport.URLParams
  1481. ifNoneMatch_ string
  1482. ctx_ context.Context
  1483. }
  1484. // List: Enumerate ResourceRecordSets that have been created but not yet
  1485. // deleted.
  1486. func (r *ResourceRecordSetsService) List(project string, managedZone string) *ResourceRecordSetsListCall {
  1487. c := &ResourceRecordSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1488. c.project = project
  1489. c.managedZone = managedZone
  1490. return c
  1491. }
  1492. // MaxResults sets the optional parameter "maxResults": Maximum number
  1493. // of results to be returned. If unspecified, the server will decide how
  1494. // many results to return.
  1495. func (c *ResourceRecordSetsListCall) MaxResults(maxResults int64) *ResourceRecordSetsListCall {
  1496. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1497. return c
  1498. }
  1499. // Name sets the optional parameter "name": Restricts the list to return
  1500. // only records with this fully qualified domain name.
  1501. func (c *ResourceRecordSetsListCall) Name(name string) *ResourceRecordSetsListCall {
  1502. c.urlParams_.Set("name", name)
  1503. return c
  1504. }
  1505. // PageToken sets the optional parameter "pageToken": A tag returned by
  1506. // a previous list request that was truncated. Use this parameter to
  1507. // continue a previous list request.
  1508. func (c *ResourceRecordSetsListCall) PageToken(pageToken string) *ResourceRecordSetsListCall {
  1509. c.urlParams_.Set("pageToken", pageToken)
  1510. return c
  1511. }
  1512. // Type sets the optional parameter "type": Restricts the list to return
  1513. // only records of this type. If present, the "name" parameter must also
  1514. // be present.
  1515. func (c *ResourceRecordSetsListCall) Type(type_ string) *ResourceRecordSetsListCall {
  1516. c.urlParams_.Set("type", type_)
  1517. return c
  1518. }
  1519. // Fields allows partial responses to be retrieved. See
  1520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1521. // for more information.
  1522. func (c *ResourceRecordSetsListCall) Fields(s ...googleapi.Field) *ResourceRecordSetsListCall {
  1523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1524. return c
  1525. }
  1526. // IfNoneMatch sets the optional parameter which makes the operation
  1527. // fail if the object's ETag matches the given value. This is useful for
  1528. // getting updates only after the object has changed since the last
  1529. // request. Use googleapi.IsNotModified to check whether the response
  1530. // error from Do is the result of In-None-Match.
  1531. func (c *ResourceRecordSetsListCall) IfNoneMatch(entityTag string) *ResourceRecordSetsListCall {
  1532. c.ifNoneMatch_ = entityTag
  1533. return c
  1534. }
  1535. // Context sets the context to be used in this call's Do method. Any
  1536. // pending HTTP request will be aborted if the provided context is
  1537. // canceled.
  1538. func (c *ResourceRecordSetsListCall) Context(ctx context.Context) *ResourceRecordSetsListCall {
  1539. c.ctx_ = ctx
  1540. return c
  1541. }
  1542. func (c *ResourceRecordSetsListCall) doRequest(alt string) (*http.Response, error) {
  1543. var body io.Reader = nil
  1544. c.urlParams_.Set("alt", alt)
  1545. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/rrsets")
  1546. urls += "?" + c.urlParams_.Encode()
  1547. req, _ := http.NewRequest("GET", urls, body)
  1548. googleapi.Expand(req.URL, map[string]string{
  1549. "project": c.project,
  1550. "managedZone": c.managedZone,
  1551. })
  1552. req.Header.Set("User-Agent", c.s.userAgent())
  1553. if c.ifNoneMatch_ != "" {
  1554. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1555. }
  1556. if c.ctx_ != nil {
  1557. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1558. }
  1559. return c.s.client.Do(req)
  1560. }
  1561. // Do executes the "dns.resourceRecordSets.list" call.
  1562. // Exactly one of *ResourceRecordSetsListResponse or error will be
  1563. // non-nil. Any non-2xx status code is an error. Response headers are in
  1564. // either *ResourceRecordSetsListResponse.ServerResponse.Header or (if a
  1565. // response was returned at all) in error.(*googleapi.Error).Header. Use
  1566. // googleapi.IsNotModified to check whether the returned error was
  1567. // because http.StatusNotModified was returned.
  1568. func (c *ResourceRecordSetsListCall) Do(opts ...googleapi.CallOption) (*ResourceRecordSetsListResponse, error) {
  1569. gensupport.SetOptions(c.urlParams_, opts...)
  1570. res, err := c.doRequest("json")
  1571. if res != nil && res.StatusCode == http.StatusNotModified {
  1572. if res.Body != nil {
  1573. res.Body.Close()
  1574. }
  1575. return nil, &googleapi.Error{
  1576. Code: res.StatusCode,
  1577. Header: res.Header,
  1578. }
  1579. }
  1580. if err != nil {
  1581. return nil, err
  1582. }
  1583. defer googleapi.CloseBody(res)
  1584. if err := googleapi.CheckResponse(res); err != nil {
  1585. return nil, err
  1586. }
  1587. ret := &ResourceRecordSetsListResponse{
  1588. ServerResponse: googleapi.ServerResponse{
  1589. Header: res.Header,
  1590. HTTPStatusCode: res.StatusCode,
  1591. },
  1592. }
  1593. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1594. return nil, err
  1595. }
  1596. return ret, nil
  1597. // {
  1598. // "description": "Enumerate ResourceRecordSets that have been created but not yet deleted.",
  1599. // "httpMethod": "GET",
  1600. // "id": "dns.resourceRecordSets.list",
  1601. // "parameterOrder": [
  1602. // "project",
  1603. // "managedZone"
  1604. // ],
  1605. // "parameters": {
  1606. // "managedZone": {
  1607. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  1608. // "location": "path",
  1609. // "required": true,
  1610. // "type": "string"
  1611. // },
  1612. // "maxResults": {
  1613. // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
  1614. // "format": "int32",
  1615. // "location": "query",
  1616. // "type": "integer"
  1617. // },
  1618. // "name": {
  1619. // "description": "Restricts the list to return only records with this fully qualified domain name.",
  1620. // "location": "query",
  1621. // "type": "string"
  1622. // },
  1623. // "pageToken": {
  1624. // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
  1625. // "location": "query",
  1626. // "type": "string"
  1627. // },
  1628. // "project": {
  1629. // "description": "Identifies the project addressed by this request.",
  1630. // "location": "path",
  1631. // "required": true,
  1632. // "type": "string"
  1633. // },
  1634. // "type": {
  1635. // "description": "Restricts the list to return only records of this type. If present, the \"name\" parameter must also be present.",
  1636. // "location": "query",
  1637. // "type": "string"
  1638. // }
  1639. // },
  1640. // "path": "{project}/managedZones/{managedZone}/rrsets",
  1641. // "response": {
  1642. // "$ref": "ResourceRecordSetsListResponse"
  1643. // },
  1644. // "scopes": [
  1645. // "https://www.googleapis.com/auth/cloud-platform",
  1646. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1647. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1648. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1649. // ]
  1650. // }
  1651. }
  1652. // Pages invokes f for each page of results.
  1653. // A non-nil error returned from f will halt the iteration.
  1654. // The provided context supersedes any context provided to the Context method.
  1655. func (c *ResourceRecordSetsListCall) Pages(ctx context.Context, f func(*ResourceRecordSetsListResponse) error) error {
  1656. c.ctx_ = ctx
  1657. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1658. for {
  1659. x, err := c.Do()
  1660. if err != nil {
  1661. return err
  1662. }
  1663. if err := f(x); err != nil {
  1664. return err
  1665. }
  1666. if x.NextPageToken == "" {
  1667. return nil
  1668. }
  1669. c.PageToken(x.NextPageToken)
  1670. }
  1671. }