You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

3783 lines
129 KiB

  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/v2beta1"
  8. // ...
  9. // dnsService, err := dns.New(oauthHttpClient)
  10. package dns // import "google.golang.org/api/dns/v2beta1"
  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:v2beta1"
  41. const apiName = "dns"
  42. const apiVersion = "v2beta1"
  43. const basePath = "https://www.googleapis.com/dns/v2beta1/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.DnsKeys = NewDnsKeysService(s)
  62. s.ManagedZoneOperations = NewManagedZoneOperationsService(s)
  63. s.ManagedZones = NewManagedZonesService(s)
  64. s.Projects = NewProjectsService(s)
  65. s.ResourceRecordSets = NewResourceRecordSetsService(s)
  66. return s, nil
  67. }
  68. type Service struct {
  69. client *http.Client
  70. BasePath string // API endpoint base URL
  71. UserAgent string // optional additional User-Agent fragment
  72. Changes *ChangesService
  73. DnsKeys *DnsKeysService
  74. ManagedZoneOperations *ManagedZoneOperationsService
  75. ManagedZones *ManagedZonesService
  76. Projects *ProjectsService
  77. ResourceRecordSets *ResourceRecordSetsService
  78. }
  79. func (s *Service) userAgent() string {
  80. if s.UserAgent == "" {
  81. return googleapi.UserAgent
  82. }
  83. return googleapi.UserAgent + " " + s.UserAgent
  84. }
  85. func NewChangesService(s *Service) *ChangesService {
  86. rs := &ChangesService{s: s}
  87. return rs
  88. }
  89. type ChangesService struct {
  90. s *Service
  91. }
  92. func NewDnsKeysService(s *Service) *DnsKeysService {
  93. rs := &DnsKeysService{s: s}
  94. return rs
  95. }
  96. type DnsKeysService struct {
  97. s *Service
  98. }
  99. func NewManagedZoneOperationsService(s *Service) *ManagedZoneOperationsService {
  100. rs := &ManagedZoneOperationsService{s: s}
  101. return rs
  102. }
  103. type ManagedZoneOperationsService struct {
  104. s *Service
  105. }
  106. func NewManagedZonesService(s *Service) *ManagedZonesService {
  107. rs := &ManagedZonesService{s: s}
  108. return rs
  109. }
  110. type ManagedZonesService struct {
  111. s *Service
  112. }
  113. func NewProjectsService(s *Service) *ProjectsService {
  114. rs := &ProjectsService{s: s}
  115. return rs
  116. }
  117. type ProjectsService struct {
  118. s *Service
  119. }
  120. func NewResourceRecordSetsService(s *Service) *ResourceRecordSetsService {
  121. rs := &ResourceRecordSetsService{s: s}
  122. return rs
  123. }
  124. type ResourceRecordSetsService struct {
  125. s *Service
  126. }
  127. // Change: An atomic update to a collection of ResourceRecordSets.
  128. type Change struct {
  129. // Additions: Which ResourceRecordSets to add?
  130. Additions []*ResourceRecordSet `json:"additions,omitempty"`
  131. // Deletions: Which ResourceRecordSets to remove? Must match existing
  132. // data exactly.
  133. Deletions []*ResourceRecordSet `json:"deletions,omitempty"`
  134. // Id: Unique identifier for the resource; defined by the server (output
  135. // only).
  136. Id string `json:"id,omitempty"`
  137. // IsServing: If the DNS queries for the zone will be served.
  138. IsServing bool `json:"isServing,omitempty"`
  139. // Kind: Identifies what kind of resource this is. Value: the fixed
  140. // string "dns#change".
  141. Kind string `json:"kind,omitempty"`
  142. // StartTime: The time that this operation was started by the server
  143. // (output only). This is in RFC3339 text format.
  144. StartTime string `json:"startTime,omitempty"`
  145. // Status: Status of the operation (output only).
  146. //
  147. // Possible values:
  148. // "DONE"
  149. // "PENDING"
  150. Status string `json:"status,omitempty"`
  151. // ServerResponse contains the HTTP response code and headers from the
  152. // server.
  153. googleapi.ServerResponse `json:"-"`
  154. // ForceSendFields is a list of field names (e.g. "Additions") to
  155. // unconditionally include in API requests. By default, fields with
  156. // empty values are omitted from API requests. However, any non-pointer,
  157. // non-interface field appearing in ForceSendFields will be sent to the
  158. // server regardless of whether the field is empty or not. This may be
  159. // used to include empty fields in Patch requests.
  160. ForceSendFields []string `json:"-"`
  161. // NullFields is a list of field names (e.g. "Additions") to include in
  162. // API requests with the JSON null value. By default, fields with empty
  163. // values are omitted from API requests. However, any field with an
  164. // empty value appearing in NullFields will be sent to the server as
  165. // null. It is an error if a field in this list has a non-empty value.
  166. // This may be used to include null fields in Patch requests.
  167. NullFields []string `json:"-"`
  168. }
  169. func (s *Change) MarshalJSON() ([]byte, error) {
  170. type NoMethod Change
  171. raw := NoMethod(*s)
  172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  173. }
  174. // ChangesListResponse: The response to a request to enumerate Changes
  175. // to a ResourceRecordSets collection.
  176. type ChangesListResponse struct {
  177. // Changes: The requested changes.
  178. Changes []*Change `json:"changes,omitempty"`
  179. Header *ResponseHeader `json:"header,omitempty"`
  180. // Kind: Type of resource.
  181. Kind string `json:"kind,omitempty"`
  182. // NextPageToken: The presence of this field indicates that there exist
  183. // more results following your last page of results in pagination order.
  184. // To fetch them, make another list request using this value as your
  185. // pagination token.
  186. //
  187. // In this way you can retrieve the complete contents of even very large
  188. // collections one page at a time. However, if the contents of the
  189. // collection change between the first and last paginated list request,
  190. // the set of all elements returned will be an inconsistent view of the
  191. // collection. There is no way to retrieve a "snapshot" of collections
  192. // larger than the maximum page size.
  193. NextPageToken string `json:"nextPageToken,omitempty"`
  194. // ServerResponse contains the HTTP response code and headers from the
  195. // server.
  196. googleapi.ServerResponse `json:"-"`
  197. // ForceSendFields is a list of field names (e.g. "Changes") to
  198. // unconditionally include in API requests. By default, fields with
  199. // empty values are omitted from API requests. However, any non-pointer,
  200. // non-interface field appearing in ForceSendFields will be sent to the
  201. // server regardless of whether the field is empty or not. This may be
  202. // used to include empty fields in Patch requests.
  203. ForceSendFields []string `json:"-"`
  204. // NullFields is a list of field names (e.g. "Changes") to include in
  205. // API requests with the JSON null value. By default, fields with empty
  206. // values are omitted from API requests. However, any field with an
  207. // empty value appearing in NullFields will be sent to the server as
  208. // null. It is an error if a field in this list has a non-empty value.
  209. // This may be used to include null fields in Patch requests.
  210. NullFields []string `json:"-"`
  211. }
  212. func (s *ChangesListResponse) MarshalJSON() ([]byte, error) {
  213. type NoMethod ChangesListResponse
  214. raw := NoMethod(*s)
  215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  216. }
  217. // DnsKey: A DNSSEC key pair.
  218. type DnsKey struct {
  219. // Algorithm: String mnemonic specifying the DNSSEC algorithm of this
  220. // key. Immutable after creation time.
  221. //
  222. // Possible values:
  223. // "ECDSAP256SHA256"
  224. // "ECDSAP384SHA384"
  225. // "RSASHA1"
  226. // "RSASHA256"
  227. // "RSASHA512"
  228. Algorithm string `json:"algorithm,omitempty"`
  229. // CreationTime: The time that this resource was created in the control
  230. // plane. This is in RFC3339 text format. Output only.
  231. CreationTime string `json:"creationTime,omitempty"`
  232. // Description: A mutable string of at most 1024 characters associated
  233. // with this resource for the user's convenience. Has no effect on the
  234. // resource's function.
  235. Description string `json:"description,omitempty"`
  236. // Digests: Cryptographic hashes of the DNSKEY resource record
  237. // associated with this DnsKey. These digests are needed to construct a
  238. // DS record that points at this DNS key. Output only.
  239. Digests []*DnsKeyDigest `json:"digests,omitempty"`
  240. // Id: Unique identifier for the resource; defined by the server (output
  241. // only).
  242. Id string `json:"id,omitempty"`
  243. // IsActive: Active keys will be used to sign subsequent changes to the
  244. // ManagedZone. Inactive keys will still be present as DNSKEY Resource
  245. // Records for the use of resolvers validating existing signatures.
  246. IsActive bool `json:"isActive,omitempty"`
  247. // KeyLength: Length of the key in bits. Specified at creation time then
  248. // immutable.
  249. KeyLength int64 `json:"keyLength,omitempty"`
  250. // KeyTag: The key tag is a non-cryptographic hash of the a DNSKEY
  251. // resource record associated with this DnsKey. The key tag can be used
  252. // to identify a DNSKEY more quickly (but it is not a unique
  253. // identifier). In particular, the key tag is used in a parent zone's DS
  254. // record to point at the DNSKEY in this child ManagedZone. The key tag
  255. // is a number in the range [0, 65535] and the algorithm to calculate it
  256. // is specified in RFC4034 Appendix B. Output only.
  257. KeyTag int64 `json:"keyTag,omitempty"`
  258. // Kind: Identifies what kind of resource this is. Value: the fixed
  259. // string "dns#dnsKey".
  260. Kind string `json:"kind,omitempty"`
  261. // PublicKey: Base64 encoded public half of this key. Output only.
  262. PublicKey string `json:"publicKey,omitempty"`
  263. // Type: One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type
  264. // KEY_SIGNING have the Secure Entry Point flag set and, when active,
  265. // will be used to sign only resource record sets of type DNSKEY.
  266. // Otherwise, the Secure Entry Point flag will be cleared and this key
  267. // will be used to sign only resource record sets of other types.
  268. // Immutable after creation time.
  269. //
  270. // Possible values:
  271. // "KEY_SIGNING"
  272. // "ZONE_SIGNING"
  273. Type string `json:"type,omitempty"`
  274. // ServerResponse contains the HTTP response code and headers from the
  275. // server.
  276. googleapi.ServerResponse `json:"-"`
  277. // ForceSendFields is a list of field names (e.g. "Algorithm") to
  278. // unconditionally include in API requests. By default, fields with
  279. // empty values are omitted from API requests. However, any non-pointer,
  280. // non-interface field appearing in ForceSendFields will be sent to the
  281. // server regardless of whether the field is empty or not. This may be
  282. // used to include empty fields in Patch requests.
  283. ForceSendFields []string `json:"-"`
  284. // NullFields is a list of field names (e.g. "Algorithm") to include in
  285. // API requests with the JSON null value. By default, fields with empty
  286. // values are omitted from API requests. However, any field with an
  287. // empty value appearing in NullFields will be sent to the server as
  288. // null. It is an error if a field in this list has a non-empty value.
  289. // This may be used to include null fields in Patch requests.
  290. NullFields []string `json:"-"`
  291. }
  292. func (s *DnsKey) MarshalJSON() ([]byte, error) {
  293. type NoMethod DnsKey
  294. raw := NoMethod(*s)
  295. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  296. }
  297. type DnsKeyDigest struct {
  298. // Digest: The base-16 encoded bytes of this digest. Suitable for use in
  299. // a DS resource record.
  300. Digest string `json:"digest,omitempty"`
  301. // Type: Specifies the algorithm used to calculate this digest.
  302. //
  303. // Possible values:
  304. // "SHA1"
  305. // "SHA256"
  306. // "SHA384"
  307. Type string `json:"type,omitempty"`
  308. // ForceSendFields is a list of field names (e.g. "Digest") to
  309. // unconditionally include in API requests. By default, fields with
  310. // empty values are omitted from API requests. However, any non-pointer,
  311. // non-interface field appearing in ForceSendFields will be sent to the
  312. // server regardless of whether the field is empty or not. This may be
  313. // used to include empty fields in Patch requests.
  314. ForceSendFields []string `json:"-"`
  315. // NullFields is a list of field names (e.g. "Digest") to include in API
  316. // requests with the JSON null value. By default, fields with empty
  317. // values are omitted from API requests. However, any field with an
  318. // empty value appearing in NullFields will be sent to the server as
  319. // null. It is an error if a field in this list has a non-empty value.
  320. // This may be used to include null fields in Patch requests.
  321. NullFields []string `json:"-"`
  322. }
  323. func (s *DnsKeyDigest) MarshalJSON() ([]byte, error) {
  324. type NoMethod DnsKeyDigest
  325. raw := NoMethod(*s)
  326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  327. }
  328. // DnsKeySpec: Parameters for DnsKey key generation. Used for generating
  329. // initial keys for a new ManagedZone and as default when adding a new
  330. // DnsKey.
  331. type DnsKeySpec struct {
  332. // Algorithm: String mnemonic specifying the DNSSEC algorithm of this
  333. // key.
  334. //
  335. // Possible values:
  336. // "ECDSAP256SHA256"
  337. // "ECDSAP384SHA384"
  338. // "RSASHA1"
  339. // "RSASHA256"
  340. // "RSASHA512"
  341. Algorithm string `json:"algorithm,omitempty"`
  342. // KeyLength: Length of the keys in bits.
  343. KeyLength int64 `json:"keyLength,omitempty"`
  344. // KeyType: One of "KEY_SIGNING" or "ZONE_SIGNING". Keys of type
  345. // KEY_SIGNING have the Secure Entry Point flag set and, when active,
  346. // will be used to sign only resource record sets of type DNSKEY.
  347. // Otherwise, the Secure Entry Point flag will be cleared and this key
  348. // will be used to sign only resource record sets of other types.
  349. //
  350. // Possible values:
  351. // "KEY_SIGNING"
  352. // "ZONE_SIGNING"
  353. KeyType string `json:"keyType,omitempty"`
  354. // Kind: Identifies what kind of resource this is. Value: the fixed
  355. // string "dns#dnsKeySpec".
  356. Kind string `json:"kind,omitempty"`
  357. // ForceSendFields is a list of field names (e.g. "Algorithm") to
  358. // unconditionally include in API requests. By default, fields with
  359. // empty values are omitted from API requests. However, any non-pointer,
  360. // non-interface field appearing in ForceSendFields will be sent to the
  361. // server regardless of whether the field is empty or not. This may be
  362. // used to include empty fields in Patch requests.
  363. ForceSendFields []string `json:"-"`
  364. // NullFields is a list of field names (e.g. "Algorithm") to include in
  365. // API requests with the JSON null value. By default, fields with empty
  366. // values are omitted from API requests. However, any field with an
  367. // empty value appearing in NullFields will be sent to the server as
  368. // null. It is an error if a field in this list has a non-empty value.
  369. // This may be used to include null fields in Patch requests.
  370. NullFields []string `json:"-"`
  371. }
  372. func (s *DnsKeySpec) MarshalJSON() ([]byte, error) {
  373. type NoMethod DnsKeySpec
  374. raw := NoMethod(*s)
  375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  376. }
  377. // DnsKeysListResponse: The response to a request to enumerate DnsKeys
  378. // in a ManagedZone.
  379. type DnsKeysListResponse struct {
  380. // DnsKeys: The requested resources.
  381. DnsKeys []*DnsKey `json:"dnsKeys,omitempty"`
  382. Header *ResponseHeader `json:"header,omitempty"`
  383. // Kind: Type of resource.
  384. Kind string `json:"kind,omitempty"`
  385. // NextPageToken: The presence of this field indicates that there exist
  386. // more results following your last page of results in pagination order.
  387. // To fetch them, make another list request using this value as your
  388. // pagination token.
  389. //
  390. // In this way you can retrieve the complete contents of even very large
  391. // collections one page at a time. However, if the contents of the
  392. // collection change between the first and last paginated list request,
  393. // the set of all elements returned will be an inconsistent view of the
  394. // collection. There is no way to retrieve a "snapshot" of collections
  395. // larger than the maximum page size.
  396. NextPageToken string `json:"nextPageToken,omitempty"`
  397. // ServerResponse contains the HTTP response code and headers from the
  398. // server.
  399. googleapi.ServerResponse `json:"-"`
  400. // ForceSendFields is a list of field names (e.g. "DnsKeys") to
  401. // unconditionally include in API requests. By default, fields with
  402. // empty values are omitted from API requests. However, any non-pointer,
  403. // non-interface field appearing in ForceSendFields will be sent to the
  404. // server regardless of whether the field is empty or not. This may be
  405. // used to include empty fields in Patch requests.
  406. ForceSendFields []string `json:"-"`
  407. // NullFields is a list of field names (e.g. "DnsKeys") to include in
  408. // API requests with the JSON null value. By default, fields with empty
  409. // values are omitted from API requests. However, any field with an
  410. // empty value appearing in NullFields will be sent to the server as
  411. // null. It is an error if a field in this list has a non-empty value.
  412. // This may be used to include null fields in Patch requests.
  413. NullFields []string `json:"-"`
  414. }
  415. func (s *DnsKeysListResponse) MarshalJSON() ([]byte, error) {
  416. type NoMethod DnsKeysListResponse
  417. raw := NoMethod(*s)
  418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  419. }
  420. // ManagedZone: A zone is a subtree of the DNS namespace under one
  421. // administrative responsibility. A ManagedZone is a resource that
  422. // represents a DNS zone hosted by the Cloud DNS service.
  423. type ManagedZone struct {
  424. // CreationTime: The time that this resource was created on the server.
  425. // This is in RFC3339 text format. Output only.
  426. CreationTime string `json:"creationTime,omitempty"`
  427. // Description: A mutable string of at most 1024 characters associated
  428. // with this resource for the user's convenience. Has no effect on the
  429. // managed zone's function.
  430. Description string `json:"description,omitempty"`
  431. // DnsName: The DNS name of this managed zone, for instance
  432. // "example.com.".
  433. DnsName string `json:"dnsName,omitempty"`
  434. // DnssecConfig: DNSSEC configuration.
  435. DnssecConfig *ManagedZoneDnsSecConfig `json:"dnssecConfig,omitempty"`
  436. // Id: Unique identifier for the resource; defined by the server (output
  437. // only)
  438. Id uint64 `json:"id,omitempty,string"`
  439. // Kind: Identifies what kind of resource this is. Value: the fixed
  440. // string "dns#managedZone".
  441. Kind string `json:"kind,omitempty"`
  442. // Labels: User labels.
  443. Labels map[string]string `json:"labels,omitempty"`
  444. // Name: User assigned name for this resource. Must be unique within the
  445. // project. The name must be 1-63 characters long, must begin with a
  446. // letter, end with a letter or digit, and only contain lowercase
  447. // letters, digits or dashes.
  448. Name string `json:"name,omitempty"`
  449. // NameServerSet: Optionally specifies the NameServerSet for this
  450. // ManagedZone. A NameServerSet is a set of DNS name servers that all
  451. // host the same ManagedZones. Most users will leave this field unset.
  452. NameServerSet string `json:"nameServerSet,omitempty"`
  453. // NameServers: Delegate your managed_zone to these virtual name
  454. // servers; defined by the server (output only)
  455. NameServers []string `json:"nameServers,omitempty"`
  456. // ServerResponse contains the HTTP response code and headers from the
  457. // server.
  458. googleapi.ServerResponse `json:"-"`
  459. // ForceSendFields is a list of field names (e.g. "CreationTime") to
  460. // unconditionally include in API requests. By default, fields with
  461. // empty values are omitted from API requests. However, any non-pointer,
  462. // non-interface field appearing in ForceSendFields will be sent to the
  463. // server regardless of whether the field is empty or not. This may be
  464. // used to include empty fields in Patch requests.
  465. ForceSendFields []string `json:"-"`
  466. // NullFields is a list of field names (e.g. "CreationTime") to include
  467. // in API requests with the JSON null value. By default, fields with
  468. // empty values are omitted from API requests. However, any field with
  469. // an empty value appearing in NullFields will be sent to the server as
  470. // null. It is an error if a field in this list has a non-empty value.
  471. // This may be used to include null fields in Patch requests.
  472. NullFields []string `json:"-"`
  473. }
  474. func (s *ManagedZone) MarshalJSON() ([]byte, error) {
  475. type NoMethod ManagedZone
  476. raw := NoMethod(*s)
  477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  478. }
  479. type ManagedZoneDnsSecConfig struct {
  480. // DefaultKeySpecs: Specifies parameters that will be used for
  481. // generating initial DnsKeys for this ManagedZone. Output only while
  482. // state is not OFF.
  483. DefaultKeySpecs []*DnsKeySpec `json:"defaultKeySpecs,omitempty"`
  484. // Kind: Identifies what kind of resource this is. Value: the fixed
  485. // string "dns#managedZoneDnsSecConfig".
  486. Kind string `json:"kind,omitempty"`
  487. // NonExistence: Specifies the mechanism used to provide authenticated
  488. // denial-of-existence responses. Output only while state is not OFF.
  489. //
  490. // Possible values:
  491. // "NSEC"
  492. // "NSEC3"
  493. NonExistence string `json:"nonExistence,omitempty"`
  494. // State: Specifies whether DNSSEC is enabled, and what mode it is in.
  495. //
  496. // Possible values:
  497. // "OFF"
  498. // "ON"
  499. // "TRANSFER"
  500. State string `json:"state,omitempty"`
  501. // ForceSendFields is a list of field names (e.g. "DefaultKeySpecs") to
  502. // unconditionally include in API requests. By default, fields with
  503. // empty values are omitted from API requests. However, any non-pointer,
  504. // non-interface field appearing in ForceSendFields will be sent to the
  505. // server regardless of whether the field is empty or not. This may be
  506. // used to include empty fields in Patch requests.
  507. ForceSendFields []string `json:"-"`
  508. // NullFields is a list of field names (e.g. "DefaultKeySpecs") to
  509. // include in API requests with the JSON null value. By default, fields
  510. // with empty values are omitted from API requests. However, any field
  511. // with an empty value appearing in NullFields will be sent to the
  512. // server as null. It is an error if a field in this list has a
  513. // non-empty value. This may be used to include null fields in Patch
  514. // requests.
  515. NullFields []string `json:"-"`
  516. }
  517. func (s *ManagedZoneDnsSecConfig) MarshalJSON() ([]byte, error) {
  518. type NoMethod ManagedZoneDnsSecConfig
  519. raw := NoMethod(*s)
  520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  521. }
  522. type ManagedZoneOperationsListResponse struct {
  523. Header *ResponseHeader `json:"header,omitempty"`
  524. // Kind: Type of resource.
  525. Kind string `json:"kind,omitempty"`
  526. // NextPageToken: The presence of this field indicates that there exist
  527. // more results following your last page of results in pagination order.
  528. // To fetch them, make another list request using this value as your
  529. // page token.
  530. //
  531. // In this way you can retrieve the complete contents of even very large
  532. // collections one page at a time. However, if the contents of the
  533. // collection change between the first and last paginated list request,
  534. // the set of all elements returned will be an inconsistent view of the
  535. // collection. There is no way to retrieve a consistent snapshot of a
  536. // collection larger than the maximum page size.
  537. NextPageToken string `json:"nextPageToken,omitempty"`
  538. // Operations: The operation resources.
  539. Operations []*Operation `json:"operations,omitempty"`
  540. // ServerResponse contains the HTTP response code and headers from the
  541. // server.
  542. googleapi.ServerResponse `json:"-"`
  543. // ForceSendFields is a list of field names (e.g. "Header") to
  544. // unconditionally include in API requests. By default, fields with
  545. // empty values are omitted from API requests. However, any non-pointer,
  546. // non-interface field appearing in ForceSendFields will be sent to the
  547. // server regardless of whether the field is empty or not. This may be
  548. // used to include empty fields in Patch requests.
  549. ForceSendFields []string `json:"-"`
  550. // NullFields is a list of field names (e.g. "Header") to include in API
  551. // requests with the JSON null value. By default, fields with empty
  552. // values are omitted from API requests. However, any field with an
  553. // empty value appearing in NullFields will be sent to the server as
  554. // null. It is an error if a field in this list has a non-empty value.
  555. // This may be used to include null fields in Patch requests.
  556. NullFields []string `json:"-"`
  557. }
  558. func (s *ManagedZoneOperationsListResponse) MarshalJSON() ([]byte, error) {
  559. type NoMethod ManagedZoneOperationsListResponse
  560. raw := NoMethod(*s)
  561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  562. }
  563. type ManagedZonesListResponse struct {
  564. Header *ResponseHeader `json:"header,omitempty"`
  565. // Kind: Type of resource.
  566. Kind string `json:"kind,omitempty"`
  567. // ManagedZones: The managed zone resources.
  568. ManagedZones []*ManagedZone `json:"managedZones,omitempty"`
  569. // NextPageToken: The presence of this field indicates that there exist
  570. // more results following your last page of results in pagination order.
  571. // To fetch them, make another list request using this value as your
  572. // page token.
  573. //
  574. // In this way you can retrieve the complete contents of even very large
  575. // collections one page at a time. However, if the contents of the
  576. // collection change between the first and last paginated list request,
  577. // the set of all elements returned will be an inconsistent view of the
  578. // collection. There is no way to retrieve a consistent snapshot of a
  579. // collection larger than the maximum page size.
  580. NextPageToken string `json:"nextPageToken,omitempty"`
  581. // ServerResponse contains the HTTP response code and headers from the
  582. // server.
  583. googleapi.ServerResponse `json:"-"`
  584. // ForceSendFields is a list of field names (e.g. "Header") to
  585. // unconditionally include in API requests. By default, fields with
  586. // empty values are omitted from API requests. However, any non-pointer,
  587. // non-interface field appearing in ForceSendFields will be sent to the
  588. // server regardless of whether the field is empty or not. This may be
  589. // used to include empty fields in Patch requests.
  590. ForceSendFields []string `json:"-"`
  591. // NullFields is a list of field names (e.g. "Header") to include in API
  592. // requests with the JSON null value. By default, fields with empty
  593. // values are omitted from API requests. However, any field with an
  594. // empty value appearing in NullFields will be sent to the server as
  595. // null. It is an error if a field in this list has a non-empty value.
  596. // This may be used to include null fields in Patch requests.
  597. NullFields []string `json:"-"`
  598. }
  599. func (s *ManagedZonesListResponse) MarshalJSON() ([]byte, error) {
  600. type NoMethod ManagedZonesListResponse
  601. raw := NoMethod(*s)
  602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  603. }
  604. // Operation: An operation represents a successful mutation performed on
  605. // a Cloud DNS resource. Operations provide: - An audit log of server
  606. // resource mutations. - A way to recover/retry API calls in the case
  607. // where the response is never received by the caller. Use the caller
  608. // specified client_operation_id.
  609. type Operation struct {
  610. // DnsKeyContext: Only populated if the operation targeted a DnsKey
  611. // (output only).
  612. DnsKeyContext *OperationDnsKeyContext `json:"dnsKeyContext,omitempty"`
  613. // Id: Unique identifier for the resource. This is the
  614. // client_operation_id if the client specified it when the mutation was
  615. // initiated, otherwise, it is generated by the server. The name must be
  616. // 1-63 characters long and match the regular expression [-a-z0-9]?
  617. // (output only)
  618. Id string `json:"id,omitempty"`
  619. // Kind: Identifies what kind of resource this is. Value: the fixed
  620. // string "dns#operation".
  621. Kind string `json:"kind,omitempty"`
  622. // StartTime: The time that this operation was started by the server.
  623. // This is in RFC3339 text format (output only).
  624. StartTime string `json:"startTime,omitempty"`
  625. // Status: Status of the operation. Can be one of the following:
  626. // "PENDING" or "DONE" (output only).
  627. //
  628. // Possible values:
  629. // "DONE"
  630. // "PENDING"
  631. Status string `json:"status,omitempty"`
  632. // Type: Type of the operation. Operations include insert, update, and
  633. // delete (output only).
  634. Type string `json:"type,omitempty"`
  635. // User: User who requested the operation, for example:
  636. // user@example.com. cloud-dns-system for operations automatically done
  637. // by the system. (output only)
  638. User string `json:"user,omitempty"`
  639. // ZoneContext: Only populated if the operation targeted a ManagedZone
  640. // (output only).
  641. ZoneContext *OperationManagedZoneContext `json:"zoneContext,omitempty"`
  642. // ServerResponse contains the HTTP response code and headers from the
  643. // server.
  644. googleapi.ServerResponse `json:"-"`
  645. // ForceSendFields is a list of field names (e.g. "DnsKeyContext") to
  646. // unconditionally include in API requests. By default, fields with
  647. // empty values are omitted from API requests. However, any non-pointer,
  648. // non-interface field appearing in ForceSendFields will be sent to the
  649. // server regardless of whether the field is empty or not. This may be
  650. // used to include empty fields in Patch requests.
  651. ForceSendFields []string `json:"-"`
  652. // NullFields is a list of field names (e.g. "DnsKeyContext") to include
  653. // in API requests with the JSON null value. By default, fields with
  654. // empty values are omitted from API requests. However, any field with
  655. // an empty value appearing in NullFields will be sent to the server as
  656. // null. It is an error if a field in this list has a non-empty value.
  657. // This may be used to include null fields in Patch requests.
  658. NullFields []string `json:"-"`
  659. }
  660. func (s *Operation) MarshalJSON() ([]byte, error) {
  661. type NoMethod Operation
  662. raw := NoMethod(*s)
  663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  664. }
  665. type OperationDnsKeyContext struct {
  666. // NewValue: The post-operation DnsKey resource.
  667. NewValue *DnsKey `json:"newValue,omitempty"`
  668. // OldValue: The pre-operation DnsKey resource.
  669. OldValue *DnsKey `json:"oldValue,omitempty"`
  670. // ForceSendFields is a list of field names (e.g. "NewValue") to
  671. // unconditionally include in API requests. By default, fields with
  672. // empty values are omitted from API requests. However, any non-pointer,
  673. // non-interface field appearing in ForceSendFields will be sent to the
  674. // server regardless of whether the field is empty or not. This may be
  675. // used to include empty fields in Patch requests.
  676. ForceSendFields []string `json:"-"`
  677. // NullFields is a list of field names (e.g. "NewValue") to include in
  678. // API requests with the JSON null value. By default, fields with empty
  679. // values are omitted from API requests. However, any field with an
  680. // empty value appearing in NullFields will be sent to the server as
  681. // null. It is an error if a field in this list has a non-empty value.
  682. // This may be used to include null fields in Patch requests.
  683. NullFields []string `json:"-"`
  684. }
  685. func (s *OperationDnsKeyContext) MarshalJSON() ([]byte, error) {
  686. type NoMethod OperationDnsKeyContext
  687. raw := NoMethod(*s)
  688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  689. }
  690. type OperationManagedZoneContext struct {
  691. // NewValue: The post-operation ManagedZone resource.
  692. NewValue *ManagedZone `json:"newValue,omitempty"`
  693. // OldValue: The pre-operation ManagedZone resource.
  694. OldValue *ManagedZone `json:"oldValue,omitempty"`
  695. // ForceSendFields is a list of field names (e.g. "NewValue") to
  696. // unconditionally include in API requests. By default, fields with
  697. // empty values are omitted from API requests. However, any non-pointer,
  698. // non-interface field appearing in ForceSendFields will be sent to the
  699. // server regardless of whether the field is empty or not. This may be
  700. // used to include empty fields in Patch requests.
  701. ForceSendFields []string `json:"-"`
  702. // NullFields is a list of field names (e.g. "NewValue") to include in
  703. // API requests with the JSON null value. By default, fields with empty
  704. // values are omitted from API requests. However, any field with an
  705. // empty value appearing in NullFields will be sent to the server as
  706. // null. It is an error if a field in this list has a non-empty value.
  707. // This may be used to include null fields in Patch requests.
  708. NullFields []string `json:"-"`
  709. }
  710. func (s *OperationManagedZoneContext) MarshalJSON() ([]byte, error) {
  711. type NoMethod OperationManagedZoneContext
  712. raw := NoMethod(*s)
  713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  714. }
  715. // Project: A project resource. The project is a top level container for
  716. // resources including Cloud DNS ManagedZones. Projects can be created
  717. // only in the APIs console.
  718. type Project struct {
  719. // Id: User assigned unique identifier for the resource (output only).
  720. Id string `json:"id,omitempty"`
  721. // Kind: Identifies what kind of resource this is. Value: the fixed
  722. // string "dns#project".
  723. Kind string `json:"kind,omitempty"`
  724. // Number: Unique numeric identifier for the resource; defined by the
  725. // server (output only).
  726. Number uint64 `json:"number,omitempty,string"`
  727. // Quota: Quotas assigned to this project (output only).
  728. Quota *Quota `json:"quota,omitempty"`
  729. // ServerResponse contains the HTTP response code and headers from the
  730. // server.
  731. googleapi.ServerResponse `json:"-"`
  732. // ForceSendFields is a list of field names (e.g. "Id") to
  733. // unconditionally include in API requests. By default, fields with
  734. // empty values are omitted from API requests. However, any non-pointer,
  735. // non-interface field appearing in ForceSendFields will be sent to the
  736. // server regardless of whether the field is empty or not. This may be
  737. // used to include empty fields in Patch requests.
  738. ForceSendFields []string `json:"-"`
  739. // NullFields is a list of field names (e.g. "Id") to include in API
  740. // requests with the JSON null value. By default, fields with empty
  741. // values are omitted from API requests. However, any field with an
  742. // empty value appearing in NullFields will be sent to the server as
  743. // null. It is an error if a field in this list has a non-empty value.
  744. // This may be used to include null fields in Patch requests.
  745. NullFields []string `json:"-"`
  746. }
  747. func (s *Project) MarshalJSON() ([]byte, error) {
  748. type NoMethod Project
  749. raw := NoMethod(*s)
  750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  751. }
  752. // Quota: Limits associated with a Project.
  753. type Quota struct {
  754. // BlackHoleHidesSystemZones: Whether a black hole zone should suppress
  755. // system zones for this project.
  756. BlackHoleHidesSystemZones bool `json:"blackHoleHidesSystemZones,omitempty"`
  757. // DnsKeysPerManagedZone: Maximum allowed number of DnsKeys per
  758. // ManagedZone.
  759. DnsKeysPerManagedZone int64 `json:"dnsKeysPerManagedZone,omitempty"`
  760. // Kind: Identifies what kind of resource this is. Value: the fixed
  761. // string "dns#quota".
  762. Kind string `json:"kind,omitempty"`
  763. // ManagedZones: Maximum allowed number of managed zones in the project.
  764. ManagedZones int64 `json:"managedZones,omitempty"`
  765. // ResourceRecordsPerRrset: Maximum allowed number of ResourceRecords
  766. // per ResourceRecordSet.
  767. ResourceRecordsPerRrset int64 `json:"resourceRecordsPerRrset,omitempty"`
  768. // RrsetAdditionsPerChange: Maximum allowed number of ResourceRecordSets
  769. // to add per ChangesCreateRequest.
  770. RrsetAdditionsPerChange int64 `json:"rrsetAdditionsPerChange,omitempty"`
  771. // RrsetDeletionsPerChange: Maximum allowed number of ResourceRecordSets
  772. // to delete per ChangesCreateRequest.
  773. RrsetDeletionsPerChange int64 `json:"rrsetDeletionsPerChange,omitempty"`
  774. // RrsetsPerManagedZone: Maximum allowed number of ResourceRecordSets
  775. // per zone in the project.
  776. RrsetsPerManagedZone int64 `json:"rrsetsPerManagedZone,omitempty"`
  777. // TotalRrdataSizePerChange: Maximum allowed size for total rrdata in
  778. // one ChangesCreateRequest in bytes.
  779. TotalRrdataSizePerChange int64 `json:"totalRrdataSizePerChange,omitempty"`
  780. // WhitelistedKeySpecs: DNSSEC algorithm and key length types that can
  781. // be used for DnsKeys.
  782. WhitelistedKeySpecs []*DnsKeySpec `json:"whitelistedKeySpecs,omitempty"`
  783. // ForceSendFields is a list of field names (e.g.
  784. // "BlackHoleHidesSystemZones") to unconditionally include in API
  785. // requests. By default, fields with empty values are omitted from API
  786. // requests. However, any non-pointer, non-interface field appearing in
  787. // ForceSendFields will be sent to the server regardless of whether the
  788. // field is empty or not. This may be used to include empty fields in
  789. // Patch requests.
  790. ForceSendFields []string `json:"-"`
  791. // NullFields is a list of field names (e.g.
  792. // "BlackHoleHidesSystemZones") to include in API requests with the JSON
  793. // null value. By default, fields with empty values are omitted from API
  794. // requests. However, any field with an empty value appearing in
  795. // NullFields will be sent to the server as null. It is an error if a
  796. // field in this list has a non-empty value. This may be used to include
  797. // null fields in Patch requests.
  798. NullFields []string `json:"-"`
  799. }
  800. func (s *Quota) MarshalJSON() ([]byte, error) {
  801. type NoMethod Quota
  802. raw := NoMethod(*s)
  803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  804. }
  805. // ResourceRecordSet: A unit of data that will be returned by the DNS
  806. // servers.
  807. type ResourceRecordSet struct {
  808. // Kind: Identifies what kind of resource this is. Value: the fixed
  809. // string "dns#resourceRecordSet".
  810. Kind string `json:"kind,omitempty"`
  811. // Name: For example, www.example.com.
  812. Name string `json:"name,omitempty"`
  813. // Rrdatas: As defined in RFC 1035 (section 5) and RFC 1034 (section
  814. // 3.6.1).
  815. Rrdatas []string `json:"rrdatas,omitempty"`
  816. // SignatureRrdatas: As defined in RFC 4034 (section 3.2).
  817. SignatureRrdatas []string `json:"signatureRrdatas,omitempty"`
  818. // Ttl: Number of seconds that this ResourceRecordSet can be cached by
  819. // resolvers.
  820. Ttl int64 `json:"ttl,omitempty"`
  821. // Type: The identifier of a supported record type, for example, A,
  822. // AAAA, MX, TXT, and so on.
  823. Type string `json:"type,omitempty"`
  824. // ForceSendFields is a list of field names (e.g. "Kind") to
  825. // unconditionally include in API requests. By default, fields with
  826. // empty values are omitted from API requests. However, any non-pointer,
  827. // non-interface field appearing in ForceSendFields will be sent to the
  828. // server regardless of whether the field is empty or not. This may be
  829. // used to include empty fields in Patch requests.
  830. ForceSendFields []string `json:"-"`
  831. // NullFields is a list of field names (e.g. "Kind") to include in API
  832. // requests with the JSON null value. By default, fields with empty
  833. // values are omitted from API requests. However, any field with an
  834. // empty value appearing in NullFields will be sent to the server as
  835. // null. It is an error if a field in this list has a non-empty value.
  836. // This may be used to include null fields in Patch requests.
  837. NullFields []string `json:"-"`
  838. }
  839. func (s *ResourceRecordSet) MarshalJSON() ([]byte, error) {
  840. type NoMethod ResourceRecordSet
  841. raw := NoMethod(*s)
  842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  843. }
  844. type ResourceRecordSetsListResponse struct {
  845. Header *ResponseHeader `json:"header,omitempty"`
  846. // Kind: Type of resource.
  847. Kind string `json:"kind,omitempty"`
  848. // NextPageToken: The presence of this field indicates that there exist
  849. // more results following your last page of results in pagination order.
  850. // To fetch them, make another list request using this value as your
  851. // pagination token.
  852. //
  853. // In this way you can retrieve the complete contents of even very large
  854. // collections one page at a time. However, if the contents of the
  855. // collection change between the first and last paginated list request,
  856. // the set of all elements returned will be an inconsistent view of the
  857. // collection. There is no way to retrieve a consistent snapshot of a
  858. // collection larger than the maximum page size.
  859. NextPageToken string `json:"nextPageToken,omitempty"`
  860. // Rrsets: The resource record set resources.
  861. Rrsets []*ResourceRecordSet `json:"rrsets,omitempty"`
  862. // ServerResponse contains the HTTP response code and headers from the
  863. // server.
  864. googleapi.ServerResponse `json:"-"`
  865. // ForceSendFields is a list of field names (e.g. "Header") to
  866. // unconditionally include in API requests. By default, fields with
  867. // empty values are omitted from API requests. However, any non-pointer,
  868. // non-interface field appearing in ForceSendFields will be sent to the
  869. // server regardless of whether the field is empty or not. This may be
  870. // used to include empty fields in Patch requests.
  871. ForceSendFields []string `json:"-"`
  872. // NullFields is a list of field names (e.g. "Header") to include in API
  873. // requests with the JSON null value. By default, fields with empty
  874. // values are omitted from API requests. However, any field with an
  875. // empty value appearing in NullFields will be sent to the server as
  876. // null. It is an error if a field in this list has a non-empty value.
  877. // This may be used to include null fields in Patch requests.
  878. NullFields []string `json:"-"`
  879. }
  880. func (s *ResourceRecordSetsListResponse) MarshalJSON() ([]byte, error) {
  881. type NoMethod ResourceRecordSetsListResponse
  882. raw := NoMethod(*s)
  883. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  884. }
  885. // ResponseHeader: Elements common to every response.
  886. type ResponseHeader struct {
  887. // OperationId: For mutating operation requests that completed
  888. // successfully. This is the client_operation_id if the client specified
  889. // it, otherwise it is generated by the server (output only).
  890. OperationId string `json:"operationId,omitempty"`
  891. // ForceSendFields is a list of field names (e.g. "OperationId") to
  892. // unconditionally include in API requests. By default, fields with
  893. // empty values are omitted from API requests. However, any non-pointer,
  894. // non-interface field appearing in ForceSendFields will be sent to the
  895. // server regardless of whether the field is empty or not. This may be
  896. // used to include empty fields in Patch requests.
  897. ForceSendFields []string `json:"-"`
  898. // NullFields is a list of field names (e.g. "OperationId") to include
  899. // in API requests with the JSON null value. By default, fields with
  900. // empty values are omitted from API requests. However, any field with
  901. // an empty value appearing in NullFields will be sent to the server as
  902. // null. It is an error if a field in this list has a non-empty value.
  903. // This may be used to include null fields in Patch requests.
  904. NullFields []string `json:"-"`
  905. }
  906. func (s *ResponseHeader) MarshalJSON() ([]byte, error) {
  907. type NoMethod ResponseHeader
  908. raw := NoMethod(*s)
  909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  910. }
  911. // method id "dns.changes.create":
  912. type ChangesCreateCall struct {
  913. s *Service
  914. project string
  915. managedZone string
  916. change *Change
  917. urlParams_ gensupport.URLParams
  918. ctx_ context.Context
  919. header_ http.Header
  920. }
  921. // Create: Atomically update the ResourceRecordSet collection.
  922. func (r *ChangesService) Create(project string, managedZone string, change *Change) *ChangesCreateCall {
  923. c := &ChangesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  924. c.project = project
  925. c.managedZone = managedZone
  926. c.change = change
  927. return c
  928. }
  929. // ClientOperationId sets the optional parameter "clientOperationId":
  930. // For mutating operation requests only. An optional identifier
  931. // specified by the client. Must be unique for operation resources in
  932. // the Operations collection.
  933. func (c *ChangesCreateCall) ClientOperationId(clientOperationId string) *ChangesCreateCall {
  934. c.urlParams_.Set("clientOperationId", clientOperationId)
  935. return c
  936. }
  937. // Fields allows partial responses to be retrieved. See
  938. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  939. // for more information.
  940. func (c *ChangesCreateCall) Fields(s ...googleapi.Field) *ChangesCreateCall {
  941. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  942. return c
  943. }
  944. // Context sets the context to be used in this call's Do method. Any
  945. // pending HTTP request will be aborted if the provided context is
  946. // canceled.
  947. func (c *ChangesCreateCall) Context(ctx context.Context) *ChangesCreateCall {
  948. c.ctx_ = ctx
  949. return c
  950. }
  951. // Header returns an http.Header that can be modified by the caller to
  952. // add HTTP headers to the request.
  953. func (c *ChangesCreateCall) Header() http.Header {
  954. if c.header_ == nil {
  955. c.header_ = make(http.Header)
  956. }
  957. return c.header_
  958. }
  959. func (c *ChangesCreateCall) doRequest(alt string) (*http.Response, error) {
  960. reqHeaders := make(http.Header)
  961. for k, v := range c.header_ {
  962. reqHeaders[k] = v
  963. }
  964. reqHeaders.Set("User-Agent", c.s.userAgent())
  965. var body io.Reader = nil
  966. body, err := googleapi.WithoutDataWrapper.JSONReader(c.change)
  967. if err != nil {
  968. return nil, err
  969. }
  970. reqHeaders.Set("Content-Type", "application/json")
  971. c.urlParams_.Set("alt", alt)
  972. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
  973. urls += "?" + c.urlParams_.Encode()
  974. req, _ := http.NewRequest("POST", urls, body)
  975. req.Header = reqHeaders
  976. googleapi.Expand(req.URL, map[string]string{
  977. "project": c.project,
  978. "managedZone": c.managedZone,
  979. })
  980. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  981. }
  982. // Do executes the "dns.changes.create" call.
  983. // Exactly one of *Change or error will be non-nil. Any non-2xx status
  984. // code is an error. Response headers are in either
  985. // *Change.ServerResponse.Header or (if a response was returned at all)
  986. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  987. // check whether the returned error was because http.StatusNotModified
  988. // was returned.
  989. func (c *ChangesCreateCall) Do(opts ...googleapi.CallOption) (*Change, error) {
  990. gensupport.SetOptions(c.urlParams_, opts...)
  991. res, err := c.doRequest("json")
  992. if res != nil && res.StatusCode == http.StatusNotModified {
  993. if res.Body != nil {
  994. res.Body.Close()
  995. }
  996. return nil, &googleapi.Error{
  997. Code: res.StatusCode,
  998. Header: res.Header,
  999. }
  1000. }
  1001. if err != nil {
  1002. return nil, err
  1003. }
  1004. defer googleapi.CloseBody(res)
  1005. if err := googleapi.CheckResponse(res); err != nil {
  1006. return nil, err
  1007. }
  1008. ret := &Change{
  1009. ServerResponse: googleapi.ServerResponse{
  1010. Header: res.Header,
  1011. HTTPStatusCode: res.StatusCode,
  1012. },
  1013. }
  1014. target := &ret
  1015. if err := gensupport.DecodeResponse(target, res); err != nil {
  1016. return nil, err
  1017. }
  1018. return ret, nil
  1019. // {
  1020. // "description": "Atomically update the ResourceRecordSet collection.",
  1021. // "httpMethod": "POST",
  1022. // "id": "dns.changes.create",
  1023. // "parameterOrder": [
  1024. // "project",
  1025. // "managedZone"
  1026. // ],
  1027. // "parameters": {
  1028. // "clientOperationId": {
  1029. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  1030. // "location": "query",
  1031. // "type": "string"
  1032. // },
  1033. // "managedZone": {
  1034. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  1035. // "location": "path",
  1036. // "required": true,
  1037. // "type": "string"
  1038. // },
  1039. // "project": {
  1040. // "description": "Identifies the project addressed by this request.",
  1041. // "location": "path",
  1042. // "required": true,
  1043. // "type": "string"
  1044. // }
  1045. // },
  1046. // "path": "{project}/managedZones/{managedZone}/changes",
  1047. // "request": {
  1048. // "$ref": "Change"
  1049. // },
  1050. // "response": {
  1051. // "$ref": "Change"
  1052. // },
  1053. // "scopes": [
  1054. // "https://www.googleapis.com/auth/cloud-platform",
  1055. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1056. // ]
  1057. // }
  1058. }
  1059. // method id "dns.changes.get":
  1060. type ChangesGetCall struct {
  1061. s *Service
  1062. project string
  1063. managedZone string
  1064. changeId string
  1065. urlParams_ gensupport.URLParams
  1066. ifNoneMatch_ string
  1067. ctx_ context.Context
  1068. header_ http.Header
  1069. }
  1070. // Get: Fetch the representation of an existing Change.
  1071. func (r *ChangesService) Get(project string, managedZone string, changeId string) *ChangesGetCall {
  1072. c := &ChangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1073. c.project = project
  1074. c.managedZone = managedZone
  1075. c.changeId = changeId
  1076. return c
  1077. }
  1078. // ClientOperationId sets the optional parameter "clientOperationId":
  1079. // For mutating operation requests only. An optional identifier
  1080. // specified by the client. Must be unique for operation resources in
  1081. // the Operations collection.
  1082. func (c *ChangesGetCall) ClientOperationId(clientOperationId string) *ChangesGetCall {
  1083. c.urlParams_.Set("clientOperationId", clientOperationId)
  1084. return c
  1085. }
  1086. // Fields allows partial responses to be retrieved. See
  1087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1088. // for more information.
  1089. func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall {
  1090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1091. return c
  1092. }
  1093. // IfNoneMatch sets the optional parameter which makes the operation
  1094. // fail if the object's ETag matches the given value. This is useful for
  1095. // getting updates only after the object has changed since the last
  1096. // request. Use googleapi.IsNotModified to check whether the response
  1097. // error from Do is the result of In-None-Match.
  1098. func (c *ChangesGetCall) IfNoneMatch(entityTag string) *ChangesGetCall {
  1099. c.ifNoneMatch_ = entityTag
  1100. return c
  1101. }
  1102. // Context sets the context to be used in this call's Do method. Any
  1103. // pending HTTP request will be aborted if the provided context is
  1104. // canceled.
  1105. func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall {
  1106. c.ctx_ = ctx
  1107. return c
  1108. }
  1109. // Header returns an http.Header that can be modified by the caller to
  1110. // add HTTP headers to the request.
  1111. func (c *ChangesGetCall) Header() http.Header {
  1112. if c.header_ == nil {
  1113. c.header_ = make(http.Header)
  1114. }
  1115. return c.header_
  1116. }
  1117. func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) {
  1118. reqHeaders := make(http.Header)
  1119. for k, v := range c.header_ {
  1120. reqHeaders[k] = v
  1121. }
  1122. reqHeaders.Set("User-Agent", c.s.userAgent())
  1123. if c.ifNoneMatch_ != "" {
  1124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1125. }
  1126. var body io.Reader = nil
  1127. c.urlParams_.Set("alt", alt)
  1128. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes/{changeId}")
  1129. urls += "?" + c.urlParams_.Encode()
  1130. req, _ := http.NewRequest("GET", urls, body)
  1131. req.Header = reqHeaders
  1132. googleapi.Expand(req.URL, map[string]string{
  1133. "project": c.project,
  1134. "managedZone": c.managedZone,
  1135. "changeId": c.changeId,
  1136. })
  1137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1138. }
  1139. // Do executes the "dns.changes.get" call.
  1140. // Exactly one of *Change or error will be non-nil. Any non-2xx status
  1141. // code is an error. Response headers are in either
  1142. // *Change.ServerResponse.Header or (if a response was returned at all)
  1143. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1144. // check whether the returned error was because http.StatusNotModified
  1145. // was returned.
  1146. func (c *ChangesGetCall) Do(opts ...googleapi.CallOption) (*Change, error) {
  1147. gensupport.SetOptions(c.urlParams_, opts...)
  1148. res, err := c.doRequest("json")
  1149. if res != nil && res.StatusCode == http.StatusNotModified {
  1150. if res.Body != nil {
  1151. res.Body.Close()
  1152. }
  1153. return nil, &googleapi.Error{
  1154. Code: res.StatusCode,
  1155. Header: res.Header,
  1156. }
  1157. }
  1158. if err != nil {
  1159. return nil, err
  1160. }
  1161. defer googleapi.CloseBody(res)
  1162. if err := googleapi.CheckResponse(res); err != nil {
  1163. return nil, err
  1164. }
  1165. ret := &Change{
  1166. ServerResponse: googleapi.ServerResponse{
  1167. Header: res.Header,
  1168. HTTPStatusCode: res.StatusCode,
  1169. },
  1170. }
  1171. target := &ret
  1172. if err := gensupport.DecodeResponse(target, res); err != nil {
  1173. return nil, err
  1174. }
  1175. return ret, nil
  1176. // {
  1177. // "description": "Fetch the representation of an existing Change.",
  1178. // "httpMethod": "GET",
  1179. // "id": "dns.changes.get",
  1180. // "parameterOrder": [
  1181. // "project",
  1182. // "managedZone",
  1183. // "changeId"
  1184. // ],
  1185. // "parameters": {
  1186. // "changeId": {
  1187. // "description": "The identifier of the requested change, from a previous ResourceRecordSetsChangeResponse.",
  1188. // "location": "path",
  1189. // "required": true,
  1190. // "type": "string"
  1191. // },
  1192. // "clientOperationId": {
  1193. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  1194. // "location": "query",
  1195. // "type": "string"
  1196. // },
  1197. // "managedZone": {
  1198. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  1199. // "location": "path",
  1200. // "required": true,
  1201. // "type": "string"
  1202. // },
  1203. // "project": {
  1204. // "description": "Identifies the project addressed by this request.",
  1205. // "location": "path",
  1206. // "required": true,
  1207. // "type": "string"
  1208. // }
  1209. // },
  1210. // "path": "{project}/managedZones/{managedZone}/changes/{changeId}",
  1211. // "response": {
  1212. // "$ref": "Change"
  1213. // },
  1214. // "scopes": [
  1215. // "https://www.googleapis.com/auth/cloud-platform",
  1216. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1217. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1218. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1219. // ]
  1220. // }
  1221. }
  1222. // method id "dns.changes.list":
  1223. type ChangesListCall struct {
  1224. s *Service
  1225. project string
  1226. managedZone string
  1227. urlParams_ gensupport.URLParams
  1228. ifNoneMatch_ string
  1229. ctx_ context.Context
  1230. header_ http.Header
  1231. }
  1232. // List: Enumerate Changes to a ResourceRecordSet collection.
  1233. func (r *ChangesService) List(project string, managedZone string) *ChangesListCall {
  1234. c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1235. c.project = project
  1236. c.managedZone = managedZone
  1237. return c
  1238. }
  1239. // MaxResults sets the optional parameter "maxResults": Maximum number
  1240. // of results to be returned. If unspecified, the server will decide how
  1241. // many results to return.
  1242. func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall {
  1243. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1244. return c
  1245. }
  1246. // PageToken sets the optional parameter "pageToken": A tag returned by
  1247. // a previous list request that was truncated. Use this parameter to
  1248. // continue a previous list request.
  1249. func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall {
  1250. c.urlParams_.Set("pageToken", pageToken)
  1251. return c
  1252. }
  1253. // SortBy sets the optional parameter "sortBy": Sorting criterion. The
  1254. // only supported value is change sequence.
  1255. //
  1256. // Possible values:
  1257. // "CHANGE_SEQUENCE" (default)
  1258. func (c *ChangesListCall) SortBy(sortBy string) *ChangesListCall {
  1259. c.urlParams_.Set("sortBy", sortBy)
  1260. return c
  1261. }
  1262. // SortOrder sets the optional parameter "sortOrder": Sorting order
  1263. // direction: 'ascending' or 'descending'.
  1264. func (c *ChangesListCall) SortOrder(sortOrder string) *ChangesListCall {
  1265. c.urlParams_.Set("sortOrder", sortOrder)
  1266. return c
  1267. }
  1268. // Fields allows partial responses to be retrieved. See
  1269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1270. // for more information.
  1271. func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall {
  1272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1273. return c
  1274. }
  1275. // IfNoneMatch sets the optional parameter which makes the operation
  1276. // fail if the object's ETag matches the given value. This is useful for
  1277. // getting updates only after the object has changed since the last
  1278. // request. Use googleapi.IsNotModified to check whether the response
  1279. // error from Do is the result of In-None-Match.
  1280. func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall {
  1281. c.ifNoneMatch_ = entityTag
  1282. return c
  1283. }
  1284. // Context sets the context to be used in this call's Do method. Any
  1285. // pending HTTP request will be aborted if the provided context is
  1286. // canceled.
  1287. func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall {
  1288. c.ctx_ = ctx
  1289. return c
  1290. }
  1291. // Header returns an http.Header that can be modified by the caller to
  1292. // add HTTP headers to the request.
  1293. func (c *ChangesListCall) Header() http.Header {
  1294. if c.header_ == nil {
  1295. c.header_ = make(http.Header)
  1296. }
  1297. return c.header_
  1298. }
  1299. func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) {
  1300. reqHeaders := make(http.Header)
  1301. for k, v := range c.header_ {
  1302. reqHeaders[k] = v
  1303. }
  1304. reqHeaders.Set("User-Agent", c.s.userAgent())
  1305. if c.ifNoneMatch_ != "" {
  1306. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1307. }
  1308. var body io.Reader = nil
  1309. c.urlParams_.Set("alt", alt)
  1310. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
  1311. urls += "?" + c.urlParams_.Encode()
  1312. req, _ := http.NewRequest("GET", urls, body)
  1313. req.Header = reqHeaders
  1314. googleapi.Expand(req.URL, map[string]string{
  1315. "project": c.project,
  1316. "managedZone": c.managedZone,
  1317. })
  1318. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1319. }
  1320. // Do executes the "dns.changes.list" call.
  1321. // Exactly one of *ChangesListResponse or error will be non-nil. Any
  1322. // non-2xx status code is an error. Response headers are in either
  1323. // *ChangesListResponse.ServerResponse.Header or (if a response was
  1324. // returned at all) in error.(*googleapi.Error).Header. Use
  1325. // googleapi.IsNotModified to check whether the returned error was
  1326. // because http.StatusNotModified was returned.
  1327. func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangesListResponse, error) {
  1328. gensupport.SetOptions(c.urlParams_, opts...)
  1329. res, err := c.doRequest("json")
  1330. if res != nil && res.StatusCode == http.StatusNotModified {
  1331. if res.Body != nil {
  1332. res.Body.Close()
  1333. }
  1334. return nil, &googleapi.Error{
  1335. Code: res.StatusCode,
  1336. Header: res.Header,
  1337. }
  1338. }
  1339. if err != nil {
  1340. return nil, err
  1341. }
  1342. defer googleapi.CloseBody(res)
  1343. if err := googleapi.CheckResponse(res); err != nil {
  1344. return nil, err
  1345. }
  1346. ret := &ChangesListResponse{
  1347. ServerResponse: googleapi.ServerResponse{
  1348. Header: res.Header,
  1349. HTTPStatusCode: res.StatusCode,
  1350. },
  1351. }
  1352. target := &ret
  1353. if err := gensupport.DecodeResponse(target, res); err != nil {
  1354. return nil, err
  1355. }
  1356. return ret, nil
  1357. // {
  1358. // "description": "Enumerate Changes to a ResourceRecordSet collection.",
  1359. // "httpMethod": "GET",
  1360. // "id": "dns.changes.list",
  1361. // "parameterOrder": [
  1362. // "project",
  1363. // "managedZone"
  1364. // ],
  1365. // "parameters": {
  1366. // "managedZone": {
  1367. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  1368. // "location": "path",
  1369. // "required": true,
  1370. // "type": "string"
  1371. // },
  1372. // "maxResults": {
  1373. // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
  1374. // "format": "int32",
  1375. // "location": "query",
  1376. // "type": "integer"
  1377. // },
  1378. // "pageToken": {
  1379. // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
  1380. // "location": "query",
  1381. // "type": "string"
  1382. // },
  1383. // "project": {
  1384. // "description": "Identifies the project addressed by this request.",
  1385. // "location": "path",
  1386. // "required": true,
  1387. // "type": "string"
  1388. // },
  1389. // "sortBy": {
  1390. // "default": "CHANGE_SEQUENCE",
  1391. // "description": "Sorting criterion. The only supported value is change sequence.",
  1392. // "enum": [
  1393. // "CHANGE_SEQUENCE"
  1394. // ],
  1395. // "enumDescriptions": [
  1396. // ""
  1397. // ],
  1398. // "location": "query",
  1399. // "type": "string"
  1400. // },
  1401. // "sortOrder": {
  1402. // "description": "Sorting order direction: 'ascending' or 'descending'.",
  1403. // "location": "query",
  1404. // "type": "string"
  1405. // }
  1406. // },
  1407. // "path": "{project}/managedZones/{managedZone}/changes",
  1408. // "response": {
  1409. // "$ref": "ChangesListResponse"
  1410. // },
  1411. // "scopes": [
  1412. // "https://www.googleapis.com/auth/cloud-platform",
  1413. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1414. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1415. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1416. // ]
  1417. // }
  1418. }
  1419. // Pages invokes f for each page of results.
  1420. // A non-nil error returned from f will halt the iteration.
  1421. // The provided context supersedes any context provided to the Context method.
  1422. func (c *ChangesListCall) Pages(ctx context.Context, f func(*ChangesListResponse) error) error {
  1423. c.ctx_ = ctx
  1424. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1425. for {
  1426. x, err := c.Do()
  1427. if err != nil {
  1428. return err
  1429. }
  1430. if err := f(x); err != nil {
  1431. return err
  1432. }
  1433. if x.NextPageToken == "" {
  1434. return nil
  1435. }
  1436. c.PageToken(x.NextPageToken)
  1437. }
  1438. }
  1439. // method id "dns.dnsKeys.get":
  1440. type DnsKeysGetCall struct {
  1441. s *Service
  1442. project string
  1443. managedZone string
  1444. dnsKeyId string
  1445. urlParams_ gensupport.URLParams
  1446. ifNoneMatch_ string
  1447. ctx_ context.Context
  1448. header_ http.Header
  1449. }
  1450. // Get: Fetch the representation of an existing DnsKey.
  1451. func (r *DnsKeysService) Get(project string, managedZone string, dnsKeyId string) *DnsKeysGetCall {
  1452. c := &DnsKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1453. c.project = project
  1454. c.managedZone = managedZone
  1455. c.dnsKeyId = dnsKeyId
  1456. return c
  1457. }
  1458. // ClientOperationId sets the optional parameter "clientOperationId":
  1459. // For mutating operation requests only. An optional identifier
  1460. // specified by the client. Must be unique for operation resources in
  1461. // the Operations collection.
  1462. func (c *DnsKeysGetCall) ClientOperationId(clientOperationId string) *DnsKeysGetCall {
  1463. c.urlParams_.Set("clientOperationId", clientOperationId)
  1464. return c
  1465. }
  1466. // DigestType sets the optional parameter "digestType": An optional
  1467. // comma-separated list of digest types to compute and display for key
  1468. // signing keys. If omitted, the recommended digest type will be
  1469. // computed and displayed.
  1470. func (c *DnsKeysGetCall) DigestType(digestType string) *DnsKeysGetCall {
  1471. c.urlParams_.Set("digestType", digestType)
  1472. return c
  1473. }
  1474. // Fields allows partial responses to be retrieved. See
  1475. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1476. // for more information.
  1477. func (c *DnsKeysGetCall) Fields(s ...googleapi.Field) *DnsKeysGetCall {
  1478. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1479. return c
  1480. }
  1481. // IfNoneMatch sets the optional parameter which makes the operation
  1482. // fail if the object's ETag matches the given value. This is useful for
  1483. // getting updates only after the object has changed since the last
  1484. // request. Use googleapi.IsNotModified to check whether the response
  1485. // error from Do is the result of In-None-Match.
  1486. func (c *DnsKeysGetCall) IfNoneMatch(entityTag string) *DnsKeysGetCall {
  1487. c.ifNoneMatch_ = entityTag
  1488. return c
  1489. }
  1490. // Context sets the context to be used in this call's Do method. Any
  1491. // pending HTTP request will be aborted if the provided context is
  1492. // canceled.
  1493. func (c *DnsKeysGetCall) Context(ctx context.Context) *DnsKeysGetCall {
  1494. c.ctx_ = ctx
  1495. return c
  1496. }
  1497. // Header returns an http.Header that can be modified by the caller to
  1498. // add HTTP headers to the request.
  1499. func (c *DnsKeysGetCall) Header() http.Header {
  1500. if c.header_ == nil {
  1501. c.header_ = make(http.Header)
  1502. }
  1503. return c.header_
  1504. }
  1505. func (c *DnsKeysGetCall) doRequest(alt string) (*http.Response, error) {
  1506. reqHeaders := make(http.Header)
  1507. for k, v := range c.header_ {
  1508. reqHeaders[k] = v
  1509. }
  1510. reqHeaders.Set("User-Agent", c.s.userAgent())
  1511. if c.ifNoneMatch_ != "" {
  1512. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1513. }
  1514. var body io.Reader = nil
  1515. c.urlParams_.Set("alt", alt)
  1516. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}")
  1517. urls += "?" + c.urlParams_.Encode()
  1518. req, _ := http.NewRequest("GET", urls, body)
  1519. req.Header = reqHeaders
  1520. googleapi.Expand(req.URL, map[string]string{
  1521. "project": c.project,
  1522. "managedZone": c.managedZone,
  1523. "dnsKeyId": c.dnsKeyId,
  1524. })
  1525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1526. }
  1527. // Do executes the "dns.dnsKeys.get" call.
  1528. // Exactly one of *DnsKey or error will be non-nil. Any non-2xx status
  1529. // code is an error. Response headers are in either
  1530. // *DnsKey.ServerResponse.Header or (if a response was returned at all)
  1531. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1532. // check whether the returned error was because http.StatusNotModified
  1533. // was returned.
  1534. func (c *DnsKeysGetCall) Do(opts ...googleapi.CallOption) (*DnsKey, error) {
  1535. gensupport.SetOptions(c.urlParams_, opts...)
  1536. res, err := c.doRequest("json")
  1537. if res != nil && res.StatusCode == http.StatusNotModified {
  1538. if res.Body != nil {
  1539. res.Body.Close()
  1540. }
  1541. return nil, &googleapi.Error{
  1542. Code: res.StatusCode,
  1543. Header: res.Header,
  1544. }
  1545. }
  1546. if err != nil {
  1547. return nil, err
  1548. }
  1549. defer googleapi.CloseBody(res)
  1550. if err := googleapi.CheckResponse(res); err != nil {
  1551. return nil, err
  1552. }
  1553. ret := &DnsKey{
  1554. ServerResponse: googleapi.ServerResponse{
  1555. Header: res.Header,
  1556. HTTPStatusCode: res.StatusCode,
  1557. },
  1558. }
  1559. target := &ret
  1560. if err := gensupport.DecodeResponse(target, res); err != nil {
  1561. return nil, err
  1562. }
  1563. return ret, nil
  1564. // {
  1565. // "description": "Fetch the representation of an existing DnsKey.",
  1566. // "httpMethod": "GET",
  1567. // "id": "dns.dnsKeys.get",
  1568. // "parameterOrder": [
  1569. // "project",
  1570. // "managedZone",
  1571. // "dnsKeyId"
  1572. // ],
  1573. // "parameters": {
  1574. // "clientOperationId": {
  1575. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  1576. // "location": "query",
  1577. // "type": "string"
  1578. // },
  1579. // "digestType": {
  1580. // "description": "An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed.",
  1581. // "location": "query",
  1582. // "type": "string"
  1583. // },
  1584. // "dnsKeyId": {
  1585. // "description": "The identifier of the requested DnsKey.",
  1586. // "location": "path",
  1587. // "required": true,
  1588. // "type": "string"
  1589. // },
  1590. // "managedZone": {
  1591. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  1592. // "location": "path",
  1593. // "required": true,
  1594. // "type": "string"
  1595. // },
  1596. // "project": {
  1597. // "description": "Identifies the project addressed by this request.",
  1598. // "location": "path",
  1599. // "required": true,
  1600. // "type": "string"
  1601. // }
  1602. // },
  1603. // "path": "{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}",
  1604. // "response": {
  1605. // "$ref": "DnsKey"
  1606. // },
  1607. // "scopes": [
  1608. // "https://www.googleapis.com/auth/cloud-platform",
  1609. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1610. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1611. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1612. // ]
  1613. // }
  1614. }
  1615. // method id "dns.dnsKeys.list":
  1616. type DnsKeysListCall struct {
  1617. s *Service
  1618. project string
  1619. managedZone string
  1620. urlParams_ gensupport.URLParams
  1621. ifNoneMatch_ string
  1622. ctx_ context.Context
  1623. header_ http.Header
  1624. }
  1625. // List: Enumerate DnsKeys to a ResourceRecordSet collection.
  1626. func (r *DnsKeysService) List(project string, managedZone string) *DnsKeysListCall {
  1627. c := &DnsKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1628. c.project = project
  1629. c.managedZone = managedZone
  1630. return c
  1631. }
  1632. // DigestType sets the optional parameter "digestType": An optional
  1633. // comma-separated list of digest types to compute and display for key
  1634. // signing keys. If omitted, the recommended digest type will be
  1635. // computed and displayed.
  1636. func (c *DnsKeysListCall) DigestType(digestType string) *DnsKeysListCall {
  1637. c.urlParams_.Set("digestType", digestType)
  1638. return c
  1639. }
  1640. // MaxResults sets the optional parameter "maxResults": Maximum number
  1641. // of results to be returned. If unspecified, the server will decide how
  1642. // many results to return.
  1643. func (c *DnsKeysListCall) MaxResults(maxResults int64) *DnsKeysListCall {
  1644. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1645. return c
  1646. }
  1647. // PageToken sets the optional parameter "pageToken": A tag returned by
  1648. // a previous list request that was truncated. Use this parameter to
  1649. // continue a previous list request.
  1650. func (c *DnsKeysListCall) PageToken(pageToken string) *DnsKeysListCall {
  1651. c.urlParams_.Set("pageToken", pageToken)
  1652. return c
  1653. }
  1654. // Fields allows partial responses to be retrieved. See
  1655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1656. // for more information.
  1657. func (c *DnsKeysListCall) Fields(s ...googleapi.Field) *DnsKeysListCall {
  1658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1659. return c
  1660. }
  1661. // IfNoneMatch sets the optional parameter which makes the operation
  1662. // fail if the object's ETag matches the given value. This is useful for
  1663. // getting updates only after the object has changed since the last
  1664. // request. Use googleapi.IsNotModified to check whether the response
  1665. // error from Do is the result of In-None-Match.
  1666. func (c *DnsKeysListCall) IfNoneMatch(entityTag string) *DnsKeysListCall {
  1667. c.ifNoneMatch_ = entityTag
  1668. return c
  1669. }
  1670. // Context sets the context to be used in this call's Do method. Any
  1671. // pending HTTP request will be aborted if the provided context is
  1672. // canceled.
  1673. func (c *DnsKeysListCall) Context(ctx context.Context) *DnsKeysListCall {
  1674. c.ctx_ = ctx
  1675. return c
  1676. }
  1677. // Header returns an http.Header that can be modified by the caller to
  1678. // add HTTP headers to the request.
  1679. func (c *DnsKeysListCall) Header() http.Header {
  1680. if c.header_ == nil {
  1681. c.header_ = make(http.Header)
  1682. }
  1683. return c.header_
  1684. }
  1685. func (c *DnsKeysListCall) doRequest(alt string) (*http.Response, error) {
  1686. reqHeaders := make(http.Header)
  1687. for k, v := range c.header_ {
  1688. reqHeaders[k] = v
  1689. }
  1690. reqHeaders.Set("User-Agent", c.s.userAgent())
  1691. if c.ifNoneMatch_ != "" {
  1692. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1693. }
  1694. var body io.Reader = nil
  1695. c.urlParams_.Set("alt", alt)
  1696. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/dnsKeys")
  1697. urls += "?" + c.urlParams_.Encode()
  1698. req, _ := http.NewRequest("GET", urls, body)
  1699. req.Header = reqHeaders
  1700. googleapi.Expand(req.URL, map[string]string{
  1701. "project": c.project,
  1702. "managedZone": c.managedZone,
  1703. })
  1704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1705. }
  1706. // Do executes the "dns.dnsKeys.list" call.
  1707. // Exactly one of *DnsKeysListResponse or error will be non-nil. Any
  1708. // non-2xx status code is an error. Response headers are in either
  1709. // *DnsKeysListResponse.ServerResponse.Header or (if a response was
  1710. // returned at all) in error.(*googleapi.Error).Header. Use
  1711. // googleapi.IsNotModified to check whether the returned error was
  1712. // because http.StatusNotModified was returned.
  1713. func (c *DnsKeysListCall) Do(opts ...googleapi.CallOption) (*DnsKeysListResponse, error) {
  1714. gensupport.SetOptions(c.urlParams_, opts...)
  1715. res, err := c.doRequest("json")
  1716. if res != nil && res.StatusCode == http.StatusNotModified {
  1717. if res.Body != nil {
  1718. res.Body.Close()
  1719. }
  1720. return nil, &googleapi.Error{
  1721. Code: res.StatusCode,
  1722. Header: res.Header,
  1723. }
  1724. }
  1725. if err != nil {
  1726. return nil, err
  1727. }
  1728. defer googleapi.CloseBody(res)
  1729. if err := googleapi.CheckResponse(res); err != nil {
  1730. return nil, err
  1731. }
  1732. ret := &DnsKeysListResponse{
  1733. ServerResponse: googleapi.ServerResponse{
  1734. Header: res.Header,
  1735. HTTPStatusCode: res.StatusCode,
  1736. },
  1737. }
  1738. target := &ret
  1739. if err := gensupport.DecodeResponse(target, res); err != nil {
  1740. return nil, err
  1741. }
  1742. return ret, nil
  1743. // {
  1744. // "description": "Enumerate DnsKeys to a ResourceRecordSet collection.",
  1745. // "httpMethod": "GET",
  1746. // "id": "dns.dnsKeys.list",
  1747. // "parameterOrder": [
  1748. // "project",
  1749. // "managedZone"
  1750. // ],
  1751. // "parameters": {
  1752. // "digestType": {
  1753. // "description": "An optional comma-separated list of digest types to compute and display for key signing keys. If omitted, the recommended digest type will be computed and displayed.",
  1754. // "location": "query",
  1755. // "type": "string"
  1756. // },
  1757. // "managedZone": {
  1758. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  1759. // "location": "path",
  1760. // "required": true,
  1761. // "type": "string"
  1762. // },
  1763. // "maxResults": {
  1764. // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
  1765. // "format": "int32",
  1766. // "location": "query",
  1767. // "type": "integer"
  1768. // },
  1769. // "pageToken": {
  1770. // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
  1771. // "location": "query",
  1772. // "type": "string"
  1773. // },
  1774. // "project": {
  1775. // "description": "Identifies the project addressed by this request.",
  1776. // "location": "path",
  1777. // "required": true,
  1778. // "type": "string"
  1779. // }
  1780. // },
  1781. // "path": "{project}/managedZones/{managedZone}/dnsKeys",
  1782. // "response": {
  1783. // "$ref": "DnsKeysListResponse"
  1784. // },
  1785. // "scopes": [
  1786. // "https://www.googleapis.com/auth/cloud-platform",
  1787. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1788. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1789. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1790. // ]
  1791. // }
  1792. }
  1793. // Pages invokes f for each page of results.
  1794. // A non-nil error returned from f will halt the iteration.
  1795. // The provided context supersedes any context provided to the Context method.
  1796. func (c *DnsKeysListCall) Pages(ctx context.Context, f func(*DnsKeysListResponse) error) error {
  1797. c.ctx_ = ctx
  1798. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1799. for {
  1800. x, err := c.Do()
  1801. if err != nil {
  1802. return err
  1803. }
  1804. if err := f(x); err != nil {
  1805. return err
  1806. }
  1807. if x.NextPageToken == "" {
  1808. return nil
  1809. }
  1810. c.PageToken(x.NextPageToken)
  1811. }
  1812. }
  1813. // method id "dns.managedZoneOperations.get":
  1814. type ManagedZoneOperationsGetCall struct {
  1815. s *Service
  1816. project string
  1817. managedZone string
  1818. operation string
  1819. urlParams_ gensupport.URLParams
  1820. ifNoneMatch_ string
  1821. ctx_ context.Context
  1822. header_ http.Header
  1823. }
  1824. // Get: Fetch the representation of an existing Operation.
  1825. func (r *ManagedZoneOperationsService) Get(project string, managedZone string, operation string) *ManagedZoneOperationsGetCall {
  1826. c := &ManagedZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1827. c.project = project
  1828. c.managedZone = managedZone
  1829. c.operation = operation
  1830. return c
  1831. }
  1832. // ClientOperationId sets the optional parameter "clientOperationId":
  1833. // For mutating operation requests only. An optional identifier
  1834. // specified by the client. Must be unique for operation resources in
  1835. // the Operations collection.
  1836. func (c *ManagedZoneOperationsGetCall) ClientOperationId(clientOperationId string) *ManagedZoneOperationsGetCall {
  1837. c.urlParams_.Set("clientOperationId", clientOperationId)
  1838. return c
  1839. }
  1840. // Fields allows partial responses to be retrieved. See
  1841. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1842. // for more information.
  1843. func (c *ManagedZoneOperationsGetCall) Fields(s ...googleapi.Field) *ManagedZoneOperationsGetCall {
  1844. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1845. return c
  1846. }
  1847. // IfNoneMatch sets the optional parameter which makes the operation
  1848. // fail if the object's ETag matches the given value. This is useful for
  1849. // getting updates only after the object has changed since the last
  1850. // request. Use googleapi.IsNotModified to check whether the response
  1851. // error from Do is the result of In-None-Match.
  1852. func (c *ManagedZoneOperationsGetCall) IfNoneMatch(entityTag string) *ManagedZoneOperationsGetCall {
  1853. c.ifNoneMatch_ = entityTag
  1854. return c
  1855. }
  1856. // Context sets the context to be used in this call's Do method. Any
  1857. // pending HTTP request will be aborted if the provided context is
  1858. // canceled.
  1859. func (c *ManagedZoneOperationsGetCall) Context(ctx context.Context) *ManagedZoneOperationsGetCall {
  1860. c.ctx_ = ctx
  1861. return c
  1862. }
  1863. // Header returns an http.Header that can be modified by the caller to
  1864. // add HTTP headers to the request.
  1865. func (c *ManagedZoneOperationsGetCall) Header() http.Header {
  1866. if c.header_ == nil {
  1867. c.header_ = make(http.Header)
  1868. }
  1869. return c.header_
  1870. }
  1871. func (c *ManagedZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1872. reqHeaders := make(http.Header)
  1873. for k, v := range c.header_ {
  1874. reqHeaders[k] = v
  1875. }
  1876. reqHeaders.Set("User-Agent", c.s.userAgent())
  1877. if c.ifNoneMatch_ != "" {
  1878. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1879. }
  1880. var body io.Reader = nil
  1881. c.urlParams_.Set("alt", alt)
  1882. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/operations/{operation}")
  1883. urls += "?" + c.urlParams_.Encode()
  1884. req, _ := http.NewRequest("GET", urls, body)
  1885. req.Header = reqHeaders
  1886. googleapi.Expand(req.URL, map[string]string{
  1887. "project": c.project,
  1888. "managedZone": c.managedZone,
  1889. "operation": c.operation,
  1890. })
  1891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1892. }
  1893. // Do executes the "dns.managedZoneOperations.get" call.
  1894. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1895. // status code is an error. Response headers are in either
  1896. // *Operation.ServerResponse.Header or (if a response was returned at
  1897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1898. // to check whether the returned error was because
  1899. // http.StatusNotModified was returned.
  1900. func (c *ManagedZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1901. gensupport.SetOptions(c.urlParams_, opts...)
  1902. res, err := c.doRequest("json")
  1903. if res != nil && res.StatusCode == http.StatusNotModified {
  1904. if res.Body != nil {
  1905. res.Body.Close()
  1906. }
  1907. return nil, &googleapi.Error{
  1908. Code: res.StatusCode,
  1909. Header: res.Header,
  1910. }
  1911. }
  1912. if err != nil {
  1913. return nil, err
  1914. }
  1915. defer googleapi.CloseBody(res)
  1916. if err := googleapi.CheckResponse(res); err != nil {
  1917. return nil, err
  1918. }
  1919. ret := &Operation{
  1920. ServerResponse: googleapi.ServerResponse{
  1921. Header: res.Header,
  1922. HTTPStatusCode: res.StatusCode,
  1923. },
  1924. }
  1925. target := &ret
  1926. if err := gensupport.DecodeResponse(target, res); err != nil {
  1927. return nil, err
  1928. }
  1929. return ret, nil
  1930. // {
  1931. // "description": "Fetch the representation of an existing Operation.",
  1932. // "httpMethod": "GET",
  1933. // "id": "dns.managedZoneOperations.get",
  1934. // "parameterOrder": [
  1935. // "project",
  1936. // "managedZone",
  1937. // "operation"
  1938. // ],
  1939. // "parameters": {
  1940. // "clientOperationId": {
  1941. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  1942. // "location": "query",
  1943. // "type": "string"
  1944. // },
  1945. // "managedZone": {
  1946. // "description": "Identifies the managed zone addressed by this request.",
  1947. // "location": "path",
  1948. // "required": true,
  1949. // "type": "string"
  1950. // },
  1951. // "operation": {
  1952. // "description": "Identifies the operation addressed by this request.",
  1953. // "location": "path",
  1954. // "required": true,
  1955. // "type": "string"
  1956. // },
  1957. // "project": {
  1958. // "description": "Identifies the project addressed by this request.",
  1959. // "location": "path",
  1960. // "required": true,
  1961. // "type": "string"
  1962. // }
  1963. // },
  1964. // "path": "{project}/managedZones/{managedZone}/operations/{operation}",
  1965. // "response": {
  1966. // "$ref": "Operation"
  1967. // },
  1968. // "scopes": [
  1969. // "https://www.googleapis.com/auth/cloud-platform",
  1970. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1971. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1972. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1973. // ]
  1974. // }
  1975. }
  1976. // method id "dns.managedZoneOperations.list":
  1977. type ManagedZoneOperationsListCall struct {
  1978. s *Service
  1979. project string
  1980. managedZone string
  1981. urlParams_ gensupport.URLParams
  1982. ifNoneMatch_ string
  1983. ctx_ context.Context
  1984. header_ http.Header
  1985. }
  1986. // List: Enumerate Operations for the given ManagedZone.
  1987. func (r *ManagedZoneOperationsService) List(project string, managedZone string) *ManagedZoneOperationsListCall {
  1988. c := &ManagedZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1989. c.project = project
  1990. c.managedZone = managedZone
  1991. return c
  1992. }
  1993. // MaxResults sets the optional parameter "maxResults": Maximum number
  1994. // of results to be returned. If unspecified, the server will decide how
  1995. // many results to return.
  1996. func (c *ManagedZoneOperationsListCall) MaxResults(maxResults int64) *ManagedZoneOperationsListCall {
  1997. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1998. return c
  1999. }
  2000. // PageToken sets the optional parameter "pageToken": A tag returned by
  2001. // a previous list request that was truncated. Use this parameter to
  2002. // continue a previous list request.
  2003. func (c *ManagedZoneOperationsListCall) PageToken(pageToken string) *ManagedZoneOperationsListCall {
  2004. c.urlParams_.Set("pageToken", pageToken)
  2005. return c
  2006. }
  2007. // SortBy sets the optional parameter "sortBy": Sorting criterion. The
  2008. // only supported values are START_TIME and ID.
  2009. //
  2010. // Possible values:
  2011. // "ID"
  2012. // "START_TIME" (default)
  2013. func (c *ManagedZoneOperationsListCall) SortBy(sortBy string) *ManagedZoneOperationsListCall {
  2014. c.urlParams_.Set("sortBy", sortBy)
  2015. return c
  2016. }
  2017. // Fields allows partial responses to be retrieved. See
  2018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2019. // for more information.
  2020. func (c *ManagedZoneOperationsListCall) Fields(s ...googleapi.Field) *ManagedZoneOperationsListCall {
  2021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2022. return c
  2023. }
  2024. // IfNoneMatch sets the optional parameter which makes the operation
  2025. // fail if the object's ETag matches the given value. This is useful for
  2026. // getting updates only after the object has changed since the last
  2027. // request. Use googleapi.IsNotModified to check whether the response
  2028. // error from Do is the result of In-None-Match.
  2029. func (c *ManagedZoneOperationsListCall) IfNoneMatch(entityTag string) *ManagedZoneOperationsListCall {
  2030. c.ifNoneMatch_ = entityTag
  2031. return c
  2032. }
  2033. // Context sets the context to be used in this call's Do method. Any
  2034. // pending HTTP request will be aborted if the provided context is
  2035. // canceled.
  2036. func (c *ManagedZoneOperationsListCall) Context(ctx context.Context) *ManagedZoneOperationsListCall {
  2037. c.ctx_ = ctx
  2038. return c
  2039. }
  2040. // Header returns an http.Header that can be modified by the caller to
  2041. // add HTTP headers to the request.
  2042. func (c *ManagedZoneOperationsListCall) Header() http.Header {
  2043. if c.header_ == nil {
  2044. c.header_ = make(http.Header)
  2045. }
  2046. return c.header_
  2047. }
  2048. func (c *ManagedZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2049. reqHeaders := make(http.Header)
  2050. for k, v := range c.header_ {
  2051. reqHeaders[k] = v
  2052. }
  2053. reqHeaders.Set("User-Agent", c.s.userAgent())
  2054. if c.ifNoneMatch_ != "" {
  2055. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2056. }
  2057. var body io.Reader = nil
  2058. c.urlParams_.Set("alt", alt)
  2059. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/operations")
  2060. urls += "?" + c.urlParams_.Encode()
  2061. req, _ := http.NewRequest("GET", urls, body)
  2062. req.Header = reqHeaders
  2063. googleapi.Expand(req.URL, map[string]string{
  2064. "project": c.project,
  2065. "managedZone": c.managedZone,
  2066. })
  2067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2068. }
  2069. // Do executes the "dns.managedZoneOperations.list" call.
  2070. // Exactly one of *ManagedZoneOperationsListResponse or error will be
  2071. // non-nil. Any non-2xx status code is an error. Response headers are in
  2072. // either *ManagedZoneOperationsListResponse.ServerResponse.Header or
  2073. // (if a response was returned at all) in
  2074. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2075. // whether the returned error was because http.StatusNotModified was
  2076. // returned.
  2077. func (c *ManagedZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*ManagedZoneOperationsListResponse, error) {
  2078. gensupport.SetOptions(c.urlParams_, opts...)
  2079. res, err := c.doRequest("json")
  2080. if res != nil && res.StatusCode == http.StatusNotModified {
  2081. if res.Body != nil {
  2082. res.Body.Close()
  2083. }
  2084. return nil, &googleapi.Error{
  2085. Code: res.StatusCode,
  2086. Header: res.Header,
  2087. }
  2088. }
  2089. if err != nil {
  2090. return nil, err
  2091. }
  2092. defer googleapi.CloseBody(res)
  2093. if err := googleapi.CheckResponse(res); err != nil {
  2094. return nil, err
  2095. }
  2096. ret := &ManagedZoneOperationsListResponse{
  2097. ServerResponse: googleapi.ServerResponse{
  2098. Header: res.Header,
  2099. HTTPStatusCode: res.StatusCode,
  2100. },
  2101. }
  2102. target := &ret
  2103. if err := gensupport.DecodeResponse(target, res); err != nil {
  2104. return nil, err
  2105. }
  2106. return ret, nil
  2107. // {
  2108. // "description": "Enumerate Operations for the given ManagedZone.",
  2109. // "httpMethod": "GET",
  2110. // "id": "dns.managedZoneOperations.list",
  2111. // "parameterOrder": [
  2112. // "project",
  2113. // "managedZone"
  2114. // ],
  2115. // "parameters": {
  2116. // "managedZone": {
  2117. // "description": "Identifies the managed zone addressed by this request.",
  2118. // "location": "path",
  2119. // "required": true,
  2120. // "type": "string"
  2121. // },
  2122. // "maxResults": {
  2123. // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
  2124. // "format": "int32",
  2125. // "location": "query",
  2126. // "type": "integer"
  2127. // },
  2128. // "pageToken": {
  2129. // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
  2130. // "location": "query",
  2131. // "type": "string"
  2132. // },
  2133. // "project": {
  2134. // "description": "Identifies the project addressed by this request.",
  2135. // "location": "path",
  2136. // "required": true,
  2137. // "type": "string"
  2138. // },
  2139. // "sortBy": {
  2140. // "default": "START_TIME",
  2141. // "description": "Sorting criterion. The only supported values are START_TIME and ID.",
  2142. // "enum": [
  2143. // "ID",
  2144. // "START_TIME"
  2145. // ],
  2146. // "enumDescriptions": [
  2147. // "",
  2148. // ""
  2149. // ],
  2150. // "location": "query",
  2151. // "type": "string"
  2152. // }
  2153. // },
  2154. // "path": "{project}/managedZones/{managedZone}/operations",
  2155. // "response": {
  2156. // "$ref": "ManagedZoneOperationsListResponse"
  2157. // },
  2158. // "scopes": [
  2159. // "https://www.googleapis.com/auth/cloud-platform",
  2160. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2161. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  2162. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2163. // ]
  2164. // }
  2165. }
  2166. // Pages invokes f for each page of results.
  2167. // A non-nil error returned from f will halt the iteration.
  2168. // The provided context supersedes any context provided to the Context method.
  2169. func (c *ManagedZoneOperationsListCall) Pages(ctx context.Context, f func(*ManagedZoneOperationsListResponse) error) error {
  2170. c.ctx_ = ctx
  2171. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2172. for {
  2173. x, err := c.Do()
  2174. if err != nil {
  2175. return err
  2176. }
  2177. if err := f(x); err != nil {
  2178. return err
  2179. }
  2180. if x.NextPageToken == "" {
  2181. return nil
  2182. }
  2183. c.PageToken(x.NextPageToken)
  2184. }
  2185. }
  2186. // method id "dns.managedZones.create":
  2187. type ManagedZonesCreateCall struct {
  2188. s *Service
  2189. project string
  2190. managedzone *ManagedZone
  2191. urlParams_ gensupport.URLParams
  2192. ctx_ context.Context
  2193. header_ http.Header
  2194. }
  2195. // Create: Create a new ManagedZone.
  2196. func (r *ManagedZonesService) Create(project string, managedzone *ManagedZone) *ManagedZonesCreateCall {
  2197. c := &ManagedZonesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2198. c.project = project
  2199. c.managedzone = managedzone
  2200. return c
  2201. }
  2202. // ClientOperationId sets the optional parameter "clientOperationId":
  2203. // For mutating operation requests only. An optional identifier
  2204. // specified by the client. Must be unique for operation resources in
  2205. // the Operations collection.
  2206. func (c *ManagedZonesCreateCall) ClientOperationId(clientOperationId string) *ManagedZonesCreateCall {
  2207. c.urlParams_.Set("clientOperationId", clientOperationId)
  2208. return c
  2209. }
  2210. // Fields allows partial responses to be retrieved. See
  2211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2212. // for more information.
  2213. func (c *ManagedZonesCreateCall) Fields(s ...googleapi.Field) *ManagedZonesCreateCall {
  2214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2215. return c
  2216. }
  2217. // Context sets the context to be used in this call's Do method. Any
  2218. // pending HTTP request will be aborted if the provided context is
  2219. // canceled.
  2220. func (c *ManagedZonesCreateCall) Context(ctx context.Context) *ManagedZonesCreateCall {
  2221. c.ctx_ = ctx
  2222. return c
  2223. }
  2224. // Header returns an http.Header that can be modified by the caller to
  2225. // add HTTP headers to the request.
  2226. func (c *ManagedZonesCreateCall) Header() http.Header {
  2227. if c.header_ == nil {
  2228. c.header_ = make(http.Header)
  2229. }
  2230. return c.header_
  2231. }
  2232. func (c *ManagedZonesCreateCall) doRequest(alt string) (*http.Response, error) {
  2233. reqHeaders := make(http.Header)
  2234. for k, v := range c.header_ {
  2235. reqHeaders[k] = v
  2236. }
  2237. reqHeaders.Set("User-Agent", c.s.userAgent())
  2238. var body io.Reader = nil
  2239. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
  2240. if err != nil {
  2241. return nil, err
  2242. }
  2243. reqHeaders.Set("Content-Type", "application/json")
  2244. c.urlParams_.Set("alt", alt)
  2245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
  2246. urls += "?" + c.urlParams_.Encode()
  2247. req, _ := http.NewRequest("POST", urls, body)
  2248. req.Header = reqHeaders
  2249. googleapi.Expand(req.URL, map[string]string{
  2250. "project": c.project,
  2251. })
  2252. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2253. }
  2254. // Do executes the "dns.managedZones.create" call.
  2255. // Exactly one of *ManagedZone or error will be non-nil. Any non-2xx
  2256. // status code is an error. Response headers are in either
  2257. // *ManagedZone.ServerResponse.Header or (if a response was returned at
  2258. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2259. // to check whether the returned error was because
  2260. // http.StatusNotModified was returned.
  2261. func (c *ManagedZonesCreateCall) Do(opts ...googleapi.CallOption) (*ManagedZone, error) {
  2262. gensupport.SetOptions(c.urlParams_, opts...)
  2263. res, err := c.doRequest("json")
  2264. if res != nil && res.StatusCode == http.StatusNotModified {
  2265. if res.Body != nil {
  2266. res.Body.Close()
  2267. }
  2268. return nil, &googleapi.Error{
  2269. Code: res.StatusCode,
  2270. Header: res.Header,
  2271. }
  2272. }
  2273. if err != nil {
  2274. return nil, err
  2275. }
  2276. defer googleapi.CloseBody(res)
  2277. if err := googleapi.CheckResponse(res); err != nil {
  2278. return nil, err
  2279. }
  2280. ret := &ManagedZone{
  2281. ServerResponse: googleapi.ServerResponse{
  2282. Header: res.Header,
  2283. HTTPStatusCode: res.StatusCode,
  2284. },
  2285. }
  2286. target := &ret
  2287. if err := gensupport.DecodeResponse(target, res); err != nil {
  2288. return nil, err
  2289. }
  2290. return ret, nil
  2291. // {
  2292. // "description": "Create a new ManagedZone.",
  2293. // "httpMethod": "POST",
  2294. // "id": "dns.managedZones.create",
  2295. // "parameterOrder": [
  2296. // "project"
  2297. // ],
  2298. // "parameters": {
  2299. // "clientOperationId": {
  2300. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  2301. // "location": "query",
  2302. // "type": "string"
  2303. // },
  2304. // "project": {
  2305. // "description": "Identifies the project addressed by this request.",
  2306. // "location": "path",
  2307. // "required": true,
  2308. // "type": "string"
  2309. // }
  2310. // },
  2311. // "path": "{project}/managedZones",
  2312. // "request": {
  2313. // "$ref": "ManagedZone"
  2314. // },
  2315. // "response": {
  2316. // "$ref": "ManagedZone"
  2317. // },
  2318. // "scopes": [
  2319. // "https://www.googleapis.com/auth/cloud-platform",
  2320. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2321. // ]
  2322. // }
  2323. }
  2324. // method id "dns.managedZones.delete":
  2325. type ManagedZonesDeleteCall struct {
  2326. s *Service
  2327. project string
  2328. managedZone string
  2329. urlParams_ gensupport.URLParams
  2330. ctx_ context.Context
  2331. header_ http.Header
  2332. }
  2333. // Delete: Delete a previously created ManagedZone.
  2334. func (r *ManagedZonesService) Delete(project string, managedZone string) *ManagedZonesDeleteCall {
  2335. c := &ManagedZonesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2336. c.project = project
  2337. c.managedZone = managedZone
  2338. return c
  2339. }
  2340. // ClientOperationId sets the optional parameter "clientOperationId":
  2341. // For mutating operation requests only. An optional identifier
  2342. // specified by the client. Must be unique for operation resources in
  2343. // the Operations collection.
  2344. func (c *ManagedZonesDeleteCall) ClientOperationId(clientOperationId string) *ManagedZonesDeleteCall {
  2345. c.urlParams_.Set("clientOperationId", clientOperationId)
  2346. return c
  2347. }
  2348. // Fields allows partial responses to be retrieved. See
  2349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2350. // for more information.
  2351. func (c *ManagedZonesDeleteCall) Fields(s ...googleapi.Field) *ManagedZonesDeleteCall {
  2352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2353. return c
  2354. }
  2355. // Context sets the context to be used in this call's Do method. Any
  2356. // pending HTTP request will be aborted if the provided context is
  2357. // canceled.
  2358. func (c *ManagedZonesDeleteCall) Context(ctx context.Context) *ManagedZonesDeleteCall {
  2359. c.ctx_ = ctx
  2360. return c
  2361. }
  2362. // Header returns an http.Header that can be modified by the caller to
  2363. // add HTTP headers to the request.
  2364. func (c *ManagedZonesDeleteCall) Header() http.Header {
  2365. if c.header_ == nil {
  2366. c.header_ = make(http.Header)
  2367. }
  2368. return c.header_
  2369. }
  2370. func (c *ManagedZonesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2371. reqHeaders := make(http.Header)
  2372. for k, v := range c.header_ {
  2373. reqHeaders[k] = v
  2374. }
  2375. reqHeaders.Set("User-Agent", c.s.userAgent())
  2376. var body io.Reader = nil
  2377. c.urlParams_.Set("alt", alt)
  2378. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  2379. urls += "?" + c.urlParams_.Encode()
  2380. req, _ := http.NewRequest("DELETE", urls, body)
  2381. req.Header = reqHeaders
  2382. googleapi.Expand(req.URL, map[string]string{
  2383. "project": c.project,
  2384. "managedZone": c.managedZone,
  2385. })
  2386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2387. }
  2388. // Do executes the "dns.managedZones.delete" call.
  2389. func (c *ManagedZonesDeleteCall) Do(opts ...googleapi.CallOption) error {
  2390. gensupport.SetOptions(c.urlParams_, opts...)
  2391. res, err := c.doRequest("json")
  2392. if err != nil {
  2393. return err
  2394. }
  2395. defer googleapi.CloseBody(res)
  2396. if err := googleapi.CheckResponse(res); err != nil {
  2397. return err
  2398. }
  2399. return nil
  2400. // {
  2401. // "description": "Delete a previously created ManagedZone.",
  2402. // "httpMethod": "DELETE",
  2403. // "id": "dns.managedZones.delete",
  2404. // "parameterOrder": [
  2405. // "project",
  2406. // "managedZone"
  2407. // ],
  2408. // "parameters": {
  2409. // "clientOperationId": {
  2410. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  2411. // "location": "query",
  2412. // "type": "string"
  2413. // },
  2414. // "managedZone": {
  2415. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  2416. // "location": "path",
  2417. // "required": true,
  2418. // "type": "string"
  2419. // },
  2420. // "project": {
  2421. // "description": "Identifies the project addressed by this request.",
  2422. // "location": "path",
  2423. // "required": true,
  2424. // "type": "string"
  2425. // }
  2426. // },
  2427. // "path": "{project}/managedZones/{managedZone}",
  2428. // "scopes": [
  2429. // "https://www.googleapis.com/auth/cloud-platform",
  2430. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2431. // ]
  2432. // }
  2433. }
  2434. // method id "dns.managedZones.get":
  2435. type ManagedZonesGetCall struct {
  2436. s *Service
  2437. project string
  2438. managedZone string
  2439. urlParams_ gensupport.URLParams
  2440. ifNoneMatch_ string
  2441. ctx_ context.Context
  2442. header_ http.Header
  2443. }
  2444. // Get: Fetch the representation of an existing ManagedZone.
  2445. func (r *ManagedZonesService) Get(project string, managedZone string) *ManagedZonesGetCall {
  2446. c := &ManagedZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2447. c.project = project
  2448. c.managedZone = managedZone
  2449. return c
  2450. }
  2451. // ClientOperationId sets the optional parameter "clientOperationId":
  2452. // For mutating operation requests only. An optional identifier
  2453. // specified by the client. Must be unique for operation resources in
  2454. // the Operations collection.
  2455. func (c *ManagedZonesGetCall) ClientOperationId(clientOperationId string) *ManagedZonesGetCall {
  2456. c.urlParams_.Set("clientOperationId", clientOperationId)
  2457. return c
  2458. }
  2459. // Fields allows partial responses to be retrieved. See
  2460. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2461. // for more information.
  2462. func (c *ManagedZonesGetCall) Fields(s ...googleapi.Field) *ManagedZonesGetCall {
  2463. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2464. return c
  2465. }
  2466. // IfNoneMatch sets the optional parameter which makes the operation
  2467. // fail if the object's ETag matches the given value. This is useful for
  2468. // getting updates only after the object has changed since the last
  2469. // request. Use googleapi.IsNotModified to check whether the response
  2470. // error from Do is the result of In-None-Match.
  2471. func (c *ManagedZonesGetCall) IfNoneMatch(entityTag string) *ManagedZonesGetCall {
  2472. c.ifNoneMatch_ = entityTag
  2473. return c
  2474. }
  2475. // Context sets the context to be used in this call's Do method. Any
  2476. // pending HTTP request will be aborted if the provided context is
  2477. // canceled.
  2478. func (c *ManagedZonesGetCall) Context(ctx context.Context) *ManagedZonesGetCall {
  2479. c.ctx_ = ctx
  2480. return c
  2481. }
  2482. // Header returns an http.Header that can be modified by the caller to
  2483. // add HTTP headers to the request.
  2484. func (c *ManagedZonesGetCall) Header() http.Header {
  2485. if c.header_ == nil {
  2486. c.header_ = make(http.Header)
  2487. }
  2488. return c.header_
  2489. }
  2490. func (c *ManagedZonesGetCall) doRequest(alt string) (*http.Response, error) {
  2491. reqHeaders := make(http.Header)
  2492. for k, v := range c.header_ {
  2493. reqHeaders[k] = v
  2494. }
  2495. reqHeaders.Set("User-Agent", c.s.userAgent())
  2496. if c.ifNoneMatch_ != "" {
  2497. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2498. }
  2499. var body io.Reader = nil
  2500. c.urlParams_.Set("alt", alt)
  2501. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  2502. urls += "?" + c.urlParams_.Encode()
  2503. req, _ := http.NewRequest("GET", urls, body)
  2504. req.Header = reqHeaders
  2505. googleapi.Expand(req.URL, map[string]string{
  2506. "project": c.project,
  2507. "managedZone": c.managedZone,
  2508. })
  2509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2510. }
  2511. // Do executes the "dns.managedZones.get" call.
  2512. // Exactly one of *ManagedZone or error will be non-nil. Any non-2xx
  2513. // status code is an error. Response headers are in either
  2514. // *ManagedZone.ServerResponse.Header or (if a response was returned at
  2515. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2516. // to check whether the returned error was because
  2517. // http.StatusNotModified was returned.
  2518. func (c *ManagedZonesGetCall) Do(opts ...googleapi.CallOption) (*ManagedZone, error) {
  2519. gensupport.SetOptions(c.urlParams_, opts...)
  2520. res, err := c.doRequest("json")
  2521. if res != nil && res.StatusCode == http.StatusNotModified {
  2522. if res.Body != nil {
  2523. res.Body.Close()
  2524. }
  2525. return nil, &googleapi.Error{
  2526. Code: res.StatusCode,
  2527. Header: res.Header,
  2528. }
  2529. }
  2530. if err != nil {
  2531. return nil, err
  2532. }
  2533. defer googleapi.CloseBody(res)
  2534. if err := googleapi.CheckResponse(res); err != nil {
  2535. return nil, err
  2536. }
  2537. ret := &ManagedZone{
  2538. ServerResponse: googleapi.ServerResponse{
  2539. Header: res.Header,
  2540. HTTPStatusCode: res.StatusCode,
  2541. },
  2542. }
  2543. target := &ret
  2544. if err := gensupport.DecodeResponse(target, res); err != nil {
  2545. return nil, err
  2546. }
  2547. return ret, nil
  2548. // {
  2549. // "description": "Fetch the representation of an existing ManagedZone.",
  2550. // "httpMethod": "GET",
  2551. // "id": "dns.managedZones.get",
  2552. // "parameterOrder": [
  2553. // "project",
  2554. // "managedZone"
  2555. // ],
  2556. // "parameters": {
  2557. // "clientOperationId": {
  2558. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  2559. // "location": "query",
  2560. // "type": "string"
  2561. // },
  2562. // "managedZone": {
  2563. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  2564. // "location": "path",
  2565. // "required": true,
  2566. // "type": "string"
  2567. // },
  2568. // "project": {
  2569. // "description": "Identifies the project addressed by this request.",
  2570. // "location": "path",
  2571. // "required": true,
  2572. // "type": "string"
  2573. // }
  2574. // },
  2575. // "path": "{project}/managedZones/{managedZone}",
  2576. // "response": {
  2577. // "$ref": "ManagedZone"
  2578. // },
  2579. // "scopes": [
  2580. // "https://www.googleapis.com/auth/cloud-platform",
  2581. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2582. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  2583. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2584. // ]
  2585. // }
  2586. }
  2587. // method id "dns.managedZones.list":
  2588. type ManagedZonesListCall struct {
  2589. s *Service
  2590. project string
  2591. urlParams_ gensupport.URLParams
  2592. ifNoneMatch_ string
  2593. ctx_ context.Context
  2594. header_ http.Header
  2595. }
  2596. // List: Enumerate ManagedZones that have been created but not yet
  2597. // deleted.
  2598. func (r *ManagedZonesService) List(project string) *ManagedZonesListCall {
  2599. c := &ManagedZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2600. c.project = project
  2601. return c
  2602. }
  2603. // DnsName sets the optional parameter "dnsName": Restricts the list to
  2604. // return only zones with this domain name.
  2605. func (c *ManagedZonesListCall) DnsName(dnsName string) *ManagedZonesListCall {
  2606. c.urlParams_.Set("dnsName", dnsName)
  2607. return c
  2608. }
  2609. // MaxResults sets the optional parameter "maxResults": Maximum number
  2610. // of results to be returned. If unspecified, the server will decide how
  2611. // many results to return.
  2612. func (c *ManagedZonesListCall) MaxResults(maxResults int64) *ManagedZonesListCall {
  2613. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2614. return c
  2615. }
  2616. // PageToken sets the optional parameter "pageToken": A tag returned by
  2617. // a previous list request that was truncated. Use this parameter to
  2618. // continue a previous list request.
  2619. func (c *ManagedZonesListCall) PageToken(pageToken string) *ManagedZonesListCall {
  2620. c.urlParams_.Set("pageToken", pageToken)
  2621. return c
  2622. }
  2623. // Fields allows partial responses to be retrieved. See
  2624. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2625. // for more information.
  2626. func (c *ManagedZonesListCall) Fields(s ...googleapi.Field) *ManagedZonesListCall {
  2627. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2628. return c
  2629. }
  2630. // IfNoneMatch sets the optional parameter which makes the operation
  2631. // fail if the object's ETag matches the given value. This is useful for
  2632. // getting updates only after the object has changed since the last
  2633. // request. Use googleapi.IsNotModified to check whether the response
  2634. // error from Do is the result of In-None-Match.
  2635. func (c *ManagedZonesListCall) IfNoneMatch(entityTag string) *ManagedZonesListCall {
  2636. c.ifNoneMatch_ = entityTag
  2637. return c
  2638. }
  2639. // Context sets the context to be used in this call's Do method. Any
  2640. // pending HTTP request will be aborted if the provided context is
  2641. // canceled.
  2642. func (c *ManagedZonesListCall) Context(ctx context.Context) *ManagedZonesListCall {
  2643. c.ctx_ = ctx
  2644. return c
  2645. }
  2646. // Header returns an http.Header that can be modified by the caller to
  2647. // add HTTP headers to the request.
  2648. func (c *ManagedZonesListCall) Header() http.Header {
  2649. if c.header_ == nil {
  2650. c.header_ = make(http.Header)
  2651. }
  2652. return c.header_
  2653. }
  2654. func (c *ManagedZonesListCall) doRequest(alt string) (*http.Response, error) {
  2655. reqHeaders := make(http.Header)
  2656. for k, v := range c.header_ {
  2657. reqHeaders[k] = v
  2658. }
  2659. reqHeaders.Set("User-Agent", c.s.userAgent())
  2660. if c.ifNoneMatch_ != "" {
  2661. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2662. }
  2663. var body io.Reader = nil
  2664. c.urlParams_.Set("alt", alt)
  2665. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
  2666. urls += "?" + c.urlParams_.Encode()
  2667. req, _ := http.NewRequest("GET", urls, body)
  2668. req.Header = reqHeaders
  2669. googleapi.Expand(req.URL, map[string]string{
  2670. "project": c.project,
  2671. })
  2672. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2673. }
  2674. // Do executes the "dns.managedZones.list" call.
  2675. // Exactly one of *ManagedZonesListResponse or error will be non-nil.
  2676. // Any non-2xx status code is an error. Response headers are in either
  2677. // *ManagedZonesListResponse.ServerResponse.Header or (if a response was
  2678. // returned at all) in error.(*googleapi.Error).Header. Use
  2679. // googleapi.IsNotModified to check whether the returned error was
  2680. // because http.StatusNotModified was returned.
  2681. func (c *ManagedZonesListCall) Do(opts ...googleapi.CallOption) (*ManagedZonesListResponse, error) {
  2682. gensupport.SetOptions(c.urlParams_, opts...)
  2683. res, err := c.doRequest("json")
  2684. if res != nil && res.StatusCode == http.StatusNotModified {
  2685. if res.Body != nil {
  2686. res.Body.Close()
  2687. }
  2688. return nil, &googleapi.Error{
  2689. Code: res.StatusCode,
  2690. Header: res.Header,
  2691. }
  2692. }
  2693. if err != nil {
  2694. return nil, err
  2695. }
  2696. defer googleapi.CloseBody(res)
  2697. if err := googleapi.CheckResponse(res); err != nil {
  2698. return nil, err
  2699. }
  2700. ret := &ManagedZonesListResponse{
  2701. ServerResponse: googleapi.ServerResponse{
  2702. Header: res.Header,
  2703. HTTPStatusCode: res.StatusCode,
  2704. },
  2705. }
  2706. target := &ret
  2707. if err := gensupport.DecodeResponse(target, res); err != nil {
  2708. return nil, err
  2709. }
  2710. return ret, nil
  2711. // {
  2712. // "description": "Enumerate ManagedZones that have been created but not yet deleted.",
  2713. // "httpMethod": "GET",
  2714. // "id": "dns.managedZones.list",
  2715. // "parameterOrder": [
  2716. // "project"
  2717. // ],
  2718. // "parameters": {
  2719. // "dnsName": {
  2720. // "description": "Restricts the list to return only zones with this domain name.",
  2721. // "location": "query",
  2722. // "type": "string"
  2723. // },
  2724. // "maxResults": {
  2725. // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
  2726. // "format": "int32",
  2727. // "location": "query",
  2728. // "type": "integer"
  2729. // },
  2730. // "pageToken": {
  2731. // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
  2732. // "location": "query",
  2733. // "type": "string"
  2734. // },
  2735. // "project": {
  2736. // "description": "Identifies the project addressed by this request.",
  2737. // "location": "path",
  2738. // "required": true,
  2739. // "type": "string"
  2740. // }
  2741. // },
  2742. // "path": "{project}/managedZones",
  2743. // "response": {
  2744. // "$ref": "ManagedZonesListResponse"
  2745. // },
  2746. // "scopes": [
  2747. // "https://www.googleapis.com/auth/cloud-platform",
  2748. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2749. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  2750. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2751. // ]
  2752. // }
  2753. }
  2754. // Pages invokes f for each page of results.
  2755. // A non-nil error returned from f will halt the iteration.
  2756. // The provided context supersedes any context provided to the Context method.
  2757. func (c *ManagedZonesListCall) Pages(ctx context.Context, f func(*ManagedZonesListResponse) error) error {
  2758. c.ctx_ = ctx
  2759. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2760. for {
  2761. x, err := c.Do()
  2762. if err != nil {
  2763. return err
  2764. }
  2765. if err := f(x); err != nil {
  2766. return err
  2767. }
  2768. if x.NextPageToken == "" {
  2769. return nil
  2770. }
  2771. c.PageToken(x.NextPageToken)
  2772. }
  2773. }
  2774. // method id "dns.managedZones.patch":
  2775. type ManagedZonesPatchCall struct {
  2776. s *Service
  2777. project string
  2778. managedZone string
  2779. managedzone *ManagedZone
  2780. urlParams_ gensupport.URLParams
  2781. ctx_ context.Context
  2782. header_ http.Header
  2783. }
  2784. // Patch: Apply a partial update to an existing ManagedZone.
  2785. func (r *ManagedZonesService) Patch(project string, managedZone string, managedzone *ManagedZone) *ManagedZonesPatchCall {
  2786. c := &ManagedZonesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2787. c.project = project
  2788. c.managedZone = managedZone
  2789. c.managedzone = managedzone
  2790. return c
  2791. }
  2792. // ClientOperationId sets the optional parameter "clientOperationId":
  2793. // For mutating operation requests only. An optional identifier
  2794. // specified by the client. Must be unique for operation resources in
  2795. // the Operations collection.
  2796. func (c *ManagedZonesPatchCall) ClientOperationId(clientOperationId string) *ManagedZonesPatchCall {
  2797. c.urlParams_.Set("clientOperationId", clientOperationId)
  2798. return c
  2799. }
  2800. // Fields allows partial responses to be retrieved. See
  2801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2802. // for more information.
  2803. func (c *ManagedZonesPatchCall) Fields(s ...googleapi.Field) *ManagedZonesPatchCall {
  2804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2805. return c
  2806. }
  2807. // Context sets the context to be used in this call's Do method. Any
  2808. // pending HTTP request will be aborted if the provided context is
  2809. // canceled.
  2810. func (c *ManagedZonesPatchCall) Context(ctx context.Context) *ManagedZonesPatchCall {
  2811. c.ctx_ = ctx
  2812. return c
  2813. }
  2814. // Header returns an http.Header that can be modified by the caller to
  2815. // add HTTP headers to the request.
  2816. func (c *ManagedZonesPatchCall) Header() http.Header {
  2817. if c.header_ == nil {
  2818. c.header_ = make(http.Header)
  2819. }
  2820. return c.header_
  2821. }
  2822. func (c *ManagedZonesPatchCall) doRequest(alt string) (*http.Response, error) {
  2823. reqHeaders := make(http.Header)
  2824. for k, v := range c.header_ {
  2825. reqHeaders[k] = v
  2826. }
  2827. reqHeaders.Set("User-Agent", c.s.userAgent())
  2828. var body io.Reader = nil
  2829. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
  2830. if err != nil {
  2831. return nil, err
  2832. }
  2833. reqHeaders.Set("Content-Type", "application/json")
  2834. c.urlParams_.Set("alt", alt)
  2835. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  2836. urls += "?" + c.urlParams_.Encode()
  2837. req, _ := http.NewRequest("PATCH", urls, body)
  2838. req.Header = reqHeaders
  2839. googleapi.Expand(req.URL, map[string]string{
  2840. "project": c.project,
  2841. "managedZone": c.managedZone,
  2842. })
  2843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2844. }
  2845. // Do executes the "dns.managedZones.patch" call.
  2846. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2847. // status code is an error. Response headers are in either
  2848. // *Operation.ServerResponse.Header or (if a response was returned at
  2849. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2850. // to check whether the returned error was because
  2851. // http.StatusNotModified was returned.
  2852. func (c *ManagedZonesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2853. gensupport.SetOptions(c.urlParams_, opts...)
  2854. res, err := c.doRequest("json")
  2855. if res != nil && res.StatusCode == http.StatusNotModified {
  2856. if res.Body != nil {
  2857. res.Body.Close()
  2858. }
  2859. return nil, &googleapi.Error{
  2860. Code: res.StatusCode,
  2861. Header: res.Header,
  2862. }
  2863. }
  2864. if err != nil {
  2865. return nil, err
  2866. }
  2867. defer googleapi.CloseBody(res)
  2868. if err := googleapi.CheckResponse(res); err != nil {
  2869. return nil, err
  2870. }
  2871. ret := &Operation{
  2872. ServerResponse: googleapi.ServerResponse{
  2873. Header: res.Header,
  2874. HTTPStatusCode: res.StatusCode,
  2875. },
  2876. }
  2877. target := &ret
  2878. if err := gensupport.DecodeResponse(target, res); err != nil {
  2879. return nil, err
  2880. }
  2881. return ret, nil
  2882. // {
  2883. // "description": "Apply a partial update to an existing ManagedZone.",
  2884. // "httpMethod": "PATCH",
  2885. // "id": "dns.managedZones.patch",
  2886. // "parameterOrder": [
  2887. // "project",
  2888. // "managedZone"
  2889. // ],
  2890. // "parameters": {
  2891. // "clientOperationId": {
  2892. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  2893. // "location": "query",
  2894. // "type": "string"
  2895. // },
  2896. // "managedZone": {
  2897. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  2898. // "location": "path",
  2899. // "required": true,
  2900. // "type": "string"
  2901. // },
  2902. // "project": {
  2903. // "description": "Identifies the project addressed by this request.",
  2904. // "location": "path",
  2905. // "required": true,
  2906. // "type": "string"
  2907. // }
  2908. // },
  2909. // "path": "{project}/managedZones/{managedZone}",
  2910. // "request": {
  2911. // "$ref": "ManagedZone"
  2912. // },
  2913. // "response": {
  2914. // "$ref": "Operation"
  2915. // },
  2916. // "scopes": [
  2917. // "https://www.googleapis.com/auth/cloud-platform",
  2918. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2919. // ]
  2920. // }
  2921. }
  2922. // method id "dns.managedZones.update":
  2923. type ManagedZonesUpdateCall struct {
  2924. s *Service
  2925. project string
  2926. managedZone string
  2927. managedzone *ManagedZone
  2928. urlParams_ gensupport.URLParams
  2929. ctx_ context.Context
  2930. header_ http.Header
  2931. }
  2932. // Update: Update an existing ManagedZone.
  2933. func (r *ManagedZonesService) Update(project string, managedZone string, managedzone *ManagedZone) *ManagedZonesUpdateCall {
  2934. c := &ManagedZonesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2935. c.project = project
  2936. c.managedZone = managedZone
  2937. c.managedzone = managedzone
  2938. return c
  2939. }
  2940. // ClientOperationId sets the optional parameter "clientOperationId":
  2941. // For mutating operation requests only. An optional identifier
  2942. // specified by the client. Must be unique for operation resources in
  2943. // the Operations collection.
  2944. func (c *ManagedZonesUpdateCall) ClientOperationId(clientOperationId string) *ManagedZonesUpdateCall {
  2945. c.urlParams_.Set("clientOperationId", clientOperationId)
  2946. return c
  2947. }
  2948. // Fields allows partial responses to be retrieved. See
  2949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2950. // for more information.
  2951. func (c *ManagedZonesUpdateCall) Fields(s ...googleapi.Field) *ManagedZonesUpdateCall {
  2952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2953. return c
  2954. }
  2955. // Context sets the context to be used in this call's Do method. Any
  2956. // pending HTTP request will be aborted if the provided context is
  2957. // canceled.
  2958. func (c *ManagedZonesUpdateCall) Context(ctx context.Context) *ManagedZonesUpdateCall {
  2959. c.ctx_ = ctx
  2960. return c
  2961. }
  2962. // Header returns an http.Header that can be modified by the caller to
  2963. // add HTTP headers to the request.
  2964. func (c *ManagedZonesUpdateCall) Header() http.Header {
  2965. if c.header_ == nil {
  2966. c.header_ = make(http.Header)
  2967. }
  2968. return c.header_
  2969. }
  2970. func (c *ManagedZonesUpdateCall) doRequest(alt string) (*http.Response, error) {
  2971. reqHeaders := make(http.Header)
  2972. for k, v := range c.header_ {
  2973. reqHeaders[k] = v
  2974. }
  2975. reqHeaders.Set("User-Agent", c.s.userAgent())
  2976. var body io.Reader = nil
  2977. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
  2978. if err != nil {
  2979. return nil, err
  2980. }
  2981. reqHeaders.Set("Content-Type", "application/json")
  2982. c.urlParams_.Set("alt", alt)
  2983. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  2984. urls += "?" + c.urlParams_.Encode()
  2985. req, _ := http.NewRequest("PUT", urls, body)
  2986. req.Header = reqHeaders
  2987. googleapi.Expand(req.URL, map[string]string{
  2988. "project": c.project,
  2989. "managedZone": c.managedZone,
  2990. })
  2991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2992. }
  2993. // Do executes the "dns.managedZones.update" call.
  2994. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2995. // status code is an error. Response headers are in either
  2996. // *Operation.ServerResponse.Header or (if a response was returned at
  2997. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2998. // to check whether the returned error was because
  2999. // http.StatusNotModified was returned.
  3000. func (c *ManagedZonesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3001. gensupport.SetOptions(c.urlParams_, opts...)
  3002. res, err := c.doRequest("json")
  3003. if res != nil && res.StatusCode == http.StatusNotModified {
  3004. if res.Body != nil {
  3005. res.Body.Close()
  3006. }
  3007. return nil, &googleapi.Error{
  3008. Code: res.StatusCode,
  3009. Header: res.Header,
  3010. }
  3011. }
  3012. if err != nil {
  3013. return nil, err
  3014. }
  3015. defer googleapi.CloseBody(res)
  3016. if err := googleapi.CheckResponse(res); err != nil {
  3017. return nil, err
  3018. }
  3019. ret := &Operation{
  3020. ServerResponse: googleapi.ServerResponse{
  3021. Header: res.Header,
  3022. HTTPStatusCode: res.StatusCode,
  3023. },
  3024. }
  3025. target := &ret
  3026. if err := gensupport.DecodeResponse(target, res); err != nil {
  3027. return nil, err
  3028. }
  3029. return ret, nil
  3030. // {
  3031. // "description": "Update an existing ManagedZone.",
  3032. // "httpMethod": "PUT",
  3033. // "id": "dns.managedZones.update",
  3034. // "parameterOrder": [
  3035. // "project",
  3036. // "managedZone"
  3037. // ],
  3038. // "parameters": {
  3039. // "clientOperationId": {
  3040. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  3041. // "location": "query",
  3042. // "type": "string"
  3043. // },
  3044. // "managedZone": {
  3045. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  3046. // "location": "path",
  3047. // "required": true,
  3048. // "type": "string"
  3049. // },
  3050. // "project": {
  3051. // "description": "Identifies the project addressed by this request.",
  3052. // "location": "path",
  3053. // "required": true,
  3054. // "type": "string"
  3055. // }
  3056. // },
  3057. // "path": "{project}/managedZones/{managedZone}",
  3058. // "request": {
  3059. // "$ref": "ManagedZone"
  3060. // },
  3061. // "response": {
  3062. // "$ref": "Operation"
  3063. // },
  3064. // "scopes": [
  3065. // "https://www.googleapis.com/auth/cloud-platform",
  3066. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3067. // ]
  3068. // }
  3069. }
  3070. // method id "dns.projects.get":
  3071. type ProjectsGetCall struct {
  3072. s *Service
  3073. project string
  3074. urlParams_ gensupport.URLParams
  3075. ifNoneMatch_ string
  3076. ctx_ context.Context
  3077. header_ http.Header
  3078. }
  3079. // Get: Fetch the representation of an existing Project.
  3080. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  3081. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3082. c.project = project
  3083. return c
  3084. }
  3085. // ClientOperationId sets the optional parameter "clientOperationId":
  3086. // For mutating operation requests only. An optional identifier
  3087. // specified by the client. Must be unique for operation resources in
  3088. // the Operations collection.
  3089. func (c *ProjectsGetCall) ClientOperationId(clientOperationId string) *ProjectsGetCall {
  3090. c.urlParams_.Set("clientOperationId", clientOperationId)
  3091. return c
  3092. }
  3093. // Fields allows partial responses to be retrieved. See
  3094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3095. // for more information.
  3096. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  3097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3098. return c
  3099. }
  3100. // IfNoneMatch sets the optional parameter which makes the operation
  3101. // fail if the object's ETag matches the given value. This is useful for
  3102. // getting updates only after the object has changed since the last
  3103. // request. Use googleapi.IsNotModified to check whether the response
  3104. // error from Do is the result of In-None-Match.
  3105. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  3106. c.ifNoneMatch_ = entityTag
  3107. return c
  3108. }
  3109. // Context sets the context to be used in this call's Do method. Any
  3110. // pending HTTP request will be aborted if the provided context is
  3111. // canceled.
  3112. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  3113. c.ctx_ = ctx
  3114. return c
  3115. }
  3116. // Header returns an http.Header that can be modified by the caller to
  3117. // add HTTP headers to the request.
  3118. func (c *ProjectsGetCall) Header() http.Header {
  3119. if c.header_ == nil {
  3120. c.header_ = make(http.Header)
  3121. }
  3122. return c.header_
  3123. }
  3124. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  3125. reqHeaders := make(http.Header)
  3126. for k, v := range c.header_ {
  3127. reqHeaders[k] = v
  3128. }
  3129. reqHeaders.Set("User-Agent", c.s.userAgent())
  3130. if c.ifNoneMatch_ != "" {
  3131. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3132. }
  3133. var body io.Reader = nil
  3134. c.urlParams_.Set("alt", alt)
  3135. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  3136. urls += "?" + c.urlParams_.Encode()
  3137. req, _ := http.NewRequest("GET", urls, body)
  3138. req.Header = reqHeaders
  3139. googleapi.Expand(req.URL, map[string]string{
  3140. "project": c.project,
  3141. })
  3142. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3143. }
  3144. // Do executes the "dns.projects.get" call.
  3145. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  3146. // code is an error. Response headers are in either
  3147. // *Project.ServerResponse.Header or (if a response was returned at all)
  3148. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3149. // check whether the returned error was because http.StatusNotModified
  3150. // was returned.
  3151. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  3152. gensupport.SetOptions(c.urlParams_, opts...)
  3153. res, err := c.doRequest("json")
  3154. if res != nil && res.StatusCode == http.StatusNotModified {
  3155. if res.Body != nil {
  3156. res.Body.Close()
  3157. }
  3158. return nil, &googleapi.Error{
  3159. Code: res.StatusCode,
  3160. Header: res.Header,
  3161. }
  3162. }
  3163. if err != nil {
  3164. return nil, err
  3165. }
  3166. defer googleapi.CloseBody(res)
  3167. if err := googleapi.CheckResponse(res); err != nil {
  3168. return nil, err
  3169. }
  3170. ret := &Project{
  3171. ServerResponse: googleapi.ServerResponse{
  3172. Header: res.Header,
  3173. HTTPStatusCode: res.StatusCode,
  3174. },
  3175. }
  3176. target := &ret
  3177. if err := gensupport.DecodeResponse(target, res); err != nil {
  3178. return nil, err
  3179. }
  3180. return ret, nil
  3181. // {
  3182. // "description": "Fetch the representation of an existing Project.",
  3183. // "httpMethod": "GET",
  3184. // "id": "dns.projects.get",
  3185. // "parameterOrder": [
  3186. // "project"
  3187. // ],
  3188. // "parameters": {
  3189. // "clientOperationId": {
  3190. // "description": "For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection.",
  3191. // "location": "query",
  3192. // "type": "string"
  3193. // },
  3194. // "project": {
  3195. // "description": "Identifies the project addressed by this request.",
  3196. // "location": "path",
  3197. // "required": true,
  3198. // "type": "string"
  3199. // }
  3200. // },
  3201. // "path": "{project}",
  3202. // "response": {
  3203. // "$ref": "Project"
  3204. // },
  3205. // "scopes": [
  3206. // "https://www.googleapis.com/auth/cloud-platform",
  3207. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3208. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  3209. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3210. // ]
  3211. // }
  3212. }
  3213. // method id "dns.resourceRecordSets.list":
  3214. type ResourceRecordSetsListCall struct {
  3215. s *Service
  3216. project string
  3217. managedZone string
  3218. urlParams_ gensupport.URLParams
  3219. ifNoneMatch_ string
  3220. ctx_ context.Context
  3221. header_ http.Header
  3222. }
  3223. // List: Enumerate ResourceRecordSets that have been created but not yet
  3224. // deleted.
  3225. func (r *ResourceRecordSetsService) List(project string, managedZone string) *ResourceRecordSetsListCall {
  3226. c := &ResourceRecordSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3227. c.project = project
  3228. c.managedZone = managedZone
  3229. return c
  3230. }
  3231. // MaxResults sets the optional parameter "maxResults": Maximum number
  3232. // of results to be returned. If unspecified, the server will decide how
  3233. // many results to return.
  3234. func (c *ResourceRecordSetsListCall) MaxResults(maxResults int64) *ResourceRecordSetsListCall {
  3235. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3236. return c
  3237. }
  3238. // Name sets the optional parameter "name": Restricts the list to return
  3239. // only records with this fully qualified domain name.
  3240. func (c *ResourceRecordSetsListCall) Name(name string) *ResourceRecordSetsListCall {
  3241. c.urlParams_.Set("name", name)
  3242. return c
  3243. }
  3244. // PageToken sets the optional parameter "pageToken": A tag returned by
  3245. // a previous list request that was truncated. Use this parameter to
  3246. // continue a previous list request.
  3247. func (c *ResourceRecordSetsListCall) PageToken(pageToken string) *ResourceRecordSetsListCall {
  3248. c.urlParams_.Set("pageToken", pageToken)
  3249. return c
  3250. }
  3251. // Type sets the optional parameter "type": Restricts the list to return
  3252. // only records of this type. If present, the "name" parameter must also
  3253. // be present.
  3254. func (c *ResourceRecordSetsListCall) Type(type_ string) *ResourceRecordSetsListCall {
  3255. c.urlParams_.Set("type", type_)
  3256. return c
  3257. }
  3258. // Fields allows partial responses to be retrieved. See
  3259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3260. // for more information.
  3261. func (c *ResourceRecordSetsListCall) Fields(s ...googleapi.Field) *ResourceRecordSetsListCall {
  3262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3263. return c
  3264. }
  3265. // IfNoneMatch sets the optional parameter which makes the operation
  3266. // fail if the object's ETag matches the given value. This is useful for
  3267. // getting updates only after the object has changed since the last
  3268. // request. Use googleapi.IsNotModified to check whether the response
  3269. // error from Do is the result of In-None-Match.
  3270. func (c *ResourceRecordSetsListCall) IfNoneMatch(entityTag string) *ResourceRecordSetsListCall {
  3271. c.ifNoneMatch_ = entityTag
  3272. return c
  3273. }
  3274. // Context sets the context to be used in this call's Do method. Any
  3275. // pending HTTP request will be aborted if the provided context is
  3276. // canceled.
  3277. func (c *ResourceRecordSetsListCall) Context(ctx context.Context) *ResourceRecordSetsListCall {
  3278. c.ctx_ = ctx
  3279. return c
  3280. }
  3281. // Header returns an http.Header that can be modified by the caller to
  3282. // add HTTP headers to the request.
  3283. func (c *ResourceRecordSetsListCall) Header() http.Header {
  3284. if c.header_ == nil {
  3285. c.header_ = make(http.Header)
  3286. }
  3287. return c.header_
  3288. }
  3289. func (c *ResourceRecordSetsListCall) doRequest(alt string) (*http.Response, error) {
  3290. reqHeaders := make(http.Header)
  3291. for k, v := range c.header_ {
  3292. reqHeaders[k] = v
  3293. }
  3294. reqHeaders.Set("User-Agent", c.s.userAgent())
  3295. if c.ifNoneMatch_ != "" {
  3296. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3297. }
  3298. var body io.Reader = nil
  3299. c.urlParams_.Set("alt", alt)
  3300. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/rrsets")
  3301. urls += "?" + c.urlParams_.Encode()
  3302. req, _ := http.NewRequest("GET", urls, body)
  3303. req.Header = reqHeaders
  3304. googleapi.Expand(req.URL, map[string]string{
  3305. "project": c.project,
  3306. "managedZone": c.managedZone,
  3307. })
  3308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3309. }
  3310. // Do executes the "dns.resourceRecordSets.list" call.
  3311. // Exactly one of *ResourceRecordSetsListResponse or error will be
  3312. // non-nil. Any non-2xx status code is an error. Response headers are in
  3313. // either *ResourceRecordSetsListResponse.ServerResponse.Header or (if a
  3314. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3315. // googleapi.IsNotModified to check whether the returned error was
  3316. // because http.StatusNotModified was returned.
  3317. func (c *ResourceRecordSetsListCall) Do(opts ...googleapi.CallOption) (*ResourceRecordSetsListResponse, error) {
  3318. gensupport.SetOptions(c.urlParams_, opts...)
  3319. res, err := c.doRequest("json")
  3320. if res != nil && res.StatusCode == http.StatusNotModified {
  3321. if res.Body != nil {
  3322. res.Body.Close()
  3323. }
  3324. return nil, &googleapi.Error{
  3325. Code: res.StatusCode,
  3326. Header: res.Header,
  3327. }
  3328. }
  3329. if err != nil {
  3330. return nil, err
  3331. }
  3332. defer googleapi.CloseBody(res)
  3333. if err := googleapi.CheckResponse(res); err != nil {
  3334. return nil, err
  3335. }
  3336. ret := &ResourceRecordSetsListResponse{
  3337. ServerResponse: googleapi.ServerResponse{
  3338. Header: res.Header,
  3339. HTTPStatusCode: res.StatusCode,
  3340. },
  3341. }
  3342. target := &ret
  3343. if err := gensupport.DecodeResponse(target, res); err != nil {
  3344. return nil, err
  3345. }
  3346. return ret, nil
  3347. // {
  3348. // "description": "Enumerate ResourceRecordSets that have been created but not yet deleted.",
  3349. // "httpMethod": "GET",
  3350. // "id": "dns.resourceRecordSets.list",
  3351. // "parameterOrder": [
  3352. // "project",
  3353. // "managedZone"
  3354. // ],
  3355. // "parameters": {
  3356. // "managedZone": {
  3357. // "description": "Identifies the managed zone addressed by this request. Can be the managed zone name or id.",
  3358. // "location": "path",
  3359. // "required": true,
  3360. // "type": "string"
  3361. // },
  3362. // "maxResults": {
  3363. // "description": "Optional. Maximum number of results to be returned. If unspecified, the server will decide how many results to return.",
  3364. // "format": "int32",
  3365. // "location": "query",
  3366. // "type": "integer"
  3367. // },
  3368. // "name": {
  3369. // "description": "Restricts the list to return only records with this fully qualified domain name.",
  3370. // "location": "query",
  3371. // "type": "string"
  3372. // },
  3373. // "pageToken": {
  3374. // "description": "Optional. A tag returned by a previous list request that was truncated. Use this parameter to continue a previous list request.",
  3375. // "location": "query",
  3376. // "type": "string"
  3377. // },
  3378. // "project": {
  3379. // "description": "Identifies the project addressed by this request.",
  3380. // "location": "path",
  3381. // "required": true,
  3382. // "type": "string"
  3383. // },
  3384. // "type": {
  3385. // "description": "Restricts the list to return only records of this type. If present, the \"name\" parameter must also be present.",
  3386. // "location": "query",
  3387. // "type": "string"
  3388. // }
  3389. // },
  3390. // "path": "{project}/managedZones/{managedZone}/rrsets",
  3391. // "response": {
  3392. // "$ref": "ResourceRecordSetsListResponse"
  3393. // },
  3394. // "scopes": [
  3395. // "https://www.googleapis.com/auth/cloud-platform",
  3396. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3397. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  3398. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3399. // ]
  3400. // }
  3401. }
  3402. // Pages invokes f for each page of results.
  3403. // A non-nil error returned from f will halt the iteration.
  3404. // The provided context supersedes any context provided to the Context method.
  3405. func (c *ResourceRecordSetsListCall) Pages(ctx context.Context, f func(*ResourceRecordSetsListResponse) error) error {
  3406. c.ctx_ = ctx
  3407. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3408. for {
  3409. x, err := c.Do()
  3410. if err != nil {
  3411. return err
  3412. }
  3413. if err := f(x); err != nil {
  3414. return err
  3415. }
  3416. if x.NextPageToken == "" {
  3417. return nil
  3418. }
  3419. c.PageToken(x.NextPageToken)
  3420. }
  3421. }