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.
 
 
 

4870 lines
151 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/v1beta2"
  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/v1beta2"
  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:v1beta2"
  71. const apiName = "dns"
  72. const apiVersion = "v1beta2"
  73. const basePath = "https://www.googleapis.com/dns/v1beta2/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.Policies = NewPoliciesService(s)
  123. s.Projects = NewProjectsService(s)
  124. s.ResourceRecordSets = NewResourceRecordSetsService(s)
  125. return s, nil
  126. }
  127. type Service struct {
  128. client *http.Client
  129. BasePath string // API endpoint base URL
  130. UserAgent string // optional additional User-Agent fragment
  131. Changes *ChangesService
  132. DnsKeys *DnsKeysService
  133. ManagedZoneOperations *ManagedZoneOperationsService
  134. ManagedZones *ManagedZonesService
  135. Policies *PoliciesService
  136. Projects *ProjectsService
  137. ResourceRecordSets *ResourceRecordSetsService
  138. }
  139. func (s *Service) userAgent() string {
  140. if s.UserAgent == "" {
  141. return googleapi.UserAgent
  142. }
  143. return googleapi.UserAgent + " " + s.UserAgent
  144. }
  145. func NewChangesService(s *Service) *ChangesService {
  146. rs := &ChangesService{s: s}
  147. return rs
  148. }
  149. type ChangesService struct {
  150. s *Service
  151. }
  152. func NewDnsKeysService(s *Service) *DnsKeysService {
  153. rs := &DnsKeysService{s: s}
  154. return rs
  155. }
  156. type DnsKeysService struct {
  157. s *Service
  158. }
  159. func NewManagedZoneOperationsService(s *Service) *ManagedZoneOperationsService {
  160. rs := &ManagedZoneOperationsService{s: s}
  161. return rs
  162. }
  163. type ManagedZoneOperationsService struct {
  164. s *Service
  165. }
  166. func NewManagedZonesService(s *Service) *ManagedZonesService {
  167. rs := &ManagedZonesService{s: s}
  168. return rs
  169. }
  170. type ManagedZonesService struct {
  171. s *Service
  172. }
  173. func NewPoliciesService(s *Service) *PoliciesService {
  174. rs := &PoliciesService{s: s}
  175. return rs
  176. }
  177. type PoliciesService struct {
  178. s *Service
  179. }
  180. func NewProjectsService(s *Service) *ProjectsService {
  181. rs := &ProjectsService{s: s}
  182. return rs
  183. }
  184. type ProjectsService struct {
  185. s *Service
  186. }
  187. func NewResourceRecordSetsService(s *Service) *ResourceRecordSetsService {
  188. rs := &ResourceRecordSetsService{s: s}
  189. return rs
  190. }
  191. type ResourceRecordSetsService struct {
  192. s *Service
  193. }
  194. type Change struct {
  195. Additions []*ResourceRecordSet `json:"additions,omitempty"`
  196. Deletions []*ResourceRecordSet `json:"deletions,omitempty"`
  197. Id string `json:"id,omitempty"`
  198. IsServing bool `json:"isServing,omitempty"`
  199. // Kind: Identifies what kind of resource this is. Value: the fixed
  200. // string "dns#change".
  201. Kind string `json:"kind,omitempty"`
  202. StartTime string `json:"startTime,omitempty"`
  203. // Possible values:
  204. // "done"
  205. // "pending"
  206. Status string `json:"status,omitempty"`
  207. // ServerResponse contains the HTTP response code and headers from the
  208. // server.
  209. googleapi.ServerResponse `json:"-"`
  210. // ForceSendFields is a list of field names (e.g. "Additions") to
  211. // unconditionally include in API requests. By default, fields with
  212. // empty values are omitted from API requests. However, any non-pointer,
  213. // non-interface field appearing in ForceSendFields will be sent to the
  214. // server regardless of whether the field is empty or not. This may be
  215. // used to include empty fields in Patch requests.
  216. ForceSendFields []string `json:"-"`
  217. // NullFields is a list of field names (e.g. "Additions") to include in
  218. // API requests with the JSON null value. By default, fields with empty
  219. // values are omitted from API requests. However, any field with an
  220. // empty value appearing in NullFields will be sent to the server as
  221. // null. It is an error if a field in this list has a non-empty value.
  222. // This may be used to include null fields in Patch requests.
  223. NullFields []string `json:"-"`
  224. }
  225. func (s *Change) MarshalJSON() ([]byte, error) {
  226. type NoMethod Change
  227. raw := NoMethod(*s)
  228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  229. }
  230. type ChangesListResponse struct {
  231. Changes []*Change `json:"changes,omitempty"`
  232. Header *ResponseHeader `json:"header,omitempty"`
  233. // Kind: Type of resource.
  234. Kind string `json:"kind,omitempty"`
  235. NextPageToken string `json:"nextPageToken,omitempty"`
  236. // ServerResponse contains the HTTP response code and headers from the
  237. // server.
  238. googleapi.ServerResponse `json:"-"`
  239. // ForceSendFields is a list of field names (e.g. "Changes") to
  240. // unconditionally include in API requests. By default, fields with
  241. // empty values are omitted from API requests. However, any non-pointer,
  242. // non-interface field appearing in ForceSendFields will be sent to the
  243. // server regardless of whether the field is empty or not. This may be
  244. // used to include empty fields in Patch requests.
  245. ForceSendFields []string `json:"-"`
  246. // NullFields is a list of field names (e.g. "Changes") to include in
  247. // API requests with the JSON null value. By default, fields with empty
  248. // values are omitted from API requests. However, any field with an
  249. // empty value appearing in NullFields will be sent to the server as
  250. // null. It is an error if a field in this list has a non-empty value.
  251. // This may be used to include null fields in Patch requests.
  252. NullFields []string `json:"-"`
  253. }
  254. func (s *ChangesListResponse) MarshalJSON() ([]byte, error) {
  255. type NoMethod ChangesListResponse
  256. raw := NoMethod(*s)
  257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  258. }
  259. type DnsKey struct {
  260. // Possible values:
  261. // "ecdsap256sha256"
  262. // "ecdsap384sha384"
  263. // "rsasha1"
  264. // "rsasha256"
  265. // "rsasha512"
  266. Algorithm string `json:"algorithm,omitempty"`
  267. CreationTime string `json:"creationTime,omitempty"`
  268. Description string `json:"description,omitempty"`
  269. Digests []*DnsKeyDigest `json:"digests,omitempty"`
  270. Id string `json:"id,omitempty"`
  271. IsActive bool `json:"isActive,omitempty"`
  272. KeyLength int64 `json:"keyLength,omitempty"`
  273. KeyTag int64 `json:"keyTag,omitempty"`
  274. // Kind: Identifies what kind of resource this is. Value: the fixed
  275. // string "dns#dnsKey".
  276. Kind string `json:"kind,omitempty"`
  277. PublicKey string `json:"publicKey,omitempty"`
  278. // Possible values:
  279. // "keySigning"
  280. // "zoneSigning"
  281. Type string `json:"type,omitempty"`
  282. // ServerResponse contains the HTTP response code and headers from the
  283. // server.
  284. googleapi.ServerResponse `json:"-"`
  285. // ForceSendFields is a list of field names (e.g. "Algorithm") to
  286. // unconditionally include in API requests. By default, fields with
  287. // empty values are omitted from API requests. However, any non-pointer,
  288. // non-interface field appearing in ForceSendFields will be sent to the
  289. // server regardless of whether the field is empty or not. This may be
  290. // used to include empty fields in Patch requests.
  291. ForceSendFields []string `json:"-"`
  292. // NullFields is a list of field names (e.g. "Algorithm") to include in
  293. // API requests with the JSON null value. By default, fields with empty
  294. // values are omitted from API requests. However, any field with an
  295. // empty value appearing in NullFields will be sent to the server as
  296. // null. It is an error if a field in this list has a non-empty value.
  297. // This may be used to include null fields in Patch requests.
  298. NullFields []string `json:"-"`
  299. }
  300. func (s *DnsKey) MarshalJSON() ([]byte, error) {
  301. type NoMethod DnsKey
  302. raw := NoMethod(*s)
  303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  304. }
  305. type DnsKeyDigest struct {
  306. Digest string `json:"digest,omitempty"`
  307. // Possible values:
  308. // "sha1"
  309. // "sha256"
  310. // "sha384"
  311. Type string `json:"type,omitempty"`
  312. // ForceSendFields is a list of field names (e.g. "Digest") to
  313. // unconditionally include in API requests. By default, fields with
  314. // empty values are omitted from API requests. However, any non-pointer,
  315. // non-interface field appearing in ForceSendFields will be sent to the
  316. // server regardless of whether the field is empty or not. This may be
  317. // used to include empty fields in Patch requests.
  318. ForceSendFields []string `json:"-"`
  319. // NullFields is a list of field names (e.g. "Digest") to include in API
  320. // requests with the JSON null value. By default, fields with empty
  321. // values are omitted from API requests. However, any field with an
  322. // empty value appearing in NullFields will be sent to the server as
  323. // null. It is an error if a field in this list has a non-empty value.
  324. // This may be used to include null fields in Patch requests.
  325. NullFields []string `json:"-"`
  326. }
  327. func (s *DnsKeyDigest) MarshalJSON() ([]byte, error) {
  328. type NoMethod DnsKeyDigest
  329. raw := NoMethod(*s)
  330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  331. }
  332. type DnsKeySpec struct {
  333. // Possible values:
  334. // "ecdsap256sha256"
  335. // "ecdsap384sha384"
  336. // "rsasha1"
  337. // "rsasha256"
  338. // "rsasha512"
  339. Algorithm string `json:"algorithm,omitempty"`
  340. KeyLength int64 `json:"keyLength,omitempty"`
  341. // Possible values:
  342. // "keySigning"
  343. // "zoneSigning"
  344. KeyType string `json:"keyType,omitempty"`
  345. // Kind: Identifies what kind of resource this is. Value: the fixed
  346. // string "dns#dnsKeySpec".
  347. Kind string `json:"kind,omitempty"`
  348. // ForceSendFields is a list of field names (e.g. "Algorithm") to
  349. // unconditionally include in API requests. By default, fields with
  350. // empty values are omitted from API requests. However, any non-pointer,
  351. // non-interface field appearing in ForceSendFields will be sent to the
  352. // server regardless of whether the field is empty or not. This may be
  353. // used to include empty fields in Patch requests.
  354. ForceSendFields []string `json:"-"`
  355. // NullFields is a list of field names (e.g. "Algorithm") to include in
  356. // API requests with the JSON null value. By default, fields with empty
  357. // values are omitted from API requests. However, any field with an
  358. // empty value appearing in NullFields will be sent to the server as
  359. // null. It is an error if a field in this list has a non-empty value.
  360. // This may be used to include null fields in Patch requests.
  361. NullFields []string `json:"-"`
  362. }
  363. func (s *DnsKeySpec) MarshalJSON() ([]byte, error) {
  364. type NoMethod DnsKeySpec
  365. raw := NoMethod(*s)
  366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  367. }
  368. type DnsKeysListResponse struct {
  369. DnsKeys []*DnsKey `json:"dnsKeys,omitempty"`
  370. Header *ResponseHeader `json:"header,omitempty"`
  371. // Kind: Type of resource.
  372. Kind string `json:"kind,omitempty"`
  373. NextPageToken string `json:"nextPageToken,omitempty"`
  374. // ServerResponse contains the HTTP response code and headers from the
  375. // server.
  376. googleapi.ServerResponse `json:"-"`
  377. // ForceSendFields is a list of field names (e.g. "DnsKeys") to
  378. // unconditionally include in API requests. By default, fields with
  379. // empty values are omitted from API requests. However, any non-pointer,
  380. // non-interface field appearing in ForceSendFields will be sent to the
  381. // server regardless of whether the field is empty or not. This may be
  382. // used to include empty fields in Patch requests.
  383. ForceSendFields []string `json:"-"`
  384. // NullFields is a list of field names (e.g. "DnsKeys") to include in
  385. // API requests with the JSON null value. By default, fields with empty
  386. // values are omitted from API requests. However, any field with an
  387. // empty value appearing in NullFields will be sent to the server as
  388. // null. It is an error if a field in this list has a non-empty value.
  389. // This may be used to include null fields in Patch requests.
  390. NullFields []string `json:"-"`
  391. }
  392. func (s *DnsKeysListResponse) MarshalJSON() ([]byte, error) {
  393. type NoMethod DnsKeysListResponse
  394. raw := NoMethod(*s)
  395. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  396. }
  397. type ManagedZone struct {
  398. CreationTime string `json:"creationTime,omitempty"`
  399. Description string `json:"description,omitempty"`
  400. DnsName string `json:"dnsName,omitempty"`
  401. DnssecConfig *ManagedZoneDnsSecConfig `json:"dnssecConfig,omitempty"`
  402. ForwardingConfig *ManagedZoneForwardingConfig `json:"forwardingConfig,omitempty"`
  403. Id uint64 `json:"id,omitempty,string"`
  404. // Kind: Identifies what kind of resource this is. Value: the fixed
  405. // string "dns#managedZone".
  406. Kind string `json:"kind,omitempty"`
  407. Labels map[string]string `json:"labels,omitempty"`
  408. Name string `json:"name,omitempty"`
  409. NameServerSet string `json:"nameServerSet,omitempty"`
  410. NameServers []string `json:"nameServers,omitempty"`
  411. PrivateVisibilityConfig *ManagedZonePrivateVisibilityConfig `json:"privateVisibilityConfig,omitempty"`
  412. // Possible values:
  413. // "private"
  414. // "public"
  415. Visibility string `json:"visibility,omitempty"`
  416. // ServerResponse contains the HTTP response code and headers from the
  417. // server.
  418. googleapi.ServerResponse `json:"-"`
  419. // ForceSendFields is a list of field names (e.g. "CreationTime") to
  420. // unconditionally include in API requests. By default, fields with
  421. // empty values are omitted from API requests. However, any non-pointer,
  422. // non-interface field appearing in ForceSendFields will be sent to the
  423. // server regardless of whether the field is empty or not. This may be
  424. // used to include empty fields in Patch requests.
  425. ForceSendFields []string `json:"-"`
  426. // NullFields is a list of field names (e.g. "CreationTime") to include
  427. // in API requests with the JSON null value. By default, fields with
  428. // empty values are omitted from API requests. However, any field with
  429. // an empty value appearing in NullFields will be sent to the server as
  430. // null. It is an error if a field in this list has a non-empty value.
  431. // This may be used to include null fields in Patch requests.
  432. NullFields []string `json:"-"`
  433. }
  434. func (s *ManagedZone) MarshalJSON() ([]byte, error) {
  435. type NoMethod ManagedZone
  436. raw := NoMethod(*s)
  437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  438. }
  439. type ManagedZoneDnsSecConfig struct {
  440. DefaultKeySpecs []*DnsKeySpec `json:"defaultKeySpecs,omitempty"`
  441. // Kind: Identifies what kind of resource this is. Value: the fixed
  442. // string "dns#managedZoneDnsSecConfig".
  443. Kind string `json:"kind,omitempty"`
  444. // Possible values:
  445. // "nsec"
  446. // "nsec3"
  447. NonExistence string `json:"nonExistence,omitempty"`
  448. // Possible values:
  449. // "off"
  450. // "on"
  451. // "transfer"
  452. State string `json:"state,omitempty"`
  453. // ForceSendFields is a list of field names (e.g. "DefaultKeySpecs") to
  454. // unconditionally include in API requests. By default, fields with
  455. // empty values are omitted from API requests. However, any non-pointer,
  456. // non-interface field appearing in ForceSendFields will be sent to the
  457. // server regardless of whether the field is empty or not. This may be
  458. // used to include empty fields in Patch requests.
  459. ForceSendFields []string `json:"-"`
  460. // NullFields is a list of field names (e.g. "DefaultKeySpecs") to
  461. // include in API requests with the JSON null value. By default, fields
  462. // with empty values are omitted from API requests. However, any field
  463. // with an empty value appearing in NullFields will be sent to the
  464. // server as null. It is an error if a field in this list has a
  465. // non-empty value. This may be used to include null fields in Patch
  466. // requests.
  467. NullFields []string `json:"-"`
  468. }
  469. func (s *ManagedZoneDnsSecConfig) MarshalJSON() ([]byte, error) {
  470. type NoMethod ManagedZoneDnsSecConfig
  471. raw := NoMethod(*s)
  472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  473. }
  474. type ManagedZoneForwardingConfig struct {
  475. // Kind: Identifies what kind of resource this is. Value: the fixed
  476. // string "dns#managedZoneForwardingConfig".
  477. Kind string `json:"kind,omitempty"`
  478. TargetNameServers []*ManagedZoneForwardingConfigNameServerTarget `json:"targetNameServers,omitempty"`
  479. // ForceSendFields is a list of field names (e.g. "Kind") to
  480. // unconditionally include in API requests. By default, fields with
  481. // empty values are omitted from API requests. However, any non-pointer,
  482. // non-interface field appearing in ForceSendFields will be sent to the
  483. // server regardless of whether the field is empty or not. This may be
  484. // used to include empty fields in Patch requests.
  485. ForceSendFields []string `json:"-"`
  486. // NullFields is a list of field names (e.g. "Kind") to include in API
  487. // requests with the JSON null value. By default, fields with empty
  488. // values are omitted from API requests. However, any field with an
  489. // empty value appearing in NullFields will be sent to the server as
  490. // null. It is an error if a field in this list has a non-empty value.
  491. // This may be used to include null fields in Patch requests.
  492. NullFields []string `json:"-"`
  493. }
  494. func (s *ManagedZoneForwardingConfig) MarshalJSON() ([]byte, error) {
  495. type NoMethod ManagedZoneForwardingConfig
  496. raw := NoMethod(*s)
  497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  498. }
  499. type ManagedZoneForwardingConfigNameServerTarget struct {
  500. Ipv4Address string `json:"ipv4Address,omitempty"`
  501. // Kind: Identifies what kind of resource this is. Value: the fixed
  502. // string "dns#managedZoneForwardingConfigNameServerTarget".
  503. Kind string `json:"kind,omitempty"`
  504. // ForceSendFields is a list of field names (e.g. "Ipv4Address") to
  505. // unconditionally include in API requests. By default, fields with
  506. // empty values are omitted from API requests. However, any non-pointer,
  507. // non-interface field appearing in ForceSendFields will be sent to the
  508. // server regardless of whether the field is empty or not. This may be
  509. // used to include empty fields in Patch requests.
  510. ForceSendFields []string `json:"-"`
  511. // NullFields is a list of field names (e.g. "Ipv4Address") to include
  512. // in API requests with the JSON null value. By default, fields with
  513. // empty values are omitted from API requests. However, any field with
  514. // an empty value appearing in NullFields will be sent to the server as
  515. // null. It is an error if a field in this list has a non-empty value.
  516. // This may be used to include null fields in Patch requests.
  517. NullFields []string `json:"-"`
  518. }
  519. func (s *ManagedZoneForwardingConfigNameServerTarget) MarshalJSON() ([]byte, error) {
  520. type NoMethod ManagedZoneForwardingConfigNameServerTarget
  521. raw := NoMethod(*s)
  522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  523. }
  524. type ManagedZoneOperationsListResponse struct {
  525. Header *ResponseHeader `json:"header,omitempty"`
  526. // Kind: Type of resource.
  527. Kind string `json:"kind,omitempty"`
  528. NextPageToken string `json:"nextPageToken,omitempty"`
  529. Operations []*Operation `json:"operations,omitempty"`
  530. // ServerResponse contains the HTTP response code and headers from the
  531. // server.
  532. googleapi.ServerResponse `json:"-"`
  533. // ForceSendFields is a list of field names (e.g. "Header") to
  534. // unconditionally include in API requests. By default, fields with
  535. // empty values are omitted from API requests. However, any non-pointer,
  536. // non-interface field appearing in ForceSendFields will be sent to the
  537. // server regardless of whether the field is empty or not. This may be
  538. // used to include empty fields in Patch requests.
  539. ForceSendFields []string `json:"-"`
  540. // NullFields is a list of field names (e.g. "Header") to include in API
  541. // requests with the JSON null value. By default, fields with empty
  542. // values are omitted from API requests. However, any field with an
  543. // empty value appearing in NullFields will be sent to the server as
  544. // null. It is an error if a field in this list has a non-empty value.
  545. // This may be used to include null fields in Patch requests.
  546. NullFields []string `json:"-"`
  547. }
  548. func (s *ManagedZoneOperationsListResponse) MarshalJSON() ([]byte, error) {
  549. type NoMethod ManagedZoneOperationsListResponse
  550. raw := NoMethod(*s)
  551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  552. }
  553. type ManagedZonePrivateVisibilityConfig struct {
  554. // Kind: Identifies what kind of resource this is. Value: the fixed
  555. // string "dns#managedZonePrivateVisibilityConfig".
  556. Kind string `json:"kind,omitempty"`
  557. Networks []*ManagedZonePrivateVisibilityConfigNetwork `json:"networks,omitempty"`
  558. // ForceSendFields is a list of field names (e.g. "Kind") to
  559. // unconditionally include in API requests. By default, fields with
  560. // empty values are omitted from API requests. However, any non-pointer,
  561. // non-interface field appearing in ForceSendFields will be sent to the
  562. // server regardless of whether the field is empty or not. This may be
  563. // used to include empty fields in Patch requests.
  564. ForceSendFields []string `json:"-"`
  565. // NullFields is a list of field names (e.g. "Kind") to include in API
  566. // requests with the JSON null value. By default, fields with empty
  567. // values are omitted from API requests. However, any field with an
  568. // empty value appearing in NullFields will be sent to the server as
  569. // null. It is an error if a field in this list has a non-empty value.
  570. // This may be used to include null fields in Patch requests.
  571. NullFields []string `json:"-"`
  572. }
  573. func (s *ManagedZonePrivateVisibilityConfig) MarshalJSON() ([]byte, error) {
  574. type NoMethod ManagedZonePrivateVisibilityConfig
  575. raw := NoMethod(*s)
  576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  577. }
  578. type ManagedZonePrivateVisibilityConfigNetwork struct {
  579. // Kind: Identifies what kind of resource this is. Value: the fixed
  580. // string "dns#managedZonePrivateVisibilityConfigNetwork".
  581. Kind string `json:"kind,omitempty"`
  582. NetworkUrl string `json:"networkUrl,omitempty"`
  583. // ForceSendFields is a list of field names (e.g. "Kind") to
  584. // unconditionally include in API requests. By default, fields with
  585. // empty values are omitted from API requests. However, any non-pointer,
  586. // non-interface field appearing in ForceSendFields will be sent to the
  587. // server regardless of whether the field is empty or not. This may be
  588. // used to include empty fields in Patch requests.
  589. ForceSendFields []string `json:"-"`
  590. // NullFields is a list of field names (e.g. "Kind") to include in API
  591. // requests with the JSON null value. By default, fields with empty
  592. // values are omitted from API requests. However, any field with an
  593. // empty value appearing in NullFields will be sent to the server as
  594. // null. It is an error if a field in this list has a non-empty value.
  595. // This may be used to include null fields in Patch requests.
  596. NullFields []string `json:"-"`
  597. }
  598. func (s *ManagedZonePrivateVisibilityConfigNetwork) MarshalJSON() ([]byte, error) {
  599. type NoMethod ManagedZonePrivateVisibilityConfigNetwork
  600. raw := NoMethod(*s)
  601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  602. }
  603. type ManagedZonesListResponse struct {
  604. Header *ResponseHeader `json:"header,omitempty"`
  605. // Kind: Type of resource.
  606. Kind string `json:"kind,omitempty"`
  607. ManagedZones []*ManagedZone `json:"managedZones,omitempty"`
  608. NextPageToken string `json:"nextPageToken,omitempty"`
  609. // ServerResponse contains the HTTP response code and headers from the
  610. // server.
  611. googleapi.ServerResponse `json:"-"`
  612. // ForceSendFields is a list of field names (e.g. "Header") 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. "Header") to include in API
  620. // 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 *ManagedZonesListResponse) MarshalJSON() ([]byte, error) {
  628. type NoMethod ManagedZonesListResponse
  629. raw := NoMethod(*s)
  630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  631. }
  632. type Operation struct {
  633. DnsKeyContext *OperationDnsKeyContext `json:"dnsKeyContext,omitempty"`
  634. Id string `json:"id,omitempty"`
  635. // Kind: Identifies what kind of resource this is. Value: the fixed
  636. // string "dns#operation".
  637. Kind string `json:"kind,omitempty"`
  638. StartTime string `json:"startTime,omitempty"`
  639. // Possible values:
  640. // "done"
  641. // "pending"
  642. Status string `json:"status,omitempty"`
  643. Type string `json:"type,omitempty"`
  644. User string `json:"user,omitempty"`
  645. ZoneContext *OperationManagedZoneContext `json:"zoneContext,omitempty"`
  646. // ServerResponse contains the HTTP response code and headers from the
  647. // server.
  648. googleapi.ServerResponse `json:"-"`
  649. // ForceSendFields is a list of field names (e.g. "DnsKeyContext") to
  650. // unconditionally include in API requests. By default, fields with
  651. // empty values are omitted from API requests. However, any non-pointer,
  652. // non-interface field appearing in ForceSendFields will be sent to the
  653. // server regardless of whether the field is empty or not. This may be
  654. // used to include empty fields in Patch requests.
  655. ForceSendFields []string `json:"-"`
  656. // NullFields is a list of field names (e.g. "DnsKeyContext") to include
  657. // in API requests with the JSON null value. By default, fields with
  658. // empty values are omitted from API requests. However, any field with
  659. // an empty value appearing in NullFields will be sent to the server as
  660. // null. It is an error if a field in this list has a non-empty value.
  661. // This may be used to include null fields in Patch requests.
  662. NullFields []string `json:"-"`
  663. }
  664. func (s *Operation) MarshalJSON() ([]byte, error) {
  665. type NoMethod Operation
  666. raw := NoMethod(*s)
  667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  668. }
  669. type OperationDnsKeyContext struct {
  670. NewValue *DnsKey `json:"newValue,omitempty"`
  671. OldValue *DnsKey `json:"oldValue,omitempty"`
  672. // ForceSendFields is a list of field names (e.g. "NewValue") to
  673. // unconditionally include in API requests. By default, fields with
  674. // empty values are omitted from API requests. However, any non-pointer,
  675. // non-interface field appearing in ForceSendFields will be sent to the
  676. // server regardless of whether the field is empty or not. This may be
  677. // used to include empty fields in Patch requests.
  678. ForceSendFields []string `json:"-"`
  679. // NullFields is a list of field names (e.g. "NewValue") to include in
  680. // API requests with the JSON null value. By default, fields with empty
  681. // values are omitted from API requests. However, any field with an
  682. // empty value appearing in NullFields will be sent to the server as
  683. // null. It is an error if a field in this list has a non-empty value.
  684. // This may be used to include null fields in Patch requests.
  685. NullFields []string `json:"-"`
  686. }
  687. func (s *OperationDnsKeyContext) MarshalJSON() ([]byte, error) {
  688. type NoMethod OperationDnsKeyContext
  689. raw := NoMethod(*s)
  690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  691. }
  692. type OperationManagedZoneContext struct {
  693. NewValue *ManagedZone `json:"newValue,omitempty"`
  694. OldValue *ManagedZone `json:"oldValue,omitempty"`
  695. // ForceSendFields is a list of field names (e.g. "NewValue") to
  696. // unconditionally include in API requests. By default, fields with
  697. // empty values are omitted from API requests. However, any non-pointer,
  698. // non-interface field appearing in ForceSendFields will be sent to the
  699. // server regardless of whether the field is empty or not. This may be
  700. // used to include empty fields in Patch requests.
  701. ForceSendFields []string `json:"-"`
  702. // NullFields is a list of field names (e.g. "NewValue") to include in
  703. // API requests with the JSON null value. By default, fields with empty
  704. // values are omitted from API requests. However, any field with an
  705. // empty value appearing in NullFields will be sent to the server as
  706. // null. It is an error if a field in this list has a non-empty value.
  707. // This may be used to include null fields in Patch requests.
  708. NullFields []string `json:"-"`
  709. }
  710. func (s *OperationManagedZoneContext) MarshalJSON() ([]byte, error) {
  711. type NoMethod OperationManagedZoneContext
  712. raw := NoMethod(*s)
  713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  714. }
  715. type PoliciesListResponse struct {
  716. Header *ResponseHeader `json:"header,omitempty"`
  717. // Kind: Type of resource.
  718. Kind string `json:"kind,omitempty"`
  719. NextPageToken string `json:"nextPageToken,omitempty"`
  720. Policies []*Policy `json:"policies,omitempty"`
  721. // ServerResponse contains the HTTP response code and headers from the
  722. // server.
  723. googleapi.ServerResponse `json:"-"`
  724. // ForceSendFields is a list of field names (e.g. "Header") to
  725. // unconditionally include in API requests. By default, fields with
  726. // empty values are omitted from API requests. However, any non-pointer,
  727. // non-interface field appearing in ForceSendFields will be sent to the
  728. // server regardless of whether the field is empty or not. This may be
  729. // used to include empty fields in Patch requests.
  730. ForceSendFields []string `json:"-"`
  731. // NullFields is a list of field names (e.g. "Header") to include in API
  732. // requests with the JSON null value. By default, fields with empty
  733. // values are omitted from API requests. However, any field with an
  734. // empty value appearing in NullFields will be sent to the server as
  735. // null. It is an error if a field in this list has a non-empty value.
  736. // This may be used to include null fields in Patch requests.
  737. NullFields []string `json:"-"`
  738. }
  739. func (s *PoliciesListResponse) MarshalJSON() ([]byte, error) {
  740. type NoMethod PoliciesListResponse
  741. raw := NoMethod(*s)
  742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  743. }
  744. type PoliciesPatchResponse struct {
  745. Header *ResponseHeader `json:"header,omitempty"`
  746. Policy *Policy `json:"policy,omitempty"`
  747. // ServerResponse contains the HTTP response code and headers from the
  748. // server.
  749. googleapi.ServerResponse `json:"-"`
  750. // ForceSendFields is a list of field names (e.g. "Header") to
  751. // unconditionally include in API requests. By default, fields with
  752. // empty values are omitted from API requests. However, any non-pointer,
  753. // non-interface field appearing in ForceSendFields will be sent to the
  754. // server regardless of whether the field is empty or not. This may be
  755. // used to include empty fields in Patch requests.
  756. ForceSendFields []string `json:"-"`
  757. // NullFields is a list of field names (e.g. "Header") to include in API
  758. // requests with the JSON null value. By default, fields with empty
  759. // values are omitted from API requests. However, any field with an
  760. // empty value appearing in NullFields will be sent to the server as
  761. // null. It is an error if a field in this list has a non-empty value.
  762. // This may be used to include null fields in Patch requests.
  763. NullFields []string `json:"-"`
  764. }
  765. func (s *PoliciesPatchResponse) MarshalJSON() ([]byte, error) {
  766. type NoMethod PoliciesPatchResponse
  767. raw := NoMethod(*s)
  768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  769. }
  770. type PoliciesUpdateResponse struct {
  771. Header *ResponseHeader `json:"header,omitempty"`
  772. Policy *Policy `json:"policy,omitempty"`
  773. // ServerResponse contains the HTTP response code and headers from the
  774. // server.
  775. googleapi.ServerResponse `json:"-"`
  776. // ForceSendFields is a list of field names (e.g. "Header") to
  777. // unconditionally include in API requests. By default, fields with
  778. // empty values are omitted from API requests. However, any non-pointer,
  779. // non-interface field appearing in ForceSendFields will be sent to the
  780. // server regardless of whether the field is empty or not. This may be
  781. // used to include empty fields in Patch requests.
  782. ForceSendFields []string `json:"-"`
  783. // NullFields is a list of field names (e.g. "Header") to include in API
  784. // requests with the JSON null value. By default, fields with empty
  785. // values are omitted from API requests. However, any field with an
  786. // empty value appearing in NullFields will be sent to the server as
  787. // null. It is an error if a field in this list has a non-empty value.
  788. // This may be used to include null fields in Patch requests.
  789. NullFields []string `json:"-"`
  790. }
  791. func (s *PoliciesUpdateResponse) MarshalJSON() ([]byte, error) {
  792. type NoMethod PoliciesUpdateResponse
  793. raw := NoMethod(*s)
  794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  795. }
  796. type Policy struct {
  797. AlternativeNameServerConfig *PolicyAlternativeNameServerConfig `json:"alternativeNameServerConfig,omitempty"`
  798. Description string `json:"description,omitempty"`
  799. EnableInboundForwarding bool `json:"enableInboundForwarding,omitempty"`
  800. Id uint64 `json:"id,omitempty,string"`
  801. // Kind: Identifies what kind of resource this is. Value: the fixed
  802. // string "dns#policy".
  803. Kind string `json:"kind,omitempty"`
  804. Name string `json:"name,omitempty"`
  805. Networks []*PolicyNetwork `json:"networks,omitempty"`
  806. // ServerResponse contains the HTTP response code and headers from the
  807. // server.
  808. googleapi.ServerResponse `json:"-"`
  809. // ForceSendFields is a list of field names (e.g.
  810. // "AlternativeNameServerConfig") to unconditionally include in API
  811. // requests. By default, fields with empty values are omitted from API
  812. // requests. However, any non-pointer, non-interface field appearing in
  813. // ForceSendFields will be sent to the server regardless of whether the
  814. // field is empty or not. This may be used to include empty fields in
  815. // Patch requests.
  816. ForceSendFields []string `json:"-"`
  817. // NullFields is a list of field names (e.g.
  818. // "AlternativeNameServerConfig") to include in API requests with the
  819. // JSON null value. By default, fields with empty values are omitted
  820. // from API requests. However, any field with an empty value appearing
  821. // in NullFields will be sent to the server as null. It is an error if a
  822. // field in this list has a non-empty value. This may be used to include
  823. // null fields in Patch requests.
  824. NullFields []string `json:"-"`
  825. }
  826. func (s *Policy) MarshalJSON() ([]byte, error) {
  827. type NoMethod Policy
  828. raw := NoMethod(*s)
  829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  830. }
  831. type PolicyAlternativeNameServerConfig struct {
  832. // Kind: Identifies what kind of resource this is. Value: the fixed
  833. // string "dns#policyAlternativeNameServerConfig".
  834. Kind string `json:"kind,omitempty"`
  835. TargetNameServers []*PolicyAlternativeNameServerConfigTargetNameServer `json:"targetNameServers,omitempty"`
  836. // ForceSendFields is a list of field names (e.g. "Kind") to
  837. // unconditionally include in API requests. By default, fields with
  838. // empty values are omitted from API requests. However, any non-pointer,
  839. // non-interface field appearing in ForceSendFields will be sent to the
  840. // server regardless of whether the field is empty or not. This may be
  841. // used to include empty fields in Patch requests.
  842. ForceSendFields []string `json:"-"`
  843. // NullFields is a list of field names (e.g. "Kind") to include in API
  844. // requests with the JSON null value. By default, fields with empty
  845. // values are omitted from API requests. However, any field with an
  846. // empty value appearing in NullFields will be sent to the server as
  847. // null. It is an error if a field in this list has a non-empty value.
  848. // This may be used to include null fields in Patch requests.
  849. NullFields []string `json:"-"`
  850. }
  851. func (s *PolicyAlternativeNameServerConfig) MarshalJSON() ([]byte, error) {
  852. type NoMethod PolicyAlternativeNameServerConfig
  853. raw := NoMethod(*s)
  854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  855. }
  856. type PolicyAlternativeNameServerConfigTargetNameServer struct {
  857. Ipv4Address string `json:"ipv4Address,omitempty"`
  858. // Kind: Identifies what kind of resource this is. Value: the fixed
  859. // string "dns#policyAlternativeNameServerConfigTargetNameServer".
  860. Kind string `json:"kind,omitempty"`
  861. // ForceSendFields is a list of field names (e.g. "Ipv4Address") to
  862. // unconditionally include in API requests. By default, fields with
  863. // empty values are omitted from API requests. However, any non-pointer,
  864. // non-interface field appearing in ForceSendFields will be sent to the
  865. // server regardless of whether the field is empty or not. This may be
  866. // used to include empty fields in Patch requests.
  867. ForceSendFields []string `json:"-"`
  868. // NullFields is a list of field names (e.g. "Ipv4Address") to include
  869. // in API requests with the JSON null value. By default, fields with
  870. // empty values are omitted from API requests. However, any field with
  871. // an empty value appearing in NullFields will be sent to the server as
  872. // null. It is an error if a field in this list has a non-empty value.
  873. // This may be used to include null fields in Patch requests.
  874. NullFields []string `json:"-"`
  875. }
  876. func (s *PolicyAlternativeNameServerConfigTargetNameServer) MarshalJSON() ([]byte, error) {
  877. type NoMethod PolicyAlternativeNameServerConfigTargetNameServer
  878. raw := NoMethod(*s)
  879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  880. }
  881. type PolicyNetwork struct {
  882. // Kind: Identifies what kind of resource this is. Value: the fixed
  883. // string "dns#policyNetwork".
  884. Kind string `json:"kind,omitempty"`
  885. NetworkUrl string `json:"networkUrl,omitempty"`
  886. // ForceSendFields is a list of field names (e.g. "Kind") to
  887. // unconditionally include in API requests. By default, fields with
  888. // empty values are omitted from API requests. However, any non-pointer,
  889. // non-interface field appearing in ForceSendFields will be sent to the
  890. // server regardless of whether the field is empty or not. This may be
  891. // used to include empty fields in Patch requests.
  892. ForceSendFields []string `json:"-"`
  893. // NullFields is a list of field names (e.g. "Kind") to include in API
  894. // requests with the JSON null value. By default, fields with empty
  895. // values are omitted from API requests. However, any field with an
  896. // empty value appearing in NullFields will be sent to the server as
  897. // null. It is an error if a field in this list has a non-empty value.
  898. // This may be used to include null fields in Patch requests.
  899. NullFields []string `json:"-"`
  900. }
  901. func (s *PolicyNetwork) MarshalJSON() ([]byte, error) {
  902. type NoMethod PolicyNetwork
  903. raw := NoMethod(*s)
  904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  905. }
  906. type Project struct {
  907. Id string `json:"id,omitempty"`
  908. // Kind: Identifies what kind of resource this is. Value: the fixed
  909. // string "dns#project".
  910. Kind string `json:"kind,omitempty"`
  911. Number uint64 `json:"number,omitempty,string"`
  912. Quota *Quota `json:"quota,omitempty"`
  913. // ServerResponse contains the HTTP response code and headers from the
  914. // server.
  915. googleapi.ServerResponse `json:"-"`
  916. // ForceSendFields is a list of field names (e.g. "Id") to
  917. // unconditionally include in API requests. By default, fields with
  918. // empty values are omitted from API requests. However, any non-pointer,
  919. // non-interface field appearing in ForceSendFields will be sent to the
  920. // server regardless of whether the field is empty or not. This may be
  921. // used to include empty fields in Patch requests.
  922. ForceSendFields []string `json:"-"`
  923. // NullFields is a list of field names (e.g. "Id") to include in API
  924. // requests with the JSON null value. By default, fields with empty
  925. // values are omitted from API requests. However, any field with an
  926. // empty value appearing in NullFields will be sent to the server as
  927. // null. It is an error if a field in this list has a non-empty value.
  928. // This may be used to include null fields in Patch requests.
  929. NullFields []string `json:"-"`
  930. }
  931. func (s *Project) MarshalJSON() ([]byte, error) {
  932. type NoMethod Project
  933. raw := NoMethod(*s)
  934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  935. }
  936. type Quota struct {
  937. DnsKeysPerManagedZone int64 `json:"dnsKeysPerManagedZone,omitempty"`
  938. // Kind: Identifies what kind of resource this is. Value: the fixed
  939. // string "dns#quota".
  940. Kind string `json:"kind,omitempty"`
  941. ManagedZones int64 `json:"managedZones,omitempty"`
  942. ManagedZonesPerNetwork int64 `json:"managedZonesPerNetwork,omitempty"`
  943. NetworksPerManagedZone int64 `json:"networksPerManagedZone,omitempty"`
  944. NetworksPerPolicy int64 `json:"networksPerPolicy,omitempty"`
  945. Policies int64 `json:"policies,omitempty"`
  946. ResourceRecordsPerRrset int64 `json:"resourceRecordsPerRrset,omitempty"`
  947. RrsetAdditionsPerChange int64 `json:"rrsetAdditionsPerChange,omitempty"`
  948. RrsetDeletionsPerChange int64 `json:"rrsetDeletionsPerChange,omitempty"`
  949. RrsetsPerManagedZone int64 `json:"rrsetsPerManagedZone,omitempty"`
  950. TargetNameServersPerManagedZone int64 `json:"targetNameServersPerManagedZone,omitempty"`
  951. TargetNameServersPerPolicy int64 `json:"targetNameServersPerPolicy,omitempty"`
  952. TotalRrdataSizePerChange int64 `json:"totalRrdataSizePerChange,omitempty"`
  953. WhitelistedKeySpecs []*DnsKeySpec `json:"whitelistedKeySpecs,omitempty"`
  954. // ForceSendFields is a list of field names (e.g.
  955. // "DnsKeysPerManagedZone") to unconditionally include in API requests.
  956. // By default, fields with empty values are omitted from API requests.
  957. // However, any non-pointer, non-interface field appearing in
  958. // ForceSendFields will be sent to the server regardless of whether the
  959. // field is empty or not. This may be used to include empty fields in
  960. // Patch requests.
  961. ForceSendFields []string `json:"-"`
  962. // NullFields is a list of field names (e.g. "DnsKeysPerManagedZone") to
  963. // include in API requests with the JSON null value. By default, fields
  964. // with empty values are omitted from API requests. However, any field
  965. // with an empty value appearing in NullFields will be sent to the
  966. // server as null. It is an error if a field in this list has a
  967. // non-empty value. This may be used to include null fields in Patch
  968. // requests.
  969. NullFields []string `json:"-"`
  970. }
  971. func (s *Quota) MarshalJSON() ([]byte, error) {
  972. type NoMethod Quota
  973. raw := NoMethod(*s)
  974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  975. }
  976. type ResourceRecordSet struct {
  977. // Kind: Identifies what kind of resource this is. Value: the fixed
  978. // string "dns#resourceRecordSet".
  979. Kind string `json:"kind,omitempty"`
  980. Name string `json:"name,omitempty"`
  981. Rrdatas []string `json:"rrdatas,omitempty"`
  982. SignatureRrdatas []string `json:"signatureRrdatas,omitempty"`
  983. Ttl int64 `json:"ttl,omitempty"`
  984. Type string `json:"type,omitempty"`
  985. // ForceSendFields is a list of field names (e.g. "Kind") to
  986. // unconditionally include in API requests. By default, fields with
  987. // empty values are omitted from API requests. However, any non-pointer,
  988. // non-interface field appearing in ForceSendFields will be sent to the
  989. // server regardless of whether the field is empty or not. This may be
  990. // used to include empty fields in Patch requests.
  991. ForceSendFields []string `json:"-"`
  992. // NullFields is a list of field names (e.g. "Kind") to include in API
  993. // requests with the JSON null value. By default, fields with empty
  994. // values are omitted from API requests. However, any field with an
  995. // empty value appearing in NullFields will be sent to the server as
  996. // null. It is an error if a field in this list has a non-empty value.
  997. // This may be used to include null fields in Patch requests.
  998. NullFields []string `json:"-"`
  999. }
  1000. func (s *ResourceRecordSet) MarshalJSON() ([]byte, error) {
  1001. type NoMethod ResourceRecordSet
  1002. raw := NoMethod(*s)
  1003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1004. }
  1005. type ResourceRecordSetsListResponse struct {
  1006. Header *ResponseHeader `json:"header,omitempty"`
  1007. // Kind: Type of resource.
  1008. Kind string `json:"kind,omitempty"`
  1009. NextPageToken string `json:"nextPageToken,omitempty"`
  1010. Rrsets []*ResourceRecordSet `json:"rrsets,omitempty"`
  1011. // ServerResponse contains the HTTP response code and headers from the
  1012. // server.
  1013. googleapi.ServerResponse `json:"-"`
  1014. // ForceSendFields is a list of field names (e.g. "Header") to
  1015. // unconditionally include in API requests. By default, fields with
  1016. // empty values are omitted from API requests. However, any non-pointer,
  1017. // non-interface field appearing in ForceSendFields will be sent to the
  1018. // server regardless of whether the field is empty or not. This may be
  1019. // used to include empty fields in Patch requests.
  1020. ForceSendFields []string `json:"-"`
  1021. // NullFields is a list of field names (e.g. "Header") to include in API
  1022. // requests with the JSON null value. By default, fields with empty
  1023. // values are omitted from API requests. However, any field with an
  1024. // empty value appearing in NullFields will be sent to the server as
  1025. // null. It is an error if a field in this list has a non-empty value.
  1026. // This may be used to include null fields in Patch requests.
  1027. NullFields []string `json:"-"`
  1028. }
  1029. func (s *ResourceRecordSetsListResponse) MarshalJSON() ([]byte, error) {
  1030. type NoMethod ResourceRecordSetsListResponse
  1031. raw := NoMethod(*s)
  1032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1033. }
  1034. type ResponseHeader struct {
  1035. OperationId string `json:"operationId,omitempty"`
  1036. // ForceSendFields is a list of field names (e.g. "OperationId") to
  1037. // unconditionally include in API requests. By default, fields with
  1038. // empty values are omitted from API requests. However, any non-pointer,
  1039. // non-interface field appearing in ForceSendFields will be sent to the
  1040. // server regardless of whether the field is empty or not. This may be
  1041. // used to include empty fields in Patch requests.
  1042. ForceSendFields []string `json:"-"`
  1043. // NullFields is a list of field names (e.g. "OperationId") to include
  1044. // in API requests with the JSON null value. By default, fields with
  1045. // empty values are omitted from API requests. However, any field with
  1046. // an empty value appearing in NullFields will be sent to the server as
  1047. // null. It is an error if a field in this list has a non-empty value.
  1048. // This may be used to include null fields in Patch requests.
  1049. NullFields []string `json:"-"`
  1050. }
  1051. func (s *ResponseHeader) MarshalJSON() ([]byte, error) {
  1052. type NoMethod ResponseHeader
  1053. raw := NoMethod(*s)
  1054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1055. }
  1056. // method id "dns.changes.create":
  1057. type ChangesCreateCall struct {
  1058. s *Service
  1059. project string
  1060. managedZone string
  1061. change *Change
  1062. urlParams_ gensupport.URLParams
  1063. ctx_ context.Context
  1064. header_ http.Header
  1065. }
  1066. // Create:
  1067. func (r *ChangesService) Create(project string, managedZone string, change *Change) *ChangesCreateCall {
  1068. c := &ChangesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1069. c.project = project
  1070. c.managedZone = managedZone
  1071. c.change = change
  1072. return c
  1073. }
  1074. // ClientOperationId sets the optional parameter "clientOperationId":
  1075. func (c *ChangesCreateCall) ClientOperationId(clientOperationId string) *ChangesCreateCall {
  1076. c.urlParams_.Set("clientOperationId", clientOperationId)
  1077. return c
  1078. }
  1079. // Fields allows partial responses to be retrieved. See
  1080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1081. // for more information.
  1082. func (c *ChangesCreateCall) Fields(s ...googleapi.Field) *ChangesCreateCall {
  1083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1084. return c
  1085. }
  1086. // Context sets the context to be used in this call's Do method. Any
  1087. // pending HTTP request will be aborted if the provided context is
  1088. // canceled.
  1089. func (c *ChangesCreateCall) Context(ctx context.Context) *ChangesCreateCall {
  1090. c.ctx_ = ctx
  1091. return c
  1092. }
  1093. // Header returns an http.Header that can be modified by the caller to
  1094. // add HTTP headers to the request.
  1095. func (c *ChangesCreateCall) Header() http.Header {
  1096. if c.header_ == nil {
  1097. c.header_ = make(http.Header)
  1098. }
  1099. return c.header_
  1100. }
  1101. func (c *ChangesCreateCall) doRequest(alt string) (*http.Response, error) {
  1102. reqHeaders := make(http.Header)
  1103. for k, v := range c.header_ {
  1104. reqHeaders[k] = v
  1105. }
  1106. reqHeaders.Set("User-Agent", c.s.userAgent())
  1107. var body io.Reader = nil
  1108. body, err := googleapi.WithoutDataWrapper.JSONReader(c.change)
  1109. if err != nil {
  1110. return nil, err
  1111. }
  1112. reqHeaders.Set("Content-Type", "application/json")
  1113. c.urlParams_.Set("alt", alt)
  1114. c.urlParams_.Set("prettyPrint", "false")
  1115. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
  1116. urls += "?" + c.urlParams_.Encode()
  1117. req, err := http.NewRequest("POST", urls, body)
  1118. if err != nil {
  1119. return nil, err
  1120. }
  1121. req.Header = reqHeaders
  1122. googleapi.Expand(req.URL, map[string]string{
  1123. "project": c.project,
  1124. "managedZone": c.managedZone,
  1125. })
  1126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1127. }
  1128. // Do executes the "dns.changes.create" call.
  1129. // Exactly one of *Change or error will be non-nil. Any non-2xx status
  1130. // code is an error. Response headers are in either
  1131. // *Change.ServerResponse.Header or (if a response was returned at all)
  1132. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1133. // check whether the returned error was because http.StatusNotModified
  1134. // was returned.
  1135. func (c *ChangesCreateCall) Do(opts ...googleapi.CallOption) (*Change, error) {
  1136. gensupport.SetOptions(c.urlParams_, opts...)
  1137. res, err := c.doRequest("json")
  1138. if res != nil && res.StatusCode == http.StatusNotModified {
  1139. if res.Body != nil {
  1140. res.Body.Close()
  1141. }
  1142. return nil, &googleapi.Error{
  1143. Code: res.StatusCode,
  1144. Header: res.Header,
  1145. }
  1146. }
  1147. if err != nil {
  1148. return nil, err
  1149. }
  1150. defer googleapi.CloseBody(res)
  1151. if err := googleapi.CheckResponse(res); err != nil {
  1152. return nil, err
  1153. }
  1154. ret := &Change{
  1155. ServerResponse: googleapi.ServerResponse{
  1156. Header: res.Header,
  1157. HTTPStatusCode: res.StatusCode,
  1158. },
  1159. }
  1160. target := &ret
  1161. if err := gensupport.DecodeResponse(target, res); err != nil {
  1162. return nil, err
  1163. }
  1164. return ret, nil
  1165. // {
  1166. // "description": "",
  1167. // "httpMethod": "POST",
  1168. // "id": "dns.changes.create",
  1169. // "parameterOrder": [
  1170. // "project",
  1171. // "managedZone"
  1172. // ],
  1173. // "parameters": {
  1174. // "clientOperationId": {
  1175. // "location": "query",
  1176. // "type": "string"
  1177. // },
  1178. // "managedZone": {
  1179. // "location": "path",
  1180. // "required": true,
  1181. // "type": "string"
  1182. // },
  1183. // "project": {
  1184. // "location": "path",
  1185. // "required": true,
  1186. // "type": "string"
  1187. // }
  1188. // },
  1189. // "path": "{project}/managedZones/{managedZone}/changes",
  1190. // "request": {
  1191. // "$ref": "Change"
  1192. // },
  1193. // "response": {
  1194. // "$ref": "Change"
  1195. // },
  1196. // "scopes": [
  1197. // "https://www.googleapis.com/auth/cloud-platform",
  1198. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1199. // ]
  1200. // }
  1201. }
  1202. // method id "dns.changes.get":
  1203. type ChangesGetCall struct {
  1204. s *Service
  1205. project string
  1206. managedZone string
  1207. changeId string
  1208. urlParams_ gensupport.URLParams
  1209. ifNoneMatch_ string
  1210. ctx_ context.Context
  1211. header_ http.Header
  1212. }
  1213. // Get:
  1214. func (r *ChangesService) Get(project string, managedZone string, changeId string) *ChangesGetCall {
  1215. c := &ChangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1216. c.project = project
  1217. c.managedZone = managedZone
  1218. c.changeId = changeId
  1219. return c
  1220. }
  1221. // ClientOperationId sets the optional parameter "clientOperationId":
  1222. func (c *ChangesGetCall) ClientOperationId(clientOperationId string) *ChangesGetCall {
  1223. c.urlParams_.Set("clientOperationId", clientOperationId)
  1224. return c
  1225. }
  1226. // Fields allows partial responses to be retrieved. See
  1227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1228. // for more information.
  1229. func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall {
  1230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1231. return c
  1232. }
  1233. // IfNoneMatch sets the optional parameter which makes the operation
  1234. // fail if the object's ETag matches the given value. This is useful for
  1235. // getting updates only after the object has changed since the last
  1236. // request. Use googleapi.IsNotModified to check whether the response
  1237. // error from Do is the result of In-None-Match.
  1238. func (c *ChangesGetCall) IfNoneMatch(entityTag string) *ChangesGetCall {
  1239. c.ifNoneMatch_ = entityTag
  1240. return c
  1241. }
  1242. // Context sets the context to be used in this call's Do method. Any
  1243. // pending HTTP request will be aborted if the provided context is
  1244. // canceled.
  1245. func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall {
  1246. c.ctx_ = ctx
  1247. return c
  1248. }
  1249. // Header returns an http.Header that can be modified by the caller to
  1250. // add HTTP headers to the request.
  1251. func (c *ChangesGetCall) Header() http.Header {
  1252. if c.header_ == nil {
  1253. c.header_ = make(http.Header)
  1254. }
  1255. return c.header_
  1256. }
  1257. func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) {
  1258. reqHeaders := make(http.Header)
  1259. for k, v := range c.header_ {
  1260. reqHeaders[k] = v
  1261. }
  1262. reqHeaders.Set("User-Agent", c.s.userAgent())
  1263. if c.ifNoneMatch_ != "" {
  1264. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1265. }
  1266. var body io.Reader = nil
  1267. c.urlParams_.Set("alt", alt)
  1268. c.urlParams_.Set("prettyPrint", "false")
  1269. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes/{changeId}")
  1270. urls += "?" + c.urlParams_.Encode()
  1271. req, err := http.NewRequest("GET", urls, body)
  1272. if err != nil {
  1273. return nil, err
  1274. }
  1275. req.Header = reqHeaders
  1276. googleapi.Expand(req.URL, map[string]string{
  1277. "project": c.project,
  1278. "managedZone": c.managedZone,
  1279. "changeId": c.changeId,
  1280. })
  1281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1282. }
  1283. // Do executes the "dns.changes.get" call.
  1284. // Exactly one of *Change or error will be non-nil. Any non-2xx status
  1285. // code is an error. Response headers are in either
  1286. // *Change.ServerResponse.Header or (if a response was returned at all)
  1287. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1288. // check whether the returned error was because http.StatusNotModified
  1289. // was returned.
  1290. func (c *ChangesGetCall) Do(opts ...googleapi.CallOption) (*Change, error) {
  1291. gensupport.SetOptions(c.urlParams_, opts...)
  1292. res, err := c.doRequest("json")
  1293. if res != nil && res.StatusCode == http.StatusNotModified {
  1294. if res.Body != nil {
  1295. res.Body.Close()
  1296. }
  1297. return nil, &googleapi.Error{
  1298. Code: res.StatusCode,
  1299. Header: res.Header,
  1300. }
  1301. }
  1302. if err != nil {
  1303. return nil, err
  1304. }
  1305. defer googleapi.CloseBody(res)
  1306. if err := googleapi.CheckResponse(res); err != nil {
  1307. return nil, err
  1308. }
  1309. ret := &Change{
  1310. ServerResponse: googleapi.ServerResponse{
  1311. Header: res.Header,
  1312. HTTPStatusCode: res.StatusCode,
  1313. },
  1314. }
  1315. target := &ret
  1316. if err := gensupport.DecodeResponse(target, res); err != nil {
  1317. return nil, err
  1318. }
  1319. return ret, nil
  1320. // {
  1321. // "description": "",
  1322. // "httpMethod": "GET",
  1323. // "id": "dns.changes.get",
  1324. // "parameterOrder": [
  1325. // "project",
  1326. // "managedZone",
  1327. // "changeId"
  1328. // ],
  1329. // "parameters": {
  1330. // "changeId": {
  1331. // "location": "path",
  1332. // "required": true,
  1333. // "type": "string"
  1334. // },
  1335. // "clientOperationId": {
  1336. // "location": "query",
  1337. // "type": "string"
  1338. // },
  1339. // "managedZone": {
  1340. // "location": "path",
  1341. // "required": true,
  1342. // "type": "string"
  1343. // },
  1344. // "project": {
  1345. // "location": "path",
  1346. // "required": true,
  1347. // "type": "string"
  1348. // }
  1349. // },
  1350. // "path": "{project}/managedZones/{managedZone}/changes/{changeId}",
  1351. // "response": {
  1352. // "$ref": "Change"
  1353. // },
  1354. // "scopes": [
  1355. // "https://www.googleapis.com/auth/cloud-platform",
  1356. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1357. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1358. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1359. // ]
  1360. // }
  1361. }
  1362. // method id "dns.changes.list":
  1363. type ChangesListCall struct {
  1364. s *Service
  1365. project string
  1366. managedZone string
  1367. urlParams_ gensupport.URLParams
  1368. ifNoneMatch_ string
  1369. ctx_ context.Context
  1370. header_ http.Header
  1371. }
  1372. // List:
  1373. func (r *ChangesService) List(project string, managedZone string) *ChangesListCall {
  1374. c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1375. c.project = project
  1376. c.managedZone = managedZone
  1377. return c
  1378. }
  1379. // MaxResults sets the optional parameter "maxResults":
  1380. func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall {
  1381. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1382. return c
  1383. }
  1384. // PageToken sets the optional parameter "pageToken":
  1385. func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall {
  1386. c.urlParams_.Set("pageToken", pageToken)
  1387. return c
  1388. }
  1389. // SortBy sets the optional parameter "sortBy":
  1390. //
  1391. // Possible values:
  1392. // "changeSequence" (default)
  1393. func (c *ChangesListCall) SortBy(sortBy string) *ChangesListCall {
  1394. c.urlParams_.Set("sortBy", sortBy)
  1395. return c
  1396. }
  1397. // SortOrder sets the optional parameter "sortOrder":
  1398. func (c *ChangesListCall) SortOrder(sortOrder string) *ChangesListCall {
  1399. c.urlParams_.Set("sortOrder", sortOrder)
  1400. return c
  1401. }
  1402. // Fields allows partial responses to be retrieved. See
  1403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1404. // for more information.
  1405. func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall {
  1406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1407. return c
  1408. }
  1409. // IfNoneMatch sets the optional parameter which makes the operation
  1410. // fail if the object's ETag matches the given value. This is useful for
  1411. // getting updates only after the object has changed since the last
  1412. // request. Use googleapi.IsNotModified to check whether the response
  1413. // error from Do is the result of In-None-Match.
  1414. func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall {
  1415. c.ifNoneMatch_ = entityTag
  1416. return c
  1417. }
  1418. // Context sets the context to be used in this call's Do method. Any
  1419. // pending HTTP request will be aborted if the provided context is
  1420. // canceled.
  1421. func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall {
  1422. c.ctx_ = ctx
  1423. return c
  1424. }
  1425. // Header returns an http.Header that can be modified by the caller to
  1426. // add HTTP headers to the request.
  1427. func (c *ChangesListCall) Header() http.Header {
  1428. if c.header_ == nil {
  1429. c.header_ = make(http.Header)
  1430. }
  1431. return c.header_
  1432. }
  1433. func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) {
  1434. reqHeaders := make(http.Header)
  1435. for k, v := range c.header_ {
  1436. reqHeaders[k] = v
  1437. }
  1438. reqHeaders.Set("User-Agent", c.s.userAgent())
  1439. if c.ifNoneMatch_ != "" {
  1440. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1441. }
  1442. var body io.Reader = nil
  1443. c.urlParams_.Set("alt", alt)
  1444. c.urlParams_.Set("prettyPrint", "false")
  1445. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/changes")
  1446. urls += "?" + c.urlParams_.Encode()
  1447. req, err := http.NewRequest("GET", urls, body)
  1448. if err != nil {
  1449. return nil, err
  1450. }
  1451. req.Header = reqHeaders
  1452. googleapi.Expand(req.URL, map[string]string{
  1453. "project": c.project,
  1454. "managedZone": c.managedZone,
  1455. })
  1456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1457. }
  1458. // Do executes the "dns.changes.list" call.
  1459. // Exactly one of *ChangesListResponse or error will be non-nil. Any
  1460. // non-2xx status code is an error. Response headers are in either
  1461. // *ChangesListResponse.ServerResponse.Header or (if a response was
  1462. // returned at all) in error.(*googleapi.Error).Header. Use
  1463. // googleapi.IsNotModified to check whether the returned error was
  1464. // because http.StatusNotModified was returned.
  1465. func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangesListResponse, error) {
  1466. gensupport.SetOptions(c.urlParams_, opts...)
  1467. res, err := c.doRequest("json")
  1468. if res != nil && res.StatusCode == http.StatusNotModified {
  1469. if res.Body != nil {
  1470. res.Body.Close()
  1471. }
  1472. return nil, &googleapi.Error{
  1473. Code: res.StatusCode,
  1474. Header: res.Header,
  1475. }
  1476. }
  1477. if err != nil {
  1478. return nil, err
  1479. }
  1480. defer googleapi.CloseBody(res)
  1481. if err := googleapi.CheckResponse(res); err != nil {
  1482. return nil, err
  1483. }
  1484. ret := &ChangesListResponse{
  1485. ServerResponse: googleapi.ServerResponse{
  1486. Header: res.Header,
  1487. HTTPStatusCode: res.StatusCode,
  1488. },
  1489. }
  1490. target := &ret
  1491. if err := gensupport.DecodeResponse(target, res); err != nil {
  1492. return nil, err
  1493. }
  1494. return ret, nil
  1495. // {
  1496. // "description": "",
  1497. // "httpMethod": "GET",
  1498. // "id": "dns.changes.list",
  1499. // "parameterOrder": [
  1500. // "project",
  1501. // "managedZone"
  1502. // ],
  1503. // "parameters": {
  1504. // "managedZone": {
  1505. // "location": "path",
  1506. // "required": true,
  1507. // "type": "string"
  1508. // },
  1509. // "maxResults": {
  1510. // "format": "int32",
  1511. // "location": "query",
  1512. // "type": "integer"
  1513. // },
  1514. // "pageToken": {
  1515. // "location": "query",
  1516. // "type": "string"
  1517. // },
  1518. // "project": {
  1519. // "location": "path",
  1520. // "required": true,
  1521. // "type": "string"
  1522. // },
  1523. // "sortBy": {
  1524. // "default": "changeSequence",
  1525. // "enum": [
  1526. // "changeSequence"
  1527. // ],
  1528. // "enumDescriptions": [
  1529. // ""
  1530. // ],
  1531. // "location": "query",
  1532. // "type": "string"
  1533. // },
  1534. // "sortOrder": {
  1535. // "location": "query",
  1536. // "type": "string"
  1537. // }
  1538. // },
  1539. // "path": "{project}/managedZones/{managedZone}/changes",
  1540. // "response": {
  1541. // "$ref": "ChangesListResponse"
  1542. // },
  1543. // "scopes": [
  1544. // "https://www.googleapis.com/auth/cloud-platform",
  1545. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1546. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1547. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1548. // ]
  1549. // }
  1550. }
  1551. // Pages invokes f for each page of results.
  1552. // A non-nil error returned from f will halt the iteration.
  1553. // The provided context supersedes any context provided to the Context method.
  1554. func (c *ChangesListCall) Pages(ctx context.Context, f func(*ChangesListResponse) error) error {
  1555. c.ctx_ = ctx
  1556. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1557. for {
  1558. x, err := c.Do()
  1559. if err != nil {
  1560. return err
  1561. }
  1562. if err := f(x); err != nil {
  1563. return err
  1564. }
  1565. if x.NextPageToken == "" {
  1566. return nil
  1567. }
  1568. c.PageToken(x.NextPageToken)
  1569. }
  1570. }
  1571. // method id "dns.dnsKeys.get":
  1572. type DnsKeysGetCall struct {
  1573. s *Service
  1574. project string
  1575. managedZone string
  1576. dnsKeyId string
  1577. urlParams_ gensupport.URLParams
  1578. ifNoneMatch_ string
  1579. ctx_ context.Context
  1580. header_ http.Header
  1581. }
  1582. // Get:
  1583. func (r *DnsKeysService) Get(project string, managedZone string, dnsKeyId string) *DnsKeysGetCall {
  1584. c := &DnsKeysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1585. c.project = project
  1586. c.managedZone = managedZone
  1587. c.dnsKeyId = dnsKeyId
  1588. return c
  1589. }
  1590. // ClientOperationId sets the optional parameter "clientOperationId":
  1591. func (c *DnsKeysGetCall) ClientOperationId(clientOperationId string) *DnsKeysGetCall {
  1592. c.urlParams_.Set("clientOperationId", clientOperationId)
  1593. return c
  1594. }
  1595. // DigestType sets the optional parameter "digestType":
  1596. func (c *DnsKeysGetCall) DigestType(digestType string) *DnsKeysGetCall {
  1597. c.urlParams_.Set("digestType", digestType)
  1598. return c
  1599. }
  1600. // Fields allows partial responses to be retrieved. See
  1601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1602. // for more information.
  1603. func (c *DnsKeysGetCall) Fields(s ...googleapi.Field) *DnsKeysGetCall {
  1604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1605. return c
  1606. }
  1607. // IfNoneMatch sets the optional parameter which makes the operation
  1608. // fail if the object's ETag matches the given value. This is useful for
  1609. // getting updates only after the object has changed since the last
  1610. // request. Use googleapi.IsNotModified to check whether the response
  1611. // error from Do is the result of In-None-Match.
  1612. func (c *DnsKeysGetCall) IfNoneMatch(entityTag string) *DnsKeysGetCall {
  1613. c.ifNoneMatch_ = entityTag
  1614. return c
  1615. }
  1616. // Context sets the context to be used in this call's Do method. Any
  1617. // pending HTTP request will be aborted if the provided context is
  1618. // canceled.
  1619. func (c *DnsKeysGetCall) Context(ctx context.Context) *DnsKeysGetCall {
  1620. c.ctx_ = ctx
  1621. return c
  1622. }
  1623. // Header returns an http.Header that can be modified by the caller to
  1624. // add HTTP headers to the request.
  1625. func (c *DnsKeysGetCall) Header() http.Header {
  1626. if c.header_ == nil {
  1627. c.header_ = make(http.Header)
  1628. }
  1629. return c.header_
  1630. }
  1631. func (c *DnsKeysGetCall) doRequest(alt string) (*http.Response, error) {
  1632. reqHeaders := make(http.Header)
  1633. for k, v := range c.header_ {
  1634. reqHeaders[k] = v
  1635. }
  1636. reqHeaders.Set("User-Agent", c.s.userAgent())
  1637. if c.ifNoneMatch_ != "" {
  1638. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1639. }
  1640. var body io.Reader = nil
  1641. c.urlParams_.Set("alt", alt)
  1642. c.urlParams_.Set("prettyPrint", "false")
  1643. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}")
  1644. urls += "?" + c.urlParams_.Encode()
  1645. req, err := http.NewRequest("GET", urls, body)
  1646. if err != nil {
  1647. return nil, err
  1648. }
  1649. req.Header = reqHeaders
  1650. googleapi.Expand(req.URL, map[string]string{
  1651. "project": c.project,
  1652. "managedZone": c.managedZone,
  1653. "dnsKeyId": c.dnsKeyId,
  1654. })
  1655. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1656. }
  1657. // Do executes the "dns.dnsKeys.get" call.
  1658. // Exactly one of *DnsKey or error will be non-nil. Any non-2xx status
  1659. // code is an error. Response headers are in either
  1660. // *DnsKey.ServerResponse.Header or (if a response was returned at all)
  1661. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1662. // check whether the returned error was because http.StatusNotModified
  1663. // was returned.
  1664. func (c *DnsKeysGetCall) Do(opts ...googleapi.CallOption) (*DnsKey, error) {
  1665. gensupport.SetOptions(c.urlParams_, opts...)
  1666. res, err := c.doRequest("json")
  1667. if res != nil && res.StatusCode == http.StatusNotModified {
  1668. if res.Body != nil {
  1669. res.Body.Close()
  1670. }
  1671. return nil, &googleapi.Error{
  1672. Code: res.StatusCode,
  1673. Header: res.Header,
  1674. }
  1675. }
  1676. if err != nil {
  1677. return nil, err
  1678. }
  1679. defer googleapi.CloseBody(res)
  1680. if err := googleapi.CheckResponse(res); err != nil {
  1681. return nil, err
  1682. }
  1683. ret := &DnsKey{
  1684. ServerResponse: googleapi.ServerResponse{
  1685. Header: res.Header,
  1686. HTTPStatusCode: res.StatusCode,
  1687. },
  1688. }
  1689. target := &ret
  1690. if err := gensupport.DecodeResponse(target, res); err != nil {
  1691. return nil, err
  1692. }
  1693. return ret, nil
  1694. // {
  1695. // "description": "",
  1696. // "httpMethod": "GET",
  1697. // "id": "dns.dnsKeys.get",
  1698. // "parameterOrder": [
  1699. // "project",
  1700. // "managedZone",
  1701. // "dnsKeyId"
  1702. // ],
  1703. // "parameters": {
  1704. // "clientOperationId": {
  1705. // "location": "query",
  1706. // "type": "string"
  1707. // },
  1708. // "digestType": {
  1709. // "location": "query",
  1710. // "type": "string"
  1711. // },
  1712. // "dnsKeyId": {
  1713. // "location": "path",
  1714. // "required": true,
  1715. // "type": "string"
  1716. // },
  1717. // "managedZone": {
  1718. // "location": "path",
  1719. // "required": true,
  1720. // "type": "string"
  1721. // },
  1722. // "project": {
  1723. // "location": "path",
  1724. // "required": true,
  1725. // "type": "string"
  1726. // }
  1727. // },
  1728. // "path": "{project}/managedZones/{managedZone}/dnsKeys/{dnsKeyId}",
  1729. // "response": {
  1730. // "$ref": "DnsKey"
  1731. // },
  1732. // "scopes": [
  1733. // "https://www.googleapis.com/auth/cloud-platform",
  1734. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1735. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1736. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1737. // ]
  1738. // }
  1739. }
  1740. // method id "dns.dnsKeys.list":
  1741. type DnsKeysListCall struct {
  1742. s *Service
  1743. project string
  1744. managedZone string
  1745. urlParams_ gensupport.URLParams
  1746. ifNoneMatch_ string
  1747. ctx_ context.Context
  1748. header_ http.Header
  1749. }
  1750. // List:
  1751. func (r *DnsKeysService) List(project string, managedZone string) *DnsKeysListCall {
  1752. c := &DnsKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1753. c.project = project
  1754. c.managedZone = managedZone
  1755. return c
  1756. }
  1757. // DigestType sets the optional parameter "digestType":
  1758. func (c *DnsKeysListCall) DigestType(digestType string) *DnsKeysListCall {
  1759. c.urlParams_.Set("digestType", digestType)
  1760. return c
  1761. }
  1762. // MaxResults sets the optional parameter "maxResults":
  1763. func (c *DnsKeysListCall) MaxResults(maxResults int64) *DnsKeysListCall {
  1764. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1765. return c
  1766. }
  1767. // PageToken sets the optional parameter "pageToken":
  1768. func (c *DnsKeysListCall) PageToken(pageToken string) *DnsKeysListCall {
  1769. c.urlParams_.Set("pageToken", pageToken)
  1770. return c
  1771. }
  1772. // Fields allows partial responses to be retrieved. See
  1773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1774. // for more information.
  1775. func (c *DnsKeysListCall) Fields(s ...googleapi.Field) *DnsKeysListCall {
  1776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1777. return c
  1778. }
  1779. // IfNoneMatch sets the optional parameter which makes the operation
  1780. // fail if the object's ETag matches the given value. This is useful for
  1781. // getting updates only after the object has changed since the last
  1782. // request. Use googleapi.IsNotModified to check whether the response
  1783. // error from Do is the result of In-None-Match.
  1784. func (c *DnsKeysListCall) IfNoneMatch(entityTag string) *DnsKeysListCall {
  1785. c.ifNoneMatch_ = entityTag
  1786. return c
  1787. }
  1788. // Context sets the context to be used in this call's Do method. Any
  1789. // pending HTTP request will be aborted if the provided context is
  1790. // canceled.
  1791. func (c *DnsKeysListCall) Context(ctx context.Context) *DnsKeysListCall {
  1792. c.ctx_ = ctx
  1793. return c
  1794. }
  1795. // Header returns an http.Header that can be modified by the caller to
  1796. // add HTTP headers to the request.
  1797. func (c *DnsKeysListCall) Header() http.Header {
  1798. if c.header_ == nil {
  1799. c.header_ = make(http.Header)
  1800. }
  1801. return c.header_
  1802. }
  1803. func (c *DnsKeysListCall) doRequest(alt string) (*http.Response, error) {
  1804. reqHeaders := make(http.Header)
  1805. for k, v := range c.header_ {
  1806. reqHeaders[k] = v
  1807. }
  1808. reqHeaders.Set("User-Agent", c.s.userAgent())
  1809. if c.ifNoneMatch_ != "" {
  1810. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1811. }
  1812. var body io.Reader = nil
  1813. c.urlParams_.Set("alt", alt)
  1814. c.urlParams_.Set("prettyPrint", "false")
  1815. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/dnsKeys")
  1816. urls += "?" + c.urlParams_.Encode()
  1817. req, err := http.NewRequest("GET", urls, body)
  1818. if err != nil {
  1819. return nil, err
  1820. }
  1821. req.Header = reqHeaders
  1822. googleapi.Expand(req.URL, map[string]string{
  1823. "project": c.project,
  1824. "managedZone": c.managedZone,
  1825. })
  1826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1827. }
  1828. // Do executes the "dns.dnsKeys.list" call.
  1829. // Exactly one of *DnsKeysListResponse or error will be non-nil. Any
  1830. // non-2xx status code is an error. Response headers are in either
  1831. // *DnsKeysListResponse.ServerResponse.Header or (if a response was
  1832. // returned at all) in error.(*googleapi.Error).Header. Use
  1833. // googleapi.IsNotModified to check whether the returned error was
  1834. // because http.StatusNotModified was returned.
  1835. func (c *DnsKeysListCall) Do(opts ...googleapi.CallOption) (*DnsKeysListResponse, error) {
  1836. gensupport.SetOptions(c.urlParams_, opts...)
  1837. res, err := c.doRequest("json")
  1838. if res != nil && res.StatusCode == http.StatusNotModified {
  1839. if res.Body != nil {
  1840. res.Body.Close()
  1841. }
  1842. return nil, &googleapi.Error{
  1843. Code: res.StatusCode,
  1844. Header: res.Header,
  1845. }
  1846. }
  1847. if err != nil {
  1848. return nil, err
  1849. }
  1850. defer googleapi.CloseBody(res)
  1851. if err := googleapi.CheckResponse(res); err != nil {
  1852. return nil, err
  1853. }
  1854. ret := &DnsKeysListResponse{
  1855. ServerResponse: googleapi.ServerResponse{
  1856. Header: res.Header,
  1857. HTTPStatusCode: res.StatusCode,
  1858. },
  1859. }
  1860. target := &ret
  1861. if err := gensupport.DecodeResponse(target, res); err != nil {
  1862. return nil, err
  1863. }
  1864. return ret, nil
  1865. // {
  1866. // "description": "",
  1867. // "httpMethod": "GET",
  1868. // "id": "dns.dnsKeys.list",
  1869. // "parameterOrder": [
  1870. // "project",
  1871. // "managedZone"
  1872. // ],
  1873. // "parameters": {
  1874. // "digestType": {
  1875. // "location": "query",
  1876. // "type": "string"
  1877. // },
  1878. // "managedZone": {
  1879. // "location": "path",
  1880. // "required": true,
  1881. // "type": "string"
  1882. // },
  1883. // "maxResults": {
  1884. // "format": "int32",
  1885. // "location": "query",
  1886. // "type": "integer"
  1887. // },
  1888. // "pageToken": {
  1889. // "location": "query",
  1890. // "type": "string"
  1891. // },
  1892. // "project": {
  1893. // "location": "path",
  1894. // "required": true,
  1895. // "type": "string"
  1896. // }
  1897. // },
  1898. // "path": "{project}/managedZones/{managedZone}/dnsKeys",
  1899. // "response": {
  1900. // "$ref": "DnsKeysListResponse"
  1901. // },
  1902. // "scopes": [
  1903. // "https://www.googleapis.com/auth/cloud-platform",
  1904. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1905. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  1906. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  1907. // ]
  1908. // }
  1909. }
  1910. // Pages invokes f for each page of results.
  1911. // A non-nil error returned from f will halt the iteration.
  1912. // The provided context supersedes any context provided to the Context method.
  1913. func (c *DnsKeysListCall) Pages(ctx context.Context, f func(*DnsKeysListResponse) error) error {
  1914. c.ctx_ = ctx
  1915. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1916. for {
  1917. x, err := c.Do()
  1918. if err != nil {
  1919. return err
  1920. }
  1921. if err := f(x); err != nil {
  1922. return err
  1923. }
  1924. if x.NextPageToken == "" {
  1925. return nil
  1926. }
  1927. c.PageToken(x.NextPageToken)
  1928. }
  1929. }
  1930. // method id "dns.managedZoneOperations.get":
  1931. type ManagedZoneOperationsGetCall struct {
  1932. s *Service
  1933. project string
  1934. managedZone string
  1935. operation string
  1936. urlParams_ gensupport.URLParams
  1937. ifNoneMatch_ string
  1938. ctx_ context.Context
  1939. header_ http.Header
  1940. }
  1941. // Get:
  1942. func (r *ManagedZoneOperationsService) Get(project string, managedZone string, operation string) *ManagedZoneOperationsGetCall {
  1943. c := &ManagedZoneOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1944. c.project = project
  1945. c.managedZone = managedZone
  1946. c.operation = operation
  1947. return c
  1948. }
  1949. // ClientOperationId sets the optional parameter "clientOperationId":
  1950. func (c *ManagedZoneOperationsGetCall) ClientOperationId(clientOperationId string) *ManagedZoneOperationsGetCall {
  1951. c.urlParams_.Set("clientOperationId", clientOperationId)
  1952. return c
  1953. }
  1954. // Fields allows partial responses to be retrieved. See
  1955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1956. // for more information.
  1957. func (c *ManagedZoneOperationsGetCall) Fields(s ...googleapi.Field) *ManagedZoneOperationsGetCall {
  1958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1959. return c
  1960. }
  1961. // IfNoneMatch sets the optional parameter which makes the operation
  1962. // fail if the object's ETag matches the given value. This is useful for
  1963. // getting updates only after the object has changed since the last
  1964. // request. Use googleapi.IsNotModified to check whether the response
  1965. // error from Do is the result of In-None-Match.
  1966. func (c *ManagedZoneOperationsGetCall) IfNoneMatch(entityTag string) *ManagedZoneOperationsGetCall {
  1967. c.ifNoneMatch_ = entityTag
  1968. return c
  1969. }
  1970. // Context sets the context to be used in this call's Do method. Any
  1971. // pending HTTP request will be aborted if the provided context is
  1972. // canceled.
  1973. func (c *ManagedZoneOperationsGetCall) Context(ctx context.Context) *ManagedZoneOperationsGetCall {
  1974. c.ctx_ = ctx
  1975. return c
  1976. }
  1977. // Header returns an http.Header that can be modified by the caller to
  1978. // add HTTP headers to the request.
  1979. func (c *ManagedZoneOperationsGetCall) Header() http.Header {
  1980. if c.header_ == nil {
  1981. c.header_ = make(http.Header)
  1982. }
  1983. return c.header_
  1984. }
  1985. func (c *ManagedZoneOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  1986. reqHeaders := make(http.Header)
  1987. for k, v := range c.header_ {
  1988. reqHeaders[k] = v
  1989. }
  1990. reqHeaders.Set("User-Agent", c.s.userAgent())
  1991. if c.ifNoneMatch_ != "" {
  1992. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1993. }
  1994. var body io.Reader = nil
  1995. c.urlParams_.Set("alt", alt)
  1996. c.urlParams_.Set("prettyPrint", "false")
  1997. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/operations/{operation}")
  1998. urls += "?" + c.urlParams_.Encode()
  1999. req, err := http.NewRequest("GET", urls, body)
  2000. if err != nil {
  2001. return nil, err
  2002. }
  2003. req.Header = reqHeaders
  2004. googleapi.Expand(req.URL, map[string]string{
  2005. "project": c.project,
  2006. "managedZone": c.managedZone,
  2007. "operation": c.operation,
  2008. })
  2009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2010. }
  2011. // Do executes the "dns.managedZoneOperations.get" call.
  2012. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2013. // status code is an error. Response headers are in either
  2014. // *Operation.ServerResponse.Header or (if a response was returned at
  2015. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2016. // to check whether the returned error was because
  2017. // http.StatusNotModified was returned.
  2018. func (c *ManagedZoneOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2019. gensupport.SetOptions(c.urlParams_, opts...)
  2020. res, err := c.doRequest("json")
  2021. if res != nil && res.StatusCode == http.StatusNotModified {
  2022. if res.Body != nil {
  2023. res.Body.Close()
  2024. }
  2025. return nil, &googleapi.Error{
  2026. Code: res.StatusCode,
  2027. Header: res.Header,
  2028. }
  2029. }
  2030. if err != nil {
  2031. return nil, err
  2032. }
  2033. defer googleapi.CloseBody(res)
  2034. if err := googleapi.CheckResponse(res); err != nil {
  2035. return nil, err
  2036. }
  2037. ret := &Operation{
  2038. ServerResponse: googleapi.ServerResponse{
  2039. Header: res.Header,
  2040. HTTPStatusCode: res.StatusCode,
  2041. },
  2042. }
  2043. target := &ret
  2044. if err := gensupport.DecodeResponse(target, res); err != nil {
  2045. return nil, err
  2046. }
  2047. return ret, nil
  2048. // {
  2049. // "description": "",
  2050. // "httpMethod": "GET",
  2051. // "id": "dns.managedZoneOperations.get",
  2052. // "parameterOrder": [
  2053. // "project",
  2054. // "managedZone",
  2055. // "operation"
  2056. // ],
  2057. // "parameters": {
  2058. // "clientOperationId": {
  2059. // "location": "query",
  2060. // "type": "string"
  2061. // },
  2062. // "managedZone": {
  2063. // "location": "path",
  2064. // "required": true,
  2065. // "type": "string"
  2066. // },
  2067. // "operation": {
  2068. // "location": "path",
  2069. // "required": true,
  2070. // "type": "string"
  2071. // },
  2072. // "project": {
  2073. // "location": "path",
  2074. // "required": true,
  2075. // "type": "string"
  2076. // }
  2077. // },
  2078. // "path": "{project}/managedZones/{managedZone}/operations/{operation}",
  2079. // "response": {
  2080. // "$ref": "Operation"
  2081. // },
  2082. // "scopes": [
  2083. // "https://www.googleapis.com/auth/cloud-platform",
  2084. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2085. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  2086. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2087. // ]
  2088. // }
  2089. }
  2090. // method id "dns.managedZoneOperations.list":
  2091. type ManagedZoneOperationsListCall struct {
  2092. s *Service
  2093. project string
  2094. managedZone string
  2095. urlParams_ gensupport.URLParams
  2096. ifNoneMatch_ string
  2097. ctx_ context.Context
  2098. header_ http.Header
  2099. }
  2100. // List:
  2101. func (r *ManagedZoneOperationsService) List(project string, managedZone string) *ManagedZoneOperationsListCall {
  2102. c := &ManagedZoneOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2103. c.project = project
  2104. c.managedZone = managedZone
  2105. return c
  2106. }
  2107. // MaxResults sets the optional parameter "maxResults":
  2108. func (c *ManagedZoneOperationsListCall) MaxResults(maxResults int64) *ManagedZoneOperationsListCall {
  2109. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2110. return c
  2111. }
  2112. // PageToken sets the optional parameter "pageToken":
  2113. func (c *ManagedZoneOperationsListCall) PageToken(pageToken string) *ManagedZoneOperationsListCall {
  2114. c.urlParams_.Set("pageToken", pageToken)
  2115. return c
  2116. }
  2117. // SortBy sets the optional parameter "sortBy":
  2118. //
  2119. // Possible values:
  2120. // "id"
  2121. // "startTime" (default)
  2122. func (c *ManagedZoneOperationsListCall) SortBy(sortBy string) *ManagedZoneOperationsListCall {
  2123. c.urlParams_.Set("sortBy", sortBy)
  2124. return c
  2125. }
  2126. // Fields allows partial responses to be retrieved. See
  2127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2128. // for more information.
  2129. func (c *ManagedZoneOperationsListCall) Fields(s ...googleapi.Field) *ManagedZoneOperationsListCall {
  2130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2131. return c
  2132. }
  2133. // IfNoneMatch sets the optional parameter which makes the operation
  2134. // fail if the object's ETag matches the given value. This is useful for
  2135. // getting updates only after the object has changed since the last
  2136. // request. Use googleapi.IsNotModified to check whether the response
  2137. // error from Do is the result of In-None-Match.
  2138. func (c *ManagedZoneOperationsListCall) IfNoneMatch(entityTag string) *ManagedZoneOperationsListCall {
  2139. c.ifNoneMatch_ = entityTag
  2140. return c
  2141. }
  2142. // Context sets the context to be used in this call's Do method. Any
  2143. // pending HTTP request will be aborted if the provided context is
  2144. // canceled.
  2145. func (c *ManagedZoneOperationsListCall) Context(ctx context.Context) *ManagedZoneOperationsListCall {
  2146. c.ctx_ = ctx
  2147. return c
  2148. }
  2149. // Header returns an http.Header that can be modified by the caller to
  2150. // add HTTP headers to the request.
  2151. func (c *ManagedZoneOperationsListCall) Header() http.Header {
  2152. if c.header_ == nil {
  2153. c.header_ = make(http.Header)
  2154. }
  2155. return c.header_
  2156. }
  2157. func (c *ManagedZoneOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2158. reqHeaders := make(http.Header)
  2159. for k, v := range c.header_ {
  2160. reqHeaders[k] = v
  2161. }
  2162. reqHeaders.Set("User-Agent", c.s.userAgent())
  2163. if c.ifNoneMatch_ != "" {
  2164. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2165. }
  2166. var body io.Reader = nil
  2167. c.urlParams_.Set("alt", alt)
  2168. c.urlParams_.Set("prettyPrint", "false")
  2169. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/operations")
  2170. urls += "?" + c.urlParams_.Encode()
  2171. req, err := http.NewRequest("GET", urls, body)
  2172. if err != nil {
  2173. return nil, err
  2174. }
  2175. req.Header = reqHeaders
  2176. googleapi.Expand(req.URL, map[string]string{
  2177. "project": c.project,
  2178. "managedZone": c.managedZone,
  2179. })
  2180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2181. }
  2182. // Do executes the "dns.managedZoneOperations.list" call.
  2183. // Exactly one of *ManagedZoneOperationsListResponse or error will be
  2184. // non-nil. Any non-2xx status code is an error. Response headers are in
  2185. // either *ManagedZoneOperationsListResponse.ServerResponse.Header or
  2186. // (if a response was returned at all) in
  2187. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2188. // whether the returned error was because http.StatusNotModified was
  2189. // returned.
  2190. func (c *ManagedZoneOperationsListCall) Do(opts ...googleapi.CallOption) (*ManagedZoneOperationsListResponse, error) {
  2191. gensupport.SetOptions(c.urlParams_, opts...)
  2192. res, err := c.doRequest("json")
  2193. if res != nil && res.StatusCode == http.StatusNotModified {
  2194. if res.Body != nil {
  2195. res.Body.Close()
  2196. }
  2197. return nil, &googleapi.Error{
  2198. Code: res.StatusCode,
  2199. Header: res.Header,
  2200. }
  2201. }
  2202. if err != nil {
  2203. return nil, err
  2204. }
  2205. defer googleapi.CloseBody(res)
  2206. if err := googleapi.CheckResponse(res); err != nil {
  2207. return nil, err
  2208. }
  2209. ret := &ManagedZoneOperationsListResponse{
  2210. ServerResponse: googleapi.ServerResponse{
  2211. Header: res.Header,
  2212. HTTPStatusCode: res.StatusCode,
  2213. },
  2214. }
  2215. target := &ret
  2216. if err := gensupport.DecodeResponse(target, res); err != nil {
  2217. return nil, err
  2218. }
  2219. return ret, nil
  2220. // {
  2221. // "description": "",
  2222. // "httpMethod": "GET",
  2223. // "id": "dns.managedZoneOperations.list",
  2224. // "parameterOrder": [
  2225. // "project",
  2226. // "managedZone"
  2227. // ],
  2228. // "parameters": {
  2229. // "managedZone": {
  2230. // "location": "path",
  2231. // "required": true,
  2232. // "type": "string"
  2233. // },
  2234. // "maxResults": {
  2235. // "format": "int32",
  2236. // "location": "query",
  2237. // "type": "integer"
  2238. // },
  2239. // "pageToken": {
  2240. // "location": "query",
  2241. // "type": "string"
  2242. // },
  2243. // "project": {
  2244. // "location": "path",
  2245. // "required": true,
  2246. // "type": "string"
  2247. // },
  2248. // "sortBy": {
  2249. // "default": "startTime",
  2250. // "enum": [
  2251. // "id",
  2252. // "startTime"
  2253. // ],
  2254. // "enumDescriptions": [
  2255. // "",
  2256. // ""
  2257. // ],
  2258. // "location": "query",
  2259. // "type": "string"
  2260. // }
  2261. // },
  2262. // "path": "{project}/managedZones/{managedZone}/operations",
  2263. // "response": {
  2264. // "$ref": "ManagedZoneOperationsListResponse"
  2265. // },
  2266. // "scopes": [
  2267. // "https://www.googleapis.com/auth/cloud-platform",
  2268. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2269. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  2270. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2271. // ]
  2272. // }
  2273. }
  2274. // Pages invokes f for each page of results.
  2275. // A non-nil error returned from f will halt the iteration.
  2276. // The provided context supersedes any context provided to the Context method.
  2277. func (c *ManagedZoneOperationsListCall) Pages(ctx context.Context, f func(*ManagedZoneOperationsListResponse) error) error {
  2278. c.ctx_ = ctx
  2279. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2280. for {
  2281. x, err := c.Do()
  2282. if err != nil {
  2283. return err
  2284. }
  2285. if err := f(x); err != nil {
  2286. return err
  2287. }
  2288. if x.NextPageToken == "" {
  2289. return nil
  2290. }
  2291. c.PageToken(x.NextPageToken)
  2292. }
  2293. }
  2294. // method id "dns.managedZones.create":
  2295. type ManagedZonesCreateCall struct {
  2296. s *Service
  2297. project string
  2298. managedzone *ManagedZone
  2299. urlParams_ gensupport.URLParams
  2300. ctx_ context.Context
  2301. header_ http.Header
  2302. }
  2303. // Create:
  2304. func (r *ManagedZonesService) Create(project string, managedzone *ManagedZone) *ManagedZonesCreateCall {
  2305. c := &ManagedZonesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2306. c.project = project
  2307. c.managedzone = managedzone
  2308. return c
  2309. }
  2310. // ClientOperationId sets the optional parameter "clientOperationId":
  2311. func (c *ManagedZonesCreateCall) ClientOperationId(clientOperationId string) *ManagedZonesCreateCall {
  2312. c.urlParams_.Set("clientOperationId", clientOperationId)
  2313. return c
  2314. }
  2315. // Fields allows partial responses to be retrieved. See
  2316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2317. // for more information.
  2318. func (c *ManagedZonesCreateCall) Fields(s ...googleapi.Field) *ManagedZonesCreateCall {
  2319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  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 *ManagedZonesCreateCall) Context(ctx context.Context) *ManagedZonesCreateCall {
  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 *ManagedZonesCreateCall) Header() http.Header {
  2332. if c.header_ == nil {
  2333. c.header_ = make(http.Header)
  2334. }
  2335. return c.header_
  2336. }
  2337. func (c *ManagedZonesCreateCall) 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. var body io.Reader = nil
  2344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
  2345. if err != nil {
  2346. return nil, err
  2347. }
  2348. reqHeaders.Set("Content-Type", "application/json")
  2349. c.urlParams_.Set("alt", alt)
  2350. c.urlParams_.Set("prettyPrint", "false")
  2351. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
  2352. urls += "?" + c.urlParams_.Encode()
  2353. req, err := http.NewRequest("POST", urls, body)
  2354. if err != nil {
  2355. return nil, err
  2356. }
  2357. req.Header = reqHeaders
  2358. googleapi.Expand(req.URL, map[string]string{
  2359. "project": c.project,
  2360. })
  2361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2362. }
  2363. // Do executes the "dns.managedZones.create" call.
  2364. // Exactly one of *ManagedZone or error will be non-nil. Any non-2xx
  2365. // status code is an error. Response headers are in either
  2366. // *ManagedZone.ServerResponse.Header or (if a response was returned at
  2367. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2368. // to check whether the returned error was because
  2369. // http.StatusNotModified was returned.
  2370. func (c *ManagedZonesCreateCall) Do(opts ...googleapi.CallOption) (*ManagedZone, error) {
  2371. gensupport.SetOptions(c.urlParams_, opts...)
  2372. res, err := c.doRequest("json")
  2373. if res != nil && res.StatusCode == http.StatusNotModified {
  2374. if res.Body != nil {
  2375. res.Body.Close()
  2376. }
  2377. return nil, &googleapi.Error{
  2378. Code: res.StatusCode,
  2379. Header: res.Header,
  2380. }
  2381. }
  2382. if err != nil {
  2383. return nil, err
  2384. }
  2385. defer googleapi.CloseBody(res)
  2386. if err := googleapi.CheckResponse(res); err != nil {
  2387. return nil, err
  2388. }
  2389. ret := &ManagedZone{
  2390. ServerResponse: googleapi.ServerResponse{
  2391. Header: res.Header,
  2392. HTTPStatusCode: res.StatusCode,
  2393. },
  2394. }
  2395. target := &ret
  2396. if err := gensupport.DecodeResponse(target, res); err != nil {
  2397. return nil, err
  2398. }
  2399. return ret, nil
  2400. // {
  2401. // "description": "",
  2402. // "httpMethod": "POST",
  2403. // "id": "dns.managedZones.create",
  2404. // "parameterOrder": [
  2405. // "project"
  2406. // ],
  2407. // "parameters": {
  2408. // "clientOperationId": {
  2409. // "location": "query",
  2410. // "type": "string"
  2411. // },
  2412. // "project": {
  2413. // "location": "path",
  2414. // "required": true,
  2415. // "type": "string"
  2416. // }
  2417. // },
  2418. // "path": "{project}/managedZones",
  2419. // "request": {
  2420. // "$ref": "ManagedZone"
  2421. // },
  2422. // "response": {
  2423. // "$ref": "ManagedZone"
  2424. // },
  2425. // "scopes": [
  2426. // "https://www.googleapis.com/auth/cloud-platform",
  2427. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2428. // ]
  2429. // }
  2430. }
  2431. // method id "dns.managedZones.delete":
  2432. type ManagedZonesDeleteCall struct {
  2433. s *Service
  2434. project string
  2435. managedZone string
  2436. urlParams_ gensupport.URLParams
  2437. ctx_ context.Context
  2438. header_ http.Header
  2439. }
  2440. // Delete:
  2441. func (r *ManagedZonesService) Delete(project string, managedZone string) *ManagedZonesDeleteCall {
  2442. c := &ManagedZonesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2443. c.project = project
  2444. c.managedZone = managedZone
  2445. return c
  2446. }
  2447. // ClientOperationId sets the optional parameter "clientOperationId":
  2448. func (c *ManagedZonesDeleteCall) ClientOperationId(clientOperationId string) *ManagedZonesDeleteCall {
  2449. c.urlParams_.Set("clientOperationId", clientOperationId)
  2450. return c
  2451. }
  2452. // Fields allows partial responses to be retrieved. See
  2453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2454. // for more information.
  2455. func (c *ManagedZonesDeleteCall) Fields(s ...googleapi.Field) *ManagedZonesDeleteCall {
  2456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2457. return c
  2458. }
  2459. // Context sets the context to be used in this call's Do method. Any
  2460. // pending HTTP request will be aborted if the provided context is
  2461. // canceled.
  2462. func (c *ManagedZonesDeleteCall) Context(ctx context.Context) *ManagedZonesDeleteCall {
  2463. c.ctx_ = ctx
  2464. return c
  2465. }
  2466. // Header returns an http.Header that can be modified by the caller to
  2467. // add HTTP headers to the request.
  2468. func (c *ManagedZonesDeleteCall) Header() http.Header {
  2469. if c.header_ == nil {
  2470. c.header_ = make(http.Header)
  2471. }
  2472. return c.header_
  2473. }
  2474. func (c *ManagedZonesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2475. reqHeaders := make(http.Header)
  2476. for k, v := range c.header_ {
  2477. reqHeaders[k] = v
  2478. }
  2479. reqHeaders.Set("User-Agent", c.s.userAgent())
  2480. var body io.Reader = nil
  2481. c.urlParams_.Set("alt", alt)
  2482. c.urlParams_.Set("prettyPrint", "false")
  2483. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  2484. urls += "?" + c.urlParams_.Encode()
  2485. req, err := http.NewRequest("DELETE", urls, body)
  2486. if err != nil {
  2487. return nil, err
  2488. }
  2489. req.Header = reqHeaders
  2490. googleapi.Expand(req.URL, map[string]string{
  2491. "project": c.project,
  2492. "managedZone": c.managedZone,
  2493. })
  2494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2495. }
  2496. // Do executes the "dns.managedZones.delete" call.
  2497. func (c *ManagedZonesDeleteCall) Do(opts ...googleapi.CallOption) error {
  2498. gensupport.SetOptions(c.urlParams_, opts...)
  2499. res, err := c.doRequest("json")
  2500. if err != nil {
  2501. return err
  2502. }
  2503. defer googleapi.CloseBody(res)
  2504. if err := googleapi.CheckResponse(res); err != nil {
  2505. return err
  2506. }
  2507. return nil
  2508. // {
  2509. // "description": "",
  2510. // "httpMethod": "DELETE",
  2511. // "id": "dns.managedZones.delete",
  2512. // "parameterOrder": [
  2513. // "project",
  2514. // "managedZone"
  2515. // ],
  2516. // "parameters": {
  2517. // "clientOperationId": {
  2518. // "location": "query",
  2519. // "type": "string"
  2520. // },
  2521. // "managedZone": {
  2522. // "location": "path",
  2523. // "required": true,
  2524. // "type": "string"
  2525. // },
  2526. // "project": {
  2527. // "location": "path",
  2528. // "required": true,
  2529. // "type": "string"
  2530. // }
  2531. // },
  2532. // "path": "{project}/managedZones/{managedZone}",
  2533. // "scopes": [
  2534. // "https://www.googleapis.com/auth/cloud-platform",
  2535. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2536. // ]
  2537. // }
  2538. }
  2539. // method id "dns.managedZones.get":
  2540. type ManagedZonesGetCall struct {
  2541. s *Service
  2542. project string
  2543. managedZone string
  2544. urlParams_ gensupport.URLParams
  2545. ifNoneMatch_ string
  2546. ctx_ context.Context
  2547. header_ http.Header
  2548. }
  2549. // Get:
  2550. func (r *ManagedZonesService) Get(project string, managedZone string) *ManagedZonesGetCall {
  2551. c := &ManagedZonesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2552. c.project = project
  2553. c.managedZone = managedZone
  2554. return c
  2555. }
  2556. // ClientOperationId sets the optional parameter "clientOperationId":
  2557. func (c *ManagedZonesGetCall) ClientOperationId(clientOperationId string) *ManagedZonesGetCall {
  2558. c.urlParams_.Set("clientOperationId", clientOperationId)
  2559. return c
  2560. }
  2561. // Fields allows partial responses to be retrieved. See
  2562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2563. // for more information.
  2564. func (c *ManagedZonesGetCall) Fields(s ...googleapi.Field) *ManagedZonesGetCall {
  2565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2566. return c
  2567. }
  2568. // IfNoneMatch sets the optional parameter which makes the operation
  2569. // fail if the object's ETag matches the given value. This is useful for
  2570. // getting updates only after the object has changed since the last
  2571. // request. Use googleapi.IsNotModified to check whether the response
  2572. // error from Do is the result of In-None-Match.
  2573. func (c *ManagedZonesGetCall) IfNoneMatch(entityTag string) *ManagedZonesGetCall {
  2574. c.ifNoneMatch_ = entityTag
  2575. return c
  2576. }
  2577. // Context sets the context to be used in this call's Do method. Any
  2578. // pending HTTP request will be aborted if the provided context is
  2579. // canceled.
  2580. func (c *ManagedZonesGetCall) Context(ctx context.Context) *ManagedZonesGetCall {
  2581. c.ctx_ = ctx
  2582. return c
  2583. }
  2584. // Header returns an http.Header that can be modified by the caller to
  2585. // add HTTP headers to the request.
  2586. func (c *ManagedZonesGetCall) Header() http.Header {
  2587. if c.header_ == nil {
  2588. c.header_ = make(http.Header)
  2589. }
  2590. return c.header_
  2591. }
  2592. func (c *ManagedZonesGetCall) doRequest(alt string) (*http.Response, error) {
  2593. reqHeaders := make(http.Header)
  2594. for k, v := range c.header_ {
  2595. reqHeaders[k] = v
  2596. }
  2597. reqHeaders.Set("User-Agent", c.s.userAgent())
  2598. if c.ifNoneMatch_ != "" {
  2599. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2600. }
  2601. var body io.Reader = nil
  2602. c.urlParams_.Set("alt", alt)
  2603. c.urlParams_.Set("prettyPrint", "false")
  2604. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  2605. urls += "?" + c.urlParams_.Encode()
  2606. req, err := http.NewRequest("GET", urls, body)
  2607. if err != nil {
  2608. return nil, err
  2609. }
  2610. req.Header = reqHeaders
  2611. googleapi.Expand(req.URL, map[string]string{
  2612. "project": c.project,
  2613. "managedZone": c.managedZone,
  2614. })
  2615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2616. }
  2617. // Do executes the "dns.managedZones.get" call.
  2618. // Exactly one of *ManagedZone or error will be non-nil. Any non-2xx
  2619. // status code is an error. Response headers are in either
  2620. // *ManagedZone.ServerResponse.Header or (if a response was returned at
  2621. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2622. // to check whether the returned error was because
  2623. // http.StatusNotModified was returned.
  2624. func (c *ManagedZonesGetCall) Do(opts ...googleapi.CallOption) (*ManagedZone, error) {
  2625. gensupport.SetOptions(c.urlParams_, opts...)
  2626. res, err := c.doRequest("json")
  2627. if res != nil && res.StatusCode == http.StatusNotModified {
  2628. if res.Body != nil {
  2629. res.Body.Close()
  2630. }
  2631. return nil, &googleapi.Error{
  2632. Code: res.StatusCode,
  2633. Header: res.Header,
  2634. }
  2635. }
  2636. if err != nil {
  2637. return nil, err
  2638. }
  2639. defer googleapi.CloseBody(res)
  2640. if err := googleapi.CheckResponse(res); err != nil {
  2641. return nil, err
  2642. }
  2643. ret := &ManagedZone{
  2644. ServerResponse: googleapi.ServerResponse{
  2645. Header: res.Header,
  2646. HTTPStatusCode: res.StatusCode,
  2647. },
  2648. }
  2649. target := &ret
  2650. if err := gensupport.DecodeResponse(target, res); err != nil {
  2651. return nil, err
  2652. }
  2653. return ret, nil
  2654. // {
  2655. // "description": "",
  2656. // "httpMethod": "GET",
  2657. // "id": "dns.managedZones.get",
  2658. // "parameterOrder": [
  2659. // "project",
  2660. // "managedZone"
  2661. // ],
  2662. // "parameters": {
  2663. // "clientOperationId": {
  2664. // "location": "query",
  2665. // "type": "string"
  2666. // },
  2667. // "managedZone": {
  2668. // "location": "path",
  2669. // "required": true,
  2670. // "type": "string"
  2671. // },
  2672. // "project": {
  2673. // "location": "path",
  2674. // "required": true,
  2675. // "type": "string"
  2676. // }
  2677. // },
  2678. // "path": "{project}/managedZones/{managedZone}",
  2679. // "response": {
  2680. // "$ref": "ManagedZone"
  2681. // },
  2682. // "scopes": [
  2683. // "https://www.googleapis.com/auth/cloud-platform",
  2684. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2685. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  2686. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2687. // ]
  2688. // }
  2689. }
  2690. // method id "dns.managedZones.list":
  2691. type ManagedZonesListCall struct {
  2692. s *Service
  2693. project string
  2694. urlParams_ gensupport.URLParams
  2695. ifNoneMatch_ string
  2696. ctx_ context.Context
  2697. header_ http.Header
  2698. }
  2699. // List:
  2700. func (r *ManagedZonesService) List(project string) *ManagedZonesListCall {
  2701. c := &ManagedZonesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2702. c.project = project
  2703. return c
  2704. }
  2705. // DnsName sets the optional parameter "dnsName":
  2706. func (c *ManagedZonesListCall) DnsName(dnsName string) *ManagedZonesListCall {
  2707. c.urlParams_.Set("dnsName", dnsName)
  2708. return c
  2709. }
  2710. // MaxResults sets the optional parameter "maxResults":
  2711. func (c *ManagedZonesListCall) MaxResults(maxResults int64) *ManagedZonesListCall {
  2712. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2713. return c
  2714. }
  2715. // PageToken sets the optional parameter "pageToken":
  2716. func (c *ManagedZonesListCall) PageToken(pageToken string) *ManagedZonesListCall {
  2717. c.urlParams_.Set("pageToken", pageToken)
  2718. return c
  2719. }
  2720. // Fields allows partial responses to be retrieved. See
  2721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2722. // for more information.
  2723. func (c *ManagedZonesListCall) Fields(s ...googleapi.Field) *ManagedZonesListCall {
  2724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2725. return c
  2726. }
  2727. // IfNoneMatch sets the optional parameter which makes the operation
  2728. // fail if the object's ETag matches the given value. This is useful for
  2729. // getting updates only after the object has changed since the last
  2730. // request. Use googleapi.IsNotModified to check whether the response
  2731. // error from Do is the result of In-None-Match.
  2732. func (c *ManagedZonesListCall) IfNoneMatch(entityTag string) *ManagedZonesListCall {
  2733. c.ifNoneMatch_ = entityTag
  2734. return c
  2735. }
  2736. // Context sets the context to be used in this call's Do method. Any
  2737. // pending HTTP request will be aborted if the provided context is
  2738. // canceled.
  2739. func (c *ManagedZonesListCall) Context(ctx context.Context) *ManagedZonesListCall {
  2740. c.ctx_ = ctx
  2741. return c
  2742. }
  2743. // Header returns an http.Header that can be modified by the caller to
  2744. // add HTTP headers to the request.
  2745. func (c *ManagedZonesListCall) Header() http.Header {
  2746. if c.header_ == nil {
  2747. c.header_ = make(http.Header)
  2748. }
  2749. return c.header_
  2750. }
  2751. func (c *ManagedZonesListCall) doRequest(alt string) (*http.Response, error) {
  2752. reqHeaders := make(http.Header)
  2753. for k, v := range c.header_ {
  2754. reqHeaders[k] = v
  2755. }
  2756. reqHeaders.Set("User-Agent", c.s.userAgent())
  2757. if c.ifNoneMatch_ != "" {
  2758. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2759. }
  2760. var body io.Reader = nil
  2761. c.urlParams_.Set("alt", alt)
  2762. c.urlParams_.Set("prettyPrint", "false")
  2763. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones")
  2764. urls += "?" + c.urlParams_.Encode()
  2765. req, err := http.NewRequest("GET", urls, body)
  2766. if err != nil {
  2767. return nil, err
  2768. }
  2769. req.Header = reqHeaders
  2770. googleapi.Expand(req.URL, map[string]string{
  2771. "project": c.project,
  2772. })
  2773. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2774. }
  2775. // Do executes the "dns.managedZones.list" call.
  2776. // Exactly one of *ManagedZonesListResponse or error will be non-nil.
  2777. // Any non-2xx status code is an error. Response headers are in either
  2778. // *ManagedZonesListResponse.ServerResponse.Header or (if a response was
  2779. // returned at all) in error.(*googleapi.Error).Header. Use
  2780. // googleapi.IsNotModified to check whether the returned error was
  2781. // because http.StatusNotModified was returned.
  2782. func (c *ManagedZonesListCall) Do(opts ...googleapi.CallOption) (*ManagedZonesListResponse, error) {
  2783. gensupport.SetOptions(c.urlParams_, opts...)
  2784. res, err := c.doRequest("json")
  2785. if res != nil && res.StatusCode == http.StatusNotModified {
  2786. if res.Body != nil {
  2787. res.Body.Close()
  2788. }
  2789. return nil, &googleapi.Error{
  2790. Code: res.StatusCode,
  2791. Header: res.Header,
  2792. }
  2793. }
  2794. if err != nil {
  2795. return nil, err
  2796. }
  2797. defer googleapi.CloseBody(res)
  2798. if err := googleapi.CheckResponse(res); err != nil {
  2799. return nil, err
  2800. }
  2801. ret := &ManagedZonesListResponse{
  2802. ServerResponse: googleapi.ServerResponse{
  2803. Header: res.Header,
  2804. HTTPStatusCode: res.StatusCode,
  2805. },
  2806. }
  2807. target := &ret
  2808. if err := gensupport.DecodeResponse(target, res); err != nil {
  2809. return nil, err
  2810. }
  2811. return ret, nil
  2812. // {
  2813. // "description": "",
  2814. // "httpMethod": "GET",
  2815. // "id": "dns.managedZones.list",
  2816. // "parameterOrder": [
  2817. // "project"
  2818. // ],
  2819. // "parameters": {
  2820. // "dnsName": {
  2821. // "location": "query",
  2822. // "type": "string"
  2823. // },
  2824. // "maxResults": {
  2825. // "format": "int32",
  2826. // "location": "query",
  2827. // "type": "integer"
  2828. // },
  2829. // "pageToken": {
  2830. // "location": "query",
  2831. // "type": "string"
  2832. // },
  2833. // "project": {
  2834. // "location": "path",
  2835. // "required": true,
  2836. // "type": "string"
  2837. // }
  2838. // },
  2839. // "path": "{project}/managedZones",
  2840. // "response": {
  2841. // "$ref": "ManagedZonesListResponse"
  2842. // },
  2843. // "scopes": [
  2844. // "https://www.googleapis.com/auth/cloud-platform",
  2845. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2846. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  2847. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  2848. // ]
  2849. // }
  2850. }
  2851. // Pages invokes f for each page of results.
  2852. // A non-nil error returned from f will halt the iteration.
  2853. // The provided context supersedes any context provided to the Context method.
  2854. func (c *ManagedZonesListCall) Pages(ctx context.Context, f func(*ManagedZonesListResponse) error) error {
  2855. c.ctx_ = ctx
  2856. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2857. for {
  2858. x, err := c.Do()
  2859. if err != nil {
  2860. return err
  2861. }
  2862. if err := f(x); err != nil {
  2863. return err
  2864. }
  2865. if x.NextPageToken == "" {
  2866. return nil
  2867. }
  2868. c.PageToken(x.NextPageToken)
  2869. }
  2870. }
  2871. // method id "dns.managedZones.patch":
  2872. type ManagedZonesPatchCall struct {
  2873. s *Service
  2874. project string
  2875. managedZone string
  2876. managedzone *ManagedZone
  2877. urlParams_ gensupport.URLParams
  2878. ctx_ context.Context
  2879. header_ http.Header
  2880. }
  2881. // Patch:
  2882. func (r *ManagedZonesService) Patch(project string, managedZone string, managedzone *ManagedZone) *ManagedZonesPatchCall {
  2883. c := &ManagedZonesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2884. c.project = project
  2885. c.managedZone = managedZone
  2886. c.managedzone = managedzone
  2887. return c
  2888. }
  2889. // ClientOperationId sets the optional parameter "clientOperationId":
  2890. func (c *ManagedZonesPatchCall) ClientOperationId(clientOperationId string) *ManagedZonesPatchCall {
  2891. c.urlParams_.Set("clientOperationId", clientOperationId)
  2892. return c
  2893. }
  2894. // Fields allows partial responses to be retrieved. See
  2895. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2896. // for more information.
  2897. func (c *ManagedZonesPatchCall) Fields(s ...googleapi.Field) *ManagedZonesPatchCall {
  2898. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2899. return c
  2900. }
  2901. // Context sets the context to be used in this call's Do method. Any
  2902. // pending HTTP request will be aborted if the provided context is
  2903. // canceled.
  2904. func (c *ManagedZonesPatchCall) Context(ctx context.Context) *ManagedZonesPatchCall {
  2905. c.ctx_ = ctx
  2906. return c
  2907. }
  2908. // Header returns an http.Header that can be modified by the caller to
  2909. // add HTTP headers to the request.
  2910. func (c *ManagedZonesPatchCall) Header() http.Header {
  2911. if c.header_ == nil {
  2912. c.header_ = make(http.Header)
  2913. }
  2914. return c.header_
  2915. }
  2916. func (c *ManagedZonesPatchCall) doRequest(alt string) (*http.Response, error) {
  2917. reqHeaders := make(http.Header)
  2918. for k, v := range c.header_ {
  2919. reqHeaders[k] = v
  2920. }
  2921. reqHeaders.Set("User-Agent", c.s.userAgent())
  2922. var body io.Reader = nil
  2923. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
  2924. if err != nil {
  2925. return nil, err
  2926. }
  2927. reqHeaders.Set("Content-Type", "application/json")
  2928. c.urlParams_.Set("alt", alt)
  2929. c.urlParams_.Set("prettyPrint", "false")
  2930. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  2931. urls += "?" + c.urlParams_.Encode()
  2932. req, err := http.NewRequest("PATCH", urls, body)
  2933. if err != nil {
  2934. return nil, err
  2935. }
  2936. req.Header = reqHeaders
  2937. googleapi.Expand(req.URL, map[string]string{
  2938. "project": c.project,
  2939. "managedZone": c.managedZone,
  2940. })
  2941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2942. }
  2943. // Do executes the "dns.managedZones.patch" call.
  2944. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2945. // status code is an error. Response headers are in either
  2946. // *Operation.ServerResponse.Header or (if a response was returned at
  2947. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2948. // to check whether the returned error was because
  2949. // http.StatusNotModified was returned.
  2950. func (c *ManagedZonesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2951. gensupport.SetOptions(c.urlParams_, opts...)
  2952. res, err := c.doRequest("json")
  2953. if res != nil && res.StatusCode == http.StatusNotModified {
  2954. if res.Body != nil {
  2955. res.Body.Close()
  2956. }
  2957. return nil, &googleapi.Error{
  2958. Code: res.StatusCode,
  2959. Header: res.Header,
  2960. }
  2961. }
  2962. if err != nil {
  2963. return nil, err
  2964. }
  2965. defer googleapi.CloseBody(res)
  2966. if err := googleapi.CheckResponse(res); err != nil {
  2967. return nil, err
  2968. }
  2969. ret := &Operation{
  2970. ServerResponse: googleapi.ServerResponse{
  2971. Header: res.Header,
  2972. HTTPStatusCode: res.StatusCode,
  2973. },
  2974. }
  2975. target := &ret
  2976. if err := gensupport.DecodeResponse(target, res); err != nil {
  2977. return nil, err
  2978. }
  2979. return ret, nil
  2980. // {
  2981. // "description": "",
  2982. // "httpMethod": "PATCH",
  2983. // "id": "dns.managedZones.patch",
  2984. // "parameterOrder": [
  2985. // "project",
  2986. // "managedZone"
  2987. // ],
  2988. // "parameters": {
  2989. // "clientOperationId": {
  2990. // "location": "query",
  2991. // "type": "string"
  2992. // },
  2993. // "managedZone": {
  2994. // "location": "path",
  2995. // "required": true,
  2996. // "type": "string"
  2997. // },
  2998. // "project": {
  2999. // "location": "path",
  3000. // "required": true,
  3001. // "type": "string"
  3002. // }
  3003. // },
  3004. // "path": "{project}/managedZones/{managedZone}",
  3005. // "request": {
  3006. // "$ref": "ManagedZone"
  3007. // },
  3008. // "response": {
  3009. // "$ref": "Operation"
  3010. // },
  3011. // "scopes": [
  3012. // "https://www.googleapis.com/auth/cloud-platform",
  3013. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3014. // ]
  3015. // }
  3016. }
  3017. // method id "dns.managedZones.update":
  3018. type ManagedZonesUpdateCall struct {
  3019. s *Service
  3020. project string
  3021. managedZone string
  3022. managedzone *ManagedZone
  3023. urlParams_ gensupport.URLParams
  3024. ctx_ context.Context
  3025. header_ http.Header
  3026. }
  3027. // Update:
  3028. func (r *ManagedZonesService) Update(project string, managedZone string, managedzone *ManagedZone) *ManagedZonesUpdateCall {
  3029. c := &ManagedZonesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3030. c.project = project
  3031. c.managedZone = managedZone
  3032. c.managedzone = managedzone
  3033. return c
  3034. }
  3035. // ClientOperationId sets the optional parameter "clientOperationId":
  3036. func (c *ManagedZonesUpdateCall) ClientOperationId(clientOperationId string) *ManagedZonesUpdateCall {
  3037. c.urlParams_.Set("clientOperationId", clientOperationId)
  3038. return c
  3039. }
  3040. // Fields allows partial responses to be retrieved. See
  3041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3042. // for more information.
  3043. func (c *ManagedZonesUpdateCall) Fields(s ...googleapi.Field) *ManagedZonesUpdateCall {
  3044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3045. return c
  3046. }
  3047. // Context sets the context to be used in this call's Do method. Any
  3048. // pending HTTP request will be aborted if the provided context is
  3049. // canceled.
  3050. func (c *ManagedZonesUpdateCall) Context(ctx context.Context) *ManagedZonesUpdateCall {
  3051. c.ctx_ = ctx
  3052. return c
  3053. }
  3054. // Header returns an http.Header that can be modified by the caller to
  3055. // add HTTP headers to the request.
  3056. func (c *ManagedZonesUpdateCall) Header() http.Header {
  3057. if c.header_ == nil {
  3058. c.header_ = make(http.Header)
  3059. }
  3060. return c.header_
  3061. }
  3062. func (c *ManagedZonesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3063. reqHeaders := make(http.Header)
  3064. for k, v := range c.header_ {
  3065. reqHeaders[k] = v
  3066. }
  3067. reqHeaders.Set("User-Agent", c.s.userAgent())
  3068. var body io.Reader = nil
  3069. body, err := googleapi.WithoutDataWrapper.JSONReader(c.managedzone)
  3070. if err != nil {
  3071. return nil, err
  3072. }
  3073. reqHeaders.Set("Content-Type", "application/json")
  3074. c.urlParams_.Set("alt", alt)
  3075. c.urlParams_.Set("prettyPrint", "false")
  3076. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}")
  3077. urls += "?" + c.urlParams_.Encode()
  3078. req, err := http.NewRequest("PUT", urls, body)
  3079. if err != nil {
  3080. return nil, err
  3081. }
  3082. req.Header = reqHeaders
  3083. googleapi.Expand(req.URL, map[string]string{
  3084. "project": c.project,
  3085. "managedZone": c.managedZone,
  3086. })
  3087. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3088. }
  3089. // Do executes the "dns.managedZones.update" call.
  3090. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3091. // status code is an error. Response headers are in either
  3092. // *Operation.ServerResponse.Header or (if a response was returned at
  3093. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3094. // to check whether the returned error was because
  3095. // http.StatusNotModified was returned.
  3096. func (c *ManagedZonesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3097. gensupport.SetOptions(c.urlParams_, opts...)
  3098. res, err := c.doRequest("json")
  3099. if res != nil && res.StatusCode == http.StatusNotModified {
  3100. if res.Body != nil {
  3101. res.Body.Close()
  3102. }
  3103. return nil, &googleapi.Error{
  3104. Code: res.StatusCode,
  3105. Header: res.Header,
  3106. }
  3107. }
  3108. if err != nil {
  3109. return nil, err
  3110. }
  3111. defer googleapi.CloseBody(res)
  3112. if err := googleapi.CheckResponse(res); err != nil {
  3113. return nil, err
  3114. }
  3115. ret := &Operation{
  3116. ServerResponse: googleapi.ServerResponse{
  3117. Header: res.Header,
  3118. HTTPStatusCode: res.StatusCode,
  3119. },
  3120. }
  3121. target := &ret
  3122. if err := gensupport.DecodeResponse(target, res); err != nil {
  3123. return nil, err
  3124. }
  3125. return ret, nil
  3126. // {
  3127. // "description": "",
  3128. // "httpMethod": "PUT",
  3129. // "id": "dns.managedZones.update",
  3130. // "parameterOrder": [
  3131. // "project",
  3132. // "managedZone"
  3133. // ],
  3134. // "parameters": {
  3135. // "clientOperationId": {
  3136. // "location": "query",
  3137. // "type": "string"
  3138. // },
  3139. // "managedZone": {
  3140. // "location": "path",
  3141. // "required": true,
  3142. // "type": "string"
  3143. // },
  3144. // "project": {
  3145. // "location": "path",
  3146. // "required": true,
  3147. // "type": "string"
  3148. // }
  3149. // },
  3150. // "path": "{project}/managedZones/{managedZone}",
  3151. // "request": {
  3152. // "$ref": "ManagedZone"
  3153. // },
  3154. // "response": {
  3155. // "$ref": "Operation"
  3156. // },
  3157. // "scopes": [
  3158. // "https://www.googleapis.com/auth/cloud-platform",
  3159. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3160. // ]
  3161. // }
  3162. }
  3163. // method id "dns.policies.create":
  3164. type PoliciesCreateCall struct {
  3165. s *Service
  3166. project string
  3167. policy *Policy
  3168. urlParams_ gensupport.URLParams
  3169. ctx_ context.Context
  3170. header_ http.Header
  3171. }
  3172. // Create:
  3173. func (r *PoliciesService) Create(project string, policy *Policy) *PoliciesCreateCall {
  3174. c := &PoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3175. c.project = project
  3176. c.policy = policy
  3177. return c
  3178. }
  3179. // ClientOperationId sets the optional parameter "clientOperationId":
  3180. func (c *PoliciesCreateCall) ClientOperationId(clientOperationId string) *PoliciesCreateCall {
  3181. c.urlParams_.Set("clientOperationId", clientOperationId)
  3182. return c
  3183. }
  3184. // Fields allows partial responses to be retrieved. See
  3185. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3186. // for more information.
  3187. func (c *PoliciesCreateCall) Fields(s ...googleapi.Field) *PoliciesCreateCall {
  3188. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3189. return c
  3190. }
  3191. // Context sets the context to be used in this call's Do method. Any
  3192. // pending HTTP request will be aborted if the provided context is
  3193. // canceled.
  3194. func (c *PoliciesCreateCall) Context(ctx context.Context) *PoliciesCreateCall {
  3195. c.ctx_ = ctx
  3196. return c
  3197. }
  3198. // Header returns an http.Header that can be modified by the caller to
  3199. // add HTTP headers to the request.
  3200. func (c *PoliciesCreateCall) Header() http.Header {
  3201. if c.header_ == nil {
  3202. c.header_ = make(http.Header)
  3203. }
  3204. return c.header_
  3205. }
  3206. func (c *PoliciesCreateCall) doRequest(alt string) (*http.Response, error) {
  3207. reqHeaders := make(http.Header)
  3208. for k, v := range c.header_ {
  3209. reqHeaders[k] = v
  3210. }
  3211. reqHeaders.Set("User-Agent", c.s.userAgent())
  3212. var body io.Reader = nil
  3213. body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
  3214. if err != nil {
  3215. return nil, err
  3216. }
  3217. reqHeaders.Set("Content-Type", "application/json")
  3218. c.urlParams_.Set("alt", alt)
  3219. c.urlParams_.Set("prettyPrint", "false")
  3220. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/policies")
  3221. urls += "?" + c.urlParams_.Encode()
  3222. req, err := http.NewRequest("POST", urls, body)
  3223. if err != nil {
  3224. return nil, err
  3225. }
  3226. req.Header = reqHeaders
  3227. googleapi.Expand(req.URL, map[string]string{
  3228. "project": c.project,
  3229. })
  3230. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3231. }
  3232. // Do executes the "dns.policies.create" call.
  3233. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3234. // code is an error. Response headers are in either
  3235. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3236. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3237. // check whether the returned error was because http.StatusNotModified
  3238. // was returned.
  3239. func (c *PoliciesCreateCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3240. gensupport.SetOptions(c.urlParams_, opts...)
  3241. res, err := c.doRequest("json")
  3242. if res != nil && res.StatusCode == http.StatusNotModified {
  3243. if res.Body != nil {
  3244. res.Body.Close()
  3245. }
  3246. return nil, &googleapi.Error{
  3247. Code: res.StatusCode,
  3248. Header: res.Header,
  3249. }
  3250. }
  3251. if err != nil {
  3252. return nil, err
  3253. }
  3254. defer googleapi.CloseBody(res)
  3255. if err := googleapi.CheckResponse(res); err != nil {
  3256. return nil, err
  3257. }
  3258. ret := &Policy{
  3259. ServerResponse: googleapi.ServerResponse{
  3260. Header: res.Header,
  3261. HTTPStatusCode: res.StatusCode,
  3262. },
  3263. }
  3264. target := &ret
  3265. if err := gensupport.DecodeResponse(target, res); err != nil {
  3266. return nil, err
  3267. }
  3268. return ret, nil
  3269. // {
  3270. // "description": "",
  3271. // "httpMethod": "POST",
  3272. // "id": "dns.policies.create",
  3273. // "parameterOrder": [
  3274. // "project"
  3275. // ],
  3276. // "parameters": {
  3277. // "clientOperationId": {
  3278. // "location": "query",
  3279. // "type": "string"
  3280. // },
  3281. // "project": {
  3282. // "location": "path",
  3283. // "required": true,
  3284. // "type": "string"
  3285. // }
  3286. // },
  3287. // "path": "{project}/policies",
  3288. // "request": {
  3289. // "$ref": "Policy"
  3290. // },
  3291. // "response": {
  3292. // "$ref": "Policy"
  3293. // },
  3294. // "scopes": [
  3295. // "https://www.googleapis.com/auth/cloud-platform",
  3296. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3297. // ]
  3298. // }
  3299. }
  3300. // method id "dns.policies.delete":
  3301. type PoliciesDeleteCall struct {
  3302. s *Service
  3303. project string
  3304. policy string
  3305. urlParams_ gensupport.URLParams
  3306. ctx_ context.Context
  3307. header_ http.Header
  3308. }
  3309. // Delete:
  3310. func (r *PoliciesService) Delete(project string, policy string) *PoliciesDeleteCall {
  3311. c := &PoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3312. c.project = project
  3313. c.policy = policy
  3314. return c
  3315. }
  3316. // ClientOperationId sets the optional parameter "clientOperationId":
  3317. func (c *PoliciesDeleteCall) ClientOperationId(clientOperationId string) *PoliciesDeleteCall {
  3318. c.urlParams_.Set("clientOperationId", clientOperationId)
  3319. return c
  3320. }
  3321. // Fields allows partial responses to be retrieved. See
  3322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3323. // for more information.
  3324. func (c *PoliciesDeleteCall) Fields(s ...googleapi.Field) *PoliciesDeleteCall {
  3325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3326. return c
  3327. }
  3328. // Context sets the context to be used in this call's Do method. Any
  3329. // pending HTTP request will be aborted if the provided context is
  3330. // canceled.
  3331. func (c *PoliciesDeleteCall) Context(ctx context.Context) *PoliciesDeleteCall {
  3332. c.ctx_ = ctx
  3333. return c
  3334. }
  3335. // Header returns an http.Header that can be modified by the caller to
  3336. // add HTTP headers to the request.
  3337. func (c *PoliciesDeleteCall) Header() http.Header {
  3338. if c.header_ == nil {
  3339. c.header_ = make(http.Header)
  3340. }
  3341. return c.header_
  3342. }
  3343. func (c *PoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  3344. reqHeaders := make(http.Header)
  3345. for k, v := range c.header_ {
  3346. reqHeaders[k] = v
  3347. }
  3348. reqHeaders.Set("User-Agent", c.s.userAgent())
  3349. var body io.Reader = nil
  3350. c.urlParams_.Set("alt", alt)
  3351. c.urlParams_.Set("prettyPrint", "false")
  3352. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/policies/{policy}")
  3353. urls += "?" + c.urlParams_.Encode()
  3354. req, err := http.NewRequest("DELETE", urls, body)
  3355. if err != nil {
  3356. return nil, err
  3357. }
  3358. req.Header = reqHeaders
  3359. googleapi.Expand(req.URL, map[string]string{
  3360. "project": c.project,
  3361. "policy": c.policy,
  3362. })
  3363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3364. }
  3365. // Do executes the "dns.policies.delete" call.
  3366. func (c *PoliciesDeleteCall) Do(opts ...googleapi.CallOption) error {
  3367. gensupport.SetOptions(c.urlParams_, opts...)
  3368. res, err := c.doRequest("json")
  3369. if err != nil {
  3370. return err
  3371. }
  3372. defer googleapi.CloseBody(res)
  3373. if err := googleapi.CheckResponse(res); err != nil {
  3374. return err
  3375. }
  3376. return nil
  3377. // {
  3378. // "description": "",
  3379. // "httpMethod": "DELETE",
  3380. // "id": "dns.policies.delete",
  3381. // "parameterOrder": [
  3382. // "project",
  3383. // "policy"
  3384. // ],
  3385. // "parameters": {
  3386. // "clientOperationId": {
  3387. // "location": "query",
  3388. // "type": "string"
  3389. // },
  3390. // "policy": {
  3391. // "location": "path",
  3392. // "required": true,
  3393. // "type": "string"
  3394. // },
  3395. // "project": {
  3396. // "location": "path",
  3397. // "required": true,
  3398. // "type": "string"
  3399. // }
  3400. // },
  3401. // "path": "{project}/policies/{policy}",
  3402. // "scopes": [
  3403. // "https://www.googleapis.com/auth/cloud-platform",
  3404. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3405. // ]
  3406. // }
  3407. }
  3408. // method id "dns.policies.get":
  3409. type PoliciesGetCall struct {
  3410. s *Service
  3411. project string
  3412. policy string
  3413. urlParams_ gensupport.URLParams
  3414. ifNoneMatch_ string
  3415. ctx_ context.Context
  3416. header_ http.Header
  3417. }
  3418. // Get:
  3419. func (r *PoliciesService) Get(project string, policy string) *PoliciesGetCall {
  3420. c := &PoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3421. c.project = project
  3422. c.policy = policy
  3423. return c
  3424. }
  3425. // ClientOperationId sets the optional parameter "clientOperationId":
  3426. func (c *PoliciesGetCall) ClientOperationId(clientOperationId string) *PoliciesGetCall {
  3427. c.urlParams_.Set("clientOperationId", clientOperationId)
  3428. return c
  3429. }
  3430. // Fields allows partial responses to be retrieved. See
  3431. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3432. // for more information.
  3433. func (c *PoliciesGetCall) Fields(s ...googleapi.Field) *PoliciesGetCall {
  3434. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3435. return c
  3436. }
  3437. // IfNoneMatch sets the optional parameter which makes the operation
  3438. // fail if the object's ETag matches the given value. This is useful for
  3439. // getting updates only after the object has changed since the last
  3440. // request. Use googleapi.IsNotModified to check whether the response
  3441. // error from Do is the result of In-None-Match.
  3442. func (c *PoliciesGetCall) IfNoneMatch(entityTag string) *PoliciesGetCall {
  3443. c.ifNoneMatch_ = entityTag
  3444. return c
  3445. }
  3446. // Context sets the context to be used in this call's Do method. Any
  3447. // pending HTTP request will be aborted if the provided context is
  3448. // canceled.
  3449. func (c *PoliciesGetCall) Context(ctx context.Context) *PoliciesGetCall {
  3450. c.ctx_ = ctx
  3451. return c
  3452. }
  3453. // Header returns an http.Header that can be modified by the caller to
  3454. // add HTTP headers to the request.
  3455. func (c *PoliciesGetCall) Header() http.Header {
  3456. if c.header_ == nil {
  3457. c.header_ = make(http.Header)
  3458. }
  3459. return c.header_
  3460. }
  3461. func (c *PoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  3462. reqHeaders := make(http.Header)
  3463. for k, v := range c.header_ {
  3464. reqHeaders[k] = v
  3465. }
  3466. reqHeaders.Set("User-Agent", c.s.userAgent())
  3467. if c.ifNoneMatch_ != "" {
  3468. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3469. }
  3470. var body io.Reader = nil
  3471. c.urlParams_.Set("alt", alt)
  3472. c.urlParams_.Set("prettyPrint", "false")
  3473. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/policies/{policy}")
  3474. urls += "?" + c.urlParams_.Encode()
  3475. req, err := http.NewRequest("GET", urls, body)
  3476. if err != nil {
  3477. return nil, err
  3478. }
  3479. req.Header = reqHeaders
  3480. googleapi.Expand(req.URL, map[string]string{
  3481. "project": c.project,
  3482. "policy": c.policy,
  3483. })
  3484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3485. }
  3486. // Do executes the "dns.policies.get" call.
  3487. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3488. // code is an error. Response headers are in either
  3489. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3490. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3491. // check whether the returned error was because http.StatusNotModified
  3492. // was returned.
  3493. func (c *PoliciesGetCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3494. gensupport.SetOptions(c.urlParams_, opts...)
  3495. res, err := c.doRequest("json")
  3496. if res != nil && res.StatusCode == http.StatusNotModified {
  3497. if res.Body != nil {
  3498. res.Body.Close()
  3499. }
  3500. return nil, &googleapi.Error{
  3501. Code: res.StatusCode,
  3502. Header: res.Header,
  3503. }
  3504. }
  3505. if err != nil {
  3506. return nil, err
  3507. }
  3508. defer googleapi.CloseBody(res)
  3509. if err := googleapi.CheckResponse(res); err != nil {
  3510. return nil, err
  3511. }
  3512. ret := &Policy{
  3513. ServerResponse: googleapi.ServerResponse{
  3514. Header: res.Header,
  3515. HTTPStatusCode: res.StatusCode,
  3516. },
  3517. }
  3518. target := &ret
  3519. if err := gensupport.DecodeResponse(target, res); err != nil {
  3520. return nil, err
  3521. }
  3522. return ret, nil
  3523. // {
  3524. // "description": "",
  3525. // "httpMethod": "GET",
  3526. // "id": "dns.policies.get",
  3527. // "parameterOrder": [
  3528. // "project",
  3529. // "policy"
  3530. // ],
  3531. // "parameters": {
  3532. // "clientOperationId": {
  3533. // "location": "query",
  3534. // "type": "string"
  3535. // },
  3536. // "policy": {
  3537. // "location": "path",
  3538. // "required": true,
  3539. // "type": "string"
  3540. // },
  3541. // "project": {
  3542. // "location": "path",
  3543. // "required": true,
  3544. // "type": "string"
  3545. // }
  3546. // },
  3547. // "path": "{project}/policies/{policy}",
  3548. // "response": {
  3549. // "$ref": "Policy"
  3550. // },
  3551. // "scopes": [
  3552. // "https://www.googleapis.com/auth/cloud-platform",
  3553. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3554. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  3555. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3556. // ]
  3557. // }
  3558. }
  3559. // method id "dns.policies.list":
  3560. type PoliciesListCall struct {
  3561. s *Service
  3562. project string
  3563. urlParams_ gensupport.URLParams
  3564. ifNoneMatch_ string
  3565. ctx_ context.Context
  3566. header_ http.Header
  3567. }
  3568. // List:
  3569. func (r *PoliciesService) List(project string) *PoliciesListCall {
  3570. c := &PoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3571. c.project = project
  3572. return c
  3573. }
  3574. // MaxResults sets the optional parameter "maxResults":
  3575. func (c *PoliciesListCall) MaxResults(maxResults int64) *PoliciesListCall {
  3576. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3577. return c
  3578. }
  3579. // PageToken sets the optional parameter "pageToken":
  3580. func (c *PoliciesListCall) PageToken(pageToken string) *PoliciesListCall {
  3581. c.urlParams_.Set("pageToken", pageToken)
  3582. return c
  3583. }
  3584. // Fields allows partial responses to be retrieved. See
  3585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3586. // for more information.
  3587. func (c *PoliciesListCall) Fields(s ...googleapi.Field) *PoliciesListCall {
  3588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3589. return c
  3590. }
  3591. // IfNoneMatch sets the optional parameter which makes the operation
  3592. // fail if the object's ETag matches the given value. This is useful for
  3593. // getting updates only after the object has changed since the last
  3594. // request. Use googleapi.IsNotModified to check whether the response
  3595. // error from Do is the result of In-None-Match.
  3596. func (c *PoliciesListCall) IfNoneMatch(entityTag string) *PoliciesListCall {
  3597. c.ifNoneMatch_ = entityTag
  3598. return c
  3599. }
  3600. // Context sets the context to be used in this call's Do method. Any
  3601. // pending HTTP request will be aborted if the provided context is
  3602. // canceled.
  3603. func (c *PoliciesListCall) Context(ctx context.Context) *PoliciesListCall {
  3604. c.ctx_ = ctx
  3605. return c
  3606. }
  3607. // Header returns an http.Header that can be modified by the caller to
  3608. // add HTTP headers to the request.
  3609. func (c *PoliciesListCall) Header() http.Header {
  3610. if c.header_ == nil {
  3611. c.header_ = make(http.Header)
  3612. }
  3613. return c.header_
  3614. }
  3615. func (c *PoliciesListCall) doRequest(alt string) (*http.Response, error) {
  3616. reqHeaders := make(http.Header)
  3617. for k, v := range c.header_ {
  3618. reqHeaders[k] = v
  3619. }
  3620. reqHeaders.Set("User-Agent", c.s.userAgent())
  3621. if c.ifNoneMatch_ != "" {
  3622. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3623. }
  3624. var body io.Reader = nil
  3625. c.urlParams_.Set("alt", alt)
  3626. c.urlParams_.Set("prettyPrint", "false")
  3627. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/policies")
  3628. urls += "?" + c.urlParams_.Encode()
  3629. req, err := http.NewRequest("GET", urls, body)
  3630. if err != nil {
  3631. return nil, err
  3632. }
  3633. req.Header = reqHeaders
  3634. googleapi.Expand(req.URL, map[string]string{
  3635. "project": c.project,
  3636. })
  3637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3638. }
  3639. // Do executes the "dns.policies.list" call.
  3640. // Exactly one of *PoliciesListResponse or error will be non-nil. Any
  3641. // non-2xx status code is an error. Response headers are in either
  3642. // *PoliciesListResponse.ServerResponse.Header or (if a response was
  3643. // returned at all) in error.(*googleapi.Error).Header. Use
  3644. // googleapi.IsNotModified to check whether the returned error was
  3645. // because http.StatusNotModified was returned.
  3646. func (c *PoliciesListCall) Do(opts ...googleapi.CallOption) (*PoliciesListResponse, error) {
  3647. gensupport.SetOptions(c.urlParams_, opts...)
  3648. res, err := c.doRequest("json")
  3649. if res != nil && res.StatusCode == http.StatusNotModified {
  3650. if res.Body != nil {
  3651. res.Body.Close()
  3652. }
  3653. return nil, &googleapi.Error{
  3654. Code: res.StatusCode,
  3655. Header: res.Header,
  3656. }
  3657. }
  3658. if err != nil {
  3659. return nil, err
  3660. }
  3661. defer googleapi.CloseBody(res)
  3662. if err := googleapi.CheckResponse(res); err != nil {
  3663. return nil, err
  3664. }
  3665. ret := &PoliciesListResponse{
  3666. ServerResponse: googleapi.ServerResponse{
  3667. Header: res.Header,
  3668. HTTPStatusCode: res.StatusCode,
  3669. },
  3670. }
  3671. target := &ret
  3672. if err := gensupport.DecodeResponse(target, res); err != nil {
  3673. return nil, err
  3674. }
  3675. return ret, nil
  3676. // {
  3677. // "description": "",
  3678. // "httpMethod": "GET",
  3679. // "id": "dns.policies.list",
  3680. // "parameterOrder": [
  3681. // "project"
  3682. // ],
  3683. // "parameters": {
  3684. // "maxResults": {
  3685. // "format": "int32",
  3686. // "location": "query",
  3687. // "type": "integer"
  3688. // },
  3689. // "pageToken": {
  3690. // "location": "query",
  3691. // "type": "string"
  3692. // },
  3693. // "project": {
  3694. // "location": "path",
  3695. // "required": true,
  3696. // "type": "string"
  3697. // }
  3698. // },
  3699. // "path": "{project}/policies",
  3700. // "response": {
  3701. // "$ref": "PoliciesListResponse"
  3702. // },
  3703. // "scopes": [
  3704. // "https://www.googleapis.com/auth/cloud-platform",
  3705. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3706. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  3707. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3708. // ]
  3709. // }
  3710. }
  3711. // Pages invokes f for each page of results.
  3712. // A non-nil error returned from f will halt the iteration.
  3713. // The provided context supersedes any context provided to the Context method.
  3714. func (c *PoliciesListCall) Pages(ctx context.Context, f func(*PoliciesListResponse) error) error {
  3715. c.ctx_ = ctx
  3716. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3717. for {
  3718. x, err := c.Do()
  3719. if err != nil {
  3720. return err
  3721. }
  3722. if err := f(x); err != nil {
  3723. return err
  3724. }
  3725. if x.NextPageToken == "" {
  3726. return nil
  3727. }
  3728. c.PageToken(x.NextPageToken)
  3729. }
  3730. }
  3731. // method id "dns.policies.patch":
  3732. type PoliciesPatchCall struct {
  3733. s *Service
  3734. project string
  3735. policy string
  3736. policy2 *Policy
  3737. urlParams_ gensupport.URLParams
  3738. ctx_ context.Context
  3739. header_ http.Header
  3740. }
  3741. // Patch:
  3742. func (r *PoliciesService) Patch(project string, policy string, policy2 *Policy) *PoliciesPatchCall {
  3743. c := &PoliciesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3744. c.project = project
  3745. c.policy = policy
  3746. c.policy2 = policy2
  3747. return c
  3748. }
  3749. // ClientOperationId sets the optional parameter "clientOperationId":
  3750. func (c *PoliciesPatchCall) ClientOperationId(clientOperationId string) *PoliciesPatchCall {
  3751. c.urlParams_.Set("clientOperationId", clientOperationId)
  3752. return c
  3753. }
  3754. // Fields allows partial responses to be retrieved. See
  3755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3756. // for more information.
  3757. func (c *PoliciesPatchCall) Fields(s ...googleapi.Field) *PoliciesPatchCall {
  3758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3759. return c
  3760. }
  3761. // Context sets the context to be used in this call's Do method. Any
  3762. // pending HTTP request will be aborted if the provided context is
  3763. // canceled.
  3764. func (c *PoliciesPatchCall) Context(ctx context.Context) *PoliciesPatchCall {
  3765. c.ctx_ = ctx
  3766. return c
  3767. }
  3768. // Header returns an http.Header that can be modified by the caller to
  3769. // add HTTP headers to the request.
  3770. func (c *PoliciesPatchCall) Header() http.Header {
  3771. if c.header_ == nil {
  3772. c.header_ = make(http.Header)
  3773. }
  3774. return c.header_
  3775. }
  3776. func (c *PoliciesPatchCall) doRequest(alt string) (*http.Response, error) {
  3777. reqHeaders := make(http.Header)
  3778. for k, v := range c.header_ {
  3779. reqHeaders[k] = v
  3780. }
  3781. reqHeaders.Set("User-Agent", c.s.userAgent())
  3782. var body io.Reader = nil
  3783. body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy2)
  3784. if err != nil {
  3785. return nil, err
  3786. }
  3787. reqHeaders.Set("Content-Type", "application/json")
  3788. c.urlParams_.Set("alt", alt)
  3789. c.urlParams_.Set("prettyPrint", "false")
  3790. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/policies/{policy}")
  3791. urls += "?" + c.urlParams_.Encode()
  3792. req, err := http.NewRequest("PATCH", urls, body)
  3793. if err != nil {
  3794. return nil, err
  3795. }
  3796. req.Header = reqHeaders
  3797. googleapi.Expand(req.URL, map[string]string{
  3798. "project": c.project,
  3799. "policy": c.policy,
  3800. })
  3801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3802. }
  3803. // Do executes the "dns.policies.patch" call.
  3804. // Exactly one of *PoliciesPatchResponse or error will be non-nil. Any
  3805. // non-2xx status code is an error. Response headers are in either
  3806. // *PoliciesPatchResponse.ServerResponse.Header or (if a response was
  3807. // returned at all) in error.(*googleapi.Error).Header. Use
  3808. // googleapi.IsNotModified to check whether the returned error was
  3809. // because http.StatusNotModified was returned.
  3810. func (c *PoliciesPatchCall) Do(opts ...googleapi.CallOption) (*PoliciesPatchResponse, error) {
  3811. gensupport.SetOptions(c.urlParams_, opts...)
  3812. res, err := c.doRequest("json")
  3813. if res != nil && res.StatusCode == http.StatusNotModified {
  3814. if res.Body != nil {
  3815. res.Body.Close()
  3816. }
  3817. return nil, &googleapi.Error{
  3818. Code: res.StatusCode,
  3819. Header: res.Header,
  3820. }
  3821. }
  3822. if err != nil {
  3823. return nil, err
  3824. }
  3825. defer googleapi.CloseBody(res)
  3826. if err := googleapi.CheckResponse(res); err != nil {
  3827. return nil, err
  3828. }
  3829. ret := &PoliciesPatchResponse{
  3830. ServerResponse: googleapi.ServerResponse{
  3831. Header: res.Header,
  3832. HTTPStatusCode: res.StatusCode,
  3833. },
  3834. }
  3835. target := &ret
  3836. if err := gensupport.DecodeResponse(target, res); err != nil {
  3837. return nil, err
  3838. }
  3839. return ret, nil
  3840. // {
  3841. // "description": "",
  3842. // "httpMethod": "PATCH",
  3843. // "id": "dns.policies.patch",
  3844. // "parameterOrder": [
  3845. // "project",
  3846. // "policy"
  3847. // ],
  3848. // "parameters": {
  3849. // "clientOperationId": {
  3850. // "location": "query",
  3851. // "type": "string"
  3852. // },
  3853. // "policy": {
  3854. // "location": "path",
  3855. // "required": true,
  3856. // "type": "string"
  3857. // },
  3858. // "project": {
  3859. // "location": "path",
  3860. // "required": true,
  3861. // "type": "string"
  3862. // }
  3863. // },
  3864. // "path": "{project}/policies/{policy}",
  3865. // "request": {
  3866. // "$ref": "Policy"
  3867. // },
  3868. // "response": {
  3869. // "$ref": "PoliciesPatchResponse"
  3870. // },
  3871. // "scopes": [
  3872. // "https://www.googleapis.com/auth/cloud-platform",
  3873. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  3874. // ]
  3875. // }
  3876. }
  3877. // method id "dns.policies.update":
  3878. type PoliciesUpdateCall struct {
  3879. s *Service
  3880. project string
  3881. policy string
  3882. policy2 *Policy
  3883. urlParams_ gensupport.URLParams
  3884. ctx_ context.Context
  3885. header_ http.Header
  3886. }
  3887. // Update:
  3888. func (r *PoliciesService) Update(project string, policy string, policy2 *Policy) *PoliciesUpdateCall {
  3889. c := &PoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3890. c.project = project
  3891. c.policy = policy
  3892. c.policy2 = policy2
  3893. return c
  3894. }
  3895. // ClientOperationId sets the optional parameter "clientOperationId":
  3896. func (c *PoliciesUpdateCall) ClientOperationId(clientOperationId string) *PoliciesUpdateCall {
  3897. c.urlParams_.Set("clientOperationId", clientOperationId)
  3898. return c
  3899. }
  3900. // Fields allows partial responses to be retrieved. See
  3901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3902. // for more information.
  3903. func (c *PoliciesUpdateCall) Fields(s ...googleapi.Field) *PoliciesUpdateCall {
  3904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3905. return c
  3906. }
  3907. // Context sets the context to be used in this call's Do method. Any
  3908. // pending HTTP request will be aborted if the provided context is
  3909. // canceled.
  3910. func (c *PoliciesUpdateCall) Context(ctx context.Context) *PoliciesUpdateCall {
  3911. c.ctx_ = ctx
  3912. return c
  3913. }
  3914. // Header returns an http.Header that can be modified by the caller to
  3915. // add HTTP headers to the request.
  3916. func (c *PoliciesUpdateCall) Header() http.Header {
  3917. if c.header_ == nil {
  3918. c.header_ = make(http.Header)
  3919. }
  3920. return c.header_
  3921. }
  3922. func (c *PoliciesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3923. reqHeaders := make(http.Header)
  3924. for k, v := range c.header_ {
  3925. reqHeaders[k] = v
  3926. }
  3927. reqHeaders.Set("User-Agent", c.s.userAgent())
  3928. var body io.Reader = nil
  3929. body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy2)
  3930. if err != nil {
  3931. return nil, err
  3932. }
  3933. reqHeaders.Set("Content-Type", "application/json")
  3934. c.urlParams_.Set("alt", alt)
  3935. c.urlParams_.Set("prettyPrint", "false")
  3936. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/policies/{policy}")
  3937. urls += "?" + c.urlParams_.Encode()
  3938. req, err := http.NewRequest("PUT", urls, body)
  3939. if err != nil {
  3940. return nil, err
  3941. }
  3942. req.Header = reqHeaders
  3943. googleapi.Expand(req.URL, map[string]string{
  3944. "project": c.project,
  3945. "policy": c.policy,
  3946. })
  3947. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3948. }
  3949. // Do executes the "dns.policies.update" call.
  3950. // Exactly one of *PoliciesUpdateResponse or error will be non-nil. Any
  3951. // non-2xx status code is an error. Response headers are in either
  3952. // *PoliciesUpdateResponse.ServerResponse.Header or (if a response was
  3953. // returned at all) in error.(*googleapi.Error).Header. Use
  3954. // googleapi.IsNotModified to check whether the returned error was
  3955. // because http.StatusNotModified was returned.
  3956. func (c *PoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*PoliciesUpdateResponse, error) {
  3957. gensupport.SetOptions(c.urlParams_, opts...)
  3958. res, err := c.doRequest("json")
  3959. if res != nil && res.StatusCode == http.StatusNotModified {
  3960. if res.Body != nil {
  3961. res.Body.Close()
  3962. }
  3963. return nil, &googleapi.Error{
  3964. Code: res.StatusCode,
  3965. Header: res.Header,
  3966. }
  3967. }
  3968. if err != nil {
  3969. return nil, err
  3970. }
  3971. defer googleapi.CloseBody(res)
  3972. if err := googleapi.CheckResponse(res); err != nil {
  3973. return nil, err
  3974. }
  3975. ret := &PoliciesUpdateResponse{
  3976. ServerResponse: googleapi.ServerResponse{
  3977. Header: res.Header,
  3978. HTTPStatusCode: res.StatusCode,
  3979. },
  3980. }
  3981. target := &ret
  3982. if err := gensupport.DecodeResponse(target, res); err != nil {
  3983. return nil, err
  3984. }
  3985. return ret, nil
  3986. // {
  3987. // "description": "",
  3988. // "httpMethod": "PUT",
  3989. // "id": "dns.policies.update",
  3990. // "parameterOrder": [
  3991. // "project",
  3992. // "policy"
  3993. // ],
  3994. // "parameters": {
  3995. // "clientOperationId": {
  3996. // "location": "query",
  3997. // "type": "string"
  3998. // },
  3999. // "policy": {
  4000. // "location": "path",
  4001. // "required": true,
  4002. // "type": "string"
  4003. // },
  4004. // "project": {
  4005. // "location": "path",
  4006. // "required": true,
  4007. // "type": "string"
  4008. // }
  4009. // },
  4010. // "path": "{project}/policies/{policy}",
  4011. // "request": {
  4012. // "$ref": "Policy"
  4013. // },
  4014. // "response": {
  4015. // "$ref": "PoliciesUpdateResponse"
  4016. // },
  4017. // "scopes": [
  4018. // "https://www.googleapis.com/auth/cloud-platform",
  4019. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  4020. // ]
  4021. // }
  4022. }
  4023. // method id "dns.projects.get":
  4024. type ProjectsGetCall struct {
  4025. s *Service
  4026. project string
  4027. urlParams_ gensupport.URLParams
  4028. ifNoneMatch_ string
  4029. ctx_ context.Context
  4030. header_ http.Header
  4031. }
  4032. // Get:
  4033. func (r *ProjectsService) Get(project string) *ProjectsGetCall {
  4034. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4035. c.project = project
  4036. return c
  4037. }
  4038. // ClientOperationId sets the optional parameter "clientOperationId":
  4039. func (c *ProjectsGetCall) ClientOperationId(clientOperationId string) *ProjectsGetCall {
  4040. c.urlParams_.Set("clientOperationId", clientOperationId)
  4041. return c
  4042. }
  4043. // Fields allows partial responses to be retrieved. See
  4044. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4045. // for more information.
  4046. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  4047. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4048. return c
  4049. }
  4050. // IfNoneMatch sets the optional parameter which makes the operation
  4051. // fail if the object's ETag matches the given value. This is useful for
  4052. // getting updates only after the object has changed since the last
  4053. // request. Use googleapi.IsNotModified to check whether the response
  4054. // error from Do is the result of In-None-Match.
  4055. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  4056. c.ifNoneMatch_ = entityTag
  4057. return c
  4058. }
  4059. // Context sets the context to be used in this call's Do method. Any
  4060. // pending HTTP request will be aborted if the provided context is
  4061. // canceled.
  4062. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  4063. c.ctx_ = ctx
  4064. return c
  4065. }
  4066. // Header returns an http.Header that can be modified by the caller to
  4067. // add HTTP headers to the request.
  4068. func (c *ProjectsGetCall) Header() http.Header {
  4069. if c.header_ == nil {
  4070. c.header_ = make(http.Header)
  4071. }
  4072. return c.header_
  4073. }
  4074. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  4075. reqHeaders := make(http.Header)
  4076. for k, v := range c.header_ {
  4077. reqHeaders[k] = v
  4078. }
  4079. reqHeaders.Set("User-Agent", c.s.userAgent())
  4080. if c.ifNoneMatch_ != "" {
  4081. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4082. }
  4083. var body io.Reader = nil
  4084. c.urlParams_.Set("alt", alt)
  4085. c.urlParams_.Set("prettyPrint", "false")
  4086. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}")
  4087. urls += "?" + c.urlParams_.Encode()
  4088. req, err := http.NewRequest("GET", urls, body)
  4089. if err != nil {
  4090. return nil, err
  4091. }
  4092. req.Header = reqHeaders
  4093. googleapi.Expand(req.URL, map[string]string{
  4094. "project": c.project,
  4095. })
  4096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4097. }
  4098. // Do executes the "dns.projects.get" call.
  4099. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  4100. // code is an error. Response headers are in either
  4101. // *Project.ServerResponse.Header or (if a response was returned at all)
  4102. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4103. // check whether the returned error was because http.StatusNotModified
  4104. // was returned.
  4105. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  4106. gensupport.SetOptions(c.urlParams_, opts...)
  4107. res, err := c.doRequest("json")
  4108. if res != nil && res.StatusCode == http.StatusNotModified {
  4109. if res.Body != nil {
  4110. res.Body.Close()
  4111. }
  4112. return nil, &googleapi.Error{
  4113. Code: res.StatusCode,
  4114. Header: res.Header,
  4115. }
  4116. }
  4117. if err != nil {
  4118. return nil, err
  4119. }
  4120. defer googleapi.CloseBody(res)
  4121. if err := googleapi.CheckResponse(res); err != nil {
  4122. return nil, err
  4123. }
  4124. ret := &Project{
  4125. ServerResponse: googleapi.ServerResponse{
  4126. Header: res.Header,
  4127. HTTPStatusCode: res.StatusCode,
  4128. },
  4129. }
  4130. target := &ret
  4131. if err := gensupport.DecodeResponse(target, res); err != nil {
  4132. return nil, err
  4133. }
  4134. return ret, nil
  4135. // {
  4136. // "description": "",
  4137. // "httpMethod": "GET",
  4138. // "id": "dns.projects.get",
  4139. // "parameterOrder": [
  4140. // "project"
  4141. // ],
  4142. // "parameters": {
  4143. // "clientOperationId": {
  4144. // "location": "query",
  4145. // "type": "string"
  4146. // },
  4147. // "project": {
  4148. // "location": "path",
  4149. // "required": true,
  4150. // "type": "string"
  4151. // }
  4152. // },
  4153. // "path": "{project}",
  4154. // "response": {
  4155. // "$ref": "Project"
  4156. // },
  4157. // "scopes": [
  4158. // "https://www.googleapis.com/auth/cloud-platform",
  4159. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4160. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  4161. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  4162. // ]
  4163. // }
  4164. }
  4165. // method id "dns.resourceRecordSets.list":
  4166. type ResourceRecordSetsListCall struct {
  4167. s *Service
  4168. project string
  4169. managedZone string
  4170. urlParams_ gensupport.URLParams
  4171. ifNoneMatch_ string
  4172. ctx_ context.Context
  4173. header_ http.Header
  4174. }
  4175. // List:
  4176. func (r *ResourceRecordSetsService) List(project string, managedZone string) *ResourceRecordSetsListCall {
  4177. c := &ResourceRecordSetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4178. c.project = project
  4179. c.managedZone = managedZone
  4180. return c
  4181. }
  4182. // MaxResults sets the optional parameter "maxResults":
  4183. func (c *ResourceRecordSetsListCall) MaxResults(maxResults int64) *ResourceRecordSetsListCall {
  4184. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4185. return c
  4186. }
  4187. // Name sets the optional parameter "name":
  4188. func (c *ResourceRecordSetsListCall) Name(name string) *ResourceRecordSetsListCall {
  4189. c.urlParams_.Set("name", name)
  4190. return c
  4191. }
  4192. // PageToken sets the optional parameter "pageToken":
  4193. func (c *ResourceRecordSetsListCall) PageToken(pageToken string) *ResourceRecordSetsListCall {
  4194. c.urlParams_.Set("pageToken", pageToken)
  4195. return c
  4196. }
  4197. // Type sets the optional parameter "type":
  4198. func (c *ResourceRecordSetsListCall) Type(type_ string) *ResourceRecordSetsListCall {
  4199. c.urlParams_.Set("type", type_)
  4200. return c
  4201. }
  4202. // Fields allows partial responses to be retrieved. See
  4203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4204. // for more information.
  4205. func (c *ResourceRecordSetsListCall) Fields(s ...googleapi.Field) *ResourceRecordSetsListCall {
  4206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4207. return c
  4208. }
  4209. // IfNoneMatch sets the optional parameter which makes the operation
  4210. // fail if the object's ETag matches the given value. This is useful for
  4211. // getting updates only after the object has changed since the last
  4212. // request. Use googleapi.IsNotModified to check whether the response
  4213. // error from Do is the result of In-None-Match.
  4214. func (c *ResourceRecordSetsListCall) IfNoneMatch(entityTag string) *ResourceRecordSetsListCall {
  4215. c.ifNoneMatch_ = entityTag
  4216. return c
  4217. }
  4218. // Context sets the context to be used in this call's Do method. Any
  4219. // pending HTTP request will be aborted if the provided context is
  4220. // canceled.
  4221. func (c *ResourceRecordSetsListCall) Context(ctx context.Context) *ResourceRecordSetsListCall {
  4222. c.ctx_ = ctx
  4223. return c
  4224. }
  4225. // Header returns an http.Header that can be modified by the caller to
  4226. // add HTTP headers to the request.
  4227. func (c *ResourceRecordSetsListCall) Header() http.Header {
  4228. if c.header_ == nil {
  4229. c.header_ = make(http.Header)
  4230. }
  4231. return c.header_
  4232. }
  4233. func (c *ResourceRecordSetsListCall) doRequest(alt string) (*http.Response, error) {
  4234. reqHeaders := make(http.Header)
  4235. for k, v := range c.header_ {
  4236. reqHeaders[k] = v
  4237. }
  4238. reqHeaders.Set("User-Agent", c.s.userAgent())
  4239. if c.ifNoneMatch_ != "" {
  4240. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4241. }
  4242. var body io.Reader = nil
  4243. c.urlParams_.Set("alt", alt)
  4244. c.urlParams_.Set("prettyPrint", "false")
  4245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/managedZones/{managedZone}/rrsets")
  4246. urls += "?" + c.urlParams_.Encode()
  4247. req, err := http.NewRequest("GET", urls, body)
  4248. if err != nil {
  4249. return nil, err
  4250. }
  4251. req.Header = reqHeaders
  4252. googleapi.Expand(req.URL, map[string]string{
  4253. "project": c.project,
  4254. "managedZone": c.managedZone,
  4255. })
  4256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4257. }
  4258. // Do executes the "dns.resourceRecordSets.list" call.
  4259. // Exactly one of *ResourceRecordSetsListResponse or error will be
  4260. // non-nil. Any non-2xx status code is an error. Response headers are in
  4261. // either *ResourceRecordSetsListResponse.ServerResponse.Header or (if a
  4262. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4263. // googleapi.IsNotModified to check whether the returned error was
  4264. // because http.StatusNotModified was returned.
  4265. func (c *ResourceRecordSetsListCall) Do(opts ...googleapi.CallOption) (*ResourceRecordSetsListResponse, error) {
  4266. gensupport.SetOptions(c.urlParams_, opts...)
  4267. res, err := c.doRequest("json")
  4268. if res != nil && res.StatusCode == http.StatusNotModified {
  4269. if res.Body != nil {
  4270. res.Body.Close()
  4271. }
  4272. return nil, &googleapi.Error{
  4273. Code: res.StatusCode,
  4274. Header: res.Header,
  4275. }
  4276. }
  4277. if err != nil {
  4278. return nil, err
  4279. }
  4280. defer googleapi.CloseBody(res)
  4281. if err := googleapi.CheckResponse(res); err != nil {
  4282. return nil, err
  4283. }
  4284. ret := &ResourceRecordSetsListResponse{
  4285. ServerResponse: googleapi.ServerResponse{
  4286. Header: res.Header,
  4287. HTTPStatusCode: res.StatusCode,
  4288. },
  4289. }
  4290. target := &ret
  4291. if err := gensupport.DecodeResponse(target, res); err != nil {
  4292. return nil, err
  4293. }
  4294. return ret, nil
  4295. // {
  4296. // "description": "",
  4297. // "httpMethod": "GET",
  4298. // "id": "dns.resourceRecordSets.list",
  4299. // "parameterOrder": [
  4300. // "project",
  4301. // "managedZone"
  4302. // ],
  4303. // "parameters": {
  4304. // "managedZone": {
  4305. // "location": "path",
  4306. // "required": true,
  4307. // "type": "string"
  4308. // },
  4309. // "maxResults": {
  4310. // "format": "int32",
  4311. // "location": "query",
  4312. // "type": "integer"
  4313. // },
  4314. // "name": {
  4315. // "location": "query",
  4316. // "type": "string"
  4317. // },
  4318. // "pageToken": {
  4319. // "location": "query",
  4320. // "type": "string"
  4321. // },
  4322. // "project": {
  4323. // "location": "path",
  4324. // "required": true,
  4325. // "type": "string"
  4326. // },
  4327. // "type": {
  4328. // "location": "query",
  4329. // "type": "string"
  4330. // }
  4331. // },
  4332. // "path": "{project}/managedZones/{managedZone}/rrsets",
  4333. // "response": {
  4334. // "$ref": "ResourceRecordSetsListResponse"
  4335. // },
  4336. // "scopes": [
  4337. // "https://www.googleapis.com/auth/cloud-platform",
  4338. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4339. // "https://www.googleapis.com/auth/ndev.clouddns.readonly",
  4340. // "https://www.googleapis.com/auth/ndev.clouddns.readwrite"
  4341. // ]
  4342. // }
  4343. }
  4344. // Pages invokes f for each page of results.
  4345. // A non-nil error returned from f will halt the iteration.
  4346. // The provided context supersedes any context provided to the Context method.
  4347. func (c *ResourceRecordSetsListCall) Pages(ctx context.Context, f func(*ResourceRecordSetsListResponse) error) error {
  4348. c.ctx_ = ctx
  4349. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4350. for {
  4351. x, err := c.Do()
  4352. if err != nil {
  4353. return err
  4354. }
  4355. if err := f(x); err != nil {
  4356. return err
  4357. }
  4358. if x.NextPageToken == "" {
  4359. return nil
  4360. }
  4361. c.PageToken(x.NextPageToken)
  4362. }
  4363. }