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.
 
 
 

5655 lines
215 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package deploymentmanager provides access to the Google Cloud Deployment Manager API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/deployment-manager/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/deploymentmanager/v2"
  14. // ...
  15. // ctx := context.Background()
  16. // deploymentmanagerService, err := deploymentmanager.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithScopes(deploymentmanager.NdevCloudmanReadonlyScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package deploymentmanager // import "google.golang.org/api/deploymentmanager/v2"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "deploymentmanager:v2"
  71. const apiName = "deploymentmanager"
  72. const apiVersion = "v2"
  73. const basePath = "https://www.googleapis.com/deploymentmanager/v2/projects/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your data across Google Cloud Platform services
  77. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  78. // View your data across Google Cloud Platform services
  79. CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
  80. // View and manage your Google Cloud Platform management resources and
  81. // deployment status information
  82. NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman"
  83. // View your Google Cloud Platform management resources and deployment
  84. // status information
  85. NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  86. )
  87. // NewService creates a new Service.
  88. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  89. scopesOption := option.WithScopes(
  90. "https://www.googleapis.com/auth/cloud-platform",
  91. "https://www.googleapis.com/auth/cloud-platform.read-only",
  92. "https://www.googleapis.com/auth/ndev.cloudman",
  93. "https://www.googleapis.com/auth/ndev.cloudman.readonly",
  94. )
  95. // NOTE: prepend, so we don't override user-specified scopes.
  96. opts = append([]option.ClientOption{scopesOption}, opts...)
  97. client, endpoint, err := htransport.NewClient(ctx, opts...)
  98. if err != nil {
  99. return nil, err
  100. }
  101. s, err := New(client)
  102. if err != nil {
  103. return nil, err
  104. }
  105. if endpoint != "" {
  106. s.BasePath = endpoint
  107. }
  108. return s, nil
  109. }
  110. // New creates a new Service. It uses the provided http.Client for requests.
  111. //
  112. // Deprecated: please use NewService instead.
  113. // To provide a custom HTTP client, use option.WithHTTPClient.
  114. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  115. func New(client *http.Client) (*Service, error) {
  116. if client == nil {
  117. return nil, errors.New("client is nil")
  118. }
  119. s := &Service{client: client, BasePath: basePath}
  120. s.Deployments = NewDeploymentsService(s)
  121. s.Manifests = NewManifestsService(s)
  122. s.Operations = NewOperationsService(s)
  123. s.Resources = NewResourcesService(s)
  124. s.Types = NewTypesService(s)
  125. return s, nil
  126. }
  127. type Service struct {
  128. client *http.Client
  129. BasePath string // API endpoint base URL
  130. UserAgent string // optional additional User-Agent fragment
  131. Deployments *DeploymentsService
  132. Manifests *ManifestsService
  133. Operations *OperationsService
  134. Resources *ResourcesService
  135. Types *TypesService
  136. }
  137. func (s *Service) userAgent() string {
  138. if s.UserAgent == "" {
  139. return googleapi.UserAgent
  140. }
  141. return googleapi.UserAgent + " " + s.UserAgent
  142. }
  143. func NewDeploymentsService(s *Service) *DeploymentsService {
  144. rs := &DeploymentsService{s: s}
  145. return rs
  146. }
  147. type DeploymentsService struct {
  148. s *Service
  149. }
  150. func NewManifestsService(s *Service) *ManifestsService {
  151. rs := &ManifestsService{s: s}
  152. return rs
  153. }
  154. type ManifestsService struct {
  155. s *Service
  156. }
  157. func NewOperationsService(s *Service) *OperationsService {
  158. rs := &OperationsService{s: s}
  159. return rs
  160. }
  161. type OperationsService struct {
  162. s *Service
  163. }
  164. func NewResourcesService(s *Service) *ResourcesService {
  165. rs := &ResourcesService{s: s}
  166. return rs
  167. }
  168. type ResourcesService struct {
  169. s *Service
  170. }
  171. func NewTypesService(s *Service) *TypesService {
  172. rs := &TypesService{s: s}
  173. return rs
  174. }
  175. type TypesService struct {
  176. s *Service
  177. }
  178. // AuditConfig: Specifies the audit configuration for a service. The
  179. // configuration determines which permission types are logged, and what
  180. // identities, if any, are exempted from logging. An AuditConfig must
  181. // have one or more AuditLogConfigs.
  182. //
  183. // If there are AuditConfigs for both `allServices` and a specific
  184. // service, the union of the two AuditConfigs is used for that service:
  185. // the log_types specified in each AuditConfig are enabled, and the
  186. // exempted_members in each AuditLogConfig are exempted.
  187. //
  188. // Example Policy with multiple AuditConfigs:
  189. //
  190. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  191. // [ { "log_type": "DATA_READ", "exempted_members": [
  192. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  193. // "log_type": "ADMIN_READ", } ] }, { "service":
  194. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  195. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  196. // "user:bar@gmail.com" ] } ] } ] }
  197. //
  198. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  199. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  200. // logging, and bar@gmail.com from DATA_WRITE logging.
  201. type AuditConfig struct {
  202. // AuditLogConfigs: The configuration for logging of each type of
  203. // permission.
  204. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  205. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  206. // Service: Specifies a service that will be enabled for audit logging.
  207. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  208. // `allServices` is a special value that covers all services.
  209. Service string `json:"service,omitempty"`
  210. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  211. // unconditionally include in API requests. By default, fields with
  212. // empty values are omitted from API requests. However, any non-pointer,
  213. // non-interface field appearing in ForceSendFields will be sent to the
  214. // server regardless of whether the field is empty or not. This may be
  215. // used to include empty fields in Patch requests.
  216. ForceSendFields []string `json:"-"`
  217. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  218. // include in API requests with the JSON null value. By default, fields
  219. // with empty values are omitted from API requests. However, any field
  220. // with an empty value appearing in NullFields will be sent to the
  221. // server as null. It is an error if a field in this list has a
  222. // non-empty value. This may be used to include null fields in Patch
  223. // requests.
  224. NullFields []string `json:"-"`
  225. }
  226. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  227. type NoMethod AuditConfig
  228. raw := NoMethod(*s)
  229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  230. }
  231. // AuditLogConfig: Provides the configuration for logging a type of
  232. // permissions. Example:
  233. //
  234. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  235. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  236. // "DATA_WRITE", } ] }
  237. //
  238. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  239. // foo@gmail.com from DATA_READ logging.
  240. type AuditLogConfig struct {
  241. // ExemptedMembers: Specifies the identities that do not cause logging
  242. // for this type of permission. Follows the same format of
  243. // [Binding.members][].
  244. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  245. // LogType: The log type that this config enables.
  246. LogType string `json:"logType,omitempty"`
  247. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  248. // unconditionally include in API requests. By default, fields with
  249. // empty values are omitted from API requests. However, any non-pointer,
  250. // non-interface field appearing in ForceSendFields will be sent to the
  251. // server regardless of whether the field is empty or not. This may be
  252. // used to include empty fields in Patch requests.
  253. ForceSendFields []string `json:"-"`
  254. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  255. // include in API requests with the JSON null value. By default, fields
  256. // with empty values are omitted from API requests. However, any field
  257. // with an empty value appearing in NullFields will be sent to the
  258. // server as null. It is an error if a field in this list has a
  259. // non-empty value. This may be used to include null fields in Patch
  260. // requests.
  261. NullFields []string `json:"-"`
  262. }
  263. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  264. type NoMethod AuditLogConfig
  265. raw := NoMethod(*s)
  266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  267. }
  268. // AuthorizationLoggingOptions: Authorization-related information used
  269. // by Cloud Audit Logging.
  270. type AuthorizationLoggingOptions struct {
  271. // PermissionType: The type of the permission that was checked.
  272. PermissionType string `json:"permissionType,omitempty"`
  273. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  274. // unconditionally include in API requests. By default, fields with
  275. // empty values are omitted from API requests. However, any non-pointer,
  276. // non-interface field appearing in ForceSendFields will be sent to the
  277. // server regardless of whether the field is empty or not. This may be
  278. // used to include empty fields in Patch requests.
  279. ForceSendFields []string `json:"-"`
  280. // NullFields is a list of field names (e.g. "PermissionType") to
  281. // include in API requests with the JSON null value. By default, fields
  282. // with empty values are omitted from API requests. However, any field
  283. // with an empty value appearing in NullFields will be sent to the
  284. // server as null. It is an error if a field in this list has a
  285. // non-empty value. This may be used to include null fields in Patch
  286. // requests.
  287. NullFields []string `json:"-"`
  288. }
  289. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  290. type NoMethod AuthorizationLoggingOptions
  291. raw := NoMethod(*s)
  292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  293. }
  294. // Binding: Associates `members` with a `role`.
  295. type Binding struct {
  296. // Condition: Unimplemented. The condition that is associated with this
  297. // binding. NOTE: an unsatisfied condition will not allow user access
  298. // via current binding. Different bindings, including their conditions,
  299. // are examined independently.
  300. Condition *Expr `json:"condition,omitempty"`
  301. // Members: Specifies the identities requesting access for a Cloud
  302. // Platform resource. `members` can have the following values:
  303. //
  304. // * `allUsers`: A special identifier that represents anyone who is on
  305. // the internet; with or without a Google account.
  306. //
  307. // * `allAuthenticatedUsers`: A special identifier that represents
  308. // anyone who is authenticated with a Google account or a service
  309. // account.
  310. //
  311. // * `user:{emailid}`: An email address that represents a specific
  312. // Google account. For example, `alice@gmail.com` .
  313. //
  314. //
  315. //
  316. // * `serviceAccount:{emailid}`: An email address that represents a
  317. // service account. For example,
  318. // `my-other-app@appspot.gserviceaccount.com`.
  319. //
  320. // * `group:{emailid}`: An email address that represents a Google group.
  321. // For example, `admins@example.com`.
  322. //
  323. //
  324. //
  325. // * `domain:{domain}`: A Google Apps domain name that represents all
  326. // the users of that domain. For example, `google.com` or `example.com`.
  327. Members []string `json:"members,omitempty"`
  328. // Role: Role that is assigned to `members`. For example,
  329. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  330. Role string `json:"role,omitempty"`
  331. // ForceSendFields is a list of field names (e.g. "Condition") to
  332. // unconditionally include in API requests. By default, fields with
  333. // empty values are omitted from API requests. However, any non-pointer,
  334. // non-interface field appearing in ForceSendFields will be sent to the
  335. // server regardless of whether the field is empty or not. This may be
  336. // used to include empty fields in Patch requests.
  337. ForceSendFields []string `json:"-"`
  338. // NullFields is a list of field names (e.g. "Condition") to include in
  339. // API requests with the JSON null value. By default, fields with empty
  340. // values are omitted from API requests. However, any field with an
  341. // empty value appearing in NullFields will be sent to the server as
  342. // null. It is an error if a field in this list has a non-empty value.
  343. // This may be used to include null fields in Patch requests.
  344. NullFields []string `json:"-"`
  345. }
  346. func (s *Binding) MarshalJSON() ([]byte, error) {
  347. type NoMethod Binding
  348. raw := NoMethod(*s)
  349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  350. }
  351. // Condition: A condition to be met.
  352. type Condition struct {
  353. // Iam: Trusted attributes supplied by the IAM system.
  354. Iam string `json:"iam,omitempty"`
  355. // Op: An operator to apply the subject with.
  356. Op string `json:"op,omitempty"`
  357. // Svc: Trusted attributes discharged by the service.
  358. Svc string `json:"svc,omitempty"`
  359. // Sys: Trusted attributes supplied by any service that owns resources
  360. // and uses the IAM system for access control.
  361. Sys string `json:"sys,omitempty"`
  362. // Value: DEPRECATED. Use 'values' instead.
  363. Value string `json:"value,omitempty"`
  364. // Values: The objects of the condition. This is mutually exclusive with
  365. // 'value'.
  366. Values []string `json:"values,omitempty"`
  367. // ForceSendFields is a list of field names (e.g. "Iam") to
  368. // unconditionally include in API requests. By default, fields with
  369. // empty values are omitted from API requests. However, any non-pointer,
  370. // non-interface field appearing in ForceSendFields will be sent to the
  371. // server regardless of whether the field is empty or not. This may be
  372. // used to include empty fields in Patch requests.
  373. ForceSendFields []string `json:"-"`
  374. // NullFields is a list of field names (e.g. "Iam") to include in API
  375. // requests with the JSON null value. By default, fields with empty
  376. // values are omitted from API requests. However, any field with an
  377. // empty value appearing in NullFields will be sent to the server as
  378. // null. It is an error if a field in this list has a non-empty value.
  379. // This may be used to include null fields in Patch requests.
  380. NullFields []string `json:"-"`
  381. }
  382. func (s *Condition) MarshalJSON() ([]byte, error) {
  383. type NoMethod Condition
  384. raw := NoMethod(*s)
  385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  386. }
  387. type ConfigFile struct {
  388. // Content: The contents of the file.
  389. Content string `json:"content,omitempty"`
  390. // ForceSendFields is a list of field names (e.g. "Content") to
  391. // unconditionally include in API requests. By default, fields with
  392. // empty values are omitted from API requests. However, any non-pointer,
  393. // non-interface field appearing in ForceSendFields will be sent to the
  394. // server regardless of whether the field is empty or not. This may be
  395. // used to include empty fields in Patch requests.
  396. ForceSendFields []string `json:"-"`
  397. // NullFields is a list of field names (e.g. "Content") to include in
  398. // API requests with the JSON null value. By default, fields with empty
  399. // values are omitted from API requests. However, any field with an
  400. // empty value appearing in NullFields will be sent to the server as
  401. // null. It is an error if a field in this list has a non-empty value.
  402. // This may be used to include null fields in Patch requests.
  403. NullFields []string `json:"-"`
  404. }
  405. func (s *ConfigFile) MarshalJSON() ([]byte, error) {
  406. type NoMethod ConfigFile
  407. raw := NoMethod(*s)
  408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  409. }
  410. type Deployment struct {
  411. // Description: An optional user-provided description of the deployment.
  412. Description string `json:"description,omitempty"`
  413. // Fingerprint: Provides a fingerprint to use in requests to modify a
  414. // deployment, such as update(), stop(), and cancelPreview() requests. A
  415. // fingerprint is a randomly generated value that must be provided with
  416. // update(), stop(), and cancelPreview() requests to perform optimistic
  417. // locking. This ensures optimistic concurrency so that only one request
  418. // happens at a time.
  419. //
  420. // The fingerprint is initially generated by Deployment Manager and
  421. // changes after every request to modify data. To get the latest
  422. // fingerprint value, perform a get() request to a deployment.
  423. Fingerprint string `json:"fingerprint,omitempty"`
  424. Id uint64 `json:"id,omitempty,string"`
  425. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  426. InsertTime string `json:"insertTime,omitempty"`
  427. // Labels: Map of labels; provided by the client when the resource is
  428. // created or updated. Specifically: Label keys must be between 1 and 63
  429. // characters long and must conform to the following regular expression:
  430. // [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63
  431. // characters long and must conform to the regular expression
  432. // ([a-z]([-a-z0-9]*[a-z0-9])?)?
  433. Labels []*DeploymentLabelEntry `json:"labels,omitempty"`
  434. // Manifest: Output only. URL of the manifest representing the last
  435. // manifest that was successfully deployed.
  436. Manifest string `json:"manifest,omitempty"`
  437. // Name: Name of the resource; provided by the client when the resource
  438. // is created. The name must be 1-63 characters long, and comply with
  439. // RFC1035. Specifically, the name must be 1-63 characters long and
  440. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  441. // the first character must be a lowercase letter, and all following
  442. // characters must be a dash, lowercase letter, or digit, except the
  443. // last character, which cannot be a dash.
  444. Name string `json:"name,omitempty"`
  445. // Operation: Output only. The Operation that most recently ran, or is
  446. // currently running, on this deployment.
  447. Operation *Operation `json:"operation,omitempty"`
  448. // SelfLink: Output only. Server defined URL for the resource.
  449. SelfLink string `json:"selfLink,omitempty"`
  450. // Target: [Input Only] The parameters that define your deployment,
  451. // including the deployment configuration and relevant templates.
  452. Target *TargetConfiguration `json:"target,omitempty"`
  453. // Update: Output only. If Deployment Manager is currently updating or
  454. // previewing an update to this deployment, the updated configuration
  455. // appears here.
  456. Update *DeploymentUpdate `json:"update,omitempty"`
  457. // UpdateTime: Output only. Update timestamp in RFC3339 text format.
  458. UpdateTime string `json:"updateTime,omitempty"`
  459. // ServerResponse contains the HTTP response code and headers from the
  460. // server.
  461. googleapi.ServerResponse `json:"-"`
  462. // ForceSendFields is a list of field names (e.g. "Description") to
  463. // unconditionally include in API requests. By default, fields with
  464. // empty values are omitted from API requests. However, any non-pointer,
  465. // non-interface field appearing in ForceSendFields will be sent to the
  466. // server regardless of whether the field is empty or not. This may be
  467. // used to include empty fields in Patch requests.
  468. ForceSendFields []string `json:"-"`
  469. // NullFields is a list of field names (e.g. "Description") to include
  470. // in API requests with the JSON null value. By default, fields with
  471. // empty values are omitted from API requests. However, any field with
  472. // an empty value appearing in NullFields will be sent to the server as
  473. // null. It is an error if a field in this list has a non-empty value.
  474. // This may be used to include null fields in Patch requests.
  475. NullFields []string `json:"-"`
  476. }
  477. func (s *Deployment) MarshalJSON() ([]byte, error) {
  478. type NoMethod Deployment
  479. raw := NoMethod(*s)
  480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  481. }
  482. type DeploymentLabelEntry struct {
  483. Key string `json:"key,omitempty"`
  484. Value string `json:"value,omitempty"`
  485. // ForceSendFields is a list of field names (e.g. "Key") to
  486. // unconditionally include in API requests. By default, fields with
  487. // empty values are omitted from API requests. However, any non-pointer,
  488. // non-interface field appearing in ForceSendFields will be sent to the
  489. // server regardless of whether the field is empty or not. This may be
  490. // used to include empty fields in Patch requests.
  491. ForceSendFields []string `json:"-"`
  492. // NullFields is a list of field names (e.g. "Key") to include in API
  493. // requests with the JSON null value. By default, fields with empty
  494. // values are omitted from API requests. However, any field with an
  495. // empty value appearing in NullFields will be sent to the server as
  496. // null. It is an error if a field in this list has a non-empty value.
  497. // This may be used to include null fields in Patch requests.
  498. NullFields []string `json:"-"`
  499. }
  500. func (s *DeploymentLabelEntry) MarshalJSON() ([]byte, error) {
  501. type NoMethod DeploymentLabelEntry
  502. raw := NoMethod(*s)
  503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  504. }
  505. type DeploymentUpdate struct {
  506. // Description: Output only. An optional user-provided description of
  507. // the deployment after the current update has been applied.
  508. Description string `json:"description,omitempty"`
  509. // Labels: Output only. Map of labels; provided by the client when the
  510. // resource is created or updated. Specifically: Label keys must be
  511. // between 1 and 63 characters long and must conform to the following
  512. // regular expression: [a-z]([-a-z0-9]*[a-z0-9])? Label values must be
  513. // between 0 and 63 characters long and must conform to the regular
  514. // expression ([a-z]([-a-z0-9]*[a-z0-9])?)?
  515. Labels []*DeploymentUpdateLabelEntry `json:"labels,omitempty"`
  516. // Manifest: Output only. URL of the manifest representing the update
  517. // configuration of this deployment.
  518. Manifest string `json:"manifest,omitempty"`
  519. // ForceSendFields is a list of field names (e.g. "Description") to
  520. // unconditionally include in API requests. By default, fields with
  521. // empty values are omitted from API requests. However, any non-pointer,
  522. // non-interface field appearing in ForceSendFields will be sent to the
  523. // server regardless of whether the field is empty or not. This may be
  524. // used to include empty fields in Patch requests.
  525. ForceSendFields []string `json:"-"`
  526. // NullFields is a list of field names (e.g. "Description") to include
  527. // in API requests with the JSON null value. By default, fields with
  528. // empty values are omitted from API requests. However, any field with
  529. // an empty value appearing in NullFields will be sent to the server as
  530. // null. It is an error if a field in this list has a non-empty value.
  531. // This may be used to include null fields in Patch requests.
  532. NullFields []string `json:"-"`
  533. }
  534. func (s *DeploymentUpdate) MarshalJSON() ([]byte, error) {
  535. type NoMethod DeploymentUpdate
  536. raw := NoMethod(*s)
  537. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  538. }
  539. type DeploymentUpdateLabelEntry struct {
  540. Key string `json:"key,omitempty"`
  541. Value string `json:"value,omitempty"`
  542. // ForceSendFields is a list of field names (e.g. "Key") to
  543. // unconditionally include in API requests. By default, fields with
  544. // empty values are omitted from API requests. However, any non-pointer,
  545. // non-interface field appearing in ForceSendFields will be sent to the
  546. // server regardless of whether the field is empty or not. This may be
  547. // used to include empty fields in Patch requests.
  548. ForceSendFields []string `json:"-"`
  549. // NullFields is a list of field names (e.g. "Key") to include in API
  550. // requests with the JSON null value. By default, fields with empty
  551. // values are omitted from API requests. However, any field with an
  552. // empty value appearing in NullFields will be sent to the server as
  553. // null. It is an error if a field in this list has a non-empty value.
  554. // This may be used to include null fields in Patch requests.
  555. NullFields []string `json:"-"`
  556. }
  557. func (s *DeploymentUpdateLabelEntry) MarshalJSON() ([]byte, error) {
  558. type NoMethod DeploymentUpdateLabelEntry
  559. raw := NoMethod(*s)
  560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  561. }
  562. type DeploymentsCancelPreviewRequest struct {
  563. // Fingerprint: Specifies a fingerprint for cancelPreview() requests. A
  564. // fingerprint is a randomly generated value that must be provided in
  565. // cancelPreview() requests to perform optimistic locking. This ensures
  566. // optimistic concurrency so that the deployment does not have
  567. // conflicting requests (e.g. if someone attempts to make a new update
  568. // request while another user attempts to cancel a preview, this would
  569. // prevent one of the requests).
  570. //
  571. // The fingerprint is initially generated by Deployment Manager and
  572. // changes after every request to modify a deployment. To get the latest
  573. // fingerprint value, perform a get() request on the deployment.
  574. Fingerprint string `json:"fingerprint,omitempty"`
  575. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  576. // unconditionally include in API requests. By default, fields with
  577. // empty values are omitted from API requests. However, any non-pointer,
  578. // non-interface field appearing in ForceSendFields will be sent to the
  579. // server regardless of whether the field is empty or not. This may be
  580. // used to include empty fields in Patch requests.
  581. ForceSendFields []string `json:"-"`
  582. // NullFields is a list of field names (e.g. "Fingerprint") to include
  583. // in API requests with the JSON null value. By default, fields with
  584. // empty values are omitted from API requests. However, any field with
  585. // an empty value appearing in NullFields will be sent to the server as
  586. // null. It is an error if a field in this list has a non-empty value.
  587. // This may be used to include null fields in Patch requests.
  588. NullFields []string `json:"-"`
  589. }
  590. func (s *DeploymentsCancelPreviewRequest) MarshalJSON() ([]byte, error) {
  591. type NoMethod DeploymentsCancelPreviewRequest
  592. raw := NoMethod(*s)
  593. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  594. }
  595. // DeploymentsListResponse: A response containing a partial list of
  596. // deployments and a page token used to build the next request if the
  597. // request has been truncated.
  598. type DeploymentsListResponse struct {
  599. // Deployments: Output only. The deployments contained in this response.
  600. Deployments []*Deployment `json:"deployments,omitempty"`
  601. // NextPageToken: Output only. A token used to continue a truncated list
  602. // request.
  603. NextPageToken string `json:"nextPageToken,omitempty"`
  604. // ServerResponse contains the HTTP response code and headers from the
  605. // server.
  606. googleapi.ServerResponse `json:"-"`
  607. // ForceSendFields is a list of field names (e.g. "Deployments") to
  608. // unconditionally include in API requests. By default, fields with
  609. // empty values are omitted from API requests. However, any non-pointer,
  610. // non-interface field appearing in ForceSendFields will be sent to the
  611. // server regardless of whether the field is empty or not. This may be
  612. // used to include empty fields in Patch requests.
  613. ForceSendFields []string `json:"-"`
  614. // NullFields is a list of field names (e.g. "Deployments") to include
  615. // in API requests with the JSON null value. By default, fields with
  616. // empty values are omitted from API requests. However, any field with
  617. // an empty value appearing in NullFields will be sent to the server as
  618. // null. It is an error if a field in this list has a non-empty value.
  619. // This may be used to include null fields in Patch requests.
  620. NullFields []string `json:"-"`
  621. }
  622. func (s *DeploymentsListResponse) MarshalJSON() ([]byte, error) {
  623. type NoMethod DeploymentsListResponse
  624. raw := NoMethod(*s)
  625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  626. }
  627. type DeploymentsStopRequest struct {
  628. // Fingerprint: Specifies a fingerprint for stop() requests. A
  629. // fingerprint is a randomly generated value that must be provided in
  630. // stop() requests to perform optimistic locking. This ensures
  631. // optimistic concurrency so that the deployment does not have
  632. // conflicting requests (e.g. if someone attempts to make a new update
  633. // request while another user attempts to stop an ongoing update
  634. // request, this would prevent a collision).
  635. //
  636. // The fingerprint is initially generated by Deployment Manager and
  637. // changes after every request to modify a deployment. To get the latest
  638. // fingerprint value, perform a get() request on the deployment.
  639. Fingerprint string `json:"fingerprint,omitempty"`
  640. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  641. // unconditionally include in API requests. By default, fields with
  642. // empty values are omitted from API requests. However, any non-pointer,
  643. // non-interface field appearing in ForceSendFields will be sent to the
  644. // server regardless of whether the field is empty or not. This may be
  645. // used to include empty fields in Patch requests.
  646. ForceSendFields []string `json:"-"`
  647. // NullFields is a list of field names (e.g. "Fingerprint") to include
  648. // in API requests with the JSON null value. By default, fields with
  649. // empty values are omitted from API requests. However, any field with
  650. // an empty value appearing in NullFields will be sent to the server as
  651. // null. It is an error if a field in this list has a non-empty value.
  652. // This may be used to include null fields in Patch requests.
  653. NullFields []string `json:"-"`
  654. }
  655. func (s *DeploymentsStopRequest) MarshalJSON() ([]byte, error) {
  656. type NoMethod DeploymentsStopRequest
  657. raw := NoMethod(*s)
  658. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  659. }
  660. // Expr: Represents an expression text. Example:
  661. //
  662. // title: "User account presence" description: "Determines whether the
  663. // request has a user account" expression: "size(request.user) > 0"
  664. type Expr struct {
  665. // Description: An optional description of the expression. This is a
  666. // longer text which describes the expression, e.g. when hovered over it
  667. // in a UI.
  668. Description string `json:"description,omitempty"`
  669. // Expression: Textual representation of an expression in Common
  670. // Expression Language syntax.
  671. //
  672. // The application context of the containing message determines which
  673. // well-known feature set of CEL is supported.
  674. Expression string `json:"expression,omitempty"`
  675. // Location: An optional string indicating the location of the
  676. // expression for error reporting, e.g. a file name and a position in
  677. // the file.
  678. Location string `json:"location,omitempty"`
  679. // Title: An optional title for the expression, i.e. a short string
  680. // describing its purpose. This can be used e.g. in UIs which allow to
  681. // enter the expression.
  682. Title string `json:"title,omitempty"`
  683. // ForceSendFields is a list of field names (e.g. "Description") to
  684. // unconditionally include in API requests. By default, fields with
  685. // empty values are omitted from API requests. However, any non-pointer,
  686. // non-interface field appearing in ForceSendFields will be sent to the
  687. // server regardless of whether the field is empty or not. This may be
  688. // used to include empty fields in Patch requests.
  689. ForceSendFields []string `json:"-"`
  690. // NullFields is a list of field names (e.g. "Description") to include
  691. // in API requests with the JSON null value. By default, fields with
  692. // empty values are omitted from API requests. However, any field with
  693. // an empty value appearing in NullFields will be sent to the server as
  694. // null. It is an error if a field in this list has a non-empty value.
  695. // This may be used to include null fields in Patch requests.
  696. NullFields []string `json:"-"`
  697. }
  698. func (s *Expr) MarshalJSON() ([]byte, error) {
  699. type NoMethod Expr
  700. raw := NoMethod(*s)
  701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  702. }
  703. type GlobalSetPolicyRequest struct {
  704. // Bindings: Flatten Policy to create a backward compatible wire-format.
  705. // Deprecated. Use 'policy' to specify bindings.
  706. Bindings []*Binding `json:"bindings,omitempty"`
  707. // Etag: Flatten Policy to create a backward compatible wire-format.
  708. // Deprecated. Use 'policy' to specify the etag.
  709. Etag string `json:"etag,omitempty"`
  710. // Policy: REQUIRED: The complete policy to be applied to the
  711. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  712. // empty policy is in general a valid policy but certain services (like
  713. // Projects) might reject them.
  714. Policy *Policy `json:"policy,omitempty"`
  715. // ForceSendFields is a list of field names (e.g. "Bindings") to
  716. // unconditionally include in API requests. By default, fields with
  717. // empty values are omitted from API requests. However, any non-pointer,
  718. // non-interface field appearing in ForceSendFields will be sent to the
  719. // server regardless of whether the field is empty or not. This may be
  720. // used to include empty fields in Patch requests.
  721. ForceSendFields []string `json:"-"`
  722. // NullFields is a list of field names (e.g. "Bindings") to include in
  723. // API requests with the JSON null value. By default, fields with empty
  724. // values are omitted from API requests. However, any field with an
  725. // empty value appearing in NullFields will be sent to the server as
  726. // null. It is an error if a field in this list has a non-empty value.
  727. // This may be used to include null fields in Patch requests.
  728. NullFields []string `json:"-"`
  729. }
  730. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  731. type NoMethod GlobalSetPolicyRequest
  732. raw := NoMethod(*s)
  733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  734. }
  735. type ImportFile struct {
  736. // Content: The contents of the file.
  737. Content string `json:"content,omitempty"`
  738. // Name: The name of the file.
  739. Name string `json:"name,omitempty"`
  740. // ForceSendFields is a list of field names (e.g. "Content") to
  741. // unconditionally include in API requests. By default, fields with
  742. // empty values are omitted from API requests. However, any non-pointer,
  743. // non-interface field appearing in ForceSendFields will be sent to the
  744. // server regardless of whether the field is empty or not. This may be
  745. // used to include empty fields in Patch requests.
  746. ForceSendFields []string `json:"-"`
  747. // NullFields is a list of field names (e.g. "Content") to include in
  748. // API requests with the JSON null value. By default, fields with empty
  749. // values are omitted from API requests. However, any field with an
  750. // empty value appearing in NullFields will be sent to the server as
  751. // null. It is an error if a field in this list has a non-empty value.
  752. // This may be used to include null fields in Patch requests.
  753. NullFields []string `json:"-"`
  754. }
  755. func (s *ImportFile) MarshalJSON() ([]byte, error) {
  756. type NoMethod ImportFile
  757. raw := NoMethod(*s)
  758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  759. }
  760. // LogConfig: Specifies what kind of log the caller must write
  761. type LogConfig struct {
  762. // CloudAudit: Cloud audit options.
  763. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  764. // Counter: Counter options.
  765. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  766. // DataAccess: Data access options.
  767. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  768. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  769. // unconditionally include in API requests. By default, fields with
  770. // empty values are omitted from API requests. However, any non-pointer,
  771. // non-interface field appearing in ForceSendFields will be sent to the
  772. // server regardless of whether the field is empty or not. This may be
  773. // used to include empty fields in Patch requests.
  774. ForceSendFields []string `json:"-"`
  775. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  776. // API requests with the JSON null value. By default, fields with empty
  777. // values are omitted from API requests. However, any field with an
  778. // empty value appearing in NullFields will be sent to the server as
  779. // null. It is an error if a field in this list has a non-empty value.
  780. // This may be used to include null fields in Patch requests.
  781. NullFields []string `json:"-"`
  782. }
  783. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  784. type NoMethod LogConfig
  785. raw := NoMethod(*s)
  786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  787. }
  788. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  789. type LogConfigCloudAuditOptions struct {
  790. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  791. // Logging pipeline.
  792. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  793. // LogName: The log_name to populate in the Cloud Audit Record.
  794. LogName string `json:"logName,omitempty"`
  795. // ForceSendFields is a list of field names (e.g.
  796. // "AuthorizationLoggingOptions") to unconditionally include in API
  797. // requests. By default, fields with empty values are omitted from API
  798. // requests. However, any non-pointer, non-interface field appearing in
  799. // ForceSendFields will be sent to the server regardless of whether the
  800. // field is empty or not. This may be used to include empty fields in
  801. // Patch requests.
  802. ForceSendFields []string `json:"-"`
  803. // NullFields is a list of field names (e.g.
  804. // "AuthorizationLoggingOptions") to include in API requests with the
  805. // JSON null value. By default, fields with empty values are omitted
  806. // from API requests. However, any field with an empty value appearing
  807. // in NullFields will be sent to the server as null. It is an error if a
  808. // field in this list has a non-empty value. This may be used to include
  809. // null fields in Patch requests.
  810. NullFields []string `json:"-"`
  811. }
  812. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  813. type NoMethod LogConfigCloudAuditOptions
  814. raw := NoMethod(*s)
  815. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  816. }
  817. // LogConfigCounterOptions: Increment a streamz counter with the
  818. // specified metric and field names.
  819. //
  820. // Metric names should start with a '/', generally be lowercase-only,
  821. // and end in "_count". Field names should not contain an initial slash.
  822. // The actual exported metric names will have "/iam/policy"
  823. // prepended.
  824. //
  825. // Field names correspond to IAM request parameters and field values are
  826. // their respective values.
  827. //
  828. // Supported field names: - "authority", which is "[token]" if
  829. // IAMContext.token is present, otherwise the value of
  830. // IAMContext.authority_selector if present, and otherwise a
  831. // representation of IAMContext.principal; or - "iam_principal", a
  832. // representation of IAMContext.principal even if a token or authority
  833. // selector is present; or - "" (empty string), resulting in a counter
  834. // with no fields.
  835. //
  836. // Examples: counter { metric: "/debug_access_count" field:
  837. // "iam_principal" } ==> increment counter
  838. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  839. // IAMContext.principal]}
  840. //
  841. // At this time we do not support multiple field names (though this may
  842. // be supported in the future).
  843. type LogConfigCounterOptions struct {
  844. // Field: The field value to attribute.
  845. Field string `json:"field,omitempty"`
  846. // Metric: The metric to update.
  847. Metric string `json:"metric,omitempty"`
  848. // ForceSendFields is a list of field names (e.g. "Field") to
  849. // unconditionally include in API requests. By default, fields with
  850. // empty values are omitted from API requests. However, any non-pointer,
  851. // non-interface field appearing in ForceSendFields will be sent to the
  852. // server regardless of whether the field is empty or not. This may be
  853. // used to include empty fields in Patch requests.
  854. ForceSendFields []string `json:"-"`
  855. // NullFields is a list of field names (e.g. "Field") to include in API
  856. // requests with the JSON null value. By default, fields with empty
  857. // values are omitted from API requests. However, any field with an
  858. // empty value appearing in NullFields will be sent to the server as
  859. // null. It is an error if a field in this list has a non-empty value.
  860. // This may be used to include null fields in Patch requests.
  861. NullFields []string `json:"-"`
  862. }
  863. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  864. type NoMethod LogConfigCounterOptions
  865. raw := NoMethod(*s)
  866. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  867. }
  868. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  869. type LogConfigDataAccessOptions struct {
  870. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  871. // the caller. This is relevant only in the LocalIAM implementation, for
  872. // now.
  873. //
  874. // NOTE: Logging to Gin in a fail-closed manner is currently unsupported
  875. // while work is being done to satisfy the requirements of go/345.
  876. // Currently, setting LOG_FAIL_CLOSED mode will have no effect, but
  877. // still exists because there is active work being done to support it
  878. // (b/115874152).
  879. LogMode string `json:"logMode,omitempty"`
  880. // ForceSendFields is a list of field names (e.g. "LogMode") to
  881. // unconditionally include in API requests. By default, fields with
  882. // empty values are omitted from API requests. However, any non-pointer,
  883. // non-interface field appearing in ForceSendFields will be sent to the
  884. // server regardless of whether the field is empty or not. This may be
  885. // used to include empty fields in Patch requests.
  886. ForceSendFields []string `json:"-"`
  887. // NullFields is a list of field names (e.g. "LogMode") to include in
  888. // API requests with the JSON null value. By default, fields with empty
  889. // values are omitted from API requests. However, any field with an
  890. // empty value appearing in NullFields will be sent to the server as
  891. // null. It is an error if a field in this list has a non-empty value.
  892. // This may be used to include null fields in Patch requests.
  893. NullFields []string `json:"-"`
  894. }
  895. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  896. type NoMethod LogConfigDataAccessOptions
  897. raw := NoMethod(*s)
  898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  899. }
  900. type Manifest struct {
  901. // Config: Output only. The YAML configuration for this manifest.
  902. Config *ConfigFile `json:"config,omitempty"`
  903. // ExpandedConfig: Output only. The fully-expanded configuration file,
  904. // including any templates and references.
  905. ExpandedConfig string `json:"expandedConfig,omitempty"`
  906. Id uint64 `json:"id,omitempty,string"`
  907. // Imports: Output only. The imported files for this manifest.
  908. Imports []*ImportFile `json:"imports,omitempty"`
  909. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  910. InsertTime string `json:"insertTime,omitempty"`
  911. // Layout: Output only. The YAML layout for this manifest.
  912. Layout string `json:"layout,omitempty"`
  913. // Name: Output only.
  914. //
  915. // The name of the manifest.
  916. Name string `json:"name,omitempty"`
  917. // SelfLink: Output only. Self link for the manifest.
  918. SelfLink string `json:"selfLink,omitempty"`
  919. // ServerResponse contains the HTTP response code and headers from the
  920. // server.
  921. googleapi.ServerResponse `json:"-"`
  922. // ForceSendFields is a list of field names (e.g. "Config") to
  923. // unconditionally include in API requests. By default, fields with
  924. // empty values are omitted from API requests. However, any non-pointer,
  925. // non-interface field appearing in ForceSendFields will be sent to the
  926. // server regardless of whether the field is empty or not. This may be
  927. // used to include empty fields in Patch requests.
  928. ForceSendFields []string `json:"-"`
  929. // NullFields is a list of field names (e.g. "Config") to include in API
  930. // requests with the JSON null value. By default, fields with empty
  931. // values are omitted from API requests. However, any field with an
  932. // empty value appearing in NullFields will be sent to the server as
  933. // null. It is an error if a field in this list has a non-empty value.
  934. // This may be used to include null fields in Patch requests.
  935. NullFields []string `json:"-"`
  936. }
  937. func (s *Manifest) MarshalJSON() ([]byte, error) {
  938. type NoMethod Manifest
  939. raw := NoMethod(*s)
  940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  941. }
  942. // ManifestsListResponse: A response containing a partial list of
  943. // manifests and a page token used to build the next request if the
  944. // request has been truncated.
  945. type ManifestsListResponse struct {
  946. // Manifests: Output only. Manifests contained in this list response.
  947. Manifests []*Manifest `json:"manifests,omitempty"`
  948. // NextPageToken: Output only. A token used to continue a truncated list
  949. // request.
  950. NextPageToken string `json:"nextPageToken,omitempty"`
  951. // ServerResponse contains the HTTP response code and headers from the
  952. // server.
  953. googleapi.ServerResponse `json:"-"`
  954. // ForceSendFields is a list of field names (e.g. "Manifests") to
  955. // unconditionally include in API requests. By default, fields with
  956. // empty values are omitted from API requests. However, any non-pointer,
  957. // non-interface field appearing in ForceSendFields will be sent to the
  958. // server regardless of whether the field is empty or not. This may be
  959. // used to include empty fields in Patch requests.
  960. ForceSendFields []string `json:"-"`
  961. // NullFields is a list of field names (e.g. "Manifests") to include in
  962. // API requests with the JSON null value. By default, fields with empty
  963. // values are omitted from API requests. However, any field with an
  964. // empty value appearing in NullFields will be sent to the server as
  965. // null. It is an error if a field in this list has a non-empty value.
  966. // This may be used to include null fields in Patch requests.
  967. NullFields []string `json:"-"`
  968. }
  969. func (s *ManifestsListResponse) MarshalJSON() ([]byte, error) {
  970. type NoMethod ManifestsListResponse
  971. raw := NoMethod(*s)
  972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  973. }
  974. // Operation: An Operation resource, used to manage asynchronous API
  975. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  976. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  977. // (== resource_for beta.regionOperations ==) (== resource_for
  978. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  979. type Operation struct {
  980. // ClientOperationId: [Output Only] The value of `requestId` if you
  981. // provided it in the request. Not present otherwise.
  982. ClientOperationId string `json:"clientOperationId,omitempty"`
  983. // CreationTimestamp: [Deprecated] This field is deprecated.
  984. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  985. // Description: [Output Only] A textual description of the operation,
  986. // which is set when the operation is created.
  987. Description string `json:"description,omitempty"`
  988. // EndTime: [Output Only] The time that this operation was completed.
  989. // This value is in RFC3339 text format.
  990. EndTime string `json:"endTime,omitempty"`
  991. // Error: [Output Only] If errors are generated during processing of the
  992. // operation, this field will be populated.
  993. Error *OperationError `json:"error,omitempty"`
  994. // HttpErrorMessage: [Output Only] If the operation fails, this field
  995. // contains the HTTP error message that was returned, such as NOT FOUND.
  996. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  997. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  998. // contains the HTTP error status code that was returned. For example, a
  999. // 404 means the resource was not found.
  1000. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  1001. // Id: [Output Only] The unique identifier for the resource. This
  1002. // identifier is defined by the server.
  1003. Id uint64 `json:"id,omitempty,string"`
  1004. // InsertTime: [Output Only] The time that this operation was requested.
  1005. // This value is in RFC3339 text format.
  1006. InsertTime string `json:"insertTime,omitempty"`
  1007. // Kind: [Output Only] Type of the resource. Always compute#operation
  1008. // for Operation resources.
  1009. Kind string `json:"kind,omitempty"`
  1010. // Name: [Output Only] Name of the resource.
  1011. Name string `json:"name,omitempty"`
  1012. // OperationType: [Output Only] The type of operation, such as insert,
  1013. // update, or delete, and so on.
  1014. OperationType string `json:"operationType,omitempty"`
  1015. // Progress: [Output Only] An optional progress indicator that ranges
  1016. // from 0 to 100. There is no requirement that this be linear or support
  1017. // any granularity of operations. This should not be used to guess when
  1018. // the operation will be complete. This number should monotonically
  1019. // increase as the operation progresses.
  1020. Progress int64 `json:"progress,omitempty"`
  1021. // Region: [Output Only] The URL of the region where the operation
  1022. // resides. Only available when performing regional operations. You must
  1023. // specify this field as part of the HTTP request URL. It is not
  1024. // settable as a field in the request body.
  1025. Region string `json:"region,omitempty"`
  1026. // SelfLink: [Output Only] Server-defined URL for the resource.
  1027. SelfLink string `json:"selfLink,omitempty"`
  1028. // StartTime: [Output Only] The time that this operation was started by
  1029. // the server. This value is in RFC3339 text format.
  1030. StartTime string `json:"startTime,omitempty"`
  1031. // Status: [Output Only] The status of the operation, which can be one
  1032. // of the following: PENDING, RUNNING, or DONE.
  1033. Status string `json:"status,omitempty"`
  1034. // StatusMessage: [Output Only] An optional textual description of the
  1035. // current status of the operation.
  1036. StatusMessage string `json:"statusMessage,omitempty"`
  1037. // TargetId: [Output Only] The unique target ID, which identifies a
  1038. // specific incarnation of the target resource.
  1039. TargetId uint64 `json:"targetId,omitempty,string"`
  1040. // TargetLink: [Output Only] The URL of the resource that the operation
  1041. // modifies. For operations related to creating a snapshot, this points
  1042. // to the persistent disk that the snapshot was created from.
  1043. TargetLink string `json:"targetLink,omitempty"`
  1044. // User: [Output Only] User who requested the operation, for example:
  1045. // user@example.com.
  1046. User string `json:"user,omitempty"`
  1047. // Warnings: [Output Only] If warning messages are generated during
  1048. // processing of the operation, this field will be populated.
  1049. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  1050. // Zone: [Output Only] The URL of the zone where the operation resides.
  1051. // Only available when performing per-zone operations. You must specify
  1052. // this field as part of the HTTP request URL. It is not settable as a
  1053. // field in the request body.
  1054. Zone string `json:"zone,omitempty"`
  1055. // ServerResponse contains the HTTP response code and headers from the
  1056. // server.
  1057. googleapi.ServerResponse `json:"-"`
  1058. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  1059. // to unconditionally include in API requests. By default, fields with
  1060. // empty values are omitted from API requests. However, any non-pointer,
  1061. // non-interface field appearing in ForceSendFields will be sent to the
  1062. // server regardless of whether the field is empty or not. This may be
  1063. // used to include empty fields in Patch requests.
  1064. ForceSendFields []string `json:"-"`
  1065. // NullFields is a list of field names (e.g. "ClientOperationId") to
  1066. // include in API requests with the JSON null value. By default, fields
  1067. // with empty values are omitted from API requests. However, any field
  1068. // with an empty value appearing in NullFields will be sent to the
  1069. // server as null. It is an error if a field in this list has a
  1070. // non-empty value. This may be used to include null fields in Patch
  1071. // requests.
  1072. NullFields []string `json:"-"`
  1073. }
  1074. func (s *Operation) MarshalJSON() ([]byte, error) {
  1075. type NoMethod Operation
  1076. raw := NoMethod(*s)
  1077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1078. }
  1079. // OperationError: [Output Only] If errors are generated during
  1080. // processing of the operation, this field will be populated.
  1081. type OperationError struct {
  1082. // Errors: [Output Only] The array of errors encountered while
  1083. // processing this operation.
  1084. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  1085. // ForceSendFields is a list of field names (e.g. "Errors") to
  1086. // unconditionally include in API requests. By default, fields with
  1087. // empty values are omitted from API requests. However, any non-pointer,
  1088. // non-interface field appearing in ForceSendFields will be sent to the
  1089. // server regardless of whether the field is empty or not. This may be
  1090. // used to include empty fields in Patch requests.
  1091. ForceSendFields []string `json:"-"`
  1092. // NullFields is a list of field names (e.g. "Errors") to include in API
  1093. // requests with the JSON null value. By default, fields with empty
  1094. // values are omitted from API requests. However, any field with an
  1095. // empty value appearing in NullFields will be sent to the server as
  1096. // null. It is an error if a field in this list has a non-empty value.
  1097. // This may be used to include null fields in Patch requests.
  1098. NullFields []string `json:"-"`
  1099. }
  1100. func (s *OperationError) MarshalJSON() ([]byte, error) {
  1101. type NoMethod OperationError
  1102. raw := NoMethod(*s)
  1103. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1104. }
  1105. type OperationErrorErrors struct {
  1106. // Code: [Output Only] The error type identifier for this error.
  1107. Code string `json:"code,omitempty"`
  1108. // Location: [Output Only] Indicates the field in the request that
  1109. // caused the error. This property is optional.
  1110. Location string `json:"location,omitempty"`
  1111. // Message: [Output Only] An optional, human-readable error message.
  1112. Message string `json:"message,omitempty"`
  1113. // ForceSendFields is a list of field names (e.g. "Code") to
  1114. // unconditionally include in API requests. By default, fields with
  1115. // empty values are omitted from API requests. However, any non-pointer,
  1116. // non-interface field appearing in ForceSendFields will be sent to the
  1117. // server regardless of whether the field is empty or not. This may be
  1118. // used to include empty fields in Patch requests.
  1119. ForceSendFields []string `json:"-"`
  1120. // NullFields is a list of field names (e.g. "Code") to include in API
  1121. // requests with the JSON null value. By default, fields with empty
  1122. // values are omitted from API requests. However, any field with an
  1123. // empty value appearing in NullFields will be sent to the server as
  1124. // null. It is an error if a field in this list has a non-empty value.
  1125. // This may be used to include null fields in Patch requests.
  1126. NullFields []string `json:"-"`
  1127. }
  1128. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  1129. type NoMethod OperationErrorErrors
  1130. raw := NoMethod(*s)
  1131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1132. }
  1133. type OperationWarnings struct {
  1134. // Code: [Output Only] A warning code, if applicable. For example,
  1135. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1136. // the response.
  1137. Code string `json:"code,omitempty"`
  1138. // Data: [Output Only] Metadata about this warning in key: value format.
  1139. // For example:
  1140. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1141. Data []*OperationWarningsData `json:"data,omitempty"`
  1142. // Message: [Output Only] A human-readable description of the warning
  1143. // code.
  1144. Message string `json:"message,omitempty"`
  1145. // ForceSendFields is a list of field names (e.g. "Code") to
  1146. // unconditionally include in API requests. By default, fields with
  1147. // empty values are omitted from API requests. However, any non-pointer,
  1148. // non-interface field appearing in ForceSendFields will be sent to the
  1149. // server regardless of whether the field is empty or not. This may be
  1150. // used to include empty fields in Patch requests.
  1151. ForceSendFields []string `json:"-"`
  1152. // NullFields is a list of field names (e.g. "Code") to include in API
  1153. // requests with the JSON null value. By default, fields with empty
  1154. // values are omitted from API requests. However, any field with an
  1155. // empty value appearing in NullFields will be sent to the server as
  1156. // null. It is an error if a field in this list has a non-empty value.
  1157. // This may be used to include null fields in Patch requests.
  1158. NullFields []string `json:"-"`
  1159. }
  1160. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  1161. type NoMethod OperationWarnings
  1162. raw := NoMethod(*s)
  1163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1164. }
  1165. type OperationWarningsData struct {
  1166. // Key: [Output Only] A key that provides more detail on the warning
  1167. // being returned. For example, for warnings where there are no results
  1168. // in a list request for a particular zone, this key might be scope and
  1169. // the key value might be the zone name. Other examples might be a key
  1170. // indicating a deprecated resource and a suggested replacement, or a
  1171. // warning about invalid network settings (for example, if an instance
  1172. // attempts to perform IP forwarding but is not enabled for IP
  1173. // forwarding).
  1174. Key string `json:"key,omitempty"`
  1175. // Value: [Output Only] A warning data value corresponding to the key.
  1176. Value string `json:"value,omitempty"`
  1177. // ForceSendFields is a list of field names (e.g. "Key") to
  1178. // unconditionally include in API requests. By default, fields with
  1179. // empty values are omitted from API requests. However, any non-pointer,
  1180. // non-interface field appearing in ForceSendFields will be sent to the
  1181. // server regardless of whether the field is empty or not. This may be
  1182. // used to include empty fields in Patch requests.
  1183. ForceSendFields []string `json:"-"`
  1184. // NullFields is a list of field names (e.g. "Key") to include in API
  1185. // requests with the JSON null value. By default, fields with empty
  1186. // values are omitted from API requests. However, any field with an
  1187. // empty value appearing in NullFields will be sent to the server as
  1188. // null. It is an error if a field in this list has a non-empty value.
  1189. // This may be used to include null fields in Patch requests.
  1190. NullFields []string `json:"-"`
  1191. }
  1192. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  1193. type NoMethod OperationWarningsData
  1194. raw := NoMethod(*s)
  1195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1196. }
  1197. // OperationsListResponse: A response containing a partial list of
  1198. // operations and a page token used to build the next request if the
  1199. // request has been truncated.
  1200. type OperationsListResponse struct {
  1201. // NextPageToken: Output only. A token used to continue a truncated list
  1202. // request.
  1203. NextPageToken string `json:"nextPageToken,omitempty"`
  1204. // Operations: Output only. Operations contained in this list response.
  1205. Operations []*Operation `json:"operations,omitempty"`
  1206. // ServerResponse contains the HTTP response code and headers from the
  1207. // server.
  1208. googleapi.ServerResponse `json:"-"`
  1209. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1210. // unconditionally include in API requests. By default, fields with
  1211. // empty values are omitted from API requests. However, any non-pointer,
  1212. // non-interface field appearing in ForceSendFields will be sent to the
  1213. // server regardless of whether the field is empty or not. This may be
  1214. // used to include empty fields in Patch requests.
  1215. ForceSendFields []string `json:"-"`
  1216. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1217. // in API requests with the JSON null value. By default, fields with
  1218. // empty values are omitted from API requests. However, any field with
  1219. // an empty value appearing in NullFields will be sent to the server as
  1220. // null. It is an error if a field in this list has a non-empty value.
  1221. // This may be used to include null fields in Patch requests.
  1222. NullFields []string `json:"-"`
  1223. }
  1224. func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
  1225. type NoMethod OperationsListResponse
  1226. raw := NoMethod(*s)
  1227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1228. }
  1229. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  1230. // used to specify access control policies for Cloud Platform
  1231. // resources.
  1232. //
  1233. //
  1234. //
  1235. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  1236. // of `members` to a `role`, where the members can be user accounts,
  1237. // Google groups, Google domains, and service accounts. A `role` is a
  1238. // named list of permissions defined by IAM.
  1239. //
  1240. // **JSON Example**
  1241. //
  1242. // { "bindings": [ { "role": "roles/owner", "members": [
  1243. // "user:mike@example.com", "group:admins@example.com",
  1244. // "domain:google.com",
  1245. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  1246. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  1247. // }
  1248. //
  1249. // **YAML Example**
  1250. //
  1251. // bindings: - members: - user:mike@example.com -
  1252. // group:admins@example.com - domain:google.com -
  1253. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  1254. // roles/owner - members: - user:sean@example.com role:
  1255. // roles/viewer
  1256. //
  1257. //
  1258. //
  1259. // For a description of IAM and its features, see the [IAM developer's
  1260. // guide](https://cloud.google.com/iam/docs).
  1261. type Policy struct {
  1262. // AuditConfigs: Specifies cloud audit logging configuration for this
  1263. // policy.
  1264. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  1265. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  1266. // no members will result in an error.
  1267. Bindings []*Binding `json:"bindings,omitempty"`
  1268. // Etag: `etag` is used for optimistic concurrency control as a way to
  1269. // help prevent simultaneous updates of a policy from overwriting each
  1270. // other. It is strongly suggested that systems make use of the `etag`
  1271. // in the read-modify-write cycle to perform policy updates in order to
  1272. // avoid race conditions: An `etag` is returned in the response to
  1273. // `getIamPolicy`, and systems are expected to put that etag in the
  1274. // request to `setIamPolicy` to ensure that their change will be applied
  1275. // to the same version of the policy.
  1276. //
  1277. // If no `etag` is provided in the call to `setIamPolicy`, then the
  1278. // existing policy is overwritten blindly.
  1279. Etag string `json:"etag,omitempty"`
  1280. IamOwned bool `json:"iamOwned,omitempty"`
  1281. // Rules: If more than one rule is specified, the rules are applied in
  1282. // the following manner: - All matching LOG rules are always applied. -
  1283. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  1284. // will be applied if one or more matching rule requires logging. -
  1285. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  1286. // granted. Logging will be applied if one or more matching rule
  1287. // requires logging. - Otherwise, if no rule applies, permission is
  1288. // denied.
  1289. Rules []*Rule `json:"rules,omitempty"`
  1290. // Version: Deprecated.
  1291. Version int64 `json:"version,omitempty"`
  1292. // ServerResponse contains the HTTP response code and headers from the
  1293. // server.
  1294. googleapi.ServerResponse `json:"-"`
  1295. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  1296. // unconditionally include in API requests. By default, fields with
  1297. // empty values are omitted from API requests. However, any non-pointer,
  1298. // non-interface field appearing in ForceSendFields will be sent to the
  1299. // server regardless of whether the field is empty or not. This may be
  1300. // used to include empty fields in Patch requests.
  1301. ForceSendFields []string `json:"-"`
  1302. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  1303. // in API requests with the JSON null value. By default, fields with
  1304. // empty values are omitted from API requests. However, any field with
  1305. // an empty value appearing in NullFields will be sent to the server as
  1306. // null. It is an error if a field in this list has a non-empty value.
  1307. // This may be used to include null fields in Patch requests.
  1308. NullFields []string `json:"-"`
  1309. }
  1310. func (s *Policy) MarshalJSON() ([]byte, error) {
  1311. type NoMethod Policy
  1312. raw := NoMethod(*s)
  1313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1314. }
  1315. type Resource struct {
  1316. // AccessControl: The Access Control Policy set on this resource.
  1317. AccessControl *ResourceAccessControl `json:"accessControl,omitempty"`
  1318. // FinalProperties: Output only. The evaluated properties of the
  1319. // resource with references expanded. Returned as serialized YAML.
  1320. FinalProperties string `json:"finalProperties,omitempty"`
  1321. Id uint64 `json:"id,omitempty,string"`
  1322. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  1323. InsertTime string `json:"insertTime,omitempty"`
  1324. // Manifest: Output only. URL of the manifest representing the current
  1325. // configuration of this resource.
  1326. Manifest string `json:"manifest,omitempty"`
  1327. // Name: Output only. The name of the resource as it appears in the YAML
  1328. // config.
  1329. Name string `json:"name,omitempty"`
  1330. // Properties: Output only. The current properties of the resource
  1331. // before any references have been filled in. Returned as serialized
  1332. // YAML.
  1333. Properties string `json:"properties,omitempty"`
  1334. // Type: Output only. The type of the resource, for example
  1335. // compute.v1.instance, or cloudfunctions.v1beta1.function.
  1336. Type string `json:"type,omitempty"`
  1337. // Update: Output only. If Deployment Manager is currently updating or
  1338. // previewing an update to this resource, the updated configuration
  1339. // appears here.
  1340. Update *ResourceUpdate `json:"update,omitempty"`
  1341. // UpdateTime: Output only. Update timestamp in RFC3339 text format.
  1342. UpdateTime string `json:"updateTime,omitempty"`
  1343. // Url: Output only. The URL of the actual resource.
  1344. Url string `json:"url,omitempty"`
  1345. // Warnings: Output only. If warning messages are generated during
  1346. // processing of this resource, this field will be populated.
  1347. Warnings []*ResourceWarnings `json:"warnings,omitempty"`
  1348. // ServerResponse contains the HTTP response code and headers from the
  1349. // server.
  1350. googleapi.ServerResponse `json:"-"`
  1351. // ForceSendFields is a list of field names (e.g. "AccessControl") to
  1352. // unconditionally include in API requests. By default, fields with
  1353. // empty values are omitted from API requests. However, any non-pointer,
  1354. // non-interface field appearing in ForceSendFields will be sent to the
  1355. // server regardless of whether the field is empty or not. This may be
  1356. // used to include empty fields in Patch requests.
  1357. ForceSendFields []string `json:"-"`
  1358. // NullFields is a list of field names (e.g. "AccessControl") to include
  1359. // in API requests with the JSON null value. By default, fields with
  1360. // empty values are omitted from API requests. However, any field with
  1361. // an empty value appearing in NullFields will be sent to the server as
  1362. // null. It is an error if a field in this list has a non-empty value.
  1363. // This may be used to include null fields in Patch requests.
  1364. NullFields []string `json:"-"`
  1365. }
  1366. func (s *Resource) MarshalJSON() ([]byte, error) {
  1367. type NoMethod Resource
  1368. raw := NoMethod(*s)
  1369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1370. }
  1371. type ResourceWarnings struct {
  1372. // Code: [Output Only] A warning code, if applicable. For example,
  1373. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1374. // the response.
  1375. Code string `json:"code,omitempty"`
  1376. // Data: [Output Only] Metadata about this warning in key: value format.
  1377. // For example:
  1378. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1379. Data []*ResourceWarningsData `json:"data,omitempty"`
  1380. // Message: [Output Only] A human-readable description of the warning
  1381. // code.
  1382. Message string `json:"message,omitempty"`
  1383. // ForceSendFields is a list of field names (e.g. "Code") to
  1384. // unconditionally include in API requests. By default, fields with
  1385. // empty values are omitted from API requests. However, any non-pointer,
  1386. // non-interface field appearing in ForceSendFields will be sent to the
  1387. // server regardless of whether the field is empty or not. This may be
  1388. // used to include empty fields in Patch requests.
  1389. ForceSendFields []string `json:"-"`
  1390. // NullFields is a list of field names (e.g. "Code") to include in API
  1391. // requests with the JSON null value. By default, fields with empty
  1392. // values are omitted from API requests. However, any field with an
  1393. // empty value appearing in NullFields will be sent to the server as
  1394. // null. It is an error if a field in this list has a non-empty value.
  1395. // This may be used to include null fields in Patch requests.
  1396. NullFields []string `json:"-"`
  1397. }
  1398. func (s *ResourceWarnings) MarshalJSON() ([]byte, error) {
  1399. type NoMethod ResourceWarnings
  1400. raw := NoMethod(*s)
  1401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1402. }
  1403. type ResourceWarningsData struct {
  1404. // Key: [Output Only] A key that provides more detail on the warning
  1405. // being returned. For example, for warnings where there are no results
  1406. // in a list request for a particular zone, this key might be scope and
  1407. // the key value might be the zone name. Other examples might be a key
  1408. // indicating a deprecated resource and a suggested replacement, or a
  1409. // warning about invalid network settings (for example, if an instance
  1410. // attempts to perform IP forwarding but is not enabled for IP
  1411. // forwarding).
  1412. Key string `json:"key,omitempty"`
  1413. // Value: [Output Only] A warning data value corresponding to the key.
  1414. Value string `json:"value,omitempty"`
  1415. // ForceSendFields is a list of field names (e.g. "Key") to
  1416. // unconditionally include in API requests. By default, fields with
  1417. // empty values are omitted from API requests. However, any non-pointer,
  1418. // non-interface field appearing in ForceSendFields will be sent to the
  1419. // server regardless of whether the field is empty or not. This may be
  1420. // used to include empty fields in Patch requests.
  1421. ForceSendFields []string `json:"-"`
  1422. // NullFields is a list of field names (e.g. "Key") to include in API
  1423. // requests with the JSON null value. By default, fields with empty
  1424. // values are omitted from API requests. However, any field with an
  1425. // empty value appearing in NullFields will be sent to the server as
  1426. // null. It is an error if a field in this list has a non-empty value.
  1427. // This may be used to include null fields in Patch requests.
  1428. NullFields []string `json:"-"`
  1429. }
  1430. func (s *ResourceWarningsData) MarshalJSON() ([]byte, error) {
  1431. type NoMethod ResourceWarningsData
  1432. raw := NoMethod(*s)
  1433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1434. }
  1435. // ResourceAccessControl: The access controls set on the resource.
  1436. type ResourceAccessControl struct {
  1437. // GcpIamPolicy: The GCP IAM Policy to set on the resource.
  1438. GcpIamPolicy string `json:"gcpIamPolicy,omitempty"`
  1439. // ForceSendFields is a list of field names (e.g. "GcpIamPolicy") to
  1440. // unconditionally include in API requests. By default, fields with
  1441. // empty values are omitted from API requests. However, any non-pointer,
  1442. // non-interface field appearing in ForceSendFields will be sent to the
  1443. // server regardless of whether the field is empty or not. This may be
  1444. // used to include empty fields in Patch requests.
  1445. ForceSendFields []string `json:"-"`
  1446. // NullFields is a list of field names (e.g. "GcpIamPolicy") to include
  1447. // in API requests with the JSON null value. By default, fields with
  1448. // empty values are omitted from API requests. However, any field with
  1449. // an empty value appearing in NullFields will be sent to the server as
  1450. // null. It is an error if a field in this list has a non-empty value.
  1451. // This may be used to include null fields in Patch requests.
  1452. NullFields []string `json:"-"`
  1453. }
  1454. func (s *ResourceAccessControl) MarshalJSON() ([]byte, error) {
  1455. type NoMethod ResourceAccessControl
  1456. raw := NoMethod(*s)
  1457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1458. }
  1459. type ResourceUpdate struct {
  1460. // AccessControl: The Access Control Policy to set on this resource
  1461. // after updating the resource itself.
  1462. AccessControl *ResourceAccessControl `json:"accessControl,omitempty"`
  1463. // Error: Output only. If errors are generated during update of the
  1464. // resource, this field will be populated.
  1465. Error *ResourceUpdateError `json:"error,omitempty"`
  1466. // FinalProperties: Output only. The expanded properties of the resource
  1467. // with reference values expanded. Returned as serialized YAML.
  1468. FinalProperties string `json:"finalProperties,omitempty"`
  1469. // Intent: Output only. The intent of the resource: PREVIEW, UPDATE, or
  1470. // CANCEL.
  1471. Intent string `json:"intent,omitempty"`
  1472. // Manifest: Output only. URL of the manifest representing the update
  1473. // configuration of this resource.
  1474. Manifest string `json:"manifest,omitempty"`
  1475. // Properties: Output only. The set of updated properties for this
  1476. // resource, before references are expanded. Returned as serialized
  1477. // YAML.
  1478. Properties string `json:"properties,omitempty"`
  1479. // State: Output only. The state of the resource.
  1480. State string `json:"state,omitempty"`
  1481. // Warnings: Output only. If warning messages are generated during
  1482. // processing of this resource, this field will be populated.
  1483. Warnings []*ResourceUpdateWarnings `json:"warnings,omitempty"`
  1484. // ForceSendFields is a list of field names (e.g. "AccessControl") to
  1485. // unconditionally include in API requests. By default, fields with
  1486. // empty values are omitted from API requests. However, any non-pointer,
  1487. // non-interface field appearing in ForceSendFields will be sent to the
  1488. // server regardless of whether the field is empty or not. This may be
  1489. // used to include empty fields in Patch requests.
  1490. ForceSendFields []string `json:"-"`
  1491. // NullFields is a list of field names (e.g. "AccessControl") to include
  1492. // in API requests with the JSON null value. By default, fields with
  1493. // empty values are omitted from API requests. However, any field with
  1494. // an empty value appearing in NullFields will be sent to the server as
  1495. // null. It is an error if a field in this list has a non-empty value.
  1496. // This may be used to include null fields in Patch requests.
  1497. NullFields []string `json:"-"`
  1498. }
  1499. func (s *ResourceUpdate) MarshalJSON() ([]byte, error) {
  1500. type NoMethod ResourceUpdate
  1501. raw := NoMethod(*s)
  1502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1503. }
  1504. // ResourceUpdateError: Output only. If errors are generated during
  1505. // update of the resource, this field will be populated.
  1506. type ResourceUpdateError struct {
  1507. // Errors: [Output Only] The array of errors encountered while
  1508. // processing this operation.
  1509. Errors []*ResourceUpdateErrorErrors `json:"errors,omitempty"`
  1510. // ForceSendFields is a list of field names (e.g. "Errors") to
  1511. // unconditionally include in API requests. By default, fields with
  1512. // empty values are omitted from API requests. However, any non-pointer,
  1513. // non-interface field appearing in ForceSendFields will be sent to the
  1514. // server regardless of whether the field is empty or not. This may be
  1515. // used to include empty fields in Patch requests.
  1516. ForceSendFields []string `json:"-"`
  1517. // NullFields is a list of field names (e.g. "Errors") to include in API
  1518. // requests with the JSON null value. By default, fields with empty
  1519. // values are omitted from API requests. However, any field with an
  1520. // empty value appearing in NullFields will be sent to the server as
  1521. // null. It is an error if a field in this list has a non-empty value.
  1522. // This may be used to include null fields in Patch requests.
  1523. NullFields []string `json:"-"`
  1524. }
  1525. func (s *ResourceUpdateError) MarshalJSON() ([]byte, error) {
  1526. type NoMethod ResourceUpdateError
  1527. raw := NoMethod(*s)
  1528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1529. }
  1530. type ResourceUpdateErrorErrors struct {
  1531. // Code: [Output Only] The error type identifier for this error.
  1532. Code string `json:"code,omitempty"`
  1533. // Location: [Output Only] Indicates the field in the request that
  1534. // caused the error. This property is optional.
  1535. Location string `json:"location,omitempty"`
  1536. // Message: [Output Only] An optional, human-readable error message.
  1537. Message string `json:"message,omitempty"`
  1538. // ForceSendFields is a list of field names (e.g. "Code") to
  1539. // unconditionally include in API requests. By default, fields with
  1540. // empty values are omitted from API requests. However, any non-pointer,
  1541. // non-interface field appearing in ForceSendFields will be sent to the
  1542. // server regardless of whether the field is empty or not. This may be
  1543. // used to include empty fields in Patch requests.
  1544. ForceSendFields []string `json:"-"`
  1545. // NullFields is a list of field names (e.g. "Code") to include in API
  1546. // requests with the JSON null value. By default, fields with empty
  1547. // values are omitted from API requests. However, any field with an
  1548. // empty value appearing in NullFields will be sent to the server as
  1549. // null. It is an error if a field in this list has a non-empty value.
  1550. // This may be used to include null fields in Patch requests.
  1551. NullFields []string `json:"-"`
  1552. }
  1553. func (s *ResourceUpdateErrorErrors) MarshalJSON() ([]byte, error) {
  1554. type NoMethod ResourceUpdateErrorErrors
  1555. raw := NoMethod(*s)
  1556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1557. }
  1558. type ResourceUpdateWarnings struct {
  1559. // Code: [Output Only] A warning code, if applicable. For example,
  1560. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1561. // the response.
  1562. Code string `json:"code,omitempty"`
  1563. // Data: [Output Only] Metadata about this warning in key: value format.
  1564. // For example:
  1565. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1566. Data []*ResourceUpdateWarningsData `json:"data,omitempty"`
  1567. // Message: [Output Only] A human-readable description of the warning
  1568. // code.
  1569. Message string `json:"message,omitempty"`
  1570. // ForceSendFields is a list of field names (e.g. "Code") to
  1571. // unconditionally include in API requests. By default, fields with
  1572. // empty values are omitted from API requests. However, any non-pointer,
  1573. // non-interface field appearing in ForceSendFields will be sent to the
  1574. // server regardless of whether the field is empty or not. This may be
  1575. // used to include empty fields in Patch requests.
  1576. ForceSendFields []string `json:"-"`
  1577. // NullFields is a list of field names (e.g. "Code") to include in API
  1578. // requests with the JSON null value. By default, fields with empty
  1579. // values are omitted from API requests. However, any field with an
  1580. // empty value appearing in NullFields will be sent to the server as
  1581. // null. It is an error if a field in this list has a non-empty value.
  1582. // This may be used to include null fields in Patch requests.
  1583. NullFields []string `json:"-"`
  1584. }
  1585. func (s *ResourceUpdateWarnings) MarshalJSON() ([]byte, error) {
  1586. type NoMethod ResourceUpdateWarnings
  1587. raw := NoMethod(*s)
  1588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1589. }
  1590. type ResourceUpdateWarningsData struct {
  1591. // Key: [Output Only] A key that provides more detail on the warning
  1592. // being returned. For example, for warnings where there are no results
  1593. // in a list request for a particular zone, this key might be scope and
  1594. // the key value might be the zone name. Other examples might be a key
  1595. // indicating a deprecated resource and a suggested replacement, or a
  1596. // warning about invalid network settings (for example, if an instance
  1597. // attempts to perform IP forwarding but is not enabled for IP
  1598. // forwarding).
  1599. Key string `json:"key,omitempty"`
  1600. // Value: [Output Only] A warning data value corresponding to the key.
  1601. Value string `json:"value,omitempty"`
  1602. // ForceSendFields is a list of field names (e.g. "Key") to
  1603. // unconditionally include in API requests. By default, fields with
  1604. // empty values are omitted from API requests. However, any non-pointer,
  1605. // non-interface field appearing in ForceSendFields will be sent to the
  1606. // server regardless of whether the field is empty or not. This may be
  1607. // used to include empty fields in Patch requests.
  1608. ForceSendFields []string `json:"-"`
  1609. // NullFields is a list of field names (e.g. "Key") to include in API
  1610. // requests with the JSON null value. By default, fields with empty
  1611. // values are omitted from API requests. However, any field with an
  1612. // empty value appearing in NullFields will be sent to the server as
  1613. // null. It is an error if a field in this list has a non-empty value.
  1614. // This may be used to include null fields in Patch requests.
  1615. NullFields []string `json:"-"`
  1616. }
  1617. func (s *ResourceUpdateWarningsData) MarshalJSON() ([]byte, error) {
  1618. type NoMethod ResourceUpdateWarningsData
  1619. raw := NoMethod(*s)
  1620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1621. }
  1622. // ResourcesListResponse: A response containing a partial list of
  1623. // resources and a page token used to build the next request if the
  1624. // request has been truncated.
  1625. type ResourcesListResponse struct {
  1626. // NextPageToken: A token used to continue a truncated list request.
  1627. NextPageToken string `json:"nextPageToken,omitempty"`
  1628. // Resources: Resources contained in this list response.
  1629. Resources []*Resource `json:"resources,omitempty"`
  1630. // ServerResponse contains the HTTP response code and headers from the
  1631. // server.
  1632. googleapi.ServerResponse `json:"-"`
  1633. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1634. // unconditionally include in API requests. By default, fields with
  1635. // empty values are omitted from API requests. However, any non-pointer,
  1636. // non-interface field appearing in ForceSendFields will be sent to the
  1637. // server regardless of whether the field is empty or not. This may be
  1638. // used to include empty fields in Patch requests.
  1639. ForceSendFields []string `json:"-"`
  1640. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1641. // in API requests with the JSON null value. By default, fields with
  1642. // empty values are omitted from API requests. However, any field with
  1643. // an empty value appearing in NullFields will be sent to the server as
  1644. // null. It is an error if a field in this list has a non-empty value.
  1645. // This may be used to include null fields in Patch requests.
  1646. NullFields []string `json:"-"`
  1647. }
  1648. func (s *ResourcesListResponse) MarshalJSON() ([]byte, error) {
  1649. type NoMethod ResourcesListResponse
  1650. raw := NoMethod(*s)
  1651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1652. }
  1653. // Rule: A rule to be applied in a Policy.
  1654. type Rule struct {
  1655. // Action: Required
  1656. Action string `json:"action,omitempty"`
  1657. // Conditions: Additional restrictions that must be met. All conditions
  1658. // must pass for the rule to match.
  1659. Conditions []*Condition `json:"conditions,omitempty"`
  1660. // Description: Human-readable description of the rule.
  1661. Description string `json:"description,omitempty"`
  1662. // Ins: If one or more 'in' clauses are specified, the rule matches if
  1663. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  1664. Ins []string `json:"ins,omitempty"`
  1665. // LogConfigs: The config returned to callers of
  1666. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  1667. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  1668. // NotIns: If one or more 'not_in' clauses are specified, the rule
  1669. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  1670. // entries.
  1671. NotIns []string `json:"notIns,omitempty"`
  1672. // Permissions: A permission is a string of form '..' (e.g.,
  1673. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  1674. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  1675. Permissions []string `json:"permissions,omitempty"`
  1676. // ForceSendFields is a list of field names (e.g. "Action") to
  1677. // unconditionally include in API requests. By default, fields with
  1678. // empty values are omitted from API requests. However, any non-pointer,
  1679. // non-interface field appearing in ForceSendFields will be sent to the
  1680. // server regardless of whether the field is empty or not. This may be
  1681. // used to include empty fields in Patch requests.
  1682. ForceSendFields []string `json:"-"`
  1683. // NullFields is a list of field names (e.g. "Action") to include in API
  1684. // requests with the JSON null value. By default, fields with empty
  1685. // values are omitted from API requests. However, any field with an
  1686. // empty value appearing in NullFields will be sent to the server as
  1687. // null. It is an error if a field in this list has a non-empty value.
  1688. // This may be used to include null fields in Patch requests.
  1689. NullFields []string `json:"-"`
  1690. }
  1691. func (s *Rule) MarshalJSON() ([]byte, error) {
  1692. type NoMethod Rule
  1693. raw := NoMethod(*s)
  1694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1695. }
  1696. type TargetConfiguration struct {
  1697. // Config: The configuration to use for this deployment.
  1698. Config *ConfigFile `json:"config,omitempty"`
  1699. // Imports: Specifies any files to import for this configuration. This
  1700. // can be used to import templates or other files. For example, you
  1701. // might import a text file in order to use the file in a template.
  1702. Imports []*ImportFile `json:"imports,omitempty"`
  1703. // ForceSendFields is a list of field names (e.g. "Config") to
  1704. // unconditionally include in API requests. By default, fields with
  1705. // empty values are omitted from API requests. However, any non-pointer,
  1706. // non-interface field appearing in ForceSendFields will be sent to the
  1707. // server regardless of whether the field is empty or not. This may be
  1708. // used to include empty fields in Patch requests.
  1709. ForceSendFields []string `json:"-"`
  1710. // NullFields is a list of field names (e.g. "Config") to include in API
  1711. // requests with the JSON null value. By default, fields with empty
  1712. // values are omitted from API requests. However, any field with an
  1713. // empty value appearing in NullFields will be sent to the server as
  1714. // null. It is an error if a field in this list has a non-empty value.
  1715. // This may be used to include null fields in Patch requests.
  1716. NullFields []string `json:"-"`
  1717. }
  1718. func (s *TargetConfiguration) MarshalJSON() ([]byte, error) {
  1719. type NoMethod TargetConfiguration
  1720. raw := NoMethod(*s)
  1721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1722. }
  1723. type TestPermissionsRequest struct {
  1724. // Permissions: The set of permissions to check for the 'resource'.
  1725. // Permissions with wildcards (such as '*' or 'storage.*') are not
  1726. // allowed.
  1727. Permissions []string `json:"permissions,omitempty"`
  1728. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1729. // unconditionally include in API requests. By default, fields with
  1730. // empty values are omitted from API requests. However, any non-pointer,
  1731. // non-interface field appearing in ForceSendFields will be sent to the
  1732. // server regardless of whether the field is empty or not. This may be
  1733. // used to include empty fields in Patch requests.
  1734. ForceSendFields []string `json:"-"`
  1735. // NullFields is a list of field names (e.g. "Permissions") to include
  1736. // in API requests with the JSON null value. By default, fields with
  1737. // empty values are omitted from API requests. However, any field with
  1738. // an empty value appearing in NullFields will be sent to the server as
  1739. // null. It is an error if a field in this list has a non-empty value.
  1740. // This may be used to include null fields in Patch requests.
  1741. NullFields []string `json:"-"`
  1742. }
  1743. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  1744. type NoMethod TestPermissionsRequest
  1745. raw := NoMethod(*s)
  1746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1747. }
  1748. type TestPermissionsResponse struct {
  1749. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  1750. // the caller is allowed.
  1751. Permissions []string `json:"permissions,omitempty"`
  1752. // ServerResponse contains the HTTP response code and headers from the
  1753. // server.
  1754. googleapi.ServerResponse `json:"-"`
  1755. // ForceSendFields is a list of field names (e.g. "Permissions") to
  1756. // unconditionally include in API requests. By default, fields with
  1757. // empty values are omitted from API requests. However, any non-pointer,
  1758. // non-interface field appearing in ForceSendFields will be sent to the
  1759. // server regardless of whether the field is empty or not. This may be
  1760. // used to include empty fields in Patch requests.
  1761. ForceSendFields []string `json:"-"`
  1762. // NullFields is a list of field names (e.g. "Permissions") to include
  1763. // in API requests with the JSON null value. By default, fields with
  1764. // empty values are omitted from API requests. However, any field with
  1765. // an empty value appearing in NullFields will be sent to the server as
  1766. // null. It is an error if a field in this list has a non-empty value.
  1767. // This may be used to include null fields in Patch requests.
  1768. NullFields []string `json:"-"`
  1769. }
  1770. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  1771. type NoMethod TestPermissionsResponse
  1772. raw := NoMethod(*s)
  1773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1774. }
  1775. // Type: A resource type supported by Deployment Manager.
  1776. type Type struct {
  1777. Id uint64 `json:"id,omitempty,string"`
  1778. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  1779. InsertTime string `json:"insertTime,omitempty"`
  1780. // Name: Name of the type.
  1781. Name string `json:"name,omitempty"`
  1782. // Operation: Output only. The Operation that most recently ran, or is
  1783. // currently running, on this type.
  1784. Operation *Operation `json:"operation,omitempty"`
  1785. // SelfLink: Output only. Server defined URL for the resource.
  1786. SelfLink string `json:"selfLink,omitempty"`
  1787. // ForceSendFields is a list of field names (e.g. "Id") to
  1788. // unconditionally include in API requests. By default, fields with
  1789. // empty values are omitted from API requests. However, any non-pointer,
  1790. // non-interface field appearing in ForceSendFields will be sent to the
  1791. // server regardless of whether the field is empty or not. This may be
  1792. // used to include empty fields in Patch requests.
  1793. ForceSendFields []string `json:"-"`
  1794. // NullFields is a list of field names (e.g. "Id") to include in API
  1795. // requests with the JSON null value. By default, fields with empty
  1796. // values are omitted from API requests. However, any field with an
  1797. // empty value appearing in NullFields will be sent to the server as
  1798. // null. It is an error if a field in this list has a non-empty value.
  1799. // This may be used to include null fields in Patch requests.
  1800. NullFields []string `json:"-"`
  1801. }
  1802. func (s *Type) MarshalJSON() ([]byte, error) {
  1803. type NoMethod Type
  1804. raw := NoMethod(*s)
  1805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1806. }
  1807. // TypesListResponse: A response that returns all Types supported by
  1808. // Deployment Manager
  1809. type TypesListResponse struct {
  1810. // NextPageToken: A token used to continue a truncated list request.
  1811. NextPageToken string `json:"nextPageToken,omitempty"`
  1812. // Types: Output only. A list of resource types supported by Deployment
  1813. // Manager.
  1814. Types []*Type `json:"types,omitempty"`
  1815. // ServerResponse contains the HTTP response code and headers from the
  1816. // server.
  1817. googleapi.ServerResponse `json:"-"`
  1818. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1819. // unconditionally include in API requests. By default, fields with
  1820. // empty values are omitted from API requests. However, any non-pointer,
  1821. // non-interface field appearing in ForceSendFields will be sent to the
  1822. // server regardless of whether the field is empty or not. This may be
  1823. // used to include empty fields in Patch requests.
  1824. ForceSendFields []string `json:"-"`
  1825. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1826. // in API requests with the JSON null value. By default, fields with
  1827. // empty values are omitted from API requests. However, any field with
  1828. // an empty value appearing in NullFields will be sent to the server as
  1829. // null. It is an error if a field in this list has a non-empty value.
  1830. // This may be used to include null fields in Patch requests.
  1831. NullFields []string `json:"-"`
  1832. }
  1833. func (s *TypesListResponse) MarshalJSON() ([]byte, error) {
  1834. type NoMethod TypesListResponse
  1835. raw := NoMethod(*s)
  1836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1837. }
  1838. // method id "deploymentmanager.deployments.cancelPreview":
  1839. type DeploymentsCancelPreviewCall struct {
  1840. s *Service
  1841. project string
  1842. deployment string
  1843. deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest
  1844. urlParams_ gensupport.URLParams
  1845. ctx_ context.Context
  1846. header_ http.Header
  1847. }
  1848. // CancelPreview: Cancels and removes the preview currently associated
  1849. // with the deployment.
  1850. func (r *DeploymentsService) CancelPreview(project string, deployment string, deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest) *DeploymentsCancelPreviewCall {
  1851. c := &DeploymentsCancelPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1852. c.project = project
  1853. c.deployment = deployment
  1854. c.deploymentscancelpreviewrequest = deploymentscancelpreviewrequest
  1855. return c
  1856. }
  1857. // Fields allows partial responses to be retrieved. See
  1858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1859. // for more information.
  1860. func (c *DeploymentsCancelPreviewCall) Fields(s ...googleapi.Field) *DeploymentsCancelPreviewCall {
  1861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1862. return c
  1863. }
  1864. // Context sets the context to be used in this call's Do method. Any
  1865. // pending HTTP request will be aborted if the provided context is
  1866. // canceled.
  1867. func (c *DeploymentsCancelPreviewCall) Context(ctx context.Context) *DeploymentsCancelPreviewCall {
  1868. c.ctx_ = ctx
  1869. return c
  1870. }
  1871. // Header returns an http.Header that can be modified by the caller to
  1872. // add HTTP headers to the request.
  1873. func (c *DeploymentsCancelPreviewCall) Header() http.Header {
  1874. if c.header_ == nil {
  1875. c.header_ = make(http.Header)
  1876. }
  1877. return c.header_
  1878. }
  1879. func (c *DeploymentsCancelPreviewCall) doRequest(alt string) (*http.Response, error) {
  1880. reqHeaders := make(http.Header)
  1881. for k, v := range c.header_ {
  1882. reqHeaders[k] = v
  1883. }
  1884. reqHeaders.Set("User-Agent", c.s.userAgent())
  1885. var body io.Reader = nil
  1886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentscancelpreviewrequest)
  1887. if err != nil {
  1888. return nil, err
  1889. }
  1890. reqHeaders.Set("Content-Type", "application/json")
  1891. c.urlParams_.Set("alt", alt)
  1892. c.urlParams_.Set("prettyPrint", "false")
  1893. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/cancelPreview")
  1894. urls += "?" + c.urlParams_.Encode()
  1895. req, err := http.NewRequest("POST", urls, body)
  1896. if err != nil {
  1897. return nil, err
  1898. }
  1899. req.Header = reqHeaders
  1900. googleapi.Expand(req.URL, map[string]string{
  1901. "project": c.project,
  1902. "deployment": c.deployment,
  1903. })
  1904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1905. }
  1906. // Do executes the "deploymentmanager.deployments.cancelPreview" call.
  1907. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  1908. // status code is an error. Response headers are in either
  1909. // *Operation.ServerResponse.Header or (if a response was returned at
  1910. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1911. // to check whether the returned error was because
  1912. // http.StatusNotModified was returned.
  1913. func (c *DeploymentsCancelPreviewCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  1914. gensupport.SetOptions(c.urlParams_, opts...)
  1915. res, err := c.doRequest("json")
  1916. if res != nil && res.StatusCode == http.StatusNotModified {
  1917. if res.Body != nil {
  1918. res.Body.Close()
  1919. }
  1920. return nil, &googleapi.Error{
  1921. Code: res.StatusCode,
  1922. Header: res.Header,
  1923. }
  1924. }
  1925. if err != nil {
  1926. return nil, err
  1927. }
  1928. defer googleapi.CloseBody(res)
  1929. if err := googleapi.CheckResponse(res); err != nil {
  1930. return nil, err
  1931. }
  1932. ret := &Operation{
  1933. ServerResponse: googleapi.ServerResponse{
  1934. Header: res.Header,
  1935. HTTPStatusCode: res.StatusCode,
  1936. },
  1937. }
  1938. target := &ret
  1939. if err := gensupport.DecodeResponse(target, res); err != nil {
  1940. return nil, err
  1941. }
  1942. return ret, nil
  1943. // {
  1944. // "description": "Cancels and removes the preview currently associated with the deployment.",
  1945. // "httpMethod": "POST",
  1946. // "id": "deploymentmanager.deployments.cancelPreview",
  1947. // "parameterOrder": [
  1948. // "project",
  1949. // "deployment"
  1950. // ],
  1951. // "parameters": {
  1952. // "deployment": {
  1953. // "description": "The name of the deployment for this request.",
  1954. // "location": "path",
  1955. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  1956. // "required": true,
  1957. // "type": "string"
  1958. // },
  1959. // "project": {
  1960. // "description": "The project ID for this request.",
  1961. // "location": "path",
  1962. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  1963. // "required": true,
  1964. // "type": "string"
  1965. // }
  1966. // },
  1967. // "path": "{project}/global/deployments/{deployment}/cancelPreview",
  1968. // "request": {
  1969. // "$ref": "DeploymentsCancelPreviewRequest"
  1970. // },
  1971. // "response": {
  1972. // "$ref": "Operation"
  1973. // },
  1974. // "scopes": [
  1975. // "https://www.googleapis.com/auth/cloud-platform",
  1976. // "https://www.googleapis.com/auth/ndev.cloudman"
  1977. // ]
  1978. // }
  1979. }
  1980. // method id "deploymentmanager.deployments.delete":
  1981. type DeploymentsDeleteCall struct {
  1982. s *Service
  1983. project string
  1984. deployment string
  1985. urlParams_ gensupport.URLParams
  1986. ctx_ context.Context
  1987. header_ http.Header
  1988. }
  1989. // Delete: Deletes a deployment and all of the resources in the
  1990. // deployment.
  1991. func (r *DeploymentsService) Delete(project string, deployment string) *DeploymentsDeleteCall {
  1992. c := &DeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1993. c.project = project
  1994. c.deployment = deployment
  1995. return c
  1996. }
  1997. // DeletePolicy sets the optional parameter "deletePolicy": Sets the
  1998. // policy to use for deleting resources.
  1999. //
  2000. // Possible values:
  2001. // "ABANDON"
  2002. // "DELETE" (default)
  2003. func (c *DeploymentsDeleteCall) DeletePolicy(deletePolicy string) *DeploymentsDeleteCall {
  2004. c.urlParams_.Set("deletePolicy", deletePolicy)
  2005. return c
  2006. }
  2007. // Fields allows partial responses to be retrieved. See
  2008. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2009. // for more information.
  2010. func (c *DeploymentsDeleteCall) Fields(s ...googleapi.Field) *DeploymentsDeleteCall {
  2011. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2012. return c
  2013. }
  2014. // Context sets the context to be used in this call's Do method. Any
  2015. // pending HTTP request will be aborted if the provided context is
  2016. // canceled.
  2017. func (c *DeploymentsDeleteCall) Context(ctx context.Context) *DeploymentsDeleteCall {
  2018. c.ctx_ = ctx
  2019. return c
  2020. }
  2021. // Header returns an http.Header that can be modified by the caller to
  2022. // add HTTP headers to the request.
  2023. func (c *DeploymentsDeleteCall) Header() http.Header {
  2024. if c.header_ == nil {
  2025. c.header_ = make(http.Header)
  2026. }
  2027. return c.header_
  2028. }
  2029. func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2030. reqHeaders := make(http.Header)
  2031. for k, v := range c.header_ {
  2032. reqHeaders[k] = v
  2033. }
  2034. reqHeaders.Set("User-Agent", c.s.userAgent())
  2035. var body io.Reader = nil
  2036. c.urlParams_.Set("alt", alt)
  2037. c.urlParams_.Set("prettyPrint", "false")
  2038. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}")
  2039. urls += "?" + c.urlParams_.Encode()
  2040. req, err := http.NewRequest("DELETE", urls, body)
  2041. if err != nil {
  2042. return nil, err
  2043. }
  2044. req.Header = reqHeaders
  2045. googleapi.Expand(req.URL, map[string]string{
  2046. "project": c.project,
  2047. "deployment": c.deployment,
  2048. })
  2049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2050. }
  2051. // Do executes the "deploymentmanager.deployments.delete" call.
  2052. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2053. // status code is an error. Response headers are in either
  2054. // *Operation.ServerResponse.Header or (if a response was returned at
  2055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2056. // to check whether the returned error was because
  2057. // http.StatusNotModified was returned.
  2058. func (c *DeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2059. gensupport.SetOptions(c.urlParams_, opts...)
  2060. res, err := c.doRequest("json")
  2061. if res != nil && res.StatusCode == http.StatusNotModified {
  2062. if res.Body != nil {
  2063. res.Body.Close()
  2064. }
  2065. return nil, &googleapi.Error{
  2066. Code: res.StatusCode,
  2067. Header: res.Header,
  2068. }
  2069. }
  2070. if err != nil {
  2071. return nil, err
  2072. }
  2073. defer googleapi.CloseBody(res)
  2074. if err := googleapi.CheckResponse(res); err != nil {
  2075. return nil, err
  2076. }
  2077. ret := &Operation{
  2078. ServerResponse: googleapi.ServerResponse{
  2079. Header: res.Header,
  2080. HTTPStatusCode: res.StatusCode,
  2081. },
  2082. }
  2083. target := &ret
  2084. if err := gensupport.DecodeResponse(target, res); err != nil {
  2085. return nil, err
  2086. }
  2087. return ret, nil
  2088. // {
  2089. // "description": "Deletes a deployment and all of the resources in the deployment.",
  2090. // "httpMethod": "DELETE",
  2091. // "id": "deploymentmanager.deployments.delete",
  2092. // "parameterOrder": [
  2093. // "project",
  2094. // "deployment"
  2095. // ],
  2096. // "parameters": {
  2097. // "deletePolicy": {
  2098. // "default": "DELETE",
  2099. // "description": "Sets the policy to use for deleting resources.",
  2100. // "enum": [
  2101. // "ABANDON",
  2102. // "DELETE"
  2103. // ],
  2104. // "enumDescriptions": [
  2105. // "",
  2106. // ""
  2107. // ],
  2108. // "location": "query",
  2109. // "type": "string"
  2110. // },
  2111. // "deployment": {
  2112. // "description": "The name of the deployment for this request.",
  2113. // "location": "path",
  2114. // "required": true,
  2115. // "type": "string"
  2116. // },
  2117. // "project": {
  2118. // "description": "The project ID for this request.",
  2119. // "location": "path",
  2120. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2121. // "required": true,
  2122. // "type": "string"
  2123. // }
  2124. // },
  2125. // "path": "{project}/global/deployments/{deployment}",
  2126. // "response": {
  2127. // "$ref": "Operation"
  2128. // },
  2129. // "scopes": [
  2130. // "https://www.googleapis.com/auth/cloud-platform",
  2131. // "https://www.googleapis.com/auth/ndev.cloudman"
  2132. // ]
  2133. // }
  2134. }
  2135. // method id "deploymentmanager.deployments.get":
  2136. type DeploymentsGetCall struct {
  2137. s *Service
  2138. project string
  2139. deployment string
  2140. urlParams_ gensupport.URLParams
  2141. ifNoneMatch_ string
  2142. ctx_ context.Context
  2143. header_ http.Header
  2144. }
  2145. // Get: Gets information about a specific deployment.
  2146. func (r *DeploymentsService) Get(project string, deployment string) *DeploymentsGetCall {
  2147. c := &DeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2148. c.project = project
  2149. c.deployment = deployment
  2150. return c
  2151. }
  2152. // Fields allows partial responses to be retrieved. See
  2153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2154. // for more information.
  2155. func (c *DeploymentsGetCall) Fields(s ...googleapi.Field) *DeploymentsGetCall {
  2156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2157. return c
  2158. }
  2159. // IfNoneMatch sets the optional parameter which makes the operation
  2160. // fail if the object's ETag matches the given value. This is useful for
  2161. // getting updates only after the object has changed since the last
  2162. // request. Use googleapi.IsNotModified to check whether the response
  2163. // error from Do is the result of In-None-Match.
  2164. func (c *DeploymentsGetCall) IfNoneMatch(entityTag string) *DeploymentsGetCall {
  2165. c.ifNoneMatch_ = entityTag
  2166. return c
  2167. }
  2168. // Context sets the context to be used in this call's Do method. Any
  2169. // pending HTTP request will be aborted if the provided context is
  2170. // canceled.
  2171. func (c *DeploymentsGetCall) Context(ctx context.Context) *DeploymentsGetCall {
  2172. c.ctx_ = ctx
  2173. return c
  2174. }
  2175. // Header returns an http.Header that can be modified by the caller to
  2176. // add HTTP headers to the request.
  2177. func (c *DeploymentsGetCall) Header() http.Header {
  2178. if c.header_ == nil {
  2179. c.header_ = make(http.Header)
  2180. }
  2181. return c.header_
  2182. }
  2183. func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
  2184. reqHeaders := make(http.Header)
  2185. for k, v := range c.header_ {
  2186. reqHeaders[k] = v
  2187. }
  2188. reqHeaders.Set("User-Agent", c.s.userAgent())
  2189. if c.ifNoneMatch_ != "" {
  2190. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2191. }
  2192. var body io.Reader = nil
  2193. c.urlParams_.Set("alt", alt)
  2194. c.urlParams_.Set("prettyPrint", "false")
  2195. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}")
  2196. urls += "?" + c.urlParams_.Encode()
  2197. req, err := http.NewRequest("GET", urls, body)
  2198. if err != nil {
  2199. return nil, err
  2200. }
  2201. req.Header = reqHeaders
  2202. googleapi.Expand(req.URL, map[string]string{
  2203. "project": c.project,
  2204. "deployment": c.deployment,
  2205. })
  2206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2207. }
  2208. // Do executes the "deploymentmanager.deployments.get" call.
  2209. // Exactly one of *Deployment or error will be non-nil. Any non-2xx
  2210. // status code is an error. Response headers are in either
  2211. // *Deployment.ServerResponse.Header or (if a response was returned at
  2212. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2213. // to check whether the returned error was because
  2214. // http.StatusNotModified was returned.
  2215. func (c *DeploymentsGetCall) Do(opts ...googleapi.CallOption) (*Deployment, error) {
  2216. gensupport.SetOptions(c.urlParams_, opts...)
  2217. res, err := c.doRequest("json")
  2218. if res != nil && res.StatusCode == http.StatusNotModified {
  2219. if res.Body != nil {
  2220. res.Body.Close()
  2221. }
  2222. return nil, &googleapi.Error{
  2223. Code: res.StatusCode,
  2224. Header: res.Header,
  2225. }
  2226. }
  2227. if err != nil {
  2228. return nil, err
  2229. }
  2230. defer googleapi.CloseBody(res)
  2231. if err := googleapi.CheckResponse(res); err != nil {
  2232. return nil, err
  2233. }
  2234. ret := &Deployment{
  2235. ServerResponse: googleapi.ServerResponse{
  2236. Header: res.Header,
  2237. HTTPStatusCode: res.StatusCode,
  2238. },
  2239. }
  2240. target := &ret
  2241. if err := gensupport.DecodeResponse(target, res); err != nil {
  2242. return nil, err
  2243. }
  2244. return ret, nil
  2245. // {
  2246. // "description": "Gets information about a specific deployment.",
  2247. // "httpMethod": "GET",
  2248. // "id": "deploymentmanager.deployments.get",
  2249. // "parameterOrder": [
  2250. // "project",
  2251. // "deployment"
  2252. // ],
  2253. // "parameters": {
  2254. // "deployment": {
  2255. // "description": "The name of the deployment for this request.",
  2256. // "location": "path",
  2257. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  2258. // "required": true,
  2259. // "type": "string"
  2260. // },
  2261. // "project": {
  2262. // "description": "The project ID for this request.",
  2263. // "location": "path",
  2264. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2265. // "required": true,
  2266. // "type": "string"
  2267. // }
  2268. // },
  2269. // "path": "{project}/global/deployments/{deployment}",
  2270. // "response": {
  2271. // "$ref": "Deployment"
  2272. // },
  2273. // "scopes": [
  2274. // "https://www.googleapis.com/auth/cloud-platform",
  2275. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2276. // "https://www.googleapis.com/auth/ndev.cloudman",
  2277. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  2278. // ]
  2279. // }
  2280. }
  2281. // method id "deploymentmanager.deployments.getIamPolicy":
  2282. type DeploymentsGetIamPolicyCall struct {
  2283. s *Service
  2284. project string
  2285. resource string
  2286. urlParams_ gensupport.URLParams
  2287. ifNoneMatch_ string
  2288. ctx_ context.Context
  2289. header_ http.Header
  2290. }
  2291. // GetIamPolicy: Gets the access control policy for a resource. May be
  2292. // empty if no such policy or resource exists.
  2293. func (r *DeploymentsService) GetIamPolicy(project string, resource string) *DeploymentsGetIamPolicyCall {
  2294. c := &DeploymentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2295. c.project = project
  2296. c.resource = resource
  2297. return c
  2298. }
  2299. // Fields allows partial responses to be retrieved. See
  2300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2301. // for more information.
  2302. func (c *DeploymentsGetIamPolicyCall) Fields(s ...googleapi.Field) *DeploymentsGetIamPolicyCall {
  2303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2304. return c
  2305. }
  2306. // IfNoneMatch sets the optional parameter which makes the operation
  2307. // fail if the object's ETag matches the given value. This is useful for
  2308. // getting updates only after the object has changed since the last
  2309. // request. Use googleapi.IsNotModified to check whether the response
  2310. // error from Do is the result of In-None-Match.
  2311. func (c *DeploymentsGetIamPolicyCall) IfNoneMatch(entityTag string) *DeploymentsGetIamPolicyCall {
  2312. c.ifNoneMatch_ = entityTag
  2313. return c
  2314. }
  2315. // Context sets the context to be used in this call's Do method. Any
  2316. // pending HTTP request will be aborted if the provided context is
  2317. // canceled.
  2318. func (c *DeploymentsGetIamPolicyCall) Context(ctx context.Context) *DeploymentsGetIamPolicyCall {
  2319. c.ctx_ = ctx
  2320. return c
  2321. }
  2322. // Header returns an http.Header that can be modified by the caller to
  2323. // add HTTP headers to the request.
  2324. func (c *DeploymentsGetIamPolicyCall) Header() http.Header {
  2325. if c.header_ == nil {
  2326. c.header_ = make(http.Header)
  2327. }
  2328. return c.header_
  2329. }
  2330. func (c *DeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2331. reqHeaders := make(http.Header)
  2332. for k, v := range c.header_ {
  2333. reqHeaders[k] = v
  2334. }
  2335. reqHeaders.Set("User-Agent", c.s.userAgent())
  2336. if c.ifNoneMatch_ != "" {
  2337. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2338. }
  2339. var body io.Reader = nil
  2340. c.urlParams_.Set("alt", alt)
  2341. c.urlParams_.Set("prettyPrint", "false")
  2342. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{resource}/getIamPolicy")
  2343. urls += "?" + c.urlParams_.Encode()
  2344. req, err := http.NewRequest("GET", urls, body)
  2345. if err != nil {
  2346. return nil, err
  2347. }
  2348. req.Header = reqHeaders
  2349. googleapi.Expand(req.URL, map[string]string{
  2350. "project": c.project,
  2351. "resource": c.resource,
  2352. })
  2353. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2354. }
  2355. // Do executes the "deploymentmanager.deployments.getIamPolicy" call.
  2356. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  2357. // code is an error. Response headers are in either
  2358. // *Policy.ServerResponse.Header or (if a response was returned at all)
  2359. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2360. // check whether the returned error was because http.StatusNotModified
  2361. // was returned.
  2362. func (c *DeploymentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  2363. gensupport.SetOptions(c.urlParams_, opts...)
  2364. res, err := c.doRequest("json")
  2365. if res != nil && res.StatusCode == http.StatusNotModified {
  2366. if res.Body != nil {
  2367. res.Body.Close()
  2368. }
  2369. return nil, &googleapi.Error{
  2370. Code: res.StatusCode,
  2371. Header: res.Header,
  2372. }
  2373. }
  2374. if err != nil {
  2375. return nil, err
  2376. }
  2377. defer googleapi.CloseBody(res)
  2378. if err := googleapi.CheckResponse(res); err != nil {
  2379. return nil, err
  2380. }
  2381. ret := &Policy{
  2382. ServerResponse: googleapi.ServerResponse{
  2383. Header: res.Header,
  2384. HTTPStatusCode: res.StatusCode,
  2385. },
  2386. }
  2387. target := &ret
  2388. if err := gensupport.DecodeResponse(target, res); err != nil {
  2389. return nil, err
  2390. }
  2391. return ret, nil
  2392. // {
  2393. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  2394. // "httpMethod": "GET",
  2395. // "id": "deploymentmanager.deployments.getIamPolicy",
  2396. // "parameterOrder": [
  2397. // "project",
  2398. // "resource"
  2399. // ],
  2400. // "parameters": {
  2401. // "project": {
  2402. // "description": "Project ID for this request.",
  2403. // "location": "path",
  2404. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2405. // "required": true,
  2406. // "type": "string"
  2407. // },
  2408. // "resource": {
  2409. // "description": "Name or id of the resource for this request.",
  2410. // "location": "path",
  2411. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  2412. // "required": true,
  2413. // "type": "string"
  2414. // }
  2415. // },
  2416. // "path": "{project}/global/deployments/{resource}/getIamPolicy",
  2417. // "response": {
  2418. // "$ref": "Policy"
  2419. // },
  2420. // "scopes": [
  2421. // "https://www.googleapis.com/auth/cloud-platform",
  2422. // "https://www.googleapis.com/auth/ndev.cloudman"
  2423. // ]
  2424. // }
  2425. }
  2426. // method id "deploymentmanager.deployments.insert":
  2427. type DeploymentsInsertCall struct {
  2428. s *Service
  2429. project string
  2430. deployment *Deployment
  2431. urlParams_ gensupport.URLParams
  2432. ctx_ context.Context
  2433. header_ http.Header
  2434. }
  2435. // Insert: Creates a deployment and all of the resources described by
  2436. // the deployment manifest.
  2437. func (r *DeploymentsService) Insert(project string, deployment *Deployment) *DeploymentsInsertCall {
  2438. c := &DeploymentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2439. c.project = project
  2440. c.deployment = deployment
  2441. return c
  2442. }
  2443. // CreatePolicy sets the optional parameter "createPolicy": Sets the
  2444. // policy to use for creating new resources.
  2445. //
  2446. // Possible values:
  2447. // "ACQUIRE"
  2448. // "CREATE_OR_ACQUIRE" (default)
  2449. func (c *DeploymentsInsertCall) CreatePolicy(createPolicy string) *DeploymentsInsertCall {
  2450. c.urlParams_.Set("createPolicy", createPolicy)
  2451. return c
  2452. }
  2453. // Preview sets the optional parameter "preview": If set to true,
  2454. // creates a deployment and creates "shell" resources but does not
  2455. // actually instantiate these resources. This allows you to preview what
  2456. // your deployment looks like. After previewing a deployment, you can
  2457. // deploy your resources by making a request with the update() method or
  2458. // you can use the cancelPreview() method to cancel the preview
  2459. // altogether. Note that the deployment will still exist after you
  2460. // cancel the preview and you must separately delete this deployment if
  2461. // you want to remove it.
  2462. func (c *DeploymentsInsertCall) Preview(preview bool) *DeploymentsInsertCall {
  2463. c.urlParams_.Set("preview", fmt.Sprint(preview))
  2464. return c
  2465. }
  2466. // Fields allows partial responses to be retrieved. See
  2467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2468. // for more information.
  2469. func (c *DeploymentsInsertCall) Fields(s ...googleapi.Field) *DeploymentsInsertCall {
  2470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2471. return c
  2472. }
  2473. // Context sets the context to be used in this call's Do method. Any
  2474. // pending HTTP request will be aborted if the provided context is
  2475. // canceled.
  2476. func (c *DeploymentsInsertCall) Context(ctx context.Context) *DeploymentsInsertCall {
  2477. c.ctx_ = ctx
  2478. return c
  2479. }
  2480. // Header returns an http.Header that can be modified by the caller to
  2481. // add HTTP headers to the request.
  2482. func (c *DeploymentsInsertCall) Header() http.Header {
  2483. if c.header_ == nil {
  2484. c.header_ = make(http.Header)
  2485. }
  2486. return c.header_
  2487. }
  2488. func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) {
  2489. reqHeaders := make(http.Header)
  2490. for k, v := range c.header_ {
  2491. reqHeaders[k] = v
  2492. }
  2493. reqHeaders.Set("User-Agent", c.s.userAgent())
  2494. var body io.Reader = nil
  2495. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment)
  2496. if err != nil {
  2497. return nil, err
  2498. }
  2499. reqHeaders.Set("Content-Type", "application/json")
  2500. c.urlParams_.Set("alt", alt)
  2501. c.urlParams_.Set("prettyPrint", "false")
  2502. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments")
  2503. urls += "?" + c.urlParams_.Encode()
  2504. req, err := http.NewRequest("POST", urls, body)
  2505. if err != nil {
  2506. return nil, err
  2507. }
  2508. req.Header = reqHeaders
  2509. googleapi.Expand(req.URL, map[string]string{
  2510. "project": c.project,
  2511. })
  2512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2513. }
  2514. // Do executes the "deploymentmanager.deployments.insert" call.
  2515. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2516. // status code is an error. Response headers are in either
  2517. // *Operation.ServerResponse.Header or (if a response was returned at
  2518. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2519. // to check whether the returned error was because
  2520. // http.StatusNotModified was returned.
  2521. func (c *DeploymentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2522. gensupport.SetOptions(c.urlParams_, opts...)
  2523. res, err := c.doRequest("json")
  2524. if res != nil && res.StatusCode == http.StatusNotModified {
  2525. if res.Body != nil {
  2526. res.Body.Close()
  2527. }
  2528. return nil, &googleapi.Error{
  2529. Code: res.StatusCode,
  2530. Header: res.Header,
  2531. }
  2532. }
  2533. if err != nil {
  2534. return nil, err
  2535. }
  2536. defer googleapi.CloseBody(res)
  2537. if err := googleapi.CheckResponse(res); err != nil {
  2538. return nil, err
  2539. }
  2540. ret := &Operation{
  2541. ServerResponse: googleapi.ServerResponse{
  2542. Header: res.Header,
  2543. HTTPStatusCode: res.StatusCode,
  2544. },
  2545. }
  2546. target := &ret
  2547. if err := gensupport.DecodeResponse(target, res); err != nil {
  2548. return nil, err
  2549. }
  2550. return ret, nil
  2551. // {
  2552. // "description": "Creates a deployment and all of the resources described by the deployment manifest.",
  2553. // "httpMethod": "POST",
  2554. // "id": "deploymentmanager.deployments.insert",
  2555. // "parameterOrder": [
  2556. // "project"
  2557. // ],
  2558. // "parameters": {
  2559. // "createPolicy": {
  2560. // "default": "CREATE_OR_ACQUIRE",
  2561. // "description": "Sets the policy to use for creating new resources.",
  2562. // "enum": [
  2563. // "ACQUIRE",
  2564. // "CREATE_OR_ACQUIRE"
  2565. // ],
  2566. // "enumDescriptions": [
  2567. // "",
  2568. // ""
  2569. // ],
  2570. // "location": "query",
  2571. // "type": "string"
  2572. // },
  2573. // "preview": {
  2574. // "description": "If set to true, creates a deployment and creates \"shell\" resources but does not actually instantiate these resources. This allows you to preview what your deployment looks like. After previewing a deployment, you can deploy your resources by making a request with the update() method or you can use the cancelPreview() method to cancel the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.",
  2575. // "location": "query",
  2576. // "type": "boolean"
  2577. // },
  2578. // "project": {
  2579. // "description": "The project ID for this request.",
  2580. // "location": "path",
  2581. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2582. // "required": true,
  2583. // "type": "string"
  2584. // }
  2585. // },
  2586. // "path": "{project}/global/deployments",
  2587. // "request": {
  2588. // "$ref": "Deployment"
  2589. // },
  2590. // "response": {
  2591. // "$ref": "Operation"
  2592. // },
  2593. // "scopes": [
  2594. // "https://www.googleapis.com/auth/cloud-platform",
  2595. // "https://www.googleapis.com/auth/ndev.cloudman"
  2596. // ]
  2597. // }
  2598. }
  2599. // method id "deploymentmanager.deployments.list":
  2600. type DeploymentsListCall struct {
  2601. s *Service
  2602. project string
  2603. urlParams_ gensupport.URLParams
  2604. ifNoneMatch_ string
  2605. ctx_ context.Context
  2606. header_ http.Header
  2607. }
  2608. // List: Lists all deployments for a given project.
  2609. func (r *DeploymentsService) List(project string) *DeploymentsListCall {
  2610. c := &DeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2611. c.project = project
  2612. return c
  2613. }
  2614. // Filter sets the optional parameter "filter": A filter expression that
  2615. // filters resources listed in the response. The expression must specify
  2616. // the field name, a comparison operator, and the value that you want to
  2617. // use for filtering. The value must be a string, a number, or a
  2618. // boolean. The comparison operator must be either =, !=, >, or <.
  2619. //
  2620. // For example, if you are filtering Compute Engine instances, you can
  2621. // exclude instances named example-instance by specifying name !=
  2622. // example-instance.
  2623. //
  2624. // You can also filter nested fields. For example, you could specify
  2625. // scheduling.automaticRestart = false to include instances only if they
  2626. // are not scheduled for automatic restarts. You can use filtering on
  2627. // nested fields to filter based on resource labels.
  2628. //
  2629. // To filter on multiple expressions, provide each separate expression
  2630. // within parentheses. For example, (scheduling.automaticRestart = true)
  2631. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  2632. // AND expression. However, you can include AND and OR expressions
  2633. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  2634. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  2635. // true).
  2636. func (c *DeploymentsListCall) Filter(filter string) *DeploymentsListCall {
  2637. c.urlParams_.Set("filter", filter)
  2638. return c
  2639. }
  2640. // MaxResults sets the optional parameter "maxResults": The maximum
  2641. // number of results per page that should be returned. If the number of
  2642. // available results is larger than maxResults, Compute Engine returns a
  2643. // nextPageToken that can be used to get the next page of results in
  2644. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  2645. // (Default: 500)
  2646. func (c *DeploymentsListCall) MaxResults(maxResults int64) *DeploymentsListCall {
  2647. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2648. return c
  2649. }
  2650. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  2651. // a certain order. By default, results are returned in alphanumerical
  2652. // order based on the resource name.
  2653. //
  2654. // You can also sort results in descending order based on the creation
  2655. // timestamp using orderBy="creationTimestamp desc". This sorts results
  2656. // based on the creationTimestamp field in reverse chronological order
  2657. // (newest result first). Use this to sort resources like operations so
  2658. // that the newest operation is returned first.
  2659. //
  2660. // Currently, only sorting by name or creationTimestamp desc is
  2661. // supported.
  2662. func (c *DeploymentsListCall) OrderBy(orderBy string) *DeploymentsListCall {
  2663. c.urlParams_.Set("orderBy", orderBy)
  2664. return c
  2665. }
  2666. // PageToken sets the optional parameter "pageToken": Specifies a page
  2667. // token to use. Set pageToken to the nextPageToken returned by a
  2668. // previous list request to get the next page of results.
  2669. func (c *DeploymentsListCall) PageToken(pageToken string) *DeploymentsListCall {
  2670. c.urlParams_.Set("pageToken", pageToken)
  2671. return c
  2672. }
  2673. // Fields allows partial responses to be retrieved. See
  2674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2675. // for more information.
  2676. func (c *DeploymentsListCall) Fields(s ...googleapi.Field) *DeploymentsListCall {
  2677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2678. return c
  2679. }
  2680. // IfNoneMatch sets the optional parameter which makes the operation
  2681. // fail if the object's ETag matches the given value. This is useful for
  2682. // getting updates only after the object has changed since the last
  2683. // request. Use googleapi.IsNotModified to check whether the response
  2684. // error from Do is the result of In-None-Match.
  2685. func (c *DeploymentsListCall) IfNoneMatch(entityTag string) *DeploymentsListCall {
  2686. c.ifNoneMatch_ = entityTag
  2687. return c
  2688. }
  2689. // Context sets the context to be used in this call's Do method. Any
  2690. // pending HTTP request will be aborted if the provided context is
  2691. // canceled.
  2692. func (c *DeploymentsListCall) Context(ctx context.Context) *DeploymentsListCall {
  2693. c.ctx_ = ctx
  2694. return c
  2695. }
  2696. // Header returns an http.Header that can be modified by the caller to
  2697. // add HTTP headers to the request.
  2698. func (c *DeploymentsListCall) Header() http.Header {
  2699. if c.header_ == nil {
  2700. c.header_ = make(http.Header)
  2701. }
  2702. return c.header_
  2703. }
  2704. func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) {
  2705. reqHeaders := make(http.Header)
  2706. for k, v := range c.header_ {
  2707. reqHeaders[k] = v
  2708. }
  2709. reqHeaders.Set("User-Agent", c.s.userAgent())
  2710. if c.ifNoneMatch_ != "" {
  2711. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2712. }
  2713. var body io.Reader = nil
  2714. c.urlParams_.Set("alt", alt)
  2715. c.urlParams_.Set("prettyPrint", "false")
  2716. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments")
  2717. urls += "?" + c.urlParams_.Encode()
  2718. req, err := http.NewRequest("GET", urls, body)
  2719. if err != nil {
  2720. return nil, err
  2721. }
  2722. req.Header = reqHeaders
  2723. googleapi.Expand(req.URL, map[string]string{
  2724. "project": c.project,
  2725. })
  2726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2727. }
  2728. // Do executes the "deploymentmanager.deployments.list" call.
  2729. // Exactly one of *DeploymentsListResponse or error will be non-nil. Any
  2730. // non-2xx status code is an error. Response headers are in either
  2731. // *DeploymentsListResponse.ServerResponse.Header or (if a response was
  2732. // returned at all) in error.(*googleapi.Error).Header. Use
  2733. // googleapi.IsNotModified to check whether the returned error was
  2734. // because http.StatusNotModified was returned.
  2735. func (c *DeploymentsListCall) Do(opts ...googleapi.CallOption) (*DeploymentsListResponse, error) {
  2736. gensupport.SetOptions(c.urlParams_, opts...)
  2737. res, err := c.doRequest("json")
  2738. if res != nil && res.StatusCode == http.StatusNotModified {
  2739. if res.Body != nil {
  2740. res.Body.Close()
  2741. }
  2742. return nil, &googleapi.Error{
  2743. Code: res.StatusCode,
  2744. Header: res.Header,
  2745. }
  2746. }
  2747. if err != nil {
  2748. return nil, err
  2749. }
  2750. defer googleapi.CloseBody(res)
  2751. if err := googleapi.CheckResponse(res); err != nil {
  2752. return nil, err
  2753. }
  2754. ret := &DeploymentsListResponse{
  2755. ServerResponse: googleapi.ServerResponse{
  2756. Header: res.Header,
  2757. HTTPStatusCode: res.StatusCode,
  2758. },
  2759. }
  2760. target := &ret
  2761. if err := gensupport.DecodeResponse(target, res); err != nil {
  2762. return nil, err
  2763. }
  2764. return ret, nil
  2765. // {
  2766. // "description": "Lists all deployments for a given project.",
  2767. // "httpMethod": "GET",
  2768. // "id": "deploymentmanager.deployments.list",
  2769. // "parameterOrder": [
  2770. // "project"
  2771. // ],
  2772. // "parameters": {
  2773. // "filter": {
  2774. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  2775. // "location": "query",
  2776. // "type": "string"
  2777. // },
  2778. // "maxResults": {
  2779. // "default": "500",
  2780. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  2781. // "format": "uint32",
  2782. // "location": "query",
  2783. // "minimum": "0",
  2784. // "type": "integer"
  2785. // },
  2786. // "orderBy": {
  2787. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  2788. // "location": "query",
  2789. // "type": "string"
  2790. // },
  2791. // "pageToken": {
  2792. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  2793. // "location": "query",
  2794. // "type": "string"
  2795. // },
  2796. // "project": {
  2797. // "description": "The project ID for this request.",
  2798. // "location": "path",
  2799. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  2800. // "required": true,
  2801. // "type": "string"
  2802. // }
  2803. // },
  2804. // "path": "{project}/global/deployments",
  2805. // "response": {
  2806. // "$ref": "DeploymentsListResponse"
  2807. // },
  2808. // "scopes": [
  2809. // "https://www.googleapis.com/auth/cloud-platform",
  2810. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2811. // "https://www.googleapis.com/auth/ndev.cloudman",
  2812. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  2813. // ]
  2814. // }
  2815. }
  2816. // Pages invokes f for each page of results.
  2817. // A non-nil error returned from f will halt the iteration.
  2818. // The provided context supersedes any context provided to the Context method.
  2819. func (c *DeploymentsListCall) Pages(ctx context.Context, f func(*DeploymentsListResponse) error) error {
  2820. c.ctx_ = ctx
  2821. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2822. for {
  2823. x, err := c.Do()
  2824. if err != nil {
  2825. return err
  2826. }
  2827. if err := f(x); err != nil {
  2828. return err
  2829. }
  2830. if x.NextPageToken == "" {
  2831. return nil
  2832. }
  2833. c.PageToken(x.NextPageToken)
  2834. }
  2835. }
  2836. // method id "deploymentmanager.deployments.patch":
  2837. type DeploymentsPatchCall struct {
  2838. s *Service
  2839. project string
  2840. deployment string
  2841. deployment2 *Deployment
  2842. urlParams_ gensupport.URLParams
  2843. ctx_ context.Context
  2844. header_ http.Header
  2845. }
  2846. // Patch: Updates a deployment and all of the resources described by the
  2847. // deployment manifest. This method supports patch semantics.
  2848. func (r *DeploymentsService) Patch(project string, deployment string, deployment2 *Deployment) *DeploymentsPatchCall {
  2849. c := &DeploymentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2850. c.project = project
  2851. c.deployment = deployment
  2852. c.deployment2 = deployment2
  2853. return c
  2854. }
  2855. // CreatePolicy sets the optional parameter "createPolicy": Sets the
  2856. // policy to use for creating new resources.
  2857. //
  2858. // Possible values:
  2859. // "ACQUIRE"
  2860. // "CREATE_OR_ACQUIRE" (default)
  2861. func (c *DeploymentsPatchCall) CreatePolicy(createPolicy string) *DeploymentsPatchCall {
  2862. c.urlParams_.Set("createPolicy", createPolicy)
  2863. return c
  2864. }
  2865. // DeletePolicy sets the optional parameter "deletePolicy": Sets the
  2866. // policy to use for deleting resources.
  2867. //
  2868. // Possible values:
  2869. // "ABANDON"
  2870. // "DELETE" (default)
  2871. func (c *DeploymentsPatchCall) DeletePolicy(deletePolicy string) *DeploymentsPatchCall {
  2872. c.urlParams_.Set("deletePolicy", deletePolicy)
  2873. return c
  2874. }
  2875. // Preview sets the optional parameter "preview": If set to true,
  2876. // updates the deployment and creates and updates the "shell" resources
  2877. // but does not actually alter or instantiate these resources. This
  2878. // allows you to preview what your deployment will look like. You can
  2879. // use this intent to preview how an update would affect your
  2880. // deployment. You must provide a target.config with a configuration if
  2881. // this is set to true. After previewing a deployment, you can deploy
  2882. // your resources by making a request with the update() or you can
  2883. // cancelPreview() to remove the preview altogether. Note that the
  2884. // deployment will still exist after you cancel the preview and you must
  2885. // separately delete this deployment if you want to remove it.
  2886. func (c *DeploymentsPatchCall) Preview(preview bool) *DeploymentsPatchCall {
  2887. c.urlParams_.Set("preview", fmt.Sprint(preview))
  2888. return c
  2889. }
  2890. // Fields allows partial responses to be retrieved. See
  2891. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2892. // for more information.
  2893. func (c *DeploymentsPatchCall) Fields(s ...googleapi.Field) *DeploymentsPatchCall {
  2894. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2895. return c
  2896. }
  2897. // Context sets the context to be used in this call's Do method. Any
  2898. // pending HTTP request will be aborted if the provided context is
  2899. // canceled.
  2900. func (c *DeploymentsPatchCall) Context(ctx context.Context) *DeploymentsPatchCall {
  2901. c.ctx_ = ctx
  2902. return c
  2903. }
  2904. // Header returns an http.Header that can be modified by the caller to
  2905. // add HTTP headers to the request.
  2906. func (c *DeploymentsPatchCall) Header() http.Header {
  2907. if c.header_ == nil {
  2908. c.header_ = make(http.Header)
  2909. }
  2910. return c.header_
  2911. }
  2912. func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) {
  2913. reqHeaders := make(http.Header)
  2914. for k, v := range c.header_ {
  2915. reqHeaders[k] = v
  2916. }
  2917. reqHeaders.Set("User-Agent", c.s.userAgent())
  2918. var body io.Reader = nil
  2919. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2)
  2920. if err != nil {
  2921. return nil, err
  2922. }
  2923. reqHeaders.Set("Content-Type", "application/json")
  2924. c.urlParams_.Set("alt", alt)
  2925. c.urlParams_.Set("prettyPrint", "false")
  2926. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}")
  2927. urls += "?" + c.urlParams_.Encode()
  2928. req, err := http.NewRequest("PATCH", urls, body)
  2929. if err != nil {
  2930. return nil, err
  2931. }
  2932. req.Header = reqHeaders
  2933. googleapi.Expand(req.URL, map[string]string{
  2934. "project": c.project,
  2935. "deployment": c.deployment,
  2936. })
  2937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2938. }
  2939. // Do executes the "deploymentmanager.deployments.patch" call.
  2940. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2941. // status code is an error. Response headers are in either
  2942. // *Operation.ServerResponse.Header or (if a response was returned at
  2943. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2944. // to check whether the returned error was because
  2945. // http.StatusNotModified was returned.
  2946. func (c *DeploymentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2947. gensupport.SetOptions(c.urlParams_, opts...)
  2948. res, err := c.doRequest("json")
  2949. if res != nil && res.StatusCode == http.StatusNotModified {
  2950. if res.Body != nil {
  2951. res.Body.Close()
  2952. }
  2953. return nil, &googleapi.Error{
  2954. Code: res.StatusCode,
  2955. Header: res.Header,
  2956. }
  2957. }
  2958. if err != nil {
  2959. return nil, err
  2960. }
  2961. defer googleapi.CloseBody(res)
  2962. if err := googleapi.CheckResponse(res); err != nil {
  2963. return nil, err
  2964. }
  2965. ret := &Operation{
  2966. ServerResponse: googleapi.ServerResponse{
  2967. Header: res.Header,
  2968. HTTPStatusCode: res.StatusCode,
  2969. },
  2970. }
  2971. target := &ret
  2972. if err := gensupport.DecodeResponse(target, res); err != nil {
  2973. return nil, err
  2974. }
  2975. return ret, nil
  2976. // {
  2977. // "description": "Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics.",
  2978. // "httpMethod": "PATCH",
  2979. // "id": "deploymentmanager.deployments.patch",
  2980. // "parameterOrder": [
  2981. // "project",
  2982. // "deployment"
  2983. // ],
  2984. // "parameters": {
  2985. // "createPolicy": {
  2986. // "default": "CREATE_OR_ACQUIRE",
  2987. // "description": "Sets the policy to use for creating new resources.",
  2988. // "enum": [
  2989. // "ACQUIRE",
  2990. // "CREATE_OR_ACQUIRE"
  2991. // ],
  2992. // "enumDescriptions": [
  2993. // "",
  2994. // ""
  2995. // ],
  2996. // "location": "query",
  2997. // "type": "string"
  2998. // },
  2999. // "deletePolicy": {
  3000. // "default": "DELETE",
  3001. // "description": "Sets the policy to use for deleting resources.",
  3002. // "enum": [
  3003. // "ABANDON",
  3004. // "DELETE"
  3005. // ],
  3006. // "enumDescriptions": [
  3007. // "",
  3008. // ""
  3009. // ],
  3010. // "location": "query",
  3011. // "type": "string"
  3012. // },
  3013. // "deployment": {
  3014. // "description": "The name of the deployment for this request.",
  3015. // "location": "path",
  3016. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  3017. // "required": true,
  3018. // "type": "string"
  3019. // },
  3020. // "preview": {
  3021. // "default": "false",
  3022. // "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.",
  3023. // "location": "query",
  3024. // "type": "boolean"
  3025. // },
  3026. // "project": {
  3027. // "description": "The project ID for this request.",
  3028. // "location": "path",
  3029. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3030. // "required": true,
  3031. // "type": "string"
  3032. // }
  3033. // },
  3034. // "path": "{project}/global/deployments/{deployment}",
  3035. // "request": {
  3036. // "$ref": "Deployment"
  3037. // },
  3038. // "response": {
  3039. // "$ref": "Operation"
  3040. // },
  3041. // "scopes": [
  3042. // "https://www.googleapis.com/auth/cloud-platform",
  3043. // "https://www.googleapis.com/auth/ndev.cloudman"
  3044. // ]
  3045. // }
  3046. }
  3047. // method id "deploymentmanager.deployments.setIamPolicy":
  3048. type DeploymentsSetIamPolicyCall struct {
  3049. s *Service
  3050. project string
  3051. resource string
  3052. globalsetpolicyrequest *GlobalSetPolicyRequest
  3053. urlParams_ gensupport.URLParams
  3054. ctx_ context.Context
  3055. header_ http.Header
  3056. }
  3057. // SetIamPolicy: Sets the access control policy on the specified
  3058. // resource. Replaces any existing policy.
  3059. func (r *DeploymentsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *DeploymentsSetIamPolicyCall {
  3060. c := &DeploymentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3061. c.project = project
  3062. c.resource = resource
  3063. c.globalsetpolicyrequest = globalsetpolicyrequest
  3064. return c
  3065. }
  3066. // Fields allows partial responses to be retrieved. See
  3067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3068. // for more information.
  3069. func (c *DeploymentsSetIamPolicyCall) Fields(s ...googleapi.Field) *DeploymentsSetIamPolicyCall {
  3070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3071. return c
  3072. }
  3073. // Context sets the context to be used in this call's Do method. Any
  3074. // pending HTTP request will be aborted if the provided context is
  3075. // canceled.
  3076. func (c *DeploymentsSetIamPolicyCall) Context(ctx context.Context) *DeploymentsSetIamPolicyCall {
  3077. c.ctx_ = ctx
  3078. return c
  3079. }
  3080. // Header returns an http.Header that can be modified by the caller to
  3081. // add HTTP headers to the request.
  3082. func (c *DeploymentsSetIamPolicyCall) Header() http.Header {
  3083. if c.header_ == nil {
  3084. c.header_ = make(http.Header)
  3085. }
  3086. return c.header_
  3087. }
  3088. func (c *DeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3089. reqHeaders := make(http.Header)
  3090. for k, v := range c.header_ {
  3091. reqHeaders[k] = v
  3092. }
  3093. reqHeaders.Set("User-Agent", c.s.userAgent())
  3094. var body io.Reader = nil
  3095. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  3096. if err != nil {
  3097. return nil, err
  3098. }
  3099. reqHeaders.Set("Content-Type", "application/json")
  3100. c.urlParams_.Set("alt", alt)
  3101. c.urlParams_.Set("prettyPrint", "false")
  3102. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{resource}/setIamPolicy")
  3103. urls += "?" + c.urlParams_.Encode()
  3104. req, err := http.NewRequest("POST", urls, body)
  3105. if err != nil {
  3106. return nil, err
  3107. }
  3108. req.Header = reqHeaders
  3109. googleapi.Expand(req.URL, map[string]string{
  3110. "project": c.project,
  3111. "resource": c.resource,
  3112. })
  3113. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3114. }
  3115. // Do executes the "deploymentmanager.deployments.setIamPolicy" call.
  3116. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3117. // code is an error. Response headers are in either
  3118. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3119. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3120. // check whether the returned error was because http.StatusNotModified
  3121. // was returned.
  3122. func (c *DeploymentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3123. gensupport.SetOptions(c.urlParams_, opts...)
  3124. res, err := c.doRequest("json")
  3125. if res != nil && res.StatusCode == http.StatusNotModified {
  3126. if res.Body != nil {
  3127. res.Body.Close()
  3128. }
  3129. return nil, &googleapi.Error{
  3130. Code: res.StatusCode,
  3131. Header: res.Header,
  3132. }
  3133. }
  3134. if err != nil {
  3135. return nil, err
  3136. }
  3137. defer googleapi.CloseBody(res)
  3138. if err := googleapi.CheckResponse(res); err != nil {
  3139. return nil, err
  3140. }
  3141. ret := &Policy{
  3142. ServerResponse: googleapi.ServerResponse{
  3143. Header: res.Header,
  3144. HTTPStatusCode: res.StatusCode,
  3145. },
  3146. }
  3147. target := &ret
  3148. if err := gensupport.DecodeResponse(target, res); err != nil {
  3149. return nil, err
  3150. }
  3151. return ret, nil
  3152. // {
  3153. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  3154. // "httpMethod": "POST",
  3155. // "id": "deploymentmanager.deployments.setIamPolicy",
  3156. // "parameterOrder": [
  3157. // "project",
  3158. // "resource"
  3159. // ],
  3160. // "parameters": {
  3161. // "project": {
  3162. // "description": "Project ID for this request.",
  3163. // "location": "path",
  3164. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3165. // "required": true,
  3166. // "type": "string"
  3167. // },
  3168. // "resource": {
  3169. // "description": "Name or id of the resource for this request.",
  3170. // "location": "path",
  3171. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  3172. // "required": true,
  3173. // "type": "string"
  3174. // }
  3175. // },
  3176. // "path": "{project}/global/deployments/{resource}/setIamPolicy",
  3177. // "request": {
  3178. // "$ref": "GlobalSetPolicyRequest"
  3179. // },
  3180. // "response": {
  3181. // "$ref": "Policy"
  3182. // },
  3183. // "scopes": [
  3184. // "https://www.googleapis.com/auth/cloud-platform",
  3185. // "https://www.googleapis.com/auth/ndev.cloudman"
  3186. // ]
  3187. // }
  3188. }
  3189. // method id "deploymentmanager.deployments.stop":
  3190. type DeploymentsStopCall struct {
  3191. s *Service
  3192. project string
  3193. deployment string
  3194. deploymentsstoprequest *DeploymentsStopRequest
  3195. urlParams_ gensupport.URLParams
  3196. ctx_ context.Context
  3197. header_ http.Header
  3198. }
  3199. // Stop: Stops an ongoing operation. This does not roll back any work
  3200. // that has already been completed, but prevents any new work from being
  3201. // started.
  3202. func (r *DeploymentsService) Stop(project string, deployment string, deploymentsstoprequest *DeploymentsStopRequest) *DeploymentsStopCall {
  3203. c := &DeploymentsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3204. c.project = project
  3205. c.deployment = deployment
  3206. c.deploymentsstoprequest = deploymentsstoprequest
  3207. return c
  3208. }
  3209. // Fields allows partial responses to be retrieved. See
  3210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3211. // for more information.
  3212. func (c *DeploymentsStopCall) Fields(s ...googleapi.Field) *DeploymentsStopCall {
  3213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3214. return c
  3215. }
  3216. // Context sets the context to be used in this call's Do method. Any
  3217. // pending HTTP request will be aborted if the provided context is
  3218. // canceled.
  3219. func (c *DeploymentsStopCall) Context(ctx context.Context) *DeploymentsStopCall {
  3220. c.ctx_ = ctx
  3221. return c
  3222. }
  3223. // Header returns an http.Header that can be modified by the caller to
  3224. // add HTTP headers to the request.
  3225. func (c *DeploymentsStopCall) Header() http.Header {
  3226. if c.header_ == nil {
  3227. c.header_ = make(http.Header)
  3228. }
  3229. return c.header_
  3230. }
  3231. func (c *DeploymentsStopCall) doRequest(alt string) (*http.Response, error) {
  3232. reqHeaders := make(http.Header)
  3233. for k, v := range c.header_ {
  3234. reqHeaders[k] = v
  3235. }
  3236. reqHeaders.Set("User-Agent", c.s.userAgent())
  3237. var body io.Reader = nil
  3238. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentsstoprequest)
  3239. if err != nil {
  3240. return nil, err
  3241. }
  3242. reqHeaders.Set("Content-Type", "application/json")
  3243. c.urlParams_.Set("alt", alt)
  3244. c.urlParams_.Set("prettyPrint", "false")
  3245. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/stop")
  3246. urls += "?" + c.urlParams_.Encode()
  3247. req, err := http.NewRequest("POST", urls, body)
  3248. if err != nil {
  3249. return nil, err
  3250. }
  3251. req.Header = reqHeaders
  3252. googleapi.Expand(req.URL, map[string]string{
  3253. "project": c.project,
  3254. "deployment": c.deployment,
  3255. })
  3256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3257. }
  3258. // Do executes the "deploymentmanager.deployments.stop" call.
  3259. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3260. // status code is an error. Response headers are in either
  3261. // *Operation.ServerResponse.Header or (if a response was returned at
  3262. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3263. // to check whether the returned error was because
  3264. // http.StatusNotModified was returned.
  3265. func (c *DeploymentsStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3266. gensupport.SetOptions(c.urlParams_, opts...)
  3267. res, err := c.doRequest("json")
  3268. if res != nil && res.StatusCode == http.StatusNotModified {
  3269. if res.Body != nil {
  3270. res.Body.Close()
  3271. }
  3272. return nil, &googleapi.Error{
  3273. Code: res.StatusCode,
  3274. Header: res.Header,
  3275. }
  3276. }
  3277. if err != nil {
  3278. return nil, err
  3279. }
  3280. defer googleapi.CloseBody(res)
  3281. if err := googleapi.CheckResponse(res); err != nil {
  3282. return nil, err
  3283. }
  3284. ret := &Operation{
  3285. ServerResponse: googleapi.ServerResponse{
  3286. Header: res.Header,
  3287. HTTPStatusCode: res.StatusCode,
  3288. },
  3289. }
  3290. target := &ret
  3291. if err := gensupport.DecodeResponse(target, res); err != nil {
  3292. return nil, err
  3293. }
  3294. return ret, nil
  3295. // {
  3296. // "description": "Stops an ongoing operation. This does not roll back any work that has already been completed, but prevents any new work from being started.",
  3297. // "httpMethod": "POST",
  3298. // "id": "deploymentmanager.deployments.stop",
  3299. // "parameterOrder": [
  3300. // "project",
  3301. // "deployment"
  3302. // ],
  3303. // "parameters": {
  3304. // "deployment": {
  3305. // "description": "The name of the deployment for this request.",
  3306. // "location": "path",
  3307. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  3308. // "required": true,
  3309. // "type": "string"
  3310. // },
  3311. // "project": {
  3312. // "description": "The project ID for this request.",
  3313. // "location": "path",
  3314. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3315. // "required": true,
  3316. // "type": "string"
  3317. // }
  3318. // },
  3319. // "path": "{project}/global/deployments/{deployment}/stop",
  3320. // "request": {
  3321. // "$ref": "DeploymentsStopRequest"
  3322. // },
  3323. // "response": {
  3324. // "$ref": "Operation"
  3325. // },
  3326. // "scopes": [
  3327. // "https://www.googleapis.com/auth/cloud-platform",
  3328. // "https://www.googleapis.com/auth/ndev.cloudman"
  3329. // ]
  3330. // }
  3331. }
  3332. // method id "deploymentmanager.deployments.testIamPermissions":
  3333. type DeploymentsTestIamPermissionsCall struct {
  3334. s *Service
  3335. project string
  3336. resource string
  3337. testpermissionsrequest *TestPermissionsRequest
  3338. urlParams_ gensupport.URLParams
  3339. ctx_ context.Context
  3340. header_ http.Header
  3341. }
  3342. // TestIamPermissions: Returns permissions that a caller has on the
  3343. // specified resource.
  3344. func (r *DeploymentsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *DeploymentsTestIamPermissionsCall {
  3345. c := &DeploymentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3346. c.project = project
  3347. c.resource = resource
  3348. c.testpermissionsrequest = testpermissionsrequest
  3349. return c
  3350. }
  3351. // Fields allows partial responses to be retrieved. See
  3352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3353. // for more information.
  3354. func (c *DeploymentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *DeploymentsTestIamPermissionsCall {
  3355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3356. return c
  3357. }
  3358. // Context sets the context to be used in this call's Do method. Any
  3359. // pending HTTP request will be aborted if the provided context is
  3360. // canceled.
  3361. func (c *DeploymentsTestIamPermissionsCall) Context(ctx context.Context) *DeploymentsTestIamPermissionsCall {
  3362. c.ctx_ = ctx
  3363. return c
  3364. }
  3365. // Header returns an http.Header that can be modified by the caller to
  3366. // add HTTP headers to the request.
  3367. func (c *DeploymentsTestIamPermissionsCall) Header() http.Header {
  3368. if c.header_ == nil {
  3369. c.header_ = make(http.Header)
  3370. }
  3371. return c.header_
  3372. }
  3373. func (c *DeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3374. reqHeaders := make(http.Header)
  3375. for k, v := range c.header_ {
  3376. reqHeaders[k] = v
  3377. }
  3378. reqHeaders.Set("User-Agent", c.s.userAgent())
  3379. var body io.Reader = nil
  3380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  3381. if err != nil {
  3382. return nil, err
  3383. }
  3384. reqHeaders.Set("Content-Type", "application/json")
  3385. c.urlParams_.Set("alt", alt)
  3386. c.urlParams_.Set("prettyPrint", "false")
  3387. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{resource}/testIamPermissions")
  3388. urls += "?" + c.urlParams_.Encode()
  3389. req, err := http.NewRequest("POST", urls, body)
  3390. if err != nil {
  3391. return nil, err
  3392. }
  3393. req.Header = reqHeaders
  3394. googleapi.Expand(req.URL, map[string]string{
  3395. "project": c.project,
  3396. "resource": c.resource,
  3397. })
  3398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3399. }
  3400. // Do executes the "deploymentmanager.deployments.testIamPermissions" call.
  3401. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  3402. // non-2xx status code is an error. Response headers are in either
  3403. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  3404. // returned at all) in error.(*googleapi.Error).Header. Use
  3405. // googleapi.IsNotModified to check whether the returned error was
  3406. // because http.StatusNotModified was returned.
  3407. func (c *DeploymentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  3408. gensupport.SetOptions(c.urlParams_, opts...)
  3409. res, err := c.doRequest("json")
  3410. if res != nil && res.StatusCode == http.StatusNotModified {
  3411. if res.Body != nil {
  3412. res.Body.Close()
  3413. }
  3414. return nil, &googleapi.Error{
  3415. Code: res.StatusCode,
  3416. Header: res.Header,
  3417. }
  3418. }
  3419. if err != nil {
  3420. return nil, err
  3421. }
  3422. defer googleapi.CloseBody(res)
  3423. if err := googleapi.CheckResponse(res); err != nil {
  3424. return nil, err
  3425. }
  3426. ret := &TestPermissionsResponse{
  3427. ServerResponse: googleapi.ServerResponse{
  3428. Header: res.Header,
  3429. HTTPStatusCode: res.StatusCode,
  3430. },
  3431. }
  3432. target := &ret
  3433. if err := gensupport.DecodeResponse(target, res); err != nil {
  3434. return nil, err
  3435. }
  3436. return ret, nil
  3437. // {
  3438. // "description": "Returns permissions that a caller has on the specified resource.",
  3439. // "httpMethod": "POST",
  3440. // "id": "deploymentmanager.deployments.testIamPermissions",
  3441. // "parameterOrder": [
  3442. // "project",
  3443. // "resource"
  3444. // ],
  3445. // "parameters": {
  3446. // "project": {
  3447. // "description": "Project ID for this request.",
  3448. // "location": "path",
  3449. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3450. // "required": true,
  3451. // "type": "string"
  3452. // },
  3453. // "resource": {
  3454. // "description": "Name or id of the resource for this request.",
  3455. // "location": "path",
  3456. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  3457. // "required": true,
  3458. // "type": "string"
  3459. // }
  3460. // },
  3461. // "path": "{project}/global/deployments/{resource}/testIamPermissions",
  3462. // "request": {
  3463. // "$ref": "TestPermissionsRequest"
  3464. // },
  3465. // "response": {
  3466. // "$ref": "TestPermissionsResponse"
  3467. // },
  3468. // "scopes": [
  3469. // "https://www.googleapis.com/auth/cloud-platform",
  3470. // "https://www.googleapis.com/auth/ndev.cloudman"
  3471. // ]
  3472. // }
  3473. }
  3474. // method id "deploymentmanager.deployments.update":
  3475. type DeploymentsUpdateCall struct {
  3476. s *Service
  3477. project string
  3478. deployment string
  3479. deployment2 *Deployment
  3480. urlParams_ gensupport.URLParams
  3481. ctx_ context.Context
  3482. header_ http.Header
  3483. }
  3484. // Update: Updates a deployment and all of the resources described by
  3485. // the deployment manifest.
  3486. func (r *DeploymentsService) Update(project string, deployment string, deployment2 *Deployment) *DeploymentsUpdateCall {
  3487. c := &DeploymentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3488. c.project = project
  3489. c.deployment = deployment
  3490. c.deployment2 = deployment2
  3491. return c
  3492. }
  3493. // CreatePolicy sets the optional parameter "createPolicy": Sets the
  3494. // policy to use for creating new resources.
  3495. //
  3496. // Possible values:
  3497. // "ACQUIRE"
  3498. // "CREATE_OR_ACQUIRE" (default)
  3499. func (c *DeploymentsUpdateCall) CreatePolicy(createPolicy string) *DeploymentsUpdateCall {
  3500. c.urlParams_.Set("createPolicy", createPolicy)
  3501. return c
  3502. }
  3503. // DeletePolicy sets the optional parameter "deletePolicy": Sets the
  3504. // policy to use for deleting resources.
  3505. //
  3506. // Possible values:
  3507. // "ABANDON"
  3508. // "DELETE" (default)
  3509. func (c *DeploymentsUpdateCall) DeletePolicy(deletePolicy string) *DeploymentsUpdateCall {
  3510. c.urlParams_.Set("deletePolicy", deletePolicy)
  3511. return c
  3512. }
  3513. // Preview sets the optional parameter "preview": If set to true,
  3514. // updates the deployment and creates and updates the "shell" resources
  3515. // but does not actually alter or instantiate these resources. This
  3516. // allows you to preview what your deployment will look like. You can
  3517. // use this intent to preview how an update would affect your
  3518. // deployment. You must provide a target.config with a configuration if
  3519. // this is set to true. After previewing a deployment, you can deploy
  3520. // your resources by making a request with the update() or you can
  3521. // cancelPreview() to remove the preview altogether. Note that the
  3522. // deployment will still exist after you cancel the preview and you must
  3523. // separately delete this deployment if you want to remove it.
  3524. func (c *DeploymentsUpdateCall) Preview(preview bool) *DeploymentsUpdateCall {
  3525. c.urlParams_.Set("preview", fmt.Sprint(preview))
  3526. return c
  3527. }
  3528. // Fields allows partial responses to be retrieved. See
  3529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3530. // for more information.
  3531. func (c *DeploymentsUpdateCall) Fields(s ...googleapi.Field) *DeploymentsUpdateCall {
  3532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3533. return c
  3534. }
  3535. // Context sets the context to be used in this call's Do method. Any
  3536. // pending HTTP request will be aborted if the provided context is
  3537. // canceled.
  3538. func (c *DeploymentsUpdateCall) Context(ctx context.Context) *DeploymentsUpdateCall {
  3539. c.ctx_ = ctx
  3540. return c
  3541. }
  3542. // Header returns an http.Header that can be modified by the caller to
  3543. // add HTTP headers to the request.
  3544. func (c *DeploymentsUpdateCall) Header() http.Header {
  3545. if c.header_ == nil {
  3546. c.header_ = make(http.Header)
  3547. }
  3548. return c.header_
  3549. }
  3550. func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3551. reqHeaders := make(http.Header)
  3552. for k, v := range c.header_ {
  3553. reqHeaders[k] = v
  3554. }
  3555. reqHeaders.Set("User-Agent", c.s.userAgent())
  3556. var body io.Reader = nil
  3557. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2)
  3558. if err != nil {
  3559. return nil, err
  3560. }
  3561. reqHeaders.Set("Content-Type", "application/json")
  3562. c.urlParams_.Set("alt", alt)
  3563. c.urlParams_.Set("prettyPrint", "false")
  3564. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}")
  3565. urls += "?" + c.urlParams_.Encode()
  3566. req, err := http.NewRequest("PUT", urls, body)
  3567. if err != nil {
  3568. return nil, err
  3569. }
  3570. req.Header = reqHeaders
  3571. googleapi.Expand(req.URL, map[string]string{
  3572. "project": c.project,
  3573. "deployment": c.deployment,
  3574. })
  3575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3576. }
  3577. // Do executes the "deploymentmanager.deployments.update" call.
  3578. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3579. // status code is an error. Response headers are in either
  3580. // *Operation.ServerResponse.Header or (if a response was returned at
  3581. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3582. // to check whether the returned error was because
  3583. // http.StatusNotModified was returned.
  3584. func (c *DeploymentsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3585. gensupport.SetOptions(c.urlParams_, opts...)
  3586. res, err := c.doRequest("json")
  3587. if res != nil && res.StatusCode == http.StatusNotModified {
  3588. if res.Body != nil {
  3589. res.Body.Close()
  3590. }
  3591. return nil, &googleapi.Error{
  3592. Code: res.StatusCode,
  3593. Header: res.Header,
  3594. }
  3595. }
  3596. if err != nil {
  3597. return nil, err
  3598. }
  3599. defer googleapi.CloseBody(res)
  3600. if err := googleapi.CheckResponse(res); err != nil {
  3601. return nil, err
  3602. }
  3603. ret := &Operation{
  3604. ServerResponse: googleapi.ServerResponse{
  3605. Header: res.Header,
  3606. HTTPStatusCode: res.StatusCode,
  3607. },
  3608. }
  3609. target := &ret
  3610. if err := gensupport.DecodeResponse(target, res); err != nil {
  3611. return nil, err
  3612. }
  3613. return ret, nil
  3614. // {
  3615. // "description": "Updates a deployment and all of the resources described by the deployment manifest.",
  3616. // "httpMethod": "PUT",
  3617. // "id": "deploymentmanager.deployments.update",
  3618. // "parameterOrder": [
  3619. // "project",
  3620. // "deployment"
  3621. // ],
  3622. // "parameters": {
  3623. // "createPolicy": {
  3624. // "default": "CREATE_OR_ACQUIRE",
  3625. // "description": "Sets the policy to use for creating new resources.",
  3626. // "enum": [
  3627. // "ACQUIRE",
  3628. // "CREATE_OR_ACQUIRE"
  3629. // ],
  3630. // "enumDescriptions": [
  3631. // "",
  3632. // ""
  3633. // ],
  3634. // "location": "query",
  3635. // "type": "string"
  3636. // },
  3637. // "deletePolicy": {
  3638. // "default": "DELETE",
  3639. // "description": "Sets the policy to use for deleting resources.",
  3640. // "enum": [
  3641. // "ABANDON",
  3642. // "DELETE"
  3643. // ],
  3644. // "enumDescriptions": [
  3645. // "",
  3646. // ""
  3647. // ],
  3648. // "location": "query",
  3649. // "type": "string"
  3650. // },
  3651. // "deployment": {
  3652. // "description": "The name of the deployment for this request.",
  3653. // "location": "path",
  3654. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  3655. // "required": true,
  3656. // "type": "string"
  3657. // },
  3658. // "preview": {
  3659. // "default": "false",
  3660. // "description": "If set to true, updates the deployment and creates and updates the \"shell\" resources but does not actually alter or instantiate these resources. This allows you to preview what your deployment will look like. You can use this intent to preview how an update would affect your deployment. You must provide a target.config with a configuration if this is set to true. After previewing a deployment, you can deploy your resources by making a request with the update() or you can cancelPreview() to remove the preview altogether. Note that the deployment will still exist after you cancel the preview and you must separately delete this deployment if you want to remove it.",
  3661. // "location": "query",
  3662. // "type": "boolean"
  3663. // },
  3664. // "project": {
  3665. // "description": "The project ID for this request.",
  3666. // "location": "path",
  3667. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3668. // "required": true,
  3669. // "type": "string"
  3670. // }
  3671. // },
  3672. // "path": "{project}/global/deployments/{deployment}",
  3673. // "request": {
  3674. // "$ref": "Deployment"
  3675. // },
  3676. // "response": {
  3677. // "$ref": "Operation"
  3678. // },
  3679. // "scopes": [
  3680. // "https://www.googleapis.com/auth/cloud-platform",
  3681. // "https://www.googleapis.com/auth/ndev.cloudman"
  3682. // ]
  3683. // }
  3684. }
  3685. // method id "deploymentmanager.manifests.get":
  3686. type ManifestsGetCall struct {
  3687. s *Service
  3688. project string
  3689. deployment string
  3690. manifest string
  3691. urlParams_ gensupport.URLParams
  3692. ifNoneMatch_ string
  3693. ctx_ context.Context
  3694. header_ http.Header
  3695. }
  3696. // Get: Gets information about a specific manifest.
  3697. func (r *ManifestsService) Get(project string, deployment string, manifest string) *ManifestsGetCall {
  3698. c := &ManifestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3699. c.project = project
  3700. c.deployment = deployment
  3701. c.manifest = manifest
  3702. return c
  3703. }
  3704. // Fields allows partial responses to be retrieved. See
  3705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3706. // for more information.
  3707. func (c *ManifestsGetCall) Fields(s ...googleapi.Field) *ManifestsGetCall {
  3708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3709. return c
  3710. }
  3711. // IfNoneMatch sets the optional parameter which makes the operation
  3712. // fail if the object's ETag matches the given value. This is useful for
  3713. // getting updates only after the object has changed since the last
  3714. // request. Use googleapi.IsNotModified to check whether the response
  3715. // error from Do is the result of In-None-Match.
  3716. func (c *ManifestsGetCall) IfNoneMatch(entityTag string) *ManifestsGetCall {
  3717. c.ifNoneMatch_ = entityTag
  3718. return c
  3719. }
  3720. // Context sets the context to be used in this call's Do method. Any
  3721. // pending HTTP request will be aborted if the provided context is
  3722. // canceled.
  3723. func (c *ManifestsGetCall) Context(ctx context.Context) *ManifestsGetCall {
  3724. c.ctx_ = ctx
  3725. return c
  3726. }
  3727. // Header returns an http.Header that can be modified by the caller to
  3728. // add HTTP headers to the request.
  3729. func (c *ManifestsGetCall) Header() http.Header {
  3730. if c.header_ == nil {
  3731. c.header_ = make(http.Header)
  3732. }
  3733. return c.header_
  3734. }
  3735. func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) {
  3736. reqHeaders := make(http.Header)
  3737. for k, v := range c.header_ {
  3738. reqHeaders[k] = v
  3739. }
  3740. reqHeaders.Set("User-Agent", c.s.userAgent())
  3741. if c.ifNoneMatch_ != "" {
  3742. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3743. }
  3744. var body io.Reader = nil
  3745. c.urlParams_.Set("alt", alt)
  3746. c.urlParams_.Set("prettyPrint", "false")
  3747. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests/{manifest}")
  3748. urls += "?" + c.urlParams_.Encode()
  3749. req, err := http.NewRequest("GET", urls, body)
  3750. if err != nil {
  3751. return nil, err
  3752. }
  3753. req.Header = reqHeaders
  3754. googleapi.Expand(req.URL, map[string]string{
  3755. "project": c.project,
  3756. "deployment": c.deployment,
  3757. "manifest": c.manifest,
  3758. })
  3759. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3760. }
  3761. // Do executes the "deploymentmanager.manifests.get" call.
  3762. // Exactly one of *Manifest or error will be non-nil. Any non-2xx status
  3763. // code is an error. Response headers are in either
  3764. // *Manifest.ServerResponse.Header or (if a response was returned at
  3765. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3766. // to check whether the returned error was because
  3767. // http.StatusNotModified was returned.
  3768. func (c *ManifestsGetCall) Do(opts ...googleapi.CallOption) (*Manifest, error) {
  3769. gensupport.SetOptions(c.urlParams_, opts...)
  3770. res, err := c.doRequest("json")
  3771. if res != nil && res.StatusCode == http.StatusNotModified {
  3772. if res.Body != nil {
  3773. res.Body.Close()
  3774. }
  3775. return nil, &googleapi.Error{
  3776. Code: res.StatusCode,
  3777. Header: res.Header,
  3778. }
  3779. }
  3780. if err != nil {
  3781. return nil, err
  3782. }
  3783. defer googleapi.CloseBody(res)
  3784. if err := googleapi.CheckResponse(res); err != nil {
  3785. return nil, err
  3786. }
  3787. ret := &Manifest{
  3788. ServerResponse: googleapi.ServerResponse{
  3789. Header: res.Header,
  3790. HTTPStatusCode: res.StatusCode,
  3791. },
  3792. }
  3793. target := &ret
  3794. if err := gensupport.DecodeResponse(target, res); err != nil {
  3795. return nil, err
  3796. }
  3797. return ret, nil
  3798. // {
  3799. // "description": "Gets information about a specific manifest.",
  3800. // "httpMethod": "GET",
  3801. // "id": "deploymentmanager.manifests.get",
  3802. // "parameterOrder": [
  3803. // "project",
  3804. // "deployment",
  3805. // "manifest"
  3806. // ],
  3807. // "parameters": {
  3808. // "deployment": {
  3809. // "description": "The name of the deployment for this request.",
  3810. // "location": "path",
  3811. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  3812. // "required": true,
  3813. // "type": "string"
  3814. // },
  3815. // "manifest": {
  3816. // "description": "The name of the manifest for this request.",
  3817. // "location": "path",
  3818. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  3819. // "required": true,
  3820. // "type": "string"
  3821. // },
  3822. // "project": {
  3823. // "description": "The project ID for this request.",
  3824. // "location": "path",
  3825. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  3826. // "required": true,
  3827. // "type": "string"
  3828. // }
  3829. // },
  3830. // "path": "{project}/global/deployments/{deployment}/manifests/{manifest}",
  3831. // "response": {
  3832. // "$ref": "Manifest"
  3833. // },
  3834. // "scopes": [
  3835. // "https://www.googleapis.com/auth/cloud-platform",
  3836. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3837. // "https://www.googleapis.com/auth/ndev.cloudman",
  3838. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  3839. // ]
  3840. // }
  3841. }
  3842. // method id "deploymentmanager.manifests.list":
  3843. type ManifestsListCall struct {
  3844. s *Service
  3845. project string
  3846. deployment string
  3847. urlParams_ gensupport.URLParams
  3848. ifNoneMatch_ string
  3849. ctx_ context.Context
  3850. header_ http.Header
  3851. }
  3852. // List: Lists all manifests for a given deployment.
  3853. func (r *ManifestsService) List(project string, deployment string) *ManifestsListCall {
  3854. c := &ManifestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3855. c.project = project
  3856. c.deployment = deployment
  3857. return c
  3858. }
  3859. // Filter sets the optional parameter "filter": A filter expression that
  3860. // filters resources listed in the response. The expression must specify
  3861. // the field name, a comparison operator, and the value that you want to
  3862. // use for filtering. The value must be a string, a number, or a
  3863. // boolean. The comparison operator must be either =, !=, >, or <.
  3864. //
  3865. // For example, if you are filtering Compute Engine instances, you can
  3866. // exclude instances named example-instance by specifying name !=
  3867. // example-instance.
  3868. //
  3869. // You can also filter nested fields. For example, you could specify
  3870. // scheduling.automaticRestart = false to include instances only if they
  3871. // are not scheduled for automatic restarts. You can use filtering on
  3872. // nested fields to filter based on resource labels.
  3873. //
  3874. // To filter on multiple expressions, provide each separate expression
  3875. // within parentheses. For example, (scheduling.automaticRestart = true)
  3876. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  3877. // AND expression. However, you can include AND and OR expressions
  3878. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  3879. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  3880. // true).
  3881. func (c *ManifestsListCall) Filter(filter string) *ManifestsListCall {
  3882. c.urlParams_.Set("filter", filter)
  3883. return c
  3884. }
  3885. // MaxResults sets the optional parameter "maxResults": The maximum
  3886. // number of results per page that should be returned. If the number of
  3887. // available results is larger than maxResults, Compute Engine returns a
  3888. // nextPageToken that can be used to get the next page of results in
  3889. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  3890. // (Default: 500)
  3891. func (c *ManifestsListCall) MaxResults(maxResults int64) *ManifestsListCall {
  3892. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3893. return c
  3894. }
  3895. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  3896. // a certain order. By default, results are returned in alphanumerical
  3897. // order based on the resource name.
  3898. //
  3899. // You can also sort results in descending order based on the creation
  3900. // timestamp using orderBy="creationTimestamp desc". This sorts results
  3901. // based on the creationTimestamp field in reverse chronological order
  3902. // (newest result first). Use this to sort resources like operations so
  3903. // that the newest operation is returned first.
  3904. //
  3905. // Currently, only sorting by name or creationTimestamp desc is
  3906. // supported.
  3907. func (c *ManifestsListCall) OrderBy(orderBy string) *ManifestsListCall {
  3908. c.urlParams_.Set("orderBy", orderBy)
  3909. return c
  3910. }
  3911. // PageToken sets the optional parameter "pageToken": Specifies a page
  3912. // token to use. Set pageToken to the nextPageToken returned by a
  3913. // previous list request to get the next page of results.
  3914. func (c *ManifestsListCall) PageToken(pageToken string) *ManifestsListCall {
  3915. c.urlParams_.Set("pageToken", pageToken)
  3916. return c
  3917. }
  3918. // Fields allows partial responses to be retrieved. See
  3919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3920. // for more information.
  3921. func (c *ManifestsListCall) Fields(s ...googleapi.Field) *ManifestsListCall {
  3922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3923. return c
  3924. }
  3925. // IfNoneMatch sets the optional parameter which makes the operation
  3926. // fail if the object's ETag matches the given value. This is useful for
  3927. // getting updates only after the object has changed since the last
  3928. // request. Use googleapi.IsNotModified to check whether the response
  3929. // error from Do is the result of In-None-Match.
  3930. func (c *ManifestsListCall) IfNoneMatch(entityTag string) *ManifestsListCall {
  3931. c.ifNoneMatch_ = entityTag
  3932. return c
  3933. }
  3934. // Context sets the context to be used in this call's Do method. Any
  3935. // pending HTTP request will be aborted if the provided context is
  3936. // canceled.
  3937. func (c *ManifestsListCall) Context(ctx context.Context) *ManifestsListCall {
  3938. c.ctx_ = ctx
  3939. return c
  3940. }
  3941. // Header returns an http.Header that can be modified by the caller to
  3942. // add HTTP headers to the request.
  3943. func (c *ManifestsListCall) Header() http.Header {
  3944. if c.header_ == nil {
  3945. c.header_ = make(http.Header)
  3946. }
  3947. return c.header_
  3948. }
  3949. func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) {
  3950. reqHeaders := make(http.Header)
  3951. for k, v := range c.header_ {
  3952. reqHeaders[k] = v
  3953. }
  3954. reqHeaders.Set("User-Agent", c.s.userAgent())
  3955. if c.ifNoneMatch_ != "" {
  3956. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3957. }
  3958. var body io.Reader = nil
  3959. c.urlParams_.Set("alt", alt)
  3960. c.urlParams_.Set("prettyPrint", "false")
  3961. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests")
  3962. urls += "?" + c.urlParams_.Encode()
  3963. req, err := http.NewRequest("GET", urls, body)
  3964. if err != nil {
  3965. return nil, err
  3966. }
  3967. req.Header = reqHeaders
  3968. googleapi.Expand(req.URL, map[string]string{
  3969. "project": c.project,
  3970. "deployment": c.deployment,
  3971. })
  3972. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3973. }
  3974. // Do executes the "deploymentmanager.manifests.list" call.
  3975. // Exactly one of *ManifestsListResponse or error will be non-nil. Any
  3976. // non-2xx status code is an error. Response headers are in either
  3977. // *ManifestsListResponse.ServerResponse.Header or (if a response was
  3978. // returned at all) in error.(*googleapi.Error).Header. Use
  3979. // googleapi.IsNotModified to check whether the returned error was
  3980. // because http.StatusNotModified was returned.
  3981. func (c *ManifestsListCall) Do(opts ...googleapi.CallOption) (*ManifestsListResponse, error) {
  3982. gensupport.SetOptions(c.urlParams_, opts...)
  3983. res, err := c.doRequest("json")
  3984. if res != nil && res.StatusCode == http.StatusNotModified {
  3985. if res.Body != nil {
  3986. res.Body.Close()
  3987. }
  3988. return nil, &googleapi.Error{
  3989. Code: res.StatusCode,
  3990. Header: res.Header,
  3991. }
  3992. }
  3993. if err != nil {
  3994. return nil, err
  3995. }
  3996. defer googleapi.CloseBody(res)
  3997. if err := googleapi.CheckResponse(res); err != nil {
  3998. return nil, err
  3999. }
  4000. ret := &ManifestsListResponse{
  4001. ServerResponse: googleapi.ServerResponse{
  4002. Header: res.Header,
  4003. HTTPStatusCode: res.StatusCode,
  4004. },
  4005. }
  4006. target := &ret
  4007. if err := gensupport.DecodeResponse(target, res); err != nil {
  4008. return nil, err
  4009. }
  4010. return ret, nil
  4011. // {
  4012. // "description": "Lists all manifests for a given deployment.",
  4013. // "httpMethod": "GET",
  4014. // "id": "deploymentmanager.manifests.list",
  4015. // "parameterOrder": [
  4016. // "project",
  4017. // "deployment"
  4018. // ],
  4019. // "parameters": {
  4020. // "deployment": {
  4021. // "description": "The name of the deployment for this request.",
  4022. // "location": "path",
  4023. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  4024. // "required": true,
  4025. // "type": "string"
  4026. // },
  4027. // "filter": {
  4028. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  4029. // "location": "query",
  4030. // "type": "string"
  4031. // },
  4032. // "maxResults": {
  4033. // "default": "500",
  4034. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  4035. // "format": "uint32",
  4036. // "location": "query",
  4037. // "minimum": "0",
  4038. // "type": "integer"
  4039. // },
  4040. // "orderBy": {
  4041. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  4042. // "location": "query",
  4043. // "type": "string"
  4044. // },
  4045. // "pageToken": {
  4046. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  4047. // "location": "query",
  4048. // "type": "string"
  4049. // },
  4050. // "project": {
  4051. // "description": "The project ID for this request.",
  4052. // "location": "path",
  4053. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4054. // "required": true,
  4055. // "type": "string"
  4056. // }
  4057. // },
  4058. // "path": "{project}/global/deployments/{deployment}/manifests",
  4059. // "response": {
  4060. // "$ref": "ManifestsListResponse"
  4061. // },
  4062. // "scopes": [
  4063. // "https://www.googleapis.com/auth/cloud-platform",
  4064. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4065. // "https://www.googleapis.com/auth/ndev.cloudman",
  4066. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  4067. // ]
  4068. // }
  4069. }
  4070. // Pages invokes f for each page of results.
  4071. // A non-nil error returned from f will halt the iteration.
  4072. // The provided context supersedes any context provided to the Context method.
  4073. func (c *ManifestsListCall) Pages(ctx context.Context, f func(*ManifestsListResponse) error) error {
  4074. c.ctx_ = ctx
  4075. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4076. for {
  4077. x, err := c.Do()
  4078. if err != nil {
  4079. return err
  4080. }
  4081. if err := f(x); err != nil {
  4082. return err
  4083. }
  4084. if x.NextPageToken == "" {
  4085. return nil
  4086. }
  4087. c.PageToken(x.NextPageToken)
  4088. }
  4089. }
  4090. // method id "deploymentmanager.operations.get":
  4091. type OperationsGetCall struct {
  4092. s *Service
  4093. project string
  4094. operation string
  4095. urlParams_ gensupport.URLParams
  4096. ifNoneMatch_ string
  4097. ctx_ context.Context
  4098. header_ http.Header
  4099. }
  4100. // Get: Gets information about a specific operation.
  4101. func (r *OperationsService) Get(project string, operation string) *OperationsGetCall {
  4102. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4103. c.project = project
  4104. c.operation = operation
  4105. return c
  4106. }
  4107. // Fields allows partial responses to be retrieved. See
  4108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4109. // for more information.
  4110. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  4111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4112. return c
  4113. }
  4114. // IfNoneMatch sets the optional parameter which makes the operation
  4115. // fail if the object's ETag matches the given value. This is useful for
  4116. // getting updates only after the object has changed since the last
  4117. // request. Use googleapi.IsNotModified to check whether the response
  4118. // error from Do is the result of In-None-Match.
  4119. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  4120. c.ifNoneMatch_ = entityTag
  4121. return c
  4122. }
  4123. // Context sets the context to be used in this call's Do method. Any
  4124. // pending HTTP request will be aborted if the provided context is
  4125. // canceled.
  4126. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  4127. c.ctx_ = ctx
  4128. return c
  4129. }
  4130. // Header returns an http.Header that can be modified by the caller to
  4131. // add HTTP headers to the request.
  4132. func (c *OperationsGetCall) Header() http.Header {
  4133. if c.header_ == nil {
  4134. c.header_ = make(http.Header)
  4135. }
  4136. return c.header_
  4137. }
  4138. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  4139. reqHeaders := make(http.Header)
  4140. for k, v := range c.header_ {
  4141. reqHeaders[k] = v
  4142. }
  4143. reqHeaders.Set("User-Agent", c.s.userAgent())
  4144. if c.ifNoneMatch_ != "" {
  4145. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4146. }
  4147. var body io.Reader = nil
  4148. c.urlParams_.Set("alt", alt)
  4149. c.urlParams_.Set("prettyPrint", "false")
  4150. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  4151. urls += "?" + c.urlParams_.Encode()
  4152. req, err := http.NewRequest("GET", urls, body)
  4153. if err != nil {
  4154. return nil, err
  4155. }
  4156. req.Header = reqHeaders
  4157. googleapi.Expand(req.URL, map[string]string{
  4158. "project": c.project,
  4159. "operation": c.operation,
  4160. })
  4161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4162. }
  4163. // Do executes the "deploymentmanager.operations.get" call.
  4164. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4165. // status code is an error. Response headers are in either
  4166. // *Operation.ServerResponse.Header or (if a response was returned at
  4167. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4168. // to check whether the returned error was because
  4169. // http.StatusNotModified was returned.
  4170. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4171. gensupport.SetOptions(c.urlParams_, opts...)
  4172. res, err := c.doRequest("json")
  4173. if res != nil && res.StatusCode == http.StatusNotModified {
  4174. if res.Body != nil {
  4175. res.Body.Close()
  4176. }
  4177. return nil, &googleapi.Error{
  4178. Code: res.StatusCode,
  4179. Header: res.Header,
  4180. }
  4181. }
  4182. if err != nil {
  4183. return nil, err
  4184. }
  4185. defer googleapi.CloseBody(res)
  4186. if err := googleapi.CheckResponse(res); err != nil {
  4187. return nil, err
  4188. }
  4189. ret := &Operation{
  4190. ServerResponse: googleapi.ServerResponse{
  4191. Header: res.Header,
  4192. HTTPStatusCode: res.StatusCode,
  4193. },
  4194. }
  4195. target := &ret
  4196. if err := gensupport.DecodeResponse(target, res); err != nil {
  4197. return nil, err
  4198. }
  4199. return ret, nil
  4200. // {
  4201. // "description": "Gets information about a specific operation.",
  4202. // "httpMethod": "GET",
  4203. // "id": "deploymentmanager.operations.get",
  4204. // "parameterOrder": [
  4205. // "project",
  4206. // "operation"
  4207. // ],
  4208. // "parameters": {
  4209. // "operation": {
  4210. // "description": "The name of the operation for this request.",
  4211. // "location": "path",
  4212. // "required": true,
  4213. // "type": "string"
  4214. // },
  4215. // "project": {
  4216. // "description": "The project ID for this request.",
  4217. // "location": "path",
  4218. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4219. // "required": true,
  4220. // "type": "string"
  4221. // }
  4222. // },
  4223. // "path": "{project}/global/operations/{operation}",
  4224. // "response": {
  4225. // "$ref": "Operation"
  4226. // },
  4227. // "scopes": [
  4228. // "https://www.googleapis.com/auth/cloud-platform",
  4229. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4230. // "https://www.googleapis.com/auth/ndev.cloudman",
  4231. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  4232. // ]
  4233. // }
  4234. }
  4235. // method id "deploymentmanager.operations.list":
  4236. type OperationsListCall struct {
  4237. s *Service
  4238. project string
  4239. urlParams_ gensupport.URLParams
  4240. ifNoneMatch_ string
  4241. ctx_ context.Context
  4242. header_ http.Header
  4243. }
  4244. // List: Lists all operations for a project.
  4245. func (r *OperationsService) List(project string) *OperationsListCall {
  4246. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4247. c.project = project
  4248. return c
  4249. }
  4250. // Filter sets the optional parameter "filter": A filter expression that
  4251. // filters resources listed in the response. The expression must specify
  4252. // the field name, a comparison operator, and the value that you want to
  4253. // use for filtering. The value must be a string, a number, or a
  4254. // boolean. The comparison operator must be either =, !=, >, or <.
  4255. //
  4256. // For example, if you are filtering Compute Engine instances, you can
  4257. // exclude instances named example-instance by specifying name !=
  4258. // example-instance.
  4259. //
  4260. // You can also filter nested fields. For example, you could specify
  4261. // scheduling.automaticRestart = false to include instances only if they
  4262. // are not scheduled for automatic restarts. You can use filtering on
  4263. // nested fields to filter based on resource labels.
  4264. //
  4265. // To filter on multiple expressions, provide each separate expression
  4266. // within parentheses. For example, (scheduling.automaticRestart = true)
  4267. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  4268. // AND expression. However, you can include AND and OR expressions
  4269. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  4270. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  4271. // true).
  4272. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  4273. c.urlParams_.Set("filter", filter)
  4274. return c
  4275. }
  4276. // MaxResults sets the optional parameter "maxResults": The maximum
  4277. // number of results per page that should be returned. If the number of
  4278. // available results is larger than maxResults, Compute Engine returns a
  4279. // nextPageToken that can be used to get the next page of results in
  4280. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  4281. // (Default: 500)
  4282. func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
  4283. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4284. return c
  4285. }
  4286. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  4287. // a certain order. By default, results are returned in alphanumerical
  4288. // order based on the resource name.
  4289. //
  4290. // You can also sort results in descending order based on the creation
  4291. // timestamp using orderBy="creationTimestamp desc". This sorts results
  4292. // based on the creationTimestamp field in reverse chronological order
  4293. // (newest result first). Use this to sort resources like operations so
  4294. // that the newest operation is returned first.
  4295. //
  4296. // Currently, only sorting by name or creationTimestamp desc is
  4297. // supported.
  4298. func (c *OperationsListCall) OrderBy(orderBy string) *OperationsListCall {
  4299. c.urlParams_.Set("orderBy", orderBy)
  4300. return c
  4301. }
  4302. // PageToken sets the optional parameter "pageToken": Specifies a page
  4303. // token to use. Set pageToken to the nextPageToken returned by a
  4304. // previous list request to get the next page of results.
  4305. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  4306. c.urlParams_.Set("pageToken", pageToken)
  4307. return c
  4308. }
  4309. // Fields allows partial responses to be retrieved. See
  4310. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4311. // for more information.
  4312. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  4313. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4314. return c
  4315. }
  4316. // IfNoneMatch sets the optional parameter which makes the operation
  4317. // fail if the object's ETag matches the given value. This is useful for
  4318. // getting updates only after the object has changed since the last
  4319. // request. Use googleapi.IsNotModified to check whether the response
  4320. // error from Do is the result of In-None-Match.
  4321. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  4322. c.ifNoneMatch_ = entityTag
  4323. return c
  4324. }
  4325. // Context sets the context to be used in this call's Do method. Any
  4326. // pending HTTP request will be aborted if the provided context is
  4327. // canceled.
  4328. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  4329. c.ctx_ = ctx
  4330. return c
  4331. }
  4332. // Header returns an http.Header that can be modified by the caller to
  4333. // add HTTP headers to the request.
  4334. func (c *OperationsListCall) Header() http.Header {
  4335. if c.header_ == nil {
  4336. c.header_ = make(http.Header)
  4337. }
  4338. return c.header_
  4339. }
  4340. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  4341. reqHeaders := make(http.Header)
  4342. for k, v := range c.header_ {
  4343. reqHeaders[k] = v
  4344. }
  4345. reqHeaders.Set("User-Agent", c.s.userAgent())
  4346. if c.ifNoneMatch_ != "" {
  4347. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4348. }
  4349. var body io.Reader = nil
  4350. c.urlParams_.Set("alt", alt)
  4351. c.urlParams_.Set("prettyPrint", "false")
  4352. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  4353. urls += "?" + c.urlParams_.Encode()
  4354. req, err := http.NewRequest("GET", urls, body)
  4355. if err != nil {
  4356. return nil, err
  4357. }
  4358. req.Header = reqHeaders
  4359. googleapi.Expand(req.URL, map[string]string{
  4360. "project": c.project,
  4361. })
  4362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4363. }
  4364. // Do executes the "deploymentmanager.operations.list" call.
  4365. // Exactly one of *OperationsListResponse or error will be non-nil. Any
  4366. // non-2xx status code is an error. Response headers are in either
  4367. // *OperationsListResponse.ServerResponse.Header or (if a response was
  4368. // returned at all) in error.(*googleapi.Error).Header. Use
  4369. // googleapi.IsNotModified to check whether the returned error was
  4370. // because http.StatusNotModified was returned.
  4371. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
  4372. gensupport.SetOptions(c.urlParams_, opts...)
  4373. res, err := c.doRequest("json")
  4374. if res != nil && res.StatusCode == http.StatusNotModified {
  4375. if res.Body != nil {
  4376. res.Body.Close()
  4377. }
  4378. return nil, &googleapi.Error{
  4379. Code: res.StatusCode,
  4380. Header: res.Header,
  4381. }
  4382. }
  4383. if err != nil {
  4384. return nil, err
  4385. }
  4386. defer googleapi.CloseBody(res)
  4387. if err := googleapi.CheckResponse(res); err != nil {
  4388. return nil, err
  4389. }
  4390. ret := &OperationsListResponse{
  4391. ServerResponse: googleapi.ServerResponse{
  4392. Header: res.Header,
  4393. HTTPStatusCode: res.StatusCode,
  4394. },
  4395. }
  4396. target := &ret
  4397. if err := gensupport.DecodeResponse(target, res); err != nil {
  4398. return nil, err
  4399. }
  4400. return ret, nil
  4401. // {
  4402. // "description": "Lists all operations for a project.",
  4403. // "httpMethod": "GET",
  4404. // "id": "deploymentmanager.operations.list",
  4405. // "parameterOrder": [
  4406. // "project"
  4407. // ],
  4408. // "parameters": {
  4409. // "filter": {
  4410. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  4411. // "location": "query",
  4412. // "type": "string"
  4413. // },
  4414. // "maxResults": {
  4415. // "default": "500",
  4416. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  4417. // "format": "uint32",
  4418. // "location": "query",
  4419. // "minimum": "0",
  4420. // "type": "integer"
  4421. // },
  4422. // "orderBy": {
  4423. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  4424. // "location": "query",
  4425. // "type": "string"
  4426. // },
  4427. // "pageToken": {
  4428. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  4429. // "location": "query",
  4430. // "type": "string"
  4431. // },
  4432. // "project": {
  4433. // "description": "The project ID for this request.",
  4434. // "location": "path",
  4435. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4436. // "required": true,
  4437. // "type": "string"
  4438. // }
  4439. // },
  4440. // "path": "{project}/global/operations",
  4441. // "response": {
  4442. // "$ref": "OperationsListResponse"
  4443. // },
  4444. // "scopes": [
  4445. // "https://www.googleapis.com/auth/cloud-platform",
  4446. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4447. // "https://www.googleapis.com/auth/ndev.cloudman",
  4448. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  4449. // ]
  4450. // }
  4451. }
  4452. // Pages invokes f for each page of results.
  4453. // A non-nil error returned from f will halt the iteration.
  4454. // The provided context supersedes any context provided to the Context method.
  4455. func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
  4456. c.ctx_ = ctx
  4457. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4458. for {
  4459. x, err := c.Do()
  4460. if err != nil {
  4461. return err
  4462. }
  4463. if err := f(x); err != nil {
  4464. return err
  4465. }
  4466. if x.NextPageToken == "" {
  4467. return nil
  4468. }
  4469. c.PageToken(x.NextPageToken)
  4470. }
  4471. }
  4472. // method id "deploymentmanager.resources.get":
  4473. type ResourcesGetCall struct {
  4474. s *Service
  4475. project string
  4476. deployment string
  4477. resource string
  4478. urlParams_ gensupport.URLParams
  4479. ifNoneMatch_ string
  4480. ctx_ context.Context
  4481. header_ http.Header
  4482. }
  4483. // Get: Gets information about a single resource.
  4484. func (r *ResourcesService) Get(project string, deployment string, resource string) *ResourcesGetCall {
  4485. c := &ResourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4486. c.project = project
  4487. c.deployment = deployment
  4488. c.resource = resource
  4489. return c
  4490. }
  4491. // Fields allows partial responses to be retrieved. See
  4492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4493. // for more information.
  4494. func (c *ResourcesGetCall) Fields(s ...googleapi.Field) *ResourcesGetCall {
  4495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4496. return c
  4497. }
  4498. // IfNoneMatch sets the optional parameter which makes the operation
  4499. // fail if the object's ETag matches the given value. This is useful for
  4500. // getting updates only after the object has changed since the last
  4501. // request. Use googleapi.IsNotModified to check whether the response
  4502. // error from Do is the result of In-None-Match.
  4503. func (c *ResourcesGetCall) IfNoneMatch(entityTag string) *ResourcesGetCall {
  4504. c.ifNoneMatch_ = entityTag
  4505. return c
  4506. }
  4507. // Context sets the context to be used in this call's Do method. Any
  4508. // pending HTTP request will be aborted if the provided context is
  4509. // canceled.
  4510. func (c *ResourcesGetCall) Context(ctx context.Context) *ResourcesGetCall {
  4511. c.ctx_ = ctx
  4512. return c
  4513. }
  4514. // Header returns an http.Header that can be modified by the caller to
  4515. // add HTTP headers to the request.
  4516. func (c *ResourcesGetCall) Header() http.Header {
  4517. if c.header_ == nil {
  4518. c.header_ = make(http.Header)
  4519. }
  4520. return c.header_
  4521. }
  4522. func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) {
  4523. reqHeaders := make(http.Header)
  4524. for k, v := range c.header_ {
  4525. reqHeaders[k] = v
  4526. }
  4527. reqHeaders.Set("User-Agent", c.s.userAgent())
  4528. if c.ifNoneMatch_ != "" {
  4529. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4530. }
  4531. var body io.Reader = nil
  4532. c.urlParams_.Set("alt", alt)
  4533. c.urlParams_.Set("prettyPrint", "false")
  4534. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources/{resource}")
  4535. urls += "?" + c.urlParams_.Encode()
  4536. req, err := http.NewRequest("GET", urls, body)
  4537. if err != nil {
  4538. return nil, err
  4539. }
  4540. req.Header = reqHeaders
  4541. googleapi.Expand(req.URL, map[string]string{
  4542. "project": c.project,
  4543. "deployment": c.deployment,
  4544. "resource": c.resource,
  4545. })
  4546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4547. }
  4548. // Do executes the "deploymentmanager.resources.get" call.
  4549. // Exactly one of *Resource or error will be non-nil. Any non-2xx status
  4550. // code is an error. Response headers are in either
  4551. // *Resource.ServerResponse.Header or (if a response was returned at
  4552. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4553. // to check whether the returned error was because
  4554. // http.StatusNotModified was returned.
  4555. func (c *ResourcesGetCall) Do(opts ...googleapi.CallOption) (*Resource, error) {
  4556. gensupport.SetOptions(c.urlParams_, opts...)
  4557. res, err := c.doRequest("json")
  4558. if res != nil && res.StatusCode == http.StatusNotModified {
  4559. if res.Body != nil {
  4560. res.Body.Close()
  4561. }
  4562. return nil, &googleapi.Error{
  4563. Code: res.StatusCode,
  4564. Header: res.Header,
  4565. }
  4566. }
  4567. if err != nil {
  4568. return nil, err
  4569. }
  4570. defer googleapi.CloseBody(res)
  4571. if err := googleapi.CheckResponse(res); err != nil {
  4572. return nil, err
  4573. }
  4574. ret := &Resource{
  4575. ServerResponse: googleapi.ServerResponse{
  4576. Header: res.Header,
  4577. HTTPStatusCode: res.StatusCode,
  4578. },
  4579. }
  4580. target := &ret
  4581. if err := gensupport.DecodeResponse(target, res); err != nil {
  4582. return nil, err
  4583. }
  4584. return ret, nil
  4585. // {
  4586. // "description": "Gets information about a single resource.",
  4587. // "httpMethod": "GET",
  4588. // "id": "deploymentmanager.resources.get",
  4589. // "parameterOrder": [
  4590. // "project",
  4591. // "deployment",
  4592. // "resource"
  4593. // ],
  4594. // "parameters": {
  4595. // "deployment": {
  4596. // "description": "The name of the deployment for this request.",
  4597. // "location": "path",
  4598. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  4599. // "required": true,
  4600. // "type": "string"
  4601. // },
  4602. // "project": {
  4603. // "description": "The project ID for this request.",
  4604. // "location": "path",
  4605. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4606. // "required": true,
  4607. // "type": "string"
  4608. // },
  4609. // "resource": {
  4610. // "description": "The name of the resource for this request.",
  4611. // "location": "path",
  4612. // "required": true,
  4613. // "type": "string"
  4614. // }
  4615. // },
  4616. // "path": "{project}/global/deployments/{deployment}/resources/{resource}",
  4617. // "response": {
  4618. // "$ref": "Resource"
  4619. // },
  4620. // "scopes": [
  4621. // "https://www.googleapis.com/auth/cloud-platform",
  4622. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4623. // "https://www.googleapis.com/auth/ndev.cloudman",
  4624. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  4625. // ]
  4626. // }
  4627. }
  4628. // method id "deploymentmanager.resources.list":
  4629. type ResourcesListCall struct {
  4630. s *Service
  4631. project string
  4632. deployment string
  4633. urlParams_ gensupport.URLParams
  4634. ifNoneMatch_ string
  4635. ctx_ context.Context
  4636. header_ http.Header
  4637. }
  4638. // List: Lists all resources in a given deployment.
  4639. func (r *ResourcesService) List(project string, deployment string) *ResourcesListCall {
  4640. c := &ResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4641. c.project = project
  4642. c.deployment = deployment
  4643. return c
  4644. }
  4645. // Filter sets the optional parameter "filter": A filter expression that
  4646. // filters resources listed in the response. The expression must specify
  4647. // the field name, a comparison operator, and the value that you want to
  4648. // use for filtering. The value must be a string, a number, or a
  4649. // boolean. The comparison operator must be either =, !=, >, or <.
  4650. //
  4651. // For example, if you are filtering Compute Engine instances, you can
  4652. // exclude instances named example-instance by specifying name !=
  4653. // example-instance.
  4654. //
  4655. // You can also filter nested fields. For example, you could specify
  4656. // scheduling.automaticRestart = false to include instances only if they
  4657. // are not scheduled for automatic restarts. You can use filtering on
  4658. // nested fields to filter based on resource labels.
  4659. //
  4660. // To filter on multiple expressions, provide each separate expression
  4661. // within parentheses. For example, (scheduling.automaticRestart = true)
  4662. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  4663. // AND expression. However, you can include AND and OR expressions
  4664. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  4665. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  4666. // true).
  4667. func (c *ResourcesListCall) Filter(filter string) *ResourcesListCall {
  4668. c.urlParams_.Set("filter", filter)
  4669. return c
  4670. }
  4671. // MaxResults sets the optional parameter "maxResults": The maximum
  4672. // number of results per page that should be returned. If the number of
  4673. // available results is larger than maxResults, Compute Engine returns a
  4674. // nextPageToken that can be used to get the next page of results in
  4675. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  4676. // (Default: 500)
  4677. func (c *ResourcesListCall) MaxResults(maxResults int64) *ResourcesListCall {
  4678. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4679. return c
  4680. }
  4681. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  4682. // a certain order. By default, results are returned in alphanumerical
  4683. // order based on the resource name.
  4684. //
  4685. // You can also sort results in descending order based on the creation
  4686. // timestamp using orderBy="creationTimestamp desc". This sorts results
  4687. // based on the creationTimestamp field in reverse chronological order
  4688. // (newest result first). Use this to sort resources like operations so
  4689. // that the newest operation is returned first.
  4690. //
  4691. // Currently, only sorting by name or creationTimestamp desc is
  4692. // supported.
  4693. func (c *ResourcesListCall) OrderBy(orderBy string) *ResourcesListCall {
  4694. c.urlParams_.Set("orderBy", orderBy)
  4695. return c
  4696. }
  4697. // PageToken sets the optional parameter "pageToken": Specifies a page
  4698. // token to use. Set pageToken to the nextPageToken returned by a
  4699. // previous list request to get the next page of results.
  4700. func (c *ResourcesListCall) PageToken(pageToken string) *ResourcesListCall {
  4701. c.urlParams_.Set("pageToken", pageToken)
  4702. return c
  4703. }
  4704. // Fields allows partial responses to be retrieved. See
  4705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4706. // for more information.
  4707. func (c *ResourcesListCall) Fields(s ...googleapi.Field) *ResourcesListCall {
  4708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4709. return c
  4710. }
  4711. // IfNoneMatch sets the optional parameter which makes the operation
  4712. // fail if the object's ETag matches the given value. This is useful for
  4713. // getting updates only after the object has changed since the last
  4714. // request. Use googleapi.IsNotModified to check whether the response
  4715. // error from Do is the result of In-None-Match.
  4716. func (c *ResourcesListCall) IfNoneMatch(entityTag string) *ResourcesListCall {
  4717. c.ifNoneMatch_ = entityTag
  4718. return c
  4719. }
  4720. // Context sets the context to be used in this call's Do method. Any
  4721. // pending HTTP request will be aborted if the provided context is
  4722. // canceled.
  4723. func (c *ResourcesListCall) Context(ctx context.Context) *ResourcesListCall {
  4724. c.ctx_ = ctx
  4725. return c
  4726. }
  4727. // Header returns an http.Header that can be modified by the caller to
  4728. // add HTTP headers to the request.
  4729. func (c *ResourcesListCall) Header() http.Header {
  4730. if c.header_ == nil {
  4731. c.header_ = make(http.Header)
  4732. }
  4733. return c.header_
  4734. }
  4735. func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) {
  4736. reqHeaders := make(http.Header)
  4737. for k, v := range c.header_ {
  4738. reqHeaders[k] = v
  4739. }
  4740. reqHeaders.Set("User-Agent", c.s.userAgent())
  4741. if c.ifNoneMatch_ != "" {
  4742. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4743. }
  4744. var body io.Reader = nil
  4745. c.urlParams_.Set("alt", alt)
  4746. c.urlParams_.Set("prettyPrint", "false")
  4747. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources")
  4748. urls += "?" + c.urlParams_.Encode()
  4749. req, err := http.NewRequest("GET", urls, body)
  4750. if err != nil {
  4751. return nil, err
  4752. }
  4753. req.Header = reqHeaders
  4754. googleapi.Expand(req.URL, map[string]string{
  4755. "project": c.project,
  4756. "deployment": c.deployment,
  4757. })
  4758. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4759. }
  4760. // Do executes the "deploymentmanager.resources.list" call.
  4761. // Exactly one of *ResourcesListResponse or error will be non-nil. Any
  4762. // non-2xx status code is an error. Response headers are in either
  4763. // *ResourcesListResponse.ServerResponse.Header or (if a response was
  4764. // returned at all) in error.(*googleapi.Error).Header. Use
  4765. // googleapi.IsNotModified to check whether the returned error was
  4766. // because http.StatusNotModified was returned.
  4767. func (c *ResourcesListCall) Do(opts ...googleapi.CallOption) (*ResourcesListResponse, error) {
  4768. gensupport.SetOptions(c.urlParams_, opts...)
  4769. res, err := c.doRequest("json")
  4770. if res != nil && res.StatusCode == http.StatusNotModified {
  4771. if res.Body != nil {
  4772. res.Body.Close()
  4773. }
  4774. return nil, &googleapi.Error{
  4775. Code: res.StatusCode,
  4776. Header: res.Header,
  4777. }
  4778. }
  4779. if err != nil {
  4780. return nil, err
  4781. }
  4782. defer googleapi.CloseBody(res)
  4783. if err := googleapi.CheckResponse(res); err != nil {
  4784. return nil, err
  4785. }
  4786. ret := &ResourcesListResponse{
  4787. ServerResponse: googleapi.ServerResponse{
  4788. Header: res.Header,
  4789. HTTPStatusCode: res.StatusCode,
  4790. },
  4791. }
  4792. target := &ret
  4793. if err := gensupport.DecodeResponse(target, res); err != nil {
  4794. return nil, err
  4795. }
  4796. return ret, nil
  4797. // {
  4798. // "description": "Lists all resources in a given deployment.",
  4799. // "httpMethod": "GET",
  4800. // "id": "deploymentmanager.resources.list",
  4801. // "parameterOrder": [
  4802. // "project",
  4803. // "deployment"
  4804. // ],
  4805. // "parameters": {
  4806. // "deployment": {
  4807. // "description": "The name of the deployment for this request.",
  4808. // "location": "path",
  4809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  4810. // "required": true,
  4811. // "type": "string"
  4812. // },
  4813. // "filter": {
  4814. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  4815. // "location": "query",
  4816. // "type": "string"
  4817. // },
  4818. // "maxResults": {
  4819. // "default": "500",
  4820. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  4821. // "format": "uint32",
  4822. // "location": "query",
  4823. // "minimum": "0",
  4824. // "type": "integer"
  4825. // },
  4826. // "orderBy": {
  4827. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  4828. // "location": "query",
  4829. // "type": "string"
  4830. // },
  4831. // "pageToken": {
  4832. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  4833. // "location": "query",
  4834. // "type": "string"
  4835. // },
  4836. // "project": {
  4837. // "description": "The project ID for this request.",
  4838. // "location": "path",
  4839. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  4840. // "required": true,
  4841. // "type": "string"
  4842. // }
  4843. // },
  4844. // "path": "{project}/global/deployments/{deployment}/resources",
  4845. // "response": {
  4846. // "$ref": "ResourcesListResponse"
  4847. // },
  4848. // "scopes": [
  4849. // "https://www.googleapis.com/auth/cloud-platform",
  4850. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4851. // "https://www.googleapis.com/auth/ndev.cloudman",
  4852. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  4853. // ]
  4854. // }
  4855. }
  4856. // Pages invokes f for each page of results.
  4857. // A non-nil error returned from f will halt the iteration.
  4858. // The provided context supersedes any context provided to the Context method.
  4859. func (c *ResourcesListCall) Pages(ctx context.Context, f func(*ResourcesListResponse) error) error {
  4860. c.ctx_ = ctx
  4861. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4862. for {
  4863. x, err := c.Do()
  4864. if err != nil {
  4865. return err
  4866. }
  4867. if err := f(x); err != nil {
  4868. return err
  4869. }
  4870. if x.NextPageToken == "" {
  4871. return nil
  4872. }
  4873. c.PageToken(x.NextPageToken)
  4874. }
  4875. }
  4876. // method id "deploymentmanager.types.list":
  4877. type TypesListCall struct {
  4878. s *Service
  4879. project string
  4880. urlParams_ gensupport.URLParams
  4881. ifNoneMatch_ string
  4882. ctx_ context.Context
  4883. header_ http.Header
  4884. }
  4885. // List: Lists all resource types for Deployment Manager.
  4886. func (r *TypesService) List(project string) *TypesListCall {
  4887. c := &TypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4888. c.project = project
  4889. return c
  4890. }
  4891. // Filter sets the optional parameter "filter": A filter expression that
  4892. // filters resources listed in the response. The expression must specify
  4893. // the field name, a comparison operator, and the value that you want to
  4894. // use for filtering. The value must be a string, a number, or a
  4895. // boolean. The comparison operator must be either =, !=, >, or <.
  4896. //
  4897. // For example, if you are filtering Compute Engine instances, you can
  4898. // exclude instances named example-instance by specifying name !=
  4899. // example-instance.
  4900. //
  4901. // You can also filter nested fields. For example, you could specify
  4902. // scheduling.automaticRestart = false to include instances only if they
  4903. // are not scheduled for automatic restarts. You can use filtering on
  4904. // nested fields to filter based on resource labels.
  4905. //
  4906. // To filter on multiple expressions, provide each separate expression
  4907. // within parentheses. For example, (scheduling.automaticRestart = true)
  4908. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  4909. // AND expression. However, you can include AND and OR expressions
  4910. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  4911. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  4912. // true).
  4913. func (c *TypesListCall) Filter(filter string) *TypesListCall {
  4914. c.urlParams_.Set("filter", filter)
  4915. return c
  4916. }
  4917. // MaxResults sets the optional parameter "maxResults": The maximum
  4918. // number of results per page that should be returned. If the number of
  4919. // available results is larger than maxResults, Compute Engine returns a
  4920. // nextPageToken that can be used to get the next page of results in
  4921. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  4922. // (Default: 500)
  4923. func (c *TypesListCall) MaxResults(maxResults int64) *TypesListCall {
  4924. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4925. return c
  4926. }
  4927. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  4928. // a certain order. By default, results are returned in alphanumerical
  4929. // order based on the resource name.
  4930. //
  4931. // You can also sort results in descending order based on the creation
  4932. // timestamp using orderBy="creationTimestamp desc". This sorts results
  4933. // based on the creationTimestamp field in reverse chronological order
  4934. // (newest result first). Use this to sort resources like operations so
  4935. // that the newest operation is returned first.
  4936. //
  4937. // Currently, only sorting by name or creationTimestamp desc is
  4938. // supported.
  4939. func (c *TypesListCall) OrderBy(orderBy string) *TypesListCall {
  4940. c.urlParams_.Set("orderBy", orderBy)
  4941. return c
  4942. }
  4943. // PageToken sets the optional parameter "pageToken": Specifies a page
  4944. // token to use. Set pageToken to the nextPageToken returned by a
  4945. // previous list request to get the next page of results.
  4946. func (c *TypesListCall) PageToken(pageToken string) *TypesListCall {
  4947. c.urlParams_.Set("pageToken", pageToken)
  4948. return c
  4949. }
  4950. // Fields allows partial responses to be retrieved. See
  4951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4952. // for more information.
  4953. func (c *TypesListCall) Fields(s ...googleapi.Field) *TypesListCall {
  4954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4955. return c
  4956. }
  4957. // IfNoneMatch sets the optional parameter which makes the operation
  4958. // fail if the object's ETag matches the given value. This is useful for
  4959. // getting updates only after the object has changed since the last
  4960. // request. Use googleapi.IsNotModified to check whether the response
  4961. // error from Do is the result of In-None-Match.
  4962. func (c *TypesListCall) IfNoneMatch(entityTag string) *TypesListCall {
  4963. c.ifNoneMatch_ = entityTag
  4964. return c
  4965. }
  4966. // Context sets the context to be used in this call's Do method. Any
  4967. // pending HTTP request will be aborted if the provided context is
  4968. // canceled.
  4969. func (c *TypesListCall) Context(ctx context.Context) *TypesListCall {
  4970. c.ctx_ = ctx
  4971. return c
  4972. }
  4973. // Header returns an http.Header that can be modified by the caller to
  4974. // add HTTP headers to the request.
  4975. func (c *TypesListCall) Header() http.Header {
  4976. if c.header_ == nil {
  4977. c.header_ = make(http.Header)
  4978. }
  4979. return c.header_
  4980. }
  4981. func (c *TypesListCall) doRequest(alt string) (*http.Response, error) {
  4982. reqHeaders := make(http.Header)
  4983. for k, v := range c.header_ {
  4984. reqHeaders[k] = v
  4985. }
  4986. reqHeaders.Set("User-Agent", c.s.userAgent())
  4987. if c.ifNoneMatch_ != "" {
  4988. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4989. }
  4990. var body io.Reader = nil
  4991. c.urlParams_.Set("alt", alt)
  4992. c.urlParams_.Set("prettyPrint", "false")
  4993. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types")
  4994. urls += "?" + c.urlParams_.Encode()
  4995. req, err := http.NewRequest("GET", urls, body)
  4996. if err != nil {
  4997. return nil, err
  4998. }
  4999. req.Header = reqHeaders
  5000. googleapi.Expand(req.URL, map[string]string{
  5001. "project": c.project,
  5002. })
  5003. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5004. }
  5005. // Do executes the "deploymentmanager.types.list" call.
  5006. // Exactly one of *TypesListResponse or error will be non-nil. Any
  5007. // non-2xx status code is an error. Response headers are in either
  5008. // *TypesListResponse.ServerResponse.Header or (if a response was
  5009. // returned at all) in error.(*googleapi.Error).Header. Use
  5010. // googleapi.IsNotModified to check whether the returned error was
  5011. // because http.StatusNotModified was returned.
  5012. func (c *TypesListCall) Do(opts ...googleapi.CallOption) (*TypesListResponse, error) {
  5013. gensupport.SetOptions(c.urlParams_, opts...)
  5014. res, err := c.doRequest("json")
  5015. if res != nil && res.StatusCode == http.StatusNotModified {
  5016. if res.Body != nil {
  5017. res.Body.Close()
  5018. }
  5019. return nil, &googleapi.Error{
  5020. Code: res.StatusCode,
  5021. Header: res.Header,
  5022. }
  5023. }
  5024. if err != nil {
  5025. return nil, err
  5026. }
  5027. defer googleapi.CloseBody(res)
  5028. if err := googleapi.CheckResponse(res); err != nil {
  5029. return nil, err
  5030. }
  5031. ret := &TypesListResponse{
  5032. ServerResponse: googleapi.ServerResponse{
  5033. Header: res.Header,
  5034. HTTPStatusCode: res.StatusCode,
  5035. },
  5036. }
  5037. target := &ret
  5038. if err := gensupport.DecodeResponse(target, res); err != nil {
  5039. return nil, err
  5040. }
  5041. return ret, nil
  5042. // {
  5043. // "description": "Lists all resource types for Deployment Manager.",
  5044. // "httpMethod": "GET",
  5045. // "id": "deploymentmanager.types.list",
  5046. // "parameterOrder": [
  5047. // "project"
  5048. // ],
  5049. // "parameters": {
  5050. // "filter": {
  5051. // "description": "A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either =, !=, \u003e, or \u003c.\n\nFor example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.\n\nYou can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.\n\nTo filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = \"Intel Skylake\"). By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example, (cpuPlatform = \"Intel Skylake\") OR (cpuPlatform = \"Intel Broadwell\") AND (scheduling.automaticRestart = true).",
  5052. // "location": "query",
  5053. // "type": "string"
  5054. // },
  5055. // "maxResults": {
  5056. // "default": "500",
  5057. // "description": "The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)",
  5058. // "format": "uint32",
  5059. // "location": "query",
  5060. // "minimum": "0",
  5061. // "type": "integer"
  5062. // },
  5063. // "orderBy": {
  5064. // "description": "Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.\n\nYou can also sort results in descending order based on the creation timestamp using orderBy=\"creationTimestamp desc\". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.\n\nCurrently, only sorting by name or creationTimestamp desc is supported.",
  5065. // "location": "query",
  5066. // "type": "string"
  5067. // },
  5068. // "pageToken": {
  5069. // "description": "Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.",
  5070. // "location": "query",
  5071. // "type": "string"
  5072. // },
  5073. // "project": {
  5074. // "description": "The project ID for this request.",
  5075. // "location": "path",
  5076. // "pattern": "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))",
  5077. // "required": true,
  5078. // "type": "string"
  5079. // }
  5080. // },
  5081. // "path": "{project}/global/types",
  5082. // "response": {
  5083. // "$ref": "TypesListResponse"
  5084. // },
  5085. // "scopes": [
  5086. // "https://www.googleapis.com/auth/cloud-platform",
  5087. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  5088. // "https://www.googleapis.com/auth/ndev.cloudman",
  5089. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  5090. // ]
  5091. // }
  5092. }
  5093. // Pages invokes f for each page of results.
  5094. // A non-nil error returned from f will halt the iteration.
  5095. // The provided context supersedes any context provided to the Context method.
  5096. func (c *TypesListCall) Pages(ctx context.Context, f func(*TypesListResponse) error) error {
  5097. c.ctx_ = ctx
  5098. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5099. for {
  5100. x, err := c.Do()
  5101. if err != nil {
  5102. return err
  5103. }
  5104. if err := f(x); err != nil {
  5105. return err
  5106. }
  5107. if x.NextPageToken == "" {
  5108. return nil
  5109. }
  5110. c.PageToken(x.NextPageToken)
  5111. }
  5112. }