dns-gen.go 60 KB

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