25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

5523 satır
212 KiB

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