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.
 
 
 

3627 lines
112 KiB

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