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.
 
 
 

2694 lines
90 KiB

  1. // Package resourceviews provides access to the Resource Views API.
  2. //
  3. // See https://developers.google.com/compute/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/resourceviews/v1beta1"
  8. // ...
  9. // resourceviewsService, err := resourceviews.New(oauthHttpClient)
  10. package resourceviews // import "google.golang.org/api/resourceviews/v1beta1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "resourceviews:v1beta1"
  41. const apiName = "resourceviews"
  42. const apiVersion = "v1beta1"
  43. const basePath = "https://www.googleapis.com/resourceviews/v1beta1/projects/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View your data across Google Cloud Platform services
  49. CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
  50. // View and manage your Google Compute Engine resources
  51. ComputeScope = "https://www.googleapis.com/auth/compute"
  52. // View your Google Compute Engine resources
  53. ComputeReadonlyScope = "https://www.googleapis.com/auth/compute.readonly"
  54. // View and manage your Google Cloud Platform management resources and
  55. // deployment status information
  56. NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman"
  57. // View your Google Cloud Platform management resources and deployment
  58. // status information
  59. NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  60. )
  61. func New(client *http.Client) (*Service, error) {
  62. if client == nil {
  63. return nil, errors.New("client is nil")
  64. }
  65. s := &Service{client: client, BasePath: basePath}
  66. s.RegionViews = NewRegionViewsService(s)
  67. s.ZoneViews = NewZoneViewsService(s)
  68. return s, nil
  69. }
  70. type Service struct {
  71. client *http.Client
  72. BasePath string // API endpoint base URL
  73. UserAgent string // optional additional User-Agent fragment
  74. RegionViews *RegionViewsService
  75. ZoneViews *ZoneViewsService
  76. }
  77. func (s *Service) userAgent() string {
  78. if s.UserAgent == "" {
  79. return googleapi.UserAgent
  80. }
  81. return googleapi.UserAgent + " " + s.UserAgent
  82. }
  83. func NewRegionViewsService(s *Service) *RegionViewsService {
  84. rs := &RegionViewsService{s: s}
  85. return rs
  86. }
  87. type RegionViewsService struct {
  88. s *Service
  89. }
  90. func NewZoneViewsService(s *Service) *ZoneViewsService {
  91. rs := &ZoneViewsService{s: s}
  92. return rs
  93. }
  94. type ZoneViewsService struct {
  95. s *Service
  96. }
  97. // Label: The Label to be applied to the resource views.
  98. type Label struct {
  99. // Key: Key of the label.
  100. Key string `json:"key,omitempty"`
  101. // Value: Value of the label.
  102. Value string `json:"value,omitempty"`
  103. // ForceSendFields is a list of field names (e.g. "Key") to
  104. // unconditionally include in API requests. By default, fields with
  105. // empty values are omitted from API requests. However, any non-pointer,
  106. // non-interface field appearing in ForceSendFields will be sent to the
  107. // server regardless of whether the field is empty or not. This may be
  108. // used to include empty fields in Patch requests.
  109. ForceSendFields []string `json:"-"`
  110. // NullFields is a list of field names (e.g. "Key") to include in API
  111. // requests with the JSON null value. By default, fields with empty
  112. // values are omitted from API requests. However, any field with an
  113. // empty value appearing in NullFields will be sent to the server as
  114. // null. It is an error if a field in this list has a non-empty value.
  115. // This may be used to include null fields in Patch requests.
  116. NullFields []string `json:"-"`
  117. }
  118. func (s *Label) MarshalJSON() ([]byte, error) {
  119. type NoMethod Label
  120. raw := NoMethod(*s)
  121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  122. }
  123. // RegionViewsAddResourcesRequest: The request to add resources to the
  124. // resource view.
  125. type RegionViewsAddResourcesRequest struct {
  126. // Resources: The list of resources to be added.
  127. Resources []string `json:"resources,omitempty"`
  128. // ForceSendFields is a list of field names (e.g. "Resources") to
  129. // unconditionally include in API requests. By default, fields with
  130. // empty values are omitted from API requests. However, any non-pointer,
  131. // non-interface field appearing in ForceSendFields will be sent to the
  132. // server regardless of whether the field is empty or not. This may be
  133. // used to include empty fields in Patch requests.
  134. ForceSendFields []string `json:"-"`
  135. // NullFields is a list of field names (e.g. "Resources") to include in
  136. // API requests with the JSON null value. By default, fields with empty
  137. // values are omitted from API requests. However, any field with an
  138. // empty value appearing in NullFields will be sent to the server as
  139. // null. It is an error if a field in this list has a non-empty value.
  140. // This may be used to include null fields in Patch requests.
  141. NullFields []string `json:"-"`
  142. }
  143. func (s *RegionViewsAddResourcesRequest) MarshalJSON() ([]byte, error) {
  144. type NoMethod RegionViewsAddResourcesRequest
  145. raw := NoMethod(*s)
  146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  147. }
  148. // RegionViewsInsertResponse: The response to a resource view insert
  149. // request.
  150. type RegionViewsInsertResponse struct {
  151. // Resource: The resource view object inserted.
  152. Resource *ResourceView `json:"resource,omitempty"`
  153. // ServerResponse contains the HTTP response code and headers from the
  154. // server.
  155. googleapi.ServerResponse `json:"-"`
  156. // ForceSendFields is a list of field names (e.g. "Resource") to
  157. // unconditionally include in API requests. By default, fields with
  158. // empty values are omitted from API requests. However, any non-pointer,
  159. // non-interface field appearing in ForceSendFields will be sent to the
  160. // server regardless of whether the field is empty or not. This may be
  161. // used to include empty fields in Patch requests.
  162. ForceSendFields []string `json:"-"`
  163. // NullFields is a list of field names (e.g. "Resource") to include in
  164. // API requests with the JSON null value. By default, fields with empty
  165. // values are omitted from API requests. However, any field with an
  166. // empty value appearing in NullFields will be sent to the server as
  167. // null. It is an error if a field in this list has a non-empty value.
  168. // This may be used to include null fields in Patch requests.
  169. NullFields []string `json:"-"`
  170. }
  171. func (s *RegionViewsInsertResponse) MarshalJSON() ([]byte, error) {
  172. type NoMethod RegionViewsInsertResponse
  173. raw := NoMethod(*s)
  174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  175. }
  176. // RegionViewsListResourcesResponse: The response to the list resource
  177. // request.
  178. type RegionViewsListResourcesResponse struct {
  179. // Members: The resources in the view.
  180. Members []string `json:"members,omitempty"`
  181. // NextPageToken: A token used for pagination.
  182. NextPageToken string `json:"nextPageToken,omitempty"`
  183. // ServerResponse contains the HTTP response code and headers from the
  184. // server.
  185. googleapi.ServerResponse `json:"-"`
  186. // ForceSendFields is a list of field names (e.g. "Members") to
  187. // unconditionally include in API requests. By default, fields with
  188. // empty values are omitted from API requests. However, any non-pointer,
  189. // non-interface field appearing in ForceSendFields will be sent to the
  190. // server regardless of whether the field is empty or not. This may be
  191. // used to include empty fields in Patch requests.
  192. ForceSendFields []string `json:"-"`
  193. // NullFields is a list of field names (e.g. "Members") to include in
  194. // API requests with the JSON null value. By default, fields with empty
  195. // values are omitted from API requests. However, any field with an
  196. // empty value appearing in NullFields will be sent to the server as
  197. // null. It is an error if a field in this list has a non-empty value.
  198. // This may be used to include null fields in Patch requests.
  199. NullFields []string `json:"-"`
  200. }
  201. func (s *RegionViewsListResourcesResponse) MarshalJSON() ([]byte, error) {
  202. type NoMethod RegionViewsListResourcesResponse
  203. raw := NoMethod(*s)
  204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  205. }
  206. // RegionViewsListResponse: The response to the list resource view
  207. // request.
  208. type RegionViewsListResponse struct {
  209. // NextPageToken: A token used for pagination.
  210. NextPageToken string `json:"nextPageToken,omitempty"`
  211. // ResourceViews: The list of resource views that meet the criteria.
  212. ResourceViews []*ResourceView `json:"resourceViews,omitempty"`
  213. // ServerResponse contains the HTTP response code and headers from the
  214. // server.
  215. googleapi.ServerResponse `json:"-"`
  216. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  217. // unconditionally include in API requests. By default, fields with
  218. // empty values are omitted from API requests. However, any non-pointer,
  219. // non-interface field appearing in ForceSendFields will be sent to the
  220. // server regardless of whether the field is empty or not. This may be
  221. // used to include empty fields in Patch requests.
  222. ForceSendFields []string `json:"-"`
  223. // NullFields is a list of field names (e.g. "NextPageToken") to include
  224. // in API requests with the JSON null value. By default, fields with
  225. // empty values are omitted from API requests. However, any field with
  226. // an empty value appearing in NullFields will be sent to the server as
  227. // null. It is an error if a field in this list has a non-empty value.
  228. // This may be used to include null fields in Patch requests.
  229. NullFields []string `json:"-"`
  230. }
  231. func (s *RegionViewsListResponse) MarshalJSON() ([]byte, error) {
  232. type NoMethod RegionViewsListResponse
  233. raw := NoMethod(*s)
  234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  235. }
  236. // RegionViewsRemoveResourcesRequest: The request to remove resources
  237. // from the resource view.
  238. type RegionViewsRemoveResourcesRequest struct {
  239. // Resources: The list of resources to be removed.
  240. Resources []string `json:"resources,omitempty"`
  241. // ForceSendFields is a list of field names (e.g. "Resources") to
  242. // unconditionally include in API requests. By default, fields with
  243. // empty values are omitted from API requests. However, any non-pointer,
  244. // non-interface field appearing in ForceSendFields will be sent to the
  245. // server regardless of whether the field is empty or not. This may be
  246. // used to include empty fields in Patch requests.
  247. ForceSendFields []string `json:"-"`
  248. // NullFields is a list of field names (e.g. "Resources") to include in
  249. // API requests with the JSON null value. By default, fields with empty
  250. // values are omitted from API requests. However, any field with an
  251. // empty value appearing in NullFields will be sent to the server as
  252. // null. It is an error if a field in this list has a non-empty value.
  253. // This may be used to include null fields in Patch requests.
  254. NullFields []string `json:"-"`
  255. }
  256. func (s *RegionViewsRemoveResourcesRequest) MarshalJSON() ([]byte, error) {
  257. type NoMethod RegionViewsRemoveResourcesRequest
  258. raw := NoMethod(*s)
  259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  260. }
  261. // ResourceView: The resource view object.
  262. type ResourceView struct {
  263. // CreationTime: The creation time of the resource view.
  264. CreationTime string `json:"creationTime,omitempty"`
  265. // Description: The detailed description of the resource view.
  266. Description string `json:"description,omitempty"`
  267. // Id: [Output Only] The ID of the resource view.
  268. Id string `json:"id,omitempty"`
  269. // Kind: Type of the resource.
  270. Kind string `json:"kind,omitempty"`
  271. // Labels: The labels for events.
  272. Labels []*Label `json:"labels,omitempty"`
  273. // LastModified: The last modified time of the view. Not supported yet.
  274. LastModified string `json:"lastModified,omitempty"`
  275. // Members: A list of all resources in the resource view.
  276. Members []string `json:"members,omitempty"`
  277. // Name: The name of the resource view.
  278. Name string `json:"name,omitempty"`
  279. // NumMembers: The total number of resources in the resource view.
  280. NumMembers int64 `json:"numMembers,omitempty"`
  281. // SelfLink: [Output Only] A self-link to the resource view.
  282. SelfLink string `json:"selfLink,omitempty"`
  283. // ServerResponse contains the HTTP response code and headers from the
  284. // server.
  285. googleapi.ServerResponse `json:"-"`
  286. // ForceSendFields is a list of field names (e.g. "CreationTime") to
  287. // unconditionally include in API requests. By default, fields with
  288. // empty values are omitted from API requests. However, any non-pointer,
  289. // non-interface field appearing in ForceSendFields will be sent to the
  290. // server regardless of whether the field is empty or not. This may be
  291. // used to include empty fields in Patch requests.
  292. ForceSendFields []string `json:"-"`
  293. // NullFields is a list of field names (e.g. "CreationTime") to include
  294. // in API requests with the JSON null value. By default, fields with
  295. // empty values are omitted from API requests. However, any field with
  296. // an empty value appearing in NullFields will be sent to the server as
  297. // null. It is an error if a field in this list has a non-empty value.
  298. // This may be used to include null fields in Patch requests.
  299. NullFields []string `json:"-"`
  300. }
  301. func (s *ResourceView) MarshalJSON() ([]byte, error) {
  302. type NoMethod ResourceView
  303. raw := NoMethod(*s)
  304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  305. }
  306. // ZoneViewsAddResourcesRequest: The request to add resources to the
  307. // resource view.
  308. type ZoneViewsAddResourcesRequest struct {
  309. // Resources: The list of resources to be added.
  310. Resources []string `json:"resources,omitempty"`
  311. // ForceSendFields is a list of field names (e.g. "Resources") to
  312. // unconditionally include in API requests. By default, fields with
  313. // empty values are omitted from API requests. However, any non-pointer,
  314. // non-interface field appearing in ForceSendFields will be sent to the
  315. // server regardless of whether the field is empty or not. This may be
  316. // used to include empty fields in Patch requests.
  317. ForceSendFields []string `json:"-"`
  318. // NullFields is a list of field names (e.g. "Resources") to include in
  319. // API requests with the JSON null value. By default, fields with empty
  320. // values are omitted from API requests. However, any field with an
  321. // empty value appearing in NullFields will be sent to the server as
  322. // null. It is an error if a field in this list has a non-empty value.
  323. // This may be used to include null fields in Patch requests.
  324. NullFields []string `json:"-"`
  325. }
  326. func (s *ZoneViewsAddResourcesRequest) MarshalJSON() ([]byte, error) {
  327. type NoMethod ZoneViewsAddResourcesRequest
  328. raw := NoMethod(*s)
  329. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  330. }
  331. // ZoneViewsInsertResponse: The response to an insert request.
  332. type ZoneViewsInsertResponse struct {
  333. // Resource: The resource view object that has been inserted.
  334. Resource *ResourceView `json:"resource,omitempty"`
  335. // ServerResponse contains the HTTP response code and headers from the
  336. // server.
  337. googleapi.ServerResponse `json:"-"`
  338. // ForceSendFields is a list of field names (e.g. "Resource") to
  339. // unconditionally include in API requests. By default, fields with
  340. // empty values are omitted from API requests. However, any non-pointer,
  341. // non-interface field appearing in ForceSendFields will be sent to the
  342. // server regardless of whether the field is empty or not. This may be
  343. // used to include empty fields in Patch requests.
  344. ForceSendFields []string `json:"-"`
  345. // NullFields is a list of field names (e.g. "Resource") to include in
  346. // API requests with the JSON null value. By default, fields with empty
  347. // values are omitted from API requests. However, any field with an
  348. // empty value appearing in NullFields will be sent to the server as
  349. // null. It is an error if a field in this list has a non-empty value.
  350. // This may be used to include null fields in Patch requests.
  351. NullFields []string `json:"-"`
  352. }
  353. func (s *ZoneViewsInsertResponse) MarshalJSON() ([]byte, error) {
  354. type NoMethod ZoneViewsInsertResponse
  355. raw := NoMethod(*s)
  356. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  357. }
  358. // ZoneViewsListResourcesResponse: The response to a list resource
  359. // request.
  360. type ZoneViewsListResourcesResponse struct {
  361. // Members: The full URL of resources in the view.
  362. Members []string `json:"members,omitempty"`
  363. // NextPageToken: A token used for pagination.
  364. NextPageToken string `json:"nextPageToken,omitempty"`
  365. // ServerResponse contains the HTTP response code and headers from the
  366. // server.
  367. googleapi.ServerResponse `json:"-"`
  368. // ForceSendFields is a list of field names (e.g. "Members") to
  369. // unconditionally include in API requests. By default, fields with
  370. // empty values are omitted from API requests. However, any non-pointer,
  371. // non-interface field appearing in ForceSendFields will be sent to the
  372. // server regardless of whether the field is empty or not. This may be
  373. // used to include empty fields in Patch requests.
  374. ForceSendFields []string `json:"-"`
  375. // NullFields is a list of field names (e.g. "Members") to include in
  376. // API requests with the JSON null value. By default, fields with empty
  377. // values are omitted from API requests. However, any field with an
  378. // empty value appearing in NullFields will be sent to the server as
  379. // null. It is an error if a field in this list has a non-empty value.
  380. // This may be used to include null fields in Patch requests.
  381. NullFields []string `json:"-"`
  382. }
  383. func (s *ZoneViewsListResourcesResponse) MarshalJSON() ([]byte, error) {
  384. type NoMethod ZoneViewsListResourcesResponse
  385. raw := NoMethod(*s)
  386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  387. }
  388. // ZoneViewsListResponse: The response to a list request.
  389. type ZoneViewsListResponse struct {
  390. // NextPageToken: A token used for pagination.
  391. NextPageToken string `json:"nextPageToken,omitempty"`
  392. // ResourceViews: The result that contains all resource views that meet
  393. // the criteria.
  394. ResourceViews []*ResourceView `json:"resourceViews,omitempty"`
  395. // ServerResponse contains the HTTP response code and headers from the
  396. // server.
  397. googleapi.ServerResponse `json:"-"`
  398. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  399. // unconditionally include in API requests. By default, fields with
  400. // empty values are omitted from API requests. However, any non-pointer,
  401. // non-interface field appearing in ForceSendFields will be sent to the
  402. // server regardless of whether the field is empty or not. This may be
  403. // used to include empty fields in Patch requests.
  404. ForceSendFields []string `json:"-"`
  405. // NullFields is a list of field names (e.g. "NextPageToken") to include
  406. // in API requests with the JSON null value. By default, fields with
  407. // empty values are omitted from API requests. However, any field with
  408. // an empty value appearing in NullFields will be sent to the server as
  409. // null. It is an error if a field in this list has a non-empty value.
  410. // This may be used to include null fields in Patch requests.
  411. NullFields []string `json:"-"`
  412. }
  413. func (s *ZoneViewsListResponse) MarshalJSON() ([]byte, error) {
  414. type NoMethod ZoneViewsListResponse
  415. raw := NoMethod(*s)
  416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  417. }
  418. // ZoneViewsRemoveResourcesRequest: The request to remove resources from
  419. // the resource view.
  420. type ZoneViewsRemoveResourcesRequest struct {
  421. // Resources: The list of resources to be removed.
  422. Resources []string `json:"resources,omitempty"`
  423. // ForceSendFields is a list of field names (e.g. "Resources") to
  424. // unconditionally include in API requests. By default, fields with
  425. // empty values are omitted from API requests. However, any non-pointer,
  426. // non-interface field appearing in ForceSendFields will be sent to the
  427. // server regardless of whether the field is empty or not. This may be
  428. // used to include empty fields in Patch requests.
  429. ForceSendFields []string `json:"-"`
  430. // NullFields is a list of field names (e.g. "Resources") to include in
  431. // API requests with the JSON null value. By default, fields with empty
  432. // values are omitted from API requests. However, any field with an
  433. // empty value appearing in NullFields will be sent to the server as
  434. // null. It is an error if a field in this list has a non-empty value.
  435. // This may be used to include null fields in Patch requests.
  436. NullFields []string `json:"-"`
  437. }
  438. func (s *ZoneViewsRemoveResourcesRequest) MarshalJSON() ([]byte, error) {
  439. type NoMethod ZoneViewsRemoveResourcesRequest
  440. raw := NoMethod(*s)
  441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  442. }
  443. // method id "resourceviews.regionViews.addresources":
  444. type RegionViewsAddresourcesCall struct {
  445. s *Service
  446. projectName string
  447. region string
  448. resourceViewName string
  449. regionviewsaddresourcesrequest *RegionViewsAddResourcesRequest
  450. urlParams_ gensupport.URLParams
  451. ctx_ context.Context
  452. header_ http.Header
  453. }
  454. // Addresources: Add resources to the view.
  455. func (r *RegionViewsService) Addresources(projectName string, region string, resourceViewName string, regionviewsaddresourcesrequest *RegionViewsAddResourcesRequest) *RegionViewsAddresourcesCall {
  456. c := &RegionViewsAddresourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  457. c.projectName = projectName
  458. c.region = region
  459. c.resourceViewName = resourceViewName
  460. c.regionviewsaddresourcesrequest = regionviewsaddresourcesrequest
  461. return c
  462. }
  463. // Fields allows partial responses to be retrieved. See
  464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  465. // for more information.
  466. func (c *RegionViewsAddresourcesCall) Fields(s ...googleapi.Field) *RegionViewsAddresourcesCall {
  467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  468. return c
  469. }
  470. // Context sets the context to be used in this call's Do method. Any
  471. // pending HTTP request will be aborted if the provided context is
  472. // canceled.
  473. func (c *RegionViewsAddresourcesCall) Context(ctx context.Context) *RegionViewsAddresourcesCall {
  474. c.ctx_ = ctx
  475. return c
  476. }
  477. // Header returns an http.Header that can be modified by the caller to
  478. // add HTTP headers to the request.
  479. func (c *RegionViewsAddresourcesCall) Header() http.Header {
  480. if c.header_ == nil {
  481. c.header_ = make(http.Header)
  482. }
  483. return c.header_
  484. }
  485. func (c *RegionViewsAddresourcesCall) doRequest(alt string) (*http.Response, error) {
  486. reqHeaders := make(http.Header)
  487. for k, v := range c.header_ {
  488. reqHeaders[k] = v
  489. }
  490. reqHeaders.Set("User-Agent", c.s.userAgent())
  491. var body io.Reader = nil
  492. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionviewsaddresourcesrequest)
  493. if err != nil {
  494. return nil, err
  495. }
  496. reqHeaders.Set("Content-Type", "application/json")
  497. c.urlParams_.Set("alt", alt)
  498. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}/addResources")
  499. urls += "?" + c.urlParams_.Encode()
  500. req, _ := http.NewRequest("POST", urls, body)
  501. req.Header = reqHeaders
  502. googleapi.Expand(req.URL, map[string]string{
  503. "projectName": c.projectName,
  504. "region": c.region,
  505. "resourceViewName": c.resourceViewName,
  506. })
  507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  508. }
  509. // Do executes the "resourceviews.regionViews.addresources" call.
  510. func (c *RegionViewsAddresourcesCall) Do(opts ...googleapi.CallOption) error {
  511. gensupport.SetOptions(c.urlParams_, opts...)
  512. res, err := c.doRequest("json")
  513. if err != nil {
  514. return err
  515. }
  516. defer googleapi.CloseBody(res)
  517. if err := googleapi.CheckResponse(res); err != nil {
  518. return err
  519. }
  520. return nil
  521. // {
  522. // "description": "Add resources to the view.",
  523. // "httpMethod": "POST",
  524. // "id": "resourceviews.regionViews.addresources",
  525. // "parameterOrder": [
  526. // "projectName",
  527. // "region",
  528. // "resourceViewName"
  529. // ],
  530. // "parameters": {
  531. // "projectName": {
  532. // "description": "The project name of the resource view.",
  533. // "location": "path",
  534. // "required": true,
  535. // "type": "string"
  536. // },
  537. // "region": {
  538. // "description": "The region name of the resource view.",
  539. // "location": "path",
  540. // "required": true,
  541. // "type": "string"
  542. // },
  543. // "resourceViewName": {
  544. // "description": "The name of the resource view.",
  545. // "location": "path",
  546. // "required": true,
  547. // "type": "string"
  548. // }
  549. // },
  550. // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/addResources",
  551. // "request": {
  552. // "$ref": "RegionViewsAddResourcesRequest"
  553. // },
  554. // "scopes": [
  555. // "https://www.googleapis.com/auth/cloud-platform",
  556. // "https://www.googleapis.com/auth/compute",
  557. // "https://www.googleapis.com/auth/ndev.cloudman"
  558. // ]
  559. // }
  560. }
  561. // method id "resourceviews.regionViews.delete":
  562. type RegionViewsDeleteCall struct {
  563. s *Service
  564. projectName string
  565. region string
  566. resourceViewName string
  567. urlParams_ gensupport.URLParams
  568. ctx_ context.Context
  569. header_ http.Header
  570. }
  571. // Delete: Delete a resource view.
  572. func (r *RegionViewsService) Delete(projectName string, region string, resourceViewName string) *RegionViewsDeleteCall {
  573. c := &RegionViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  574. c.projectName = projectName
  575. c.region = region
  576. c.resourceViewName = resourceViewName
  577. return c
  578. }
  579. // Fields allows partial responses to be retrieved. See
  580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  581. // for more information.
  582. func (c *RegionViewsDeleteCall) Fields(s ...googleapi.Field) *RegionViewsDeleteCall {
  583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  584. return c
  585. }
  586. // Context sets the context to be used in this call's Do method. Any
  587. // pending HTTP request will be aborted if the provided context is
  588. // canceled.
  589. func (c *RegionViewsDeleteCall) Context(ctx context.Context) *RegionViewsDeleteCall {
  590. c.ctx_ = ctx
  591. return c
  592. }
  593. // Header returns an http.Header that can be modified by the caller to
  594. // add HTTP headers to the request.
  595. func (c *RegionViewsDeleteCall) Header() http.Header {
  596. if c.header_ == nil {
  597. c.header_ = make(http.Header)
  598. }
  599. return c.header_
  600. }
  601. func (c *RegionViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
  602. reqHeaders := make(http.Header)
  603. for k, v := range c.header_ {
  604. reqHeaders[k] = v
  605. }
  606. reqHeaders.Set("User-Agent", c.s.userAgent())
  607. var body io.Reader = nil
  608. c.urlParams_.Set("alt", alt)
  609. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}")
  610. urls += "?" + c.urlParams_.Encode()
  611. req, _ := http.NewRequest("DELETE", urls, body)
  612. req.Header = reqHeaders
  613. googleapi.Expand(req.URL, map[string]string{
  614. "projectName": c.projectName,
  615. "region": c.region,
  616. "resourceViewName": c.resourceViewName,
  617. })
  618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  619. }
  620. // Do executes the "resourceviews.regionViews.delete" call.
  621. func (c *RegionViewsDeleteCall) Do(opts ...googleapi.CallOption) error {
  622. gensupport.SetOptions(c.urlParams_, opts...)
  623. res, err := c.doRequest("json")
  624. if err != nil {
  625. return err
  626. }
  627. defer googleapi.CloseBody(res)
  628. if err := googleapi.CheckResponse(res); err != nil {
  629. return err
  630. }
  631. return nil
  632. // {
  633. // "description": "Delete a resource view.",
  634. // "httpMethod": "DELETE",
  635. // "id": "resourceviews.regionViews.delete",
  636. // "parameterOrder": [
  637. // "projectName",
  638. // "region",
  639. // "resourceViewName"
  640. // ],
  641. // "parameters": {
  642. // "projectName": {
  643. // "description": "The project name of the resource view.",
  644. // "location": "path",
  645. // "required": true,
  646. // "type": "string"
  647. // },
  648. // "region": {
  649. // "description": "The region name of the resource view.",
  650. // "location": "path",
  651. // "required": true,
  652. // "type": "string"
  653. // },
  654. // "resourceViewName": {
  655. // "description": "The name of the resource view.",
  656. // "location": "path",
  657. // "required": true,
  658. // "type": "string"
  659. // }
  660. // },
  661. // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}",
  662. // "scopes": [
  663. // "https://www.googleapis.com/auth/cloud-platform",
  664. // "https://www.googleapis.com/auth/compute",
  665. // "https://www.googleapis.com/auth/ndev.cloudman"
  666. // ]
  667. // }
  668. }
  669. // method id "resourceviews.regionViews.get":
  670. type RegionViewsGetCall struct {
  671. s *Service
  672. projectName string
  673. region string
  674. resourceViewName string
  675. urlParams_ gensupport.URLParams
  676. ifNoneMatch_ string
  677. ctx_ context.Context
  678. header_ http.Header
  679. }
  680. // Get: Get the information of a resource view.
  681. func (r *RegionViewsService) Get(projectName string, region string, resourceViewName string) *RegionViewsGetCall {
  682. c := &RegionViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  683. c.projectName = projectName
  684. c.region = region
  685. c.resourceViewName = resourceViewName
  686. return c
  687. }
  688. // Fields allows partial responses to be retrieved. See
  689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  690. // for more information.
  691. func (c *RegionViewsGetCall) Fields(s ...googleapi.Field) *RegionViewsGetCall {
  692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  693. return c
  694. }
  695. // IfNoneMatch sets the optional parameter which makes the operation
  696. // fail if the object's ETag matches the given value. This is useful for
  697. // getting updates only after the object has changed since the last
  698. // request. Use googleapi.IsNotModified to check whether the response
  699. // error from Do is the result of In-None-Match.
  700. func (c *RegionViewsGetCall) IfNoneMatch(entityTag string) *RegionViewsGetCall {
  701. c.ifNoneMatch_ = entityTag
  702. return c
  703. }
  704. // Context sets the context to be used in this call's Do method. Any
  705. // pending HTTP request will be aborted if the provided context is
  706. // canceled.
  707. func (c *RegionViewsGetCall) Context(ctx context.Context) *RegionViewsGetCall {
  708. c.ctx_ = ctx
  709. return c
  710. }
  711. // Header returns an http.Header that can be modified by the caller to
  712. // add HTTP headers to the request.
  713. func (c *RegionViewsGetCall) Header() http.Header {
  714. if c.header_ == nil {
  715. c.header_ = make(http.Header)
  716. }
  717. return c.header_
  718. }
  719. func (c *RegionViewsGetCall) doRequest(alt string) (*http.Response, error) {
  720. reqHeaders := make(http.Header)
  721. for k, v := range c.header_ {
  722. reqHeaders[k] = v
  723. }
  724. reqHeaders.Set("User-Agent", c.s.userAgent())
  725. if c.ifNoneMatch_ != "" {
  726. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  727. }
  728. var body io.Reader = nil
  729. c.urlParams_.Set("alt", alt)
  730. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}")
  731. urls += "?" + c.urlParams_.Encode()
  732. req, _ := http.NewRequest("GET", urls, body)
  733. req.Header = reqHeaders
  734. googleapi.Expand(req.URL, map[string]string{
  735. "projectName": c.projectName,
  736. "region": c.region,
  737. "resourceViewName": c.resourceViewName,
  738. })
  739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  740. }
  741. // Do executes the "resourceviews.regionViews.get" call.
  742. // Exactly one of *ResourceView or error will be non-nil. Any non-2xx
  743. // status code is an error. Response headers are in either
  744. // *ResourceView.ServerResponse.Header or (if a response was returned at
  745. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  746. // to check whether the returned error was because
  747. // http.StatusNotModified was returned.
  748. func (c *RegionViewsGetCall) Do(opts ...googleapi.CallOption) (*ResourceView, error) {
  749. gensupport.SetOptions(c.urlParams_, opts...)
  750. res, err := c.doRequest("json")
  751. if res != nil && res.StatusCode == http.StatusNotModified {
  752. if res.Body != nil {
  753. res.Body.Close()
  754. }
  755. return nil, &googleapi.Error{
  756. Code: res.StatusCode,
  757. Header: res.Header,
  758. }
  759. }
  760. if err != nil {
  761. return nil, err
  762. }
  763. defer googleapi.CloseBody(res)
  764. if err := googleapi.CheckResponse(res); err != nil {
  765. return nil, err
  766. }
  767. ret := &ResourceView{
  768. ServerResponse: googleapi.ServerResponse{
  769. Header: res.Header,
  770. HTTPStatusCode: res.StatusCode,
  771. },
  772. }
  773. target := &ret
  774. if err := gensupport.DecodeResponse(target, res); err != nil {
  775. return nil, err
  776. }
  777. return ret, nil
  778. // {
  779. // "description": "Get the information of a resource view.",
  780. // "httpMethod": "GET",
  781. // "id": "resourceviews.regionViews.get",
  782. // "parameterOrder": [
  783. // "projectName",
  784. // "region",
  785. // "resourceViewName"
  786. // ],
  787. // "parameters": {
  788. // "projectName": {
  789. // "description": "The project name of the resource view.",
  790. // "location": "path",
  791. // "required": true,
  792. // "type": "string"
  793. // },
  794. // "region": {
  795. // "description": "The region name of the resource view.",
  796. // "location": "path",
  797. // "required": true,
  798. // "type": "string"
  799. // },
  800. // "resourceViewName": {
  801. // "description": "The name of the resource view.",
  802. // "location": "path",
  803. // "required": true,
  804. // "type": "string"
  805. // }
  806. // },
  807. // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}",
  808. // "response": {
  809. // "$ref": "ResourceView"
  810. // },
  811. // "scopes": [
  812. // "https://www.googleapis.com/auth/cloud-platform",
  813. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  814. // "https://www.googleapis.com/auth/compute",
  815. // "https://www.googleapis.com/auth/compute.readonly",
  816. // "https://www.googleapis.com/auth/ndev.cloudman",
  817. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  818. // ]
  819. // }
  820. }
  821. // method id "resourceviews.regionViews.insert":
  822. type RegionViewsInsertCall struct {
  823. s *Service
  824. projectName string
  825. region string
  826. resourceview *ResourceView
  827. urlParams_ gensupport.URLParams
  828. ctx_ context.Context
  829. header_ http.Header
  830. }
  831. // Insert: Create a resource view.
  832. func (r *RegionViewsService) Insert(projectName string, region string, resourceview *ResourceView) *RegionViewsInsertCall {
  833. c := &RegionViewsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  834. c.projectName = projectName
  835. c.region = region
  836. c.resourceview = resourceview
  837. return c
  838. }
  839. // Fields allows partial responses to be retrieved. See
  840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  841. // for more information.
  842. func (c *RegionViewsInsertCall) Fields(s ...googleapi.Field) *RegionViewsInsertCall {
  843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  844. return c
  845. }
  846. // Context sets the context to be used in this call's Do method. Any
  847. // pending HTTP request will be aborted if the provided context is
  848. // canceled.
  849. func (c *RegionViewsInsertCall) Context(ctx context.Context) *RegionViewsInsertCall {
  850. c.ctx_ = ctx
  851. return c
  852. }
  853. // Header returns an http.Header that can be modified by the caller to
  854. // add HTTP headers to the request.
  855. func (c *RegionViewsInsertCall) Header() http.Header {
  856. if c.header_ == nil {
  857. c.header_ = make(http.Header)
  858. }
  859. return c.header_
  860. }
  861. func (c *RegionViewsInsertCall) doRequest(alt string) (*http.Response, error) {
  862. reqHeaders := make(http.Header)
  863. for k, v := range c.header_ {
  864. reqHeaders[k] = v
  865. }
  866. reqHeaders.Set("User-Agent", c.s.userAgent())
  867. var body io.Reader = nil
  868. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourceview)
  869. if err != nil {
  870. return nil, err
  871. }
  872. reqHeaders.Set("Content-Type", "application/json")
  873. c.urlParams_.Set("alt", alt)
  874. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews")
  875. urls += "?" + c.urlParams_.Encode()
  876. req, _ := http.NewRequest("POST", urls, body)
  877. req.Header = reqHeaders
  878. googleapi.Expand(req.URL, map[string]string{
  879. "projectName": c.projectName,
  880. "region": c.region,
  881. })
  882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  883. }
  884. // Do executes the "resourceviews.regionViews.insert" call.
  885. // Exactly one of *RegionViewsInsertResponse or error will be non-nil.
  886. // Any non-2xx status code is an error. Response headers are in either
  887. // *RegionViewsInsertResponse.ServerResponse.Header or (if a response
  888. // was returned at all) in error.(*googleapi.Error).Header. Use
  889. // googleapi.IsNotModified to check whether the returned error was
  890. // because http.StatusNotModified was returned.
  891. func (c *RegionViewsInsertCall) Do(opts ...googleapi.CallOption) (*RegionViewsInsertResponse, error) {
  892. gensupport.SetOptions(c.urlParams_, opts...)
  893. res, err := c.doRequest("json")
  894. if res != nil && res.StatusCode == http.StatusNotModified {
  895. if res.Body != nil {
  896. res.Body.Close()
  897. }
  898. return nil, &googleapi.Error{
  899. Code: res.StatusCode,
  900. Header: res.Header,
  901. }
  902. }
  903. if err != nil {
  904. return nil, err
  905. }
  906. defer googleapi.CloseBody(res)
  907. if err := googleapi.CheckResponse(res); err != nil {
  908. return nil, err
  909. }
  910. ret := &RegionViewsInsertResponse{
  911. ServerResponse: googleapi.ServerResponse{
  912. Header: res.Header,
  913. HTTPStatusCode: res.StatusCode,
  914. },
  915. }
  916. target := &ret
  917. if err := gensupport.DecodeResponse(target, res); err != nil {
  918. return nil, err
  919. }
  920. return ret, nil
  921. // {
  922. // "description": "Create a resource view.",
  923. // "httpMethod": "POST",
  924. // "id": "resourceviews.regionViews.insert",
  925. // "parameterOrder": [
  926. // "projectName",
  927. // "region"
  928. // ],
  929. // "parameters": {
  930. // "projectName": {
  931. // "description": "The project name of the resource view.",
  932. // "location": "path",
  933. // "required": true,
  934. // "type": "string"
  935. // },
  936. // "region": {
  937. // "description": "The region name of the resource view.",
  938. // "location": "path",
  939. // "required": true,
  940. // "type": "string"
  941. // }
  942. // },
  943. // "path": "{projectName}/regions/{region}/resourceViews",
  944. // "request": {
  945. // "$ref": "ResourceView"
  946. // },
  947. // "response": {
  948. // "$ref": "RegionViewsInsertResponse"
  949. // },
  950. // "scopes": [
  951. // "https://www.googleapis.com/auth/cloud-platform",
  952. // "https://www.googleapis.com/auth/compute",
  953. // "https://www.googleapis.com/auth/ndev.cloudman"
  954. // ]
  955. // }
  956. }
  957. // method id "resourceviews.regionViews.list":
  958. type RegionViewsListCall struct {
  959. s *Service
  960. projectName string
  961. region string
  962. urlParams_ gensupport.URLParams
  963. ifNoneMatch_ string
  964. ctx_ context.Context
  965. header_ http.Header
  966. }
  967. // List: List resource views.
  968. func (r *RegionViewsService) List(projectName string, region string) *RegionViewsListCall {
  969. c := &RegionViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  970. c.projectName = projectName
  971. c.region = region
  972. return c
  973. }
  974. // MaxResults sets the optional parameter "maxResults": Maximum count of
  975. // results to be returned. Acceptable values are 0 to 5000, inclusive.
  976. // (Default: 5000)
  977. func (c *RegionViewsListCall) MaxResults(maxResults int64) *RegionViewsListCall {
  978. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  979. return c
  980. }
  981. // PageToken sets the optional parameter "pageToken": Specifies a
  982. // nextPageToken returned by a previous list request. This token can be
  983. // used to request the next page of results from a previous list
  984. // request.
  985. func (c *RegionViewsListCall) PageToken(pageToken string) *RegionViewsListCall {
  986. c.urlParams_.Set("pageToken", pageToken)
  987. return c
  988. }
  989. // Fields allows partial responses to be retrieved. See
  990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  991. // for more information.
  992. func (c *RegionViewsListCall) Fields(s ...googleapi.Field) *RegionViewsListCall {
  993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  994. return c
  995. }
  996. // IfNoneMatch sets the optional parameter which makes the operation
  997. // fail if the object's ETag matches the given value. This is useful for
  998. // getting updates only after the object has changed since the last
  999. // request. Use googleapi.IsNotModified to check whether the response
  1000. // error from Do is the result of In-None-Match.
  1001. func (c *RegionViewsListCall) IfNoneMatch(entityTag string) *RegionViewsListCall {
  1002. c.ifNoneMatch_ = entityTag
  1003. return c
  1004. }
  1005. // Context sets the context to be used in this call's Do method. Any
  1006. // pending HTTP request will be aborted if the provided context is
  1007. // canceled.
  1008. func (c *RegionViewsListCall) Context(ctx context.Context) *RegionViewsListCall {
  1009. c.ctx_ = ctx
  1010. return c
  1011. }
  1012. // Header returns an http.Header that can be modified by the caller to
  1013. // add HTTP headers to the request.
  1014. func (c *RegionViewsListCall) Header() http.Header {
  1015. if c.header_ == nil {
  1016. c.header_ = make(http.Header)
  1017. }
  1018. return c.header_
  1019. }
  1020. func (c *RegionViewsListCall) doRequest(alt string) (*http.Response, error) {
  1021. reqHeaders := make(http.Header)
  1022. for k, v := range c.header_ {
  1023. reqHeaders[k] = v
  1024. }
  1025. reqHeaders.Set("User-Agent", c.s.userAgent())
  1026. if c.ifNoneMatch_ != "" {
  1027. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1028. }
  1029. var body io.Reader = nil
  1030. c.urlParams_.Set("alt", alt)
  1031. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews")
  1032. urls += "?" + c.urlParams_.Encode()
  1033. req, _ := http.NewRequest("GET", urls, body)
  1034. req.Header = reqHeaders
  1035. googleapi.Expand(req.URL, map[string]string{
  1036. "projectName": c.projectName,
  1037. "region": c.region,
  1038. })
  1039. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1040. }
  1041. // Do executes the "resourceviews.regionViews.list" call.
  1042. // Exactly one of *RegionViewsListResponse or error will be non-nil. Any
  1043. // non-2xx status code is an error. Response headers are in either
  1044. // *RegionViewsListResponse.ServerResponse.Header or (if a response was
  1045. // returned at all) in error.(*googleapi.Error).Header. Use
  1046. // googleapi.IsNotModified to check whether the returned error was
  1047. // because http.StatusNotModified was returned.
  1048. func (c *RegionViewsListCall) Do(opts ...googleapi.CallOption) (*RegionViewsListResponse, error) {
  1049. gensupport.SetOptions(c.urlParams_, opts...)
  1050. res, err := c.doRequest("json")
  1051. if res != nil && res.StatusCode == http.StatusNotModified {
  1052. if res.Body != nil {
  1053. res.Body.Close()
  1054. }
  1055. return nil, &googleapi.Error{
  1056. Code: res.StatusCode,
  1057. Header: res.Header,
  1058. }
  1059. }
  1060. if err != nil {
  1061. return nil, err
  1062. }
  1063. defer googleapi.CloseBody(res)
  1064. if err := googleapi.CheckResponse(res); err != nil {
  1065. return nil, err
  1066. }
  1067. ret := &RegionViewsListResponse{
  1068. ServerResponse: googleapi.ServerResponse{
  1069. Header: res.Header,
  1070. HTTPStatusCode: res.StatusCode,
  1071. },
  1072. }
  1073. target := &ret
  1074. if err := gensupport.DecodeResponse(target, res); err != nil {
  1075. return nil, err
  1076. }
  1077. return ret, nil
  1078. // {
  1079. // "description": "List resource views.",
  1080. // "httpMethod": "GET",
  1081. // "id": "resourceviews.regionViews.list",
  1082. // "parameterOrder": [
  1083. // "projectName",
  1084. // "region"
  1085. // ],
  1086. // "parameters": {
  1087. // "maxResults": {
  1088. // "default": "5000",
  1089. // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)",
  1090. // "format": "int32",
  1091. // "location": "query",
  1092. // "maximum": "5000",
  1093. // "minimum": "0",
  1094. // "type": "integer"
  1095. // },
  1096. // "pageToken": {
  1097. // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.",
  1098. // "location": "query",
  1099. // "type": "string"
  1100. // },
  1101. // "projectName": {
  1102. // "description": "The project name of the resource view.",
  1103. // "location": "path",
  1104. // "required": true,
  1105. // "type": "string"
  1106. // },
  1107. // "region": {
  1108. // "description": "The region name of the resource view.",
  1109. // "location": "path",
  1110. // "required": true,
  1111. // "type": "string"
  1112. // }
  1113. // },
  1114. // "path": "{projectName}/regions/{region}/resourceViews",
  1115. // "response": {
  1116. // "$ref": "RegionViewsListResponse"
  1117. // },
  1118. // "scopes": [
  1119. // "https://www.googleapis.com/auth/cloud-platform",
  1120. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1121. // "https://www.googleapis.com/auth/compute",
  1122. // "https://www.googleapis.com/auth/compute.readonly",
  1123. // "https://www.googleapis.com/auth/ndev.cloudman",
  1124. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  1125. // ]
  1126. // }
  1127. }
  1128. // Pages invokes f for each page of results.
  1129. // A non-nil error returned from f will halt the iteration.
  1130. // The provided context supersedes any context provided to the Context method.
  1131. func (c *RegionViewsListCall) Pages(ctx context.Context, f func(*RegionViewsListResponse) error) error {
  1132. c.ctx_ = ctx
  1133. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1134. for {
  1135. x, err := c.Do()
  1136. if err != nil {
  1137. return err
  1138. }
  1139. if err := f(x); err != nil {
  1140. return err
  1141. }
  1142. if x.NextPageToken == "" {
  1143. return nil
  1144. }
  1145. c.PageToken(x.NextPageToken)
  1146. }
  1147. }
  1148. // method id "resourceviews.regionViews.listresources":
  1149. type RegionViewsListresourcesCall struct {
  1150. s *Service
  1151. projectName string
  1152. region string
  1153. resourceViewName string
  1154. urlParams_ gensupport.URLParams
  1155. ctx_ context.Context
  1156. header_ http.Header
  1157. }
  1158. // Listresources: List the resources in the view.
  1159. func (r *RegionViewsService) Listresources(projectName string, region string, resourceViewName string) *RegionViewsListresourcesCall {
  1160. c := &RegionViewsListresourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1161. c.projectName = projectName
  1162. c.region = region
  1163. c.resourceViewName = resourceViewName
  1164. return c
  1165. }
  1166. // MaxResults sets the optional parameter "maxResults": Maximum count of
  1167. // results to be returned. Acceptable values are 0 to 5000, inclusive.
  1168. // (Default: 5000)
  1169. func (c *RegionViewsListresourcesCall) MaxResults(maxResults int64) *RegionViewsListresourcesCall {
  1170. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1171. return c
  1172. }
  1173. // PageToken sets the optional parameter "pageToken": Specifies a
  1174. // nextPageToken returned by a previous list request. This token can be
  1175. // used to request the next page of results from a previous list
  1176. // request.
  1177. func (c *RegionViewsListresourcesCall) PageToken(pageToken string) *RegionViewsListresourcesCall {
  1178. c.urlParams_.Set("pageToken", pageToken)
  1179. return c
  1180. }
  1181. // Fields allows partial responses to be retrieved. See
  1182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1183. // for more information.
  1184. func (c *RegionViewsListresourcesCall) Fields(s ...googleapi.Field) *RegionViewsListresourcesCall {
  1185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1186. return c
  1187. }
  1188. // Context sets the context to be used in this call's Do method. Any
  1189. // pending HTTP request will be aborted if the provided context is
  1190. // canceled.
  1191. func (c *RegionViewsListresourcesCall) Context(ctx context.Context) *RegionViewsListresourcesCall {
  1192. c.ctx_ = ctx
  1193. return c
  1194. }
  1195. // Header returns an http.Header that can be modified by the caller to
  1196. // add HTTP headers to the request.
  1197. func (c *RegionViewsListresourcesCall) Header() http.Header {
  1198. if c.header_ == nil {
  1199. c.header_ = make(http.Header)
  1200. }
  1201. return c.header_
  1202. }
  1203. func (c *RegionViewsListresourcesCall) doRequest(alt string) (*http.Response, error) {
  1204. reqHeaders := make(http.Header)
  1205. for k, v := range c.header_ {
  1206. reqHeaders[k] = v
  1207. }
  1208. reqHeaders.Set("User-Agent", c.s.userAgent())
  1209. var body io.Reader = nil
  1210. c.urlParams_.Set("alt", alt)
  1211. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}/resources")
  1212. urls += "?" + c.urlParams_.Encode()
  1213. req, _ := http.NewRequest("POST", urls, body)
  1214. req.Header = reqHeaders
  1215. googleapi.Expand(req.URL, map[string]string{
  1216. "projectName": c.projectName,
  1217. "region": c.region,
  1218. "resourceViewName": c.resourceViewName,
  1219. })
  1220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1221. }
  1222. // Do executes the "resourceviews.regionViews.listresources" call.
  1223. // Exactly one of *RegionViewsListResourcesResponse or error will be
  1224. // non-nil. Any non-2xx status code is an error. Response headers are in
  1225. // either *RegionViewsListResourcesResponse.ServerResponse.Header or (if
  1226. // a response was returned at all) in error.(*googleapi.Error).Header.
  1227. // Use googleapi.IsNotModified to check whether the returned error was
  1228. // because http.StatusNotModified was returned.
  1229. func (c *RegionViewsListresourcesCall) Do(opts ...googleapi.CallOption) (*RegionViewsListResourcesResponse, error) {
  1230. gensupport.SetOptions(c.urlParams_, opts...)
  1231. res, err := c.doRequest("json")
  1232. if res != nil && res.StatusCode == http.StatusNotModified {
  1233. if res.Body != nil {
  1234. res.Body.Close()
  1235. }
  1236. return nil, &googleapi.Error{
  1237. Code: res.StatusCode,
  1238. Header: res.Header,
  1239. }
  1240. }
  1241. if err != nil {
  1242. return nil, err
  1243. }
  1244. defer googleapi.CloseBody(res)
  1245. if err := googleapi.CheckResponse(res); err != nil {
  1246. return nil, err
  1247. }
  1248. ret := &RegionViewsListResourcesResponse{
  1249. ServerResponse: googleapi.ServerResponse{
  1250. Header: res.Header,
  1251. HTTPStatusCode: res.StatusCode,
  1252. },
  1253. }
  1254. target := &ret
  1255. if err := gensupport.DecodeResponse(target, res); err != nil {
  1256. return nil, err
  1257. }
  1258. return ret, nil
  1259. // {
  1260. // "description": "List the resources in the view.",
  1261. // "httpMethod": "POST",
  1262. // "id": "resourceviews.regionViews.listresources",
  1263. // "parameterOrder": [
  1264. // "projectName",
  1265. // "region",
  1266. // "resourceViewName"
  1267. // ],
  1268. // "parameters": {
  1269. // "maxResults": {
  1270. // "default": "5000",
  1271. // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)",
  1272. // "format": "int32",
  1273. // "location": "query",
  1274. // "maximum": "5000",
  1275. // "minimum": "0",
  1276. // "type": "integer"
  1277. // },
  1278. // "pageToken": {
  1279. // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.",
  1280. // "location": "query",
  1281. // "type": "string"
  1282. // },
  1283. // "projectName": {
  1284. // "description": "The project name of the resource view.",
  1285. // "location": "path",
  1286. // "required": true,
  1287. // "type": "string"
  1288. // },
  1289. // "region": {
  1290. // "description": "The region name of the resource view.",
  1291. // "location": "path",
  1292. // "required": true,
  1293. // "type": "string"
  1294. // },
  1295. // "resourceViewName": {
  1296. // "description": "The name of the resource view.",
  1297. // "location": "path",
  1298. // "required": true,
  1299. // "type": "string"
  1300. // }
  1301. // },
  1302. // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/resources",
  1303. // "response": {
  1304. // "$ref": "RegionViewsListResourcesResponse"
  1305. // },
  1306. // "scopes": [
  1307. // "https://www.googleapis.com/auth/cloud-platform",
  1308. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1309. // "https://www.googleapis.com/auth/compute",
  1310. // "https://www.googleapis.com/auth/compute.readonly",
  1311. // "https://www.googleapis.com/auth/ndev.cloudman",
  1312. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  1313. // ]
  1314. // }
  1315. }
  1316. // Pages invokes f for each page of results.
  1317. // A non-nil error returned from f will halt the iteration.
  1318. // The provided context supersedes any context provided to the Context method.
  1319. func (c *RegionViewsListresourcesCall) Pages(ctx context.Context, f func(*RegionViewsListResourcesResponse) error) error {
  1320. c.ctx_ = ctx
  1321. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1322. for {
  1323. x, err := c.Do()
  1324. if err != nil {
  1325. return err
  1326. }
  1327. if err := f(x); err != nil {
  1328. return err
  1329. }
  1330. if x.NextPageToken == "" {
  1331. return nil
  1332. }
  1333. c.PageToken(x.NextPageToken)
  1334. }
  1335. }
  1336. // method id "resourceviews.regionViews.removeresources":
  1337. type RegionViewsRemoveresourcesCall struct {
  1338. s *Service
  1339. projectName string
  1340. region string
  1341. resourceViewName string
  1342. regionviewsremoveresourcesrequest *RegionViewsRemoveResourcesRequest
  1343. urlParams_ gensupport.URLParams
  1344. ctx_ context.Context
  1345. header_ http.Header
  1346. }
  1347. // Removeresources: Remove resources from the view.
  1348. func (r *RegionViewsService) Removeresources(projectName string, region string, resourceViewName string, regionviewsremoveresourcesrequest *RegionViewsRemoveResourcesRequest) *RegionViewsRemoveresourcesCall {
  1349. c := &RegionViewsRemoveresourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1350. c.projectName = projectName
  1351. c.region = region
  1352. c.resourceViewName = resourceViewName
  1353. c.regionviewsremoveresourcesrequest = regionviewsremoveresourcesrequest
  1354. return c
  1355. }
  1356. // Fields allows partial responses to be retrieved. See
  1357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1358. // for more information.
  1359. func (c *RegionViewsRemoveresourcesCall) Fields(s ...googleapi.Field) *RegionViewsRemoveresourcesCall {
  1360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1361. return c
  1362. }
  1363. // Context sets the context to be used in this call's Do method. Any
  1364. // pending HTTP request will be aborted if the provided context is
  1365. // canceled.
  1366. func (c *RegionViewsRemoveresourcesCall) Context(ctx context.Context) *RegionViewsRemoveresourcesCall {
  1367. c.ctx_ = ctx
  1368. return c
  1369. }
  1370. // Header returns an http.Header that can be modified by the caller to
  1371. // add HTTP headers to the request.
  1372. func (c *RegionViewsRemoveresourcesCall) Header() http.Header {
  1373. if c.header_ == nil {
  1374. c.header_ = make(http.Header)
  1375. }
  1376. return c.header_
  1377. }
  1378. func (c *RegionViewsRemoveresourcesCall) doRequest(alt string) (*http.Response, error) {
  1379. reqHeaders := make(http.Header)
  1380. for k, v := range c.header_ {
  1381. reqHeaders[k] = v
  1382. }
  1383. reqHeaders.Set("User-Agent", c.s.userAgent())
  1384. var body io.Reader = nil
  1385. body, err := googleapi.WithoutDataWrapper.JSONReader(c.regionviewsremoveresourcesrequest)
  1386. if err != nil {
  1387. return nil, err
  1388. }
  1389. reqHeaders.Set("Content-Type", "application/json")
  1390. c.urlParams_.Set("alt", alt)
  1391. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/regions/{region}/resourceViews/{resourceViewName}/removeResources")
  1392. urls += "?" + c.urlParams_.Encode()
  1393. req, _ := http.NewRequest("POST", urls, body)
  1394. req.Header = reqHeaders
  1395. googleapi.Expand(req.URL, map[string]string{
  1396. "projectName": c.projectName,
  1397. "region": c.region,
  1398. "resourceViewName": c.resourceViewName,
  1399. })
  1400. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1401. }
  1402. // Do executes the "resourceviews.regionViews.removeresources" call.
  1403. func (c *RegionViewsRemoveresourcesCall) Do(opts ...googleapi.CallOption) error {
  1404. gensupport.SetOptions(c.urlParams_, opts...)
  1405. res, err := c.doRequest("json")
  1406. if err != nil {
  1407. return err
  1408. }
  1409. defer googleapi.CloseBody(res)
  1410. if err := googleapi.CheckResponse(res); err != nil {
  1411. return err
  1412. }
  1413. return nil
  1414. // {
  1415. // "description": "Remove resources from the view.",
  1416. // "httpMethod": "POST",
  1417. // "id": "resourceviews.regionViews.removeresources",
  1418. // "parameterOrder": [
  1419. // "projectName",
  1420. // "region",
  1421. // "resourceViewName"
  1422. // ],
  1423. // "parameters": {
  1424. // "projectName": {
  1425. // "description": "The project name of the resource view.",
  1426. // "location": "path",
  1427. // "required": true,
  1428. // "type": "string"
  1429. // },
  1430. // "region": {
  1431. // "description": "The region name of the resource view.",
  1432. // "location": "path",
  1433. // "required": true,
  1434. // "type": "string"
  1435. // },
  1436. // "resourceViewName": {
  1437. // "description": "The name of the resource view.",
  1438. // "location": "path",
  1439. // "required": true,
  1440. // "type": "string"
  1441. // }
  1442. // },
  1443. // "path": "{projectName}/regions/{region}/resourceViews/{resourceViewName}/removeResources",
  1444. // "request": {
  1445. // "$ref": "RegionViewsRemoveResourcesRequest"
  1446. // },
  1447. // "scopes": [
  1448. // "https://www.googleapis.com/auth/cloud-platform",
  1449. // "https://www.googleapis.com/auth/compute",
  1450. // "https://www.googleapis.com/auth/ndev.cloudman"
  1451. // ]
  1452. // }
  1453. }
  1454. // method id "resourceviews.zoneViews.addresources":
  1455. type ZoneViewsAddresourcesCall struct {
  1456. s *Service
  1457. projectName string
  1458. zone string
  1459. resourceViewName string
  1460. zoneviewsaddresourcesrequest *ZoneViewsAddResourcesRequest
  1461. urlParams_ gensupport.URLParams
  1462. ctx_ context.Context
  1463. header_ http.Header
  1464. }
  1465. // Addresources: Add resources to the view.
  1466. func (r *ZoneViewsService) Addresources(projectName string, zone string, resourceViewName string, zoneviewsaddresourcesrequest *ZoneViewsAddResourcesRequest) *ZoneViewsAddresourcesCall {
  1467. c := &ZoneViewsAddresourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1468. c.projectName = projectName
  1469. c.zone = zone
  1470. c.resourceViewName = resourceViewName
  1471. c.zoneviewsaddresourcesrequest = zoneviewsaddresourcesrequest
  1472. return c
  1473. }
  1474. // Fields allows partial responses to be retrieved. See
  1475. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1476. // for more information.
  1477. func (c *ZoneViewsAddresourcesCall) Fields(s ...googleapi.Field) *ZoneViewsAddresourcesCall {
  1478. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1479. return c
  1480. }
  1481. // Context sets the context to be used in this call's Do method. Any
  1482. // pending HTTP request will be aborted if the provided context is
  1483. // canceled.
  1484. func (c *ZoneViewsAddresourcesCall) Context(ctx context.Context) *ZoneViewsAddresourcesCall {
  1485. c.ctx_ = ctx
  1486. return c
  1487. }
  1488. // Header returns an http.Header that can be modified by the caller to
  1489. // add HTTP headers to the request.
  1490. func (c *ZoneViewsAddresourcesCall) Header() http.Header {
  1491. if c.header_ == nil {
  1492. c.header_ = make(http.Header)
  1493. }
  1494. return c.header_
  1495. }
  1496. func (c *ZoneViewsAddresourcesCall) doRequest(alt string) (*http.Response, error) {
  1497. reqHeaders := make(http.Header)
  1498. for k, v := range c.header_ {
  1499. reqHeaders[k] = v
  1500. }
  1501. reqHeaders.Set("User-Agent", c.s.userAgent())
  1502. var body io.Reader = nil
  1503. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zoneviewsaddresourcesrequest)
  1504. if err != nil {
  1505. return nil, err
  1506. }
  1507. reqHeaders.Set("Content-Type", "application/json")
  1508. c.urlParams_.Set("alt", alt)
  1509. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/addResources")
  1510. urls += "?" + c.urlParams_.Encode()
  1511. req, _ := http.NewRequest("POST", urls, body)
  1512. req.Header = reqHeaders
  1513. googleapi.Expand(req.URL, map[string]string{
  1514. "projectName": c.projectName,
  1515. "zone": c.zone,
  1516. "resourceViewName": c.resourceViewName,
  1517. })
  1518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1519. }
  1520. // Do executes the "resourceviews.zoneViews.addresources" call.
  1521. func (c *ZoneViewsAddresourcesCall) Do(opts ...googleapi.CallOption) error {
  1522. gensupport.SetOptions(c.urlParams_, opts...)
  1523. res, err := c.doRequest("json")
  1524. if err != nil {
  1525. return err
  1526. }
  1527. defer googleapi.CloseBody(res)
  1528. if err := googleapi.CheckResponse(res); err != nil {
  1529. return err
  1530. }
  1531. return nil
  1532. // {
  1533. // "description": "Add resources to the view.",
  1534. // "httpMethod": "POST",
  1535. // "id": "resourceviews.zoneViews.addresources",
  1536. // "parameterOrder": [
  1537. // "projectName",
  1538. // "zone",
  1539. // "resourceViewName"
  1540. // ],
  1541. // "parameters": {
  1542. // "projectName": {
  1543. // "description": "The project name of the resource view.",
  1544. // "location": "path",
  1545. // "required": true,
  1546. // "type": "string"
  1547. // },
  1548. // "resourceViewName": {
  1549. // "description": "The name of the resource view.",
  1550. // "location": "path",
  1551. // "required": true,
  1552. // "type": "string"
  1553. // },
  1554. // "zone": {
  1555. // "description": "The zone name of the resource view.",
  1556. // "location": "path",
  1557. // "required": true,
  1558. // "type": "string"
  1559. // }
  1560. // },
  1561. // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/addResources",
  1562. // "request": {
  1563. // "$ref": "ZoneViewsAddResourcesRequest"
  1564. // },
  1565. // "scopes": [
  1566. // "https://www.googleapis.com/auth/cloud-platform",
  1567. // "https://www.googleapis.com/auth/compute",
  1568. // "https://www.googleapis.com/auth/ndev.cloudman"
  1569. // ]
  1570. // }
  1571. }
  1572. // method id "resourceviews.zoneViews.delete":
  1573. type ZoneViewsDeleteCall struct {
  1574. s *Service
  1575. projectName string
  1576. zone string
  1577. resourceViewName string
  1578. urlParams_ gensupport.URLParams
  1579. ctx_ context.Context
  1580. header_ http.Header
  1581. }
  1582. // Delete: Delete a resource view.
  1583. func (r *ZoneViewsService) Delete(projectName string, zone string, resourceViewName string) *ZoneViewsDeleteCall {
  1584. c := &ZoneViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1585. c.projectName = projectName
  1586. c.zone = zone
  1587. c.resourceViewName = resourceViewName
  1588. return c
  1589. }
  1590. // Fields allows partial responses to be retrieved. See
  1591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1592. // for more information.
  1593. func (c *ZoneViewsDeleteCall) Fields(s ...googleapi.Field) *ZoneViewsDeleteCall {
  1594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1595. return c
  1596. }
  1597. // Context sets the context to be used in this call's Do method. Any
  1598. // pending HTTP request will be aborted if the provided context is
  1599. // canceled.
  1600. func (c *ZoneViewsDeleteCall) Context(ctx context.Context) *ZoneViewsDeleteCall {
  1601. c.ctx_ = ctx
  1602. return c
  1603. }
  1604. // Header returns an http.Header that can be modified by the caller to
  1605. // add HTTP headers to the request.
  1606. func (c *ZoneViewsDeleteCall) Header() http.Header {
  1607. if c.header_ == nil {
  1608. c.header_ = make(http.Header)
  1609. }
  1610. return c.header_
  1611. }
  1612. func (c *ZoneViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1613. reqHeaders := make(http.Header)
  1614. for k, v := range c.header_ {
  1615. reqHeaders[k] = v
  1616. }
  1617. reqHeaders.Set("User-Agent", c.s.userAgent())
  1618. var body io.Reader = nil
  1619. c.urlParams_.Set("alt", alt)
  1620. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}")
  1621. urls += "?" + c.urlParams_.Encode()
  1622. req, _ := http.NewRequest("DELETE", urls, body)
  1623. req.Header = reqHeaders
  1624. googleapi.Expand(req.URL, map[string]string{
  1625. "projectName": c.projectName,
  1626. "zone": c.zone,
  1627. "resourceViewName": c.resourceViewName,
  1628. })
  1629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1630. }
  1631. // Do executes the "resourceviews.zoneViews.delete" call.
  1632. func (c *ZoneViewsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1633. gensupport.SetOptions(c.urlParams_, opts...)
  1634. res, err := c.doRequest("json")
  1635. if err != nil {
  1636. return err
  1637. }
  1638. defer googleapi.CloseBody(res)
  1639. if err := googleapi.CheckResponse(res); err != nil {
  1640. return err
  1641. }
  1642. return nil
  1643. // {
  1644. // "description": "Delete a resource view.",
  1645. // "httpMethod": "DELETE",
  1646. // "id": "resourceviews.zoneViews.delete",
  1647. // "parameterOrder": [
  1648. // "projectName",
  1649. // "zone",
  1650. // "resourceViewName"
  1651. // ],
  1652. // "parameters": {
  1653. // "projectName": {
  1654. // "description": "The project name of the resource view.",
  1655. // "location": "path",
  1656. // "required": true,
  1657. // "type": "string"
  1658. // },
  1659. // "resourceViewName": {
  1660. // "description": "The name of the resource view.",
  1661. // "location": "path",
  1662. // "required": true,
  1663. // "type": "string"
  1664. // },
  1665. // "zone": {
  1666. // "description": "The zone name of the resource view.",
  1667. // "location": "path",
  1668. // "required": true,
  1669. // "type": "string"
  1670. // }
  1671. // },
  1672. // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}",
  1673. // "scopes": [
  1674. // "https://www.googleapis.com/auth/cloud-platform",
  1675. // "https://www.googleapis.com/auth/compute",
  1676. // "https://www.googleapis.com/auth/ndev.cloudman"
  1677. // ]
  1678. // }
  1679. }
  1680. // method id "resourceviews.zoneViews.get":
  1681. type ZoneViewsGetCall struct {
  1682. s *Service
  1683. projectName string
  1684. zone string
  1685. resourceViewName string
  1686. urlParams_ gensupport.URLParams
  1687. ifNoneMatch_ string
  1688. ctx_ context.Context
  1689. header_ http.Header
  1690. }
  1691. // Get: Get the information of a zonal resource view.
  1692. func (r *ZoneViewsService) Get(projectName string, zone string, resourceViewName string) *ZoneViewsGetCall {
  1693. c := &ZoneViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1694. c.projectName = projectName
  1695. c.zone = zone
  1696. c.resourceViewName = resourceViewName
  1697. return c
  1698. }
  1699. // Fields allows partial responses to be retrieved. See
  1700. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1701. // for more information.
  1702. func (c *ZoneViewsGetCall) Fields(s ...googleapi.Field) *ZoneViewsGetCall {
  1703. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1704. return c
  1705. }
  1706. // IfNoneMatch sets the optional parameter which makes the operation
  1707. // fail if the object's ETag matches the given value. This is useful for
  1708. // getting updates only after the object has changed since the last
  1709. // request. Use googleapi.IsNotModified to check whether the response
  1710. // error from Do is the result of In-None-Match.
  1711. func (c *ZoneViewsGetCall) IfNoneMatch(entityTag string) *ZoneViewsGetCall {
  1712. c.ifNoneMatch_ = entityTag
  1713. return c
  1714. }
  1715. // Context sets the context to be used in this call's Do method. Any
  1716. // pending HTTP request will be aborted if the provided context is
  1717. // canceled.
  1718. func (c *ZoneViewsGetCall) Context(ctx context.Context) *ZoneViewsGetCall {
  1719. c.ctx_ = ctx
  1720. return c
  1721. }
  1722. // Header returns an http.Header that can be modified by the caller to
  1723. // add HTTP headers to the request.
  1724. func (c *ZoneViewsGetCall) Header() http.Header {
  1725. if c.header_ == nil {
  1726. c.header_ = make(http.Header)
  1727. }
  1728. return c.header_
  1729. }
  1730. func (c *ZoneViewsGetCall) doRequest(alt string) (*http.Response, error) {
  1731. reqHeaders := make(http.Header)
  1732. for k, v := range c.header_ {
  1733. reqHeaders[k] = v
  1734. }
  1735. reqHeaders.Set("User-Agent", c.s.userAgent())
  1736. if c.ifNoneMatch_ != "" {
  1737. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1738. }
  1739. var body io.Reader = nil
  1740. c.urlParams_.Set("alt", alt)
  1741. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}")
  1742. urls += "?" + c.urlParams_.Encode()
  1743. req, _ := http.NewRequest("GET", urls, body)
  1744. req.Header = reqHeaders
  1745. googleapi.Expand(req.URL, map[string]string{
  1746. "projectName": c.projectName,
  1747. "zone": c.zone,
  1748. "resourceViewName": c.resourceViewName,
  1749. })
  1750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1751. }
  1752. // Do executes the "resourceviews.zoneViews.get" call.
  1753. // Exactly one of *ResourceView or error will be non-nil. Any non-2xx
  1754. // status code is an error. Response headers are in either
  1755. // *ResourceView.ServerResponse.Header or (if a response was returned at
  1756. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1757. // to check whether the returned error was because
  1758. // http.StatusNotModified was returned.
  1759. func (c *ZoneViewsGetCall) Do(opts ...googleapi.CallOption) (*ResourceView, error) {
  1760. gensupport.SetOptions(c.urlParams_, opts...)
  1761. res, err := c.doRequest("json")
  1762. if res != nil && res.StatusCode == http.StatusNotModified {
  1763. if res.Body != nil {
  1764. res.Body.Close()
  1765. }
  1766. return nil, &googleapi.Error{
  1767. Code: res.StatusCode,
  1768. Header: res.Header,
  1769. }
  1770. }
  1771. if err != nil {
  1772. return nil, err
  1773. }
  1774. defer googleapi.CloseBody(res)
  1775. if err := googleapi.CheckResponse(res); err != nil {
  1776. return nil, err
  1777. }
  1778. ret := &ResourceView{
  1779. ServerResponse: googleapi.ServerResponse{
  1780. Header: res.Header,
  1781. HTTPStatusCode: res.StatusCode,
  1782. },
  1783. }
  1784. target := &ret
  1785. if err := gensupport.DecodeResponse(target, res); err != nil {
  1786. return nil, err
  1787. }
  1788. return ret, nil
  1789. // {
  1790. // "description": "Get the information of a zonal resource view.",
  1791. // "httpMethod": "GET",
  1792. // "id": "resourceviews.zoneViews.get",
  1793. // "parameterOrder": [
  1794. // "projectName",
  1795. // "zone",
  1796. // "resourceViewName"
  1797. // ],
  1798. // "parameters": {
  1799. // "projectName": {
  1800. // "description": "The project name of the resource view.",
  1801. // "location": "path",
  1802. // "required": true,
  1803. // "type": "string"
  1804. // },
  1805. // "resourceViewName": {
  1806. // "description": "The name of the resource view.",
  1807. // "location": "path",
  1808. // "required": true,
  1809. // "type": "string"
  1810. // },
  1811. // "zone": {
  1812. // "description": "The zone name of the resource view.",
  1813. // "location": "path",
  1814. // "required": true,
  1815. // "type": "string"
  1816. // }
  1817. // },
  1818. // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}",
  1819. // "response": {
  1820. // "$ref": "ResourceView"
  1821. // },
  1822. // "scopes": [
  1823. // "https://www.googleapis.com/auth/cloud-platform",
  1824. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  1825. // "https://www.googleapis.com/auth/compute",
  1826. // "https://www.googleapis.com/auth/compute.readonly",
  1827. // "https://www.googleapis.com/auth/ndev.cloudman",
  1828. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  1829. // ]
  1830. // }
  1831. }
  1832. // method id "resourceviews.zoneViews.insert":
  1833. type ZoneViewsInsertCall struct {
  1834. s *Service
  1835. projectName string
  1836. zone string
  1837. resourceview *ResourceView
  1838. urlParams_ gensupport.URLParams
  1839. ctx_ context.Context
  1840. header_ http.Header
  1841. }
  1842. // Insert: Create a resource view.
  1843. func (r *ZoneViewsService) Insert(projectName string, zone string, resourceview *ResourceView) *ZoneViewsInsertCall {
  1844. c := &ZoneViewsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1845. c.projectName = projectName
  1846. c.zone = zone
  1847. c.resourceview = resourceview
  1848. return c
  1849. }
  1850. // Fields allows partial responses to be retrieved. See
  1851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1852. // for more information.
  1853. func (c *ZoneViewsInsertCall) Fields(s ...googleapi.Field) *ZoneViewsInsertCall {
  1854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1855. return c
  1856. }
  1857. // Context sets the context to be used in this call's Do method. Any
  1858. // pending HTTP request will be aborted if the provided context is
  1859. // canceled.
  1860. func (c *ZoneViewsInsertCall) Context(ctx context.Context) *ZoneViewsInsertCall {
  1861. c.ctx_ = ctx
  1862. return c
  1863. }
  1864. // Header returns an http.Header that can be modified by the caller to
  1865. // add HTTP headers to the request.
  1866. func (c *ZoneViewsInsertCall) Header() http.Header {
  1867. if c.header_ == nil {
  1868. c.header_ = make(http.Header)
  1869. }
  1870. return c.header_
  1871. }
  1872. func (c *ZoneViewsInsertCall) doRequest(alt string) (*http.Response, error) {
  1873. reqHeaders := make(http.Header)
  1874. for k, v := range c.header_ {
  1875. reqHeaders[k] = v
  1876. }
  1877. reqHeaders.Set("User-Agent", c.s.userAgent())
  1878. var body io.Reader = nil
  1879. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resourceview)
  1880. if err != nil {
  1881. return nil, err
  1882. }
  1883. reqHeaders.Set("Content-Type", "application/json")
  1884. c.urlParams_.Set("alt", alt)
  1885. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews")
  1886. urls += "?" + c.urlParams_.Encode()
  1887. req, _ := http.NewRequest("POST", urls, body)
  1888. req.Header = reqHeaders
  1889. googleapi.Expand(req.URL, map[string]string{
  1890. "projectName": c.projectName,
  1891. "zone": c.zone,
  1892. })
  1893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1894. }
  1895. // Do executes the "resourceviews.zoneViews.insert" call.
  1896. // Exactly one of *ZoneViewsInsertResponse or error will be non-nil. Any
  1897. // non-2xx status code is an error. Response headers are in either
  1898. // *ZoneViewsInsertResponse.ServerResponse.Header or (if a response was
  1899. // returned at all) in error.(*googleapi.Error).Header. Use
  1900. // googleapi.IsNotModified to check whether the returned error was
  1901. // because http.StatusNotModified was returned.
  1902. func (c *ZoneViewsInsertCall) Do(opts ...googleapi.CallOption) (*ZoneViewsInsertResponse, error) {
  1903. gensupport.SetOptions(c.urlParams_, opts...)
  1904. res, err := c.doRequest("json")
  1905. if res != nil && res.StatusCode == http.StatusNotModified {
  1906. if res.Body != nil {
  1907. res.Body.Close()
  1908. }
  1909. return nil, &googleapi.Error{
  1910. Code: res.StatusCode,
  1911. Header: res.Header,
  1912. }
  1913. }
  1914. if err != nil {
  1915. return nil, err
  1916. }
  1917. defer googleapi.CloseBody(res)
  1918. if err := googleapi.CheckResponse(res); err != nil {
  1919. return nil, err
  1920. }
  1921. ret := &ZoneViewsInsertResponse{
  1922. ServerResponse: googleapi.ServerResponse{
  1923. Header: res.Header,
  1924. HTTPStatusCode: res.StatusCode,
  1925. },
  1926. }
  1927. target := &ret
  1928. if err := gensupport.DecodeResponse(target, res); err != nil {
  1929. return nil, err
  1930. }
  1931. return ret, nil
  1932. // {
  1933. // "description": "Create a resource view.",
  1934. // "httpMethod": "POST",
  1935. // "id": "resourceviews.zoneViews.insert",
  1936. // "parameterOrder": [
  1937. // "projectName",
  1938. // "zone"
  1939. // ],
  1940. // "parameters": {
  1941. // "projectName": {
  1942. // "description": "The project name of the resource view.",
  1943. // "location": "path",
  1944. // "required": true,
  1945. // "type": "string"
  1946. // },
  1947. // "zone": {
  1948. // "description": "The zone name of the resource view.",
  1949. // "location": "path",
  1950. // "required": true,
  1951. // "type": "string"
  1952. // }
  1953. // },
  1954. // "path": "{projectName}/zones/{zone}/resourceViews",
  1955. // "request": {
  1956. // "$ref": "ResourceView"
  1957. // },
  1958. // "response": {
  1959. // "$ref": "ZoneViewsInsertResponse"
  1960. // },
  1961. // "scopes": [
  1962. // "https://www.googleapis.com/auth/cloud-platform",
  1963. // "https://www.googleapis.com/auth/compute",
  1964. // "https://www.googleapis.com/auth/ndev.cloudman"
  1965. // ]
  1966. // }
  1967. }
  1968. // method id "resourceviews.zoneViews.list":
  1969. type ZoneViewsListCall struct {
  1970. s *Service
  1971. projectName string
  1972. zone string
  1973. urlParams_ gensupport.URLParams
  1974. ifNoneMatch_ string
  1975. ctx_ context.Context
  1976. header_ http.Header
  1977. }
  1978. // List: List resource views.
  1979. func (r *ZoneViewsService) List(projectName string, zone string) *ZoneViewsListCall {
  1980. c := &ZoneViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1981. c.projectName = projectName
  1982. c.zone = zone
  1983. return c
  1984. }
  1985. // MaxResults sets the optional parameter "maxResults": Maximum count of
  1986. // results to be returned. Acceptable values are 0 to 5000, inclusive.
  1987. // (Default: 5000)
  1988. func (c *ZoneViewsListCall) MaxResults(maxResults int64) *ZoneViewsListCall {
  1989. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1990. return c
  1991. }
  1992. // PageToken sets the optional parameter "pageToken": Specifies a
  1993. // nextPageToken returned by a previous list request. This token can be
  1994. // used to request the next page of results from a previous list
  1995. // request.
  1996. func (c *ZoneViewsListCall) PageToken(pageToken string) *ZoneViewsListCall {
  1997. c.urlParams_.Set("pageToken", pageToken)
  1998. return c
  1999. }
  2000. // Fields allows partial responses to be retrieved. See
  2001. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2002. // for more information.
  2003. func (c *ZoneViewsListCall) Fields(s ...googleapi.Field) *ZoneViewsListCall {
  2004. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2005. return c
  2006. }
  2007. // IfNoneMatch sets the optional parameter which makes the operation
  2008. // fail if the object's ETag matches the given value. This is useful for
  2009. // getting updates only after the object has changed since the last
  2010. // request. Use googleapi.IsNotModified to check whether the response
  2011. // error from Do is the result of In-None-Match.
  2012. func (c *ZoneViewsListCall) IfNoneMatch(entityTag string) *ZoneViewsListCall {
  2013. c.ifNoneMatch_ = entityTag
  2014. return c
  2015. }
  2016. // Context sets the context to be used in this call's Do method. Any
  2017. // pending HTTP request will be aborted if the provided context is
  2018. // canceled.
  2019. func (c *ZoneViewsListCall) Context(ctx context.Context) *ZoneViewsListCall {
  2020. c.ctx_ = ctx
  2021. return c
  2022. }
  2023. // Header returns an http.Header that can be modified by the caller to
  2024. // add HTTP headers to the request.
  2025. func (c *ZoneViewsListCall) Header() http.Header {
  2026. if c.header_ == nil {
  2027. c.header_ = make(http.Header)
  2028. }
  2029. return c.header_
  2030. }
  2031. func (c *ZoneViewsListCall) doRequest(alt string) (*http.Response, error) {
  2032. reqHeaders := make(http.Header)
  2033. for k, v := range c.header_ {
  2034. reqHeaders[k] = v
  2035. }
  2036. reqHeaders.Set("User-Agent", c.s.userAgent())
  2037. if c.ifNoneMatch_ != "" {
  2038. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2039. }
  2040. var body io.Reader = nil
  2041. c.urlParams_.Set("alt", alt)
  2042. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews")
  2043. urls += "?" + c.urlParams_.Encode()
  2044. req, _ := http.NewRequest("GET", urls, body)
  2045. req.Header = reqHeaders
  2046. googleapi.Expand(req.URL, map[string]string{
  2047. "projectName": c.projectName,
  2048. "zone": c.zone,
  2049. })
  2050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2051. }
  2052. // Do executes the "resourceviews.zoneViews.list" call.
  2053. // Exactly one of *ZoneViewsListResponse or error will be non-nil. Any
  2054. // non-2xx status code is an error. Response headers are in either
  2055. // *ZoneViewsListResponse.ServerResponse.Header or (if a response was
  2056. // returned at all) in error.(*googleapi.Error).Header. Use
  2057. // googleapi.IsNotModified to check whether the returned error was
  2058. // because http.StatusNotModified was returned.
  2059. func (c *ZoneViewsListCall) Do(opts ...googleapi.CallOption) (*ZoneViewsListResponse, error) {
  2060. gensupport.SetOptions(c.urlParams_, opts...)
  2061. res, err := c.doRequest("json")
  2062. if res != nil && res.StatusCode == http.StatusNotModified {
  2063. if res.Body != nil {
  2064. res.Body.Close()
  2065. }
  2066. return nil, &googleapi.Error{
  2067. Code: res.StatusCode,
  2068. Header: res.Header,
  2069. }
  2070. }
  2071. if err != nil {
  2072. return nil, err
  2073. }
  2074. defer googleapi.CloseBody(res)
  2075. if err := googleapi.CheckResponse(res); err != nil {
  2076. return nil, err
  2077. }
  2078. ret := &ZoneViewsListResponse{
  2079. ServerResponse: googleapi.ServerResponse{
  2080. Header: res.Header,
  2081. HTTPStatusCode: res.StatusCode,
  2082. },
  2083. }
  2084. target := &ret
  2085. if err := gensupport.DecodeResponse(target, res); err != nil {
  2086. return nil, err
  2087. }
  2088. return ret, nil
  2089. // {
  2090. // "description": "List resource views.",
  2091. // "httpMethod": "GET",
  2092. // "id": "resourceviews.zoneViews.list",
  2093. // "parameterOrder": [
  2094. // "projectName",
  2095. // "zone"
  2096. // ],
  2097. // "parameters": {
  2098. // "maxResults": {
  2099. // "default": "5000",
  2100. // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)",
  2101. // "format": "int32",
  2102. // "location": "query",
  2103. // "maximum": "5000",
  2104. // "minimum": "0",
  2105. // "type": "integer"
  2106. // },
  2107. // "pageToken": {
  2108. // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.",
  2109. // "location": "query",
  2110. // "type": "string"
  2111. // },
  2112. // "projectName": {
  2113. // "description": "The project name of the resource view.",
  2114. // "location": "path",
  2115. // "required": true,
  2116. // "type": "string"
  2117. // },
  2118. // "zone": {
  2119. // "description": "The zone name of the resource view.",
  2120. // "location": "path",
  2121. // "required": true,
  2122. // "type": "string"
  2123. // }
  2124. // },
  2125. // "path": "{projectName}/zones/{zone}/resourceViews",
  2126. // "response": {
  2127. // "$ref": "ZoneViewsListResponse"
  2128. // },
  2129. // "scopes": [
  2130. // "https://www.googleapis.com/auth/cloud-platform",
  2131. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2132. // "https://www.googleapis.com/auth/compute",
  2133. // "https://www.googleapis.com/auth/compute.readonly",
  2134. // "https://www.googleapis.com/auth/ndev.cloudman",
  2135. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  2136. // ]
  2137. // }
  2138. }
  2139. // Pages invokes f for each page of results.
  2140. // A non-nil error returned from f will halt the iteration.
  2141. // The provided context supersedes any context provided to the Context method.
  2142. func (c *ZoneViewsListCall) Pages(ctx context.Context, f func(*ZoneViewsListResponse) error) error {
  2143. c.ctx_ = ctx
  2144. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2145. for {
  2146. x, err := c.Do()
  2147. if err != nil {
  2148. return err
  2149. }
  2150. if err := f(x); err != nil {
  2151. return err
  2152. }
  2153. if x.NextPageToken == "" {
  2154. return nil
  2155. }
  2156. c.PageToken(x.NextPageToken)
  2157. }
  2158. }
  2159. // method id "resourceviews.zoneViews.listresources":
  2160. type ZoneViewsListresourcesCall struct {
  2161. s *Service
  2162. projectName string
  2163. zone string
  2164. resourceViewName string
  2165. urlParams_ gensupport.URLParams
  2166. ctx_ context.Context
  2167. header_ http.Header
  2168. }
  2169. // Listresources: List the resources of the resource view.
  2170. func (r *ZoneViewsService) Listresources(projectName string, zone string, resourceViewName string) *ZoneViewsListresourcesCall {
  2171. c := &ZoneViewsListresourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2172. c.projectName = projectName
  2173. c.zone = zone
  2174. c.resourceViewName = resourceViewName
  2175. return c
  2176. }
  2177. // MaxResults sets the optional parameter "maxResults": Maximum count of
  2178. // results to be returned. Acceptable values are 0 to 5000, inclusive.
  2179. // (Default: 5000)
  2180. func (c *ZoneViewsListresourcesCall) MaxResults(maxResults int64) *ZoneViewsListresourcesCall {
  2181. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2182. return c
  2183. }
  2184. // PageToken sets the optional parameter "pageToken": Specifies a
  2185. // nextPageToken returned by a previous list request. This token can be
  2186. // used to request the next page of results from a previous list
  2187. // request.
  2188. func (c *ZoneViewsListresourcesCall) PageToken(pageToken string) *ZoneViewsListresourcesCall {
  2189. c.urlParams_.Set("pageToken", pageToken)
  2190. return c
  2191. }
  2192. // Fields allows partial responses to be retrieved. See
  2193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2194. // for more information.
  2195. func (c *ZoneViewsListresourcesCall) Fields(s ...googleapi.Field) *ZoneViewsListresourcesCall {
  2196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2197. return c
  2198. }
  2199. // Context sets the context to be used in this call's Do method. Any
  2200. // pending HTTP request will be aborted if the provided context is
  2201. // canceled.
  2202. func (c *ZoneViewsListresourcesCall) Context(ctx context.Context) *ZoneViewsListresourcesCall {
  2203. c.ctx_ = ctx
  2204. return c
  2205. }
  2206. // Header returns an http.Header that can be modified by the caller to
  2207. // add HTTP headers to the request.
  2208. func (c *ZoneViewsListresourcesCall) Header() http.Header {
  2209. if c.header_ == nil {
  2210. c.header_ = make(http.Header)
  2211. }
  2212. return c.header_
  2213. }
  2214. func (c *ZoneViewsListresourcesCall) doRequest(alt string) (*http.Response, error) {
  2215. reqHeaders := make(http.Header)
  2216. for k, v := range c.header_ {
  2217. reqHeaders[k] = v
  2218. }
  2219. reqHeaders.Set("User-Agent", c.s.userAgent())
  2220. var body io.Reader = nil
  2221. c.urlParams_.Set("alt", alt)
  2222. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/resources")
  2223. urls += "?" + c.urlParams_.Encode()
  2224. req, _ := http.NewRequest("POST", urls, body)
  2225. req.Header = reqHeaders
  2226. googleapi.Expand(req.URL, map[string]string{
  2227. "projectName": c.projectName,
  2228. "zone": c.zone,
  2229. "resourceViewName": c.resourceViewName,
  2230. })
  2231. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2232. }
  2233. // Do executes the "resourceviews.zoneViews.listresources" call.
  2234. // Exactly one of *ZoneViewsListResourcesResponse or error will be
  2235. // non-nil. Any non-2xx status code is an error. Response headers are in
  2236. // either *ZoneViewsListResourcesResponse.ServerResponse.Header or (if a
  2237. // response was returned at all) in error.(*googleapi.Error).Header. Use
  2238. // googleapi.IsNotModified to check whether the returned error was
  2239. // because http.StatusNotModified was returned.
  2240. func (c *ZoneViewsListresourcesCall) Do(opts ...googleapi.CallOption) (*ZoneViewsListResourcesResponse, error) {
  2241. gensupport.SetOptions(c.urlParams_, opts...)
  2242. res, err := c.doRequest("json")
  2243. if res != nil && res.StatusCode == http.StatusNotModified {
  2244. if res.Body != nil {
  2245. res.Body.Close()
  2246. }
  2247. return nil, &googleapi.Error{
  2248. Code: res.StatusCode,
  2249. Header: res.Header,
  2250. }
  2251. }
  2252. if err != nil {
  2253. return nil, err
  2254. }
  2255. defer googleapi.CloseBody(res)
  2256. if err := googleapi.CheckResponse(res); err != nil {
  2257. return nil, err
  2258. }
  2259. ret := &ZoneViewsListResourcesResponse{
  2260. ServerResponse: googleapi.ServerResponse{
  2261. Header: res.Header,
  2262. HTTPStatusCode: res.StatusCode,
  2263. },
  2264. }
  2265. target := &ret
  2266. if err := gensupport.DecodeResponse(target, res); err != nil {
  2267. return nil, err
  2268. }
  2269. return ret, nil
  2270. // {
  2271. // "description": "List the resources of the resource view.",
  2272. // "httpMethod": "POST",
  2273. // "id": "resourceviews.zoneViews.listresources",
  2274. // "parameterOrder": [
  2275. // "projectName",
  2276. // "zone",
  2277. // "resourceViewName"
  2278. // ],
  2279. // "parameters": {
  2280. // "maxResults": {
  2281. // "default": "5000",
  2282. // "description": "Maximum count of results to be returned. Acceptable values are 0 to 5000, inclusive. (Default: 5000)",
  2283. // "format": "int32",
  2284. // "location": "query",
  2285. // "maximum": "5000",
  2286. // "minimum": "0",
  2287. // "type": "integer"
  2288. // },
  2289. // "pageToken": {
  2290. // "description": "Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.",
  2291. // "location": "query",
  2292. // "type": "string"
  2293. // },
  2294. // "projectName": {
  2295. // "description": "The project name of the resource view.",
  2296. // "location": "path",
  2297. // "required": true,
  2298. // "type": "string"
  2299. // },
  2300. // "resourceViewName": {
  2301. // "description": "The name of the resource view.",
  2302. // "location": "path",
  2303. // "required": true,
  2304. // "type": "string"
  2305. // },
  2306. // "zone": {
  2307. // "description": "The zone name of the resource view.",
  2308. // "location": "path",
  2309. // "required": true,
  2310. // "type": "string"
  2311. // }
  2312. // },
  2313. // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/resources",
  2314. // "response": {
  2315. // "$ref": "ZoneViewsListResourcesResponse"
  2316. // },
  2317. // "scopes": [
  2318. // "https://www.googleapis.com/auth/cloud-platform",
  2319. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2320. // "https://www.googleapis.com/auth/compute",
  2321. // "https://www.googleapis.com/auth/compute.readonly",
  2322. // "https://www.googleapis.com/auth/ndev.cloudman",
  2323. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  2324. // ]
  2325. // }
  2326. }
  2327. // Pages invokes f for each page of results.
  2328. // A non-nil error returned from f will halt the iteration.
  2329. // The provided context supersedes any context provided to the Context method.
  2330. func (c *ZoneViewsListresourcesCall) Pages(ctx context.Context, f func(*ZoneViewsListResourcesResponse) error) error {
  2331. c.ctx_ = ctx
  2332. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2333. for {
  2334. x, err := c.Do()
  2335. if err != nil {
  2336. return err
  2337. }
  2338. if err := f(x); err != nil {
  2339. return err
  2340. }
  2341. if x.NextPageToken == "" {
  2342. return nil
  2343. }
  2344. c.PageToken(x.NextPageToken)
  2345. }
  2346. }
  2347. // method id "resourceviews.zoneViews.removeresources":
  2348. type ZoneViewsRemoveresourcesCall struct {
  2349. s *Service
  2350. projectName string
  2351. zone string
  2352. resourceViewName string
  2353. zoneviewsremoveresourcesrequest *ZoneViewsRemoveResourcesRequest
  2354. urlParams_ gensupport.URLParams
  2355. ctx_ context.Context
  2356. header_ http.Header
  2357. }
  2358. // Removeresources: Remove resources from the view.
  2359. func (r *ZoneViewsService) Removeresources(projectName string, zone string, resourceViewName string, zoneviewsremoveresourcesrequest *ZoneViewsRemoveResourcesRequest) *ZoneViewsRemoveresourcesCall {
  2360. c := &ZoneViewsRemoveresourcesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2361. c.projectName = projectName
  2362. c.zone = zone
  2363. c.resourceViewName = resourceViewName
  2364. c.zoneviewsremoveresourcesrequest = zoneviewsremoveresourcesrequest
  2365. return c
  2366. }
  2367. // Fields allows partial responses to be retrieved. See
  2368. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2369. // for more information.
  2370. func (c *ZoneViewsRemoveresourcesCall) Fields(s ...googleapi.Field) *ZoneViewsRemoveresourcesCall {
  2371. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2372. return c
  2373. }
  2374. // Context sets the context to be used in this call's Do method. Any
  2375. // pending HTTP request will be aborted if the provided context is
  2376. // canceled.
  2377. func (c *ZoneViewsRemoveresourcesCall) Context(ctx context.Context) *ZoneViewsRemoveresourcesCall {
  2378. c.ctx_ = ctx
  2379. return c
  2380. }
  2381. // Header returns an http.Header that can be modified by the caller to
  2382. // add HTTP headers to the request.
  2383. func (c *ZoneViewsRemoveresourcesCall) Header() http.Header {
  2384. if c.header_ == nil {
  2385. c.header_ = make(http.Header)
  2386. }
  2387. return c.header_
  2388. }
  2389. func (c *ZoneViewsRemoveresourcesCall) doRequest(alt string) (*http.Response, error) {
  2390. reqHeaders := make(http.Header)
  2391. for k, v := range c.header_ {
  2392. reqHeaders[k] = v
  2393. }
  2394. reqHeaders.Set("User-Agent", c.s.userAgent())
  2395. var body io.Reader = nil
  2396. body, err := googleapi.WithoutDataWrapper.JSONReader(c.zoneviewsremoveresourcesrequest)
  2397. if err != nil {
  2398. return nil, err
  2399. }
  2400. reqHeaders.Set("Content-Type", "application/json")
  2401. c.urlParams_.Set("alt", alt)
  2402. urls := googleapi.ResolveRelative(c.s.BasePath, "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/removeResources")
  2403. urls += "?" + c.urlParams_.Encode()
  2404. req, _ := http.NewRequest("POST", urls, body)
  2405. req.Header = reqHeaders
  2406. googleapi.Expand(req.URL, map[string]string{
  2407. "projectName": c.projectName,
  2408. "zone": c.zone,
  2409. "resourceViewName": c.resourceViewName,
  2410. })
  2411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2412. }
  2413. // Do executes the "resourceviews.zoneViews.removeresources" call.
  2414. func (c *ZoneViewsRemoveresourcesCall) Do(opts ...googleapi.CallOption) error {
  2415. gensupport.SetOptions(c.urlParams_, opts...)
  2416. res, err := c.doRequest("json")
  2417. if err != nil {
  2418. return err
  2419. }
  2420. defer googleapi.CloseBody(res)
  2421. if err := googleapi.CheckResponse(res); err != nil {
  2422. return err
  2423. }
  2424. return nil
  2425. // {
  2426. // "description": "Remove resources from the view.",
  2427. // "httpMethod": "POST",
  2428. // "id": "resourceviews.zoneViews.removeresources",
  2429. // "parameterOrder": [
  2430. // "projectName",
  2431. // "zone",
  2432. // "resourceViewName"
  2433. // ],
  2434. // "parameters": {
  2435. // "projectName": {
  2436. // "description": "The project name of the resource view.",
  2437. // "location": "path",
  2438. // "required": true,
  2439. // "type": "string"
  2440. // },
  2441. // "resourceViewName": {
  2442. // "description": "The name of the resource view.",
  2443. // "location": "path",
  2444. // "required": true,
  2445. // "type": "string"
  2446. // },
  2447. // "zone": {
  2448. // "description": "The zone name of the resource view.",
  2449. // "location": "path",
  2450. // "required": true,
  2451. // "type": "string"
  2452. // }
  2453. // },
  2454. // "path": "{projectName}/zones/{zone}/resourceViews/{resourceViewName}/removeResources",
  2455. // "request": {
  2456. // "$ref": "ZoneViewsRemoveResourcesRequest"
  2457. // },
  2458. // "scopes": [
  2459. // "https://www.googleapis.com/auth/cloud-platform",
  2460. // "https://www.googleapis.com/auth/compute",
  2461. // "https://www.googleapis.com/auth/ndev.cloudman"
  2462. // ]
  2463. // }
  2464. }