You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

9809 lines
362 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package deploymentmanager provides access to the Google Cloud Deployment Manager Alpha API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/deployment-manager/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/deploymentmanager/v0.alpha"
  14. // ...
  15. // ctx := context.Background()
  16. // deploymentmanagerService, err := deploymentmanager.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithScopes(deploymentmanager.NdevCloudmanReadonlyScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // deploymentmanagerService, err := deploymentmanager.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package deploymentmanager // import "google.golang.org/api/deploymentmanager/v0.alpha"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "deploymentmanager:alpha"
  71. const apiName = "deploymentmanager"
  72. const apiVersion = "alpha"
  73. const basePath = "https://www.googleapis.com/deploymentmanager/alpha/projects/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage your data across Google Cloud Platform services
  77. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  78. // View your data across Google Cloud Platform services
  79. CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
  80. // View and manage your Google Cloud Platform management resources and
  81. // deployment status information
  82. NdevCloudmanScope = "https://www.googleapis.com/auth/ndev.cloudman"
  83. // View your Google Cloud Platform management resources and deployment
  84. // status information
  85. NdevCloudmanReadonlyScope = "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  86. )
  87. // NewService creates a new Service.
  88. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  89. scopesOption := option.WithScopes(
  90. "https://www.googleapis.com/auth/cloud-platform",
  91. "https://www.googleapis.com/auth/cloud-platform.read-only",
  92. "https://www.googleapis.com/auth/ndev.cloudman",
  93. "https://www.googleapis.com/auth/ndev.cloudman.readonly",
  94. )
  95. // NOTE: prepend, so we don't override user-specified scopes.
  96. opts = append([]option.ClientOption{scopesOption}, opts...)
  97. client, endpoint, err := htransport.NewClient(ctx, opts...)
  98. if err != nil {
  99. return nil, err
  100. }
  101. s, err := New(client)
  102. if err != nil {
  103. return nil, err
  104. }
  105. if endpoint != "" {
  106. s.BasePath = endpoint
  107. }
  108. return s, nil
  109. }
  110. // New creates a new Service. It uses the provided http.Client for requests.
  111. //
  112. // Deprecated: please use NewService instead.
  113. // To provide a custom HTTP client, use option.WithHTTPClient.
  114. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  115. func New(client *http.Client) (*Service, error) {
  116. if client == nil {
  117. return nil, errors.New("client is nil")
  118. }
  119. s := &Service{client: client, BasePath: basePath}
  120. s.CompositeTypes = NewCompositeTypesService(s)
  121. s.Deployments = NewDeploymentsService(s)
  122. s.Manifests = NewManifestsService(s)
  123. s.Operations = NewOperationsService(s)
  124. s.Resources = NewResourcesService(s)
  125. s.TypeProviders = NewTypeProvidersService(s)
  126. s.Types = NewTypesService(s)
  127. return s, nil
  128. }
  129. type Service struct {
  130. client *http.Client
  131. BasePath string // API endpoint base URL
  132. UserAgent string // optional additional User-Agent fragment
  133. CompositeTypes *CompositeTypesService
  134. Deployments *DeploymentsService
  135. Manifests *ManifestsService
  136. Operations *OperationsService
  137. Resources *ResourcesService
  138. TypeProviders *TypeProvidersService
  139. Types *TypesService
  140. }
  141. func (s *Service) userAgent() string {
  142. if s.UserAgent == "" {
  143. return googleapi.UserAgent
  144. }
  145. return googleapi.UserAgent + " " + s.UserAgent
  146. }
  147. func NewCompositeTypesService(s *Service) *CompositeTypesService {
  148. rs := &CompositeTypesService{s: s}
  149. return rs
  150. }
  151. type CompositeTypesService struct {
  152. s *Service
  153. }
  154. func NewDeploymentsService(s *Service) *DeploymentsService {
  155. rs := &DeploymentsService{s: s}
  156. return rs
  157. }
  158. type DeploymentsService struct {
  159. s *Service
  160. }
  161. func NewManifestsService(s *Service) *ManifestsService {
  162. rs := &ManifestsService{s: s}
  163. return rs
  164. }
  165. type ManifestsService struct {
  166. s *Service
  167. }
  168. func NewOperationsService(s *Service) *OperationsService {
  169. rs := &OperationsService{s: s}
  170. return rs
  171. }
  172. type OperationsService struct {
  173. s *Service
  174. }
  175. func NewResourcesService(s *Service) *ResourcesService {
  176. rs := &ResourcesService{s: s}
  177. return rs
  178. }
  179. type ResourcesService struct {
  180. s *Service
  181. }
  182. func NewTypeProvidersService(s *Service) *TypeProvidersService {
  183. rs := &TypeProvidersService{s: s}
  184. return rs
  185. }
  186. type TypeProvidersService struct {
  187. s *Service
  188. }
  189. func NewTypesService(s *Service) *TypesService {
  190. rs := &TypesService{s: s}
  191. return rs
  192. }
  193. type TypesService struct {
  194. s *Service
  195. }
  196. // AsyncOptions: Async options that determine when a resource should
  197. // finish.
  198. type AsyncOptions struct {
  199. // MethodMatch: Method regex where this policy will apply.
  200. MethodMatch string `json:"methodMatch,omitempty"`
  201. // PollingOptions: Deployment manager will poll instances for this API
  202. // resource setting a RUNNING state, and blocking until polling
  203. // conditions tell whether the resource is completed or failed.
  204. PollingOptions *PollingOptions `json:"pollingOptions,omitempty"`
  205. // ForceSendFields is a list of field names (e.g. "MethodMatch") to
  206. // unconditionally include in API requests. By default, fields with
  207. // empty values are omitted from API requests. However, any non-pointer,
  208. // non-interface field appearing in ForceSendFields will be sent to the
  209. // server regardless of whether the field is empty or not. This may be
  210. // used to include empty fields in Patch requests.
  211. ForceSendFields []string `json:"-"`
  212. // NullFields is a list of field names (e.g. "MethodMatch") to include
  213. // in API requests with the JSON null value. By default, fields with
  214. // empty values are omitted from API requests. However, any field with
  215. // an empty value appearing in NullFields will be sent to the server as
  216. // null. It is an error if a field in this list has a non-empty value.
  217. // This may be used to include null fields in Patch requests.
  218. NullFields []string `json:"-"`
  219. }
  220. func (s *AsyncOptions) MarshalJSON() ([]byte, error) {
  221. type NoMethod AsyncOptions
  222. raw := NoMethod(*s)
  223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  224. }
  225. // AuditConfig: Specifies the audit configuration for a service. The
  226. // configuration determines which permission types are logged, and what
  227. // identities, if any, are exempted from logging. An AuditConfig must
  228. // have one or more AuditLogConfigs.
  229. //
  230. // If there are AuditConfigs for both `allServices` and a specific
  231. // service, the union of the two AuditConfigs is used for that service:
  232. // the log_types specified in each AuditConfig are enabled, and the
  233. // exempted_members in each AuditLogConfig are exempted.
  234. //
  235. // Example Policy with multiple AuditConfigs:
  236. //
  237. // { "audit_configs": [ { "service": "allServices" "audit_log_configs":
  238. // [ { "log_type": "DATA_READ", "exempted_members": [
  239. // "user:foo@gmail.com" ] }, { "log_type": "DATA_WRITE", }, {
  240. // "log_type": "ADMIN_READ", } ] }, { "service":
  241. // "fooservice.googleapis.com" "audit_log_configs": [ { "log_type":
  242. // "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [
  243. // "user:bar@gmail.com" ] } ] } ] }
  244. //
  245. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  246. // ADMIN_READ logging. It also exempts foo@gmail.com from DATA_READ
  247. // logging, and bar@gmail.com from DATA_WRITE logging.
  248. type AuditConfig struct {
  249. // AuditLogConfigs: The configuration for logging of each type of
  250. // permission.
  251. AuditLogConfigs []*AuditLogConfig `json:"auditLogConfigs,omitempty"`
  252. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  253. // Service: Specifies a service that will be enabled for audit logging.
  254. // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
  255. // `allServices` is a special value that covers all services.
  256. Service string `json:"service,omitempty"`
  257. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  258. // unconditionally include in API requests. By default, fields with
  259. // empty values are omitted from API requests. However, any non-pointer,
  260. // non-interface field appearing in ForceSendFields will be sent to the
  261. // server regardless of whether the field is empty or not. This may be
  262. // used to include empty fields in Patch requests.
  263. ForceSendFields []string `json:"-"`
  264. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  265. // include in API requests with the JSON null value. By default, fields
  266. // with empty values are omitted from API requests. However, any field
  267. // with an empty value appearing in NullFields will be sent to the
  268. // server as null. It is an error if a field in this list has a
  269. // non-empty value. This may be used to include null fields in Patch
  270. // requests.
  271. NullFields []string `json:"-"`
  272. }
  273. func (s *AuditConfig) MarshalJSON() ([]byte, error) {
  274. type NoMethod AuditConfig
  275. raw := NoMethod(*s)
  276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  277. }
  278. // AuditLogConfig: Provides the configuration for logging a type of
  279. // permissions. Example:
  280. //
  281. // { "audit_log_configs": [ { "log_type": "DATA_READ",
  282. // "exempted_members": [ "user:foo@gmail.com" ] }, { "log_type":
  283. // "DATA_WRITE", } ] }
  284. //
  285. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting
  286. // foo@gmail.com from DATA_READ logging.
  287. type AuditLogConfig struct {
  288. // ExemptedMembers: Specifies the identities that do not cause logging
  289. // for this type of permission. Follows the same format of
  290. // [Binding.members][].
  291. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  292. // LogType: The log type that this config enables.
  293. LogType string `json:"logType,omitempty"`
  294. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  295. // unconditionally include in API requests. By default, fields with
  296. // empty values are omitted from API requests. However, any non-pointer,
  297. // non-interface field appearing in ForceSendFields will be sent to the
  298. // server regardless of whether the field is empty or not. This may be
  299. // used to include empty fields in Patch requests.
  300. ForceSendFields []string `json:"-"`
  301. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  302. // include in API requests with the JSON null value. By default, fields
  303. // with empty values are omitted from API requests. However, any field
  304. // with an empty value appearing in NullFields will be sent to the
  305. // server as null. It is an error if a field in this list has a
  306. // non-empty value. This may be used to include null fields in Patch
  307. // requests.
  308. NullFields []string `json:"-"`
  309. }
  310. func (s *AuditLogConfig) MarshalJSON() ([]byte, error) {
  311. type NoMethod AuditLogConfig
  312. raw := NoMethod(*s)
  313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  314. }
  315. // AuthorizationLoggingOptions: Authorization-related information used
  316. // by Cloud Audit Logging.
  317. type AuthorizationLoggingOptions struct {
  318. // PermissionType: The type of the permission that was checked.
  319. PermissionType string `json:"permissionType,omitempty"`
  320. // ForceSendFields is a list of field names (e.g. "PermissionType") to
  321. // unconditionally include in API requests. By default, fields with
  322. // empty values are omitted from API requests. However, any non-pointer,
  323. // non-interface field appearing in ForceSendFields will be sent to the
  324. // server regardless of whether the field is empty or not. This may be
  325. // used to include empty fields in Patch requests.
  326. ForceSendFields []string `json:"-"`
  327. // NullFields is a list of field names (e.g. "PermissionType") to
  328. // include in API requests with the JSON null value. By default, fields
  329. // with empty values are omitted from API requests. However, any field
  330. // with an empty value appearing in NullFields will be sent to the
  331. // server as null. It is an error if a field in this list has a
  332. // non-empty value. This may be used to include null fields in Patch
  333. // requests.
  334. NullFields []string `json:"-"`
  335. }
  336. func (s *AuthorizationLoggingOptions) MarshalJSON() ([]byte, error) {
  337. type NoMethod AuthorizationLoggingOptions
  338. raw := NoMethod(*s)
  339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  340. }
  341. // BasicAuth: Basic Auth used as a credential.
  342. type BasicAuth struct {
  343. Password string `json:"password,omitempty"`
  344. User string `json:"user,omitempty"`
  345. // ForceSendFields is a list of field names (e.g. "Password") to
  346. // unconditionally include in API requests. By default, fields with
  347. // empty values are omitted from API requests. However, any non-pointer,
  348. // non-interface field appearing in ForceSendFields will be sent to the
  349. // server regardless of whether the field is empty or not. This may be
  350. // used to include empty fields in Patch requests.
  351. ForceSendFields []string `json:"-"`
  352. // NullFields is a list of field names (e.g. "Password") to include in
  353. // API requests with the JSON null value. By default, fields with empty
  354. // values are omitted from API requests. However, any field with an
  355. // empty value appearing in NullFields will be sent to the server as
  356. // null. It is an error if a field in this list has a non-empty value.
  357. // This may be used to include null fields in Patch requests.
  358. NullFields []string `json:"-"`
  359. }
  360. func (s *BasicAuth) MarshalJSON() ([]byte, error) {
  361. type NoMethod BasicAuth
  362. raw := NoMethod(*s)
  363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  364. }
  365. // Binding: Associates `members` with a `role`.
  366. type Binding struct {
  367. // Condition: Unimplemented. The condition that is associated with this
  368. // binding. NOTE: an unsatisfied condition will not allow user access
  369. // via current binding. Different bindings, including their conditions,
  370. // are examined independently.
  371. Condition *Expr `json:"condition,omitempty"`
  372. // Members: Specifies the identities requesting access for a Cloud
  373. // Platform resource. `members` can have the following values:
  374. //
  375. // * `allUsers`: A special identifier that represents anyone who is on
  376. // the internet; with or without a Google account.
  377. //
  378. // * `allAuthenticatedUsers`: A special identifier that represents
  379. // anyone who is authenticated with a Google account or a service
  380. // account.
  381. //
  382. // * `user:{emailid}`: An email address that represents a specific
  383. // Google account. For example, `alice@gmail.com` .
  384. //
  385. //
  386. //
  387. // * `serviceAccount:{emailid}`: An email address that represents a
  388. // service account. For example,
  389. // `my-other-app@appspot.gserviceaccount.com`.
  390. //
  391. // * `group:{emailid}`: An email address that represents a Google group.
  392. // For example, `admins@example.com`.
  393. //
  394. //
  395. //
  396. // * `domain:{domain}`: A Google Apps domain name that represents all
  397. // the users of that domain. For example, `google.com` or `example.com`.
  398. Members []string `json:"members,omitempty"`
  399. // Role: Role that is assigned to `members`. For example,
  400. // `roles/viewer`, `roles/editor`, or `roles/owner`.
  401. Role string `json:"role,omitempty"`
  402. // ForceSendFields is a list of field names (e.g. "Condition") to
  403. // unconditionally include in API requests. By default, fields with
  404. // empty values are omitted from API requests. However, any non-pointer,
  405. // non-interface field appearing in ForceSendFields will be sent to the
  406. // server regardless of whether the field is empty or not. This may be
  407. // used to include empty fields in Patch requests.
  408. ForceSendFields []string `json:"-"`
  409. // NullFields is a list of field names (e.g. "Condition") to include in
  410. // API requests with the JSON null value. By default, fields with empty
  411. // values are omitted from API requests. However, any field with an
  412. // empty value appearing in NullFields will be sent to the server as
  413. // null. It is an error if a field in this list has a non-empty value.
  414. // This may be used to include null fields in Patch requests.
  415. NullFields []string `json:"-"`
  416. }
  417. func (s *Binding) MarshalJSON() ([]byte, error) {
  418. type NoMethod Binding
  419. raw := NoMethod(*s)
  420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  421. }
  422. // CollectionOverride: CollectionOverride allows resource handling
  423. // overrides for specific resources within a BaseType
  424. type CollectionOverride struct {
  425. // Collection: The collection that identifies this resource within its
  426. // service.
  427. Collection string `json:"collection,omitempty"`
  428. // MethodMap: Custom verb method mappings to support unordered list API
  429. // mappings.
  430. MethodMap *MethodMap `json:"methodMap,omitempty"`
  431. // Options: The options to apply to this resource-level override
  432. Options *Options `json:"options,omitempty"`
  433. // ForceSendFields is a list of field names (e.g. "Collection") to
  434. // unconditionally include in API requests. By default, fields with
  435. // empty values are omitted from API requests. However, any non-pointer,
  436. // non-interface field appearing in ForceSendFields will be sent to the
  437. // server regardless of whether the field is empty or not. This may be
  438. // used to include empty fields in Patch requests.
  439. ForceSendFields []string `json:"-"`
  440. // NullFields is a list of field names (e.g. "Collection") to include in
  441. // API requests with the JSON null value. By default, fields with empty
  442. // values are omitted from API requests. However, any field with an
  443. // empty value appearing in NullFields will be sent to the server as
  444. // null. It is an error if a field in this list has a non-empty value.
  445. // This may be used to include null fields in Patch requests.
  446. NullFields []string `json:"-"`
  447. }
  448. func (s *CollectionOverride) MarshalJSON() ([]byte, error) {
  449. type NoMethod CollectionOverride
  450. raw := NoMethod(*s)
  451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  452. }
  453. // CompositeType: Holds the composite type.
  454. type CompositeType struct {
  455. // Description: An optional textual description of the resource;
  456. // provided by the client when the resource is created.
  457. Description string `json:"description,omitempty"`
  458. Id uint64 `json:"id,omitempty,string"`
  459. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  460. InsertTime string `json:"insertTime,omitempty"`
  461. // Labels: Map of labels; provided by the client when the resource is
  462. // created or updated. Specifically: Label keys must be between 1 and 63
  463. // characters long and must conform to the following regular expression:
  464. // [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63
  465. // characters long and must conform to the regular expression
  466. // ([a-z]([-a-z0-9]*[a-z0-9])?)?
  467. Labels []*CompositeTypeLabelEntry `json:"labels,omitempty"`
  468. // Name: Name of the composite type, must follow the expression:
  469. // [a-z]([-a-z0-9_.]{0,61}[a-z0-9])?.
  470. Name string `json:"name,omitempty"`
  471. // Operation: Output only. The Operation that most recently ran, or is
  472. // currently running, on this composite type.
  473. Operation *Operation `json:"operation,omitempty"`
  474. // SelfLink: Output only. Server defined URL for the resource.
  475. SelfLink string `json:"selfLink,omitempty"`
  476. Status string `json:"status,omitempty"`
  477. // TemplateContents: Files for the template type.
  478. TemplateContents *TemplateContents `json:"templateContents,omitempty"`
  479. // ServerResponse contains the HTTP response code and headers from the
  480. // server.
  481. googleapi.ServerResponse `json:"-"`
  482. // ForceSendFields is a list of field names (e.g. "Description") to
  483. // unconditionally include in API requests. By default, fields with
  484. // empty values are omitted from API requests. However, any non-pointer,
  485. // non-interface field appearing in ForceSendFields will be sent to the
  486. // server regardless of whether the field is empty or not. This may be
  487. // used to include empty fields in Patch requests.
  488. ForceSendFields []string `json:"-"`
  489. // NullFields is a list of field names (e.g. "Description") to include
  490. // in API requests with the JSON null value. By default, fields with
  491. // empty values are omitted from API requests. However, any field with
  492. // an empty value appearing in NullFields will be sent to the server as
  493. // null. It is an error if a field in this list has a non-empty value.
  494. // This may be used to include null fields in Patch requests.
  495. NullFields []string `json:"-"`
  496. }
  497. func (s *CompositeType) MarshalJSON() ([]byte, error) {
  498. type NoMethod CompositeType
  499. raw := NoMethod(*s)
  500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  501. }
  502. type CompositeTypeLabelEntry struct {
  503. Key string `json:"key,omitempty"`
  504. Value string `json:"value,omitempty"`
  505. // ForceSendFields is a list of field names (e.g. "Key") to
  506. // unconditionally include in API requests. By default, fields with
  507. // empty values are omitted from API requests. However, any non-pointer,
  508. // non-interface field appearing in ForceSendFields will be sent to the
  509. // server regardless of whether the field is empty or not. This may be
  510. // used to include empty fields in Patch requests.
  511. ForceSendFields []string `json:"-"`
  512. // NullFields is a list of field names (e.g. "Key") to include in API
  513. // requests with the JSON null value. By default, fields with empty
  514. // values are omitted from API requests. However, any field with an
  515. // empty value appearing in NullFields will be sent to the server as
  516. // null. It is an error if a field in this list has a non-empty value.
  517. // This may be used to include null fields in Patch requests.
  518. NullFields []string `json:"-"`
  519. }
  520. func (s *CompositeTypeLabelEntry) MarshalJSON() ([]byte, error) {
  521. type NoMethod CompositeTypeLabelEntry
  522. raw := NoMethod(*s)
  523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  524. }
  525. // CompositeTypesListResponse: A response that returns all Composite
  526. // Types supported by Deployment Manager
  527. type CompositeTypesListResponse struct {
  528. // CompositeTypes: Output only. A list of resource composite types
  529. // supported by Deployment Manager.
  530. CompositeTypes []*CompositeType `json:"compositeTypes,omitempty"`
  531. // NextPageToken: A token used to continue a truncated list request.
  532. NextPageToken string `json:"nextPageToken,omitempty"`
  533. // ServerResponse contains the HTTP response code and headers from the
  534. // server.
  535. googleapi.ServerResponse `json:"-"`
  536. // ForceSendFields is a list of field names (e.g. "CompositeTypes") to
  537. // unconditionally include in API requests. By default, fields with
  538. // empty values are omitted from API requests. However, any non-pointer,
  539. // non-interface field appearing in ForceSendFields will be sent to the
  540. // server regardless of whether the field is empty or not. This may be
  541. // used to include empty fields in Patch requests.
  542. ForceSendFields []string `json:"-"`
  543. // NullFields is a list of field names (e.g. "CompositeTypes") to
  544. // include in API requests with the JSON null value. By default, fields
  545. // with empty values are omitted from API requests. However, any field
  546. // with an empty value appearing in NullFields will be sent to the
  547. // server as null. It is an error if a field in this list has a
  548. // non-empty value. This may be used to include null fields in Patch
  549. // requests.
  550. NullFields []string `json:"-"`
  551. }
  552. func (s *CompositeTypesListResponse) MarshalJSON() ([]byte, error) {
  553. type NoMethod CompositeTypesListResponse
  554. raw := NoMethod(*s)
  555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  556. }
  557. // Condition: A condition to be met.
  558. type Condition struct {
  559. // Iam: Trusted attributes supplied by the IAM system.
  560. Iam string `json:"iam,omitempty"`
  561. // Op: An operator to apply the subject with.
  562. Op string `json:"op,omitempty"`
  563. // Svc: Trusted attributes discharged by the service.
  564. Svc string `json:"svc,omitempty"`
  565. // Sys: Trusted attributes supplied by any service that owns resources
  566. // and uses the IAM system for access control.
  567. Sys string `json:"sys,omitempty"`
  568. // Value: DEPRECATED. Use 'values' instead.
  569. Value string `json:"value,omitempty"`
  570. // Values: The objects of the condition. This is mutually exclusive with
  571. // 'value'.
  572. Values []string `json:"values,omitempty"`
  573. // ForceSendFields is a list of field names (e.g. "Iam") to
  574. // unconditionally include in API requests. By default, fields with
  575. // empty values are omitted from API requests. However, any non-pointer,
  576. // non-interface field appearing in ForceSendFields will be sent to the
  577. // server regardless of whether the field is empty or not. This may be
  578. // used to include empty fields in Patch requests.
  579. ForceSendFields []string `json:"-"`
  580. // NullFields is a list of field names (e.g. "Iam") to include in API
  581. // requests with the JSON null value. By default, fields with empty
  582. // values are omitted from API requests. However, any field with an
  583. // empty value appearing in NullFields will be sent to the server as
  584. // null. It is an error if a field in this list has a non-empty value.
  585. // This may be used to include null fields in Patch requests.
  586. NullFields []string `json:"-"`
  587. }
  588. func (s *Condition) MarshalJSON() ([]byte, error) {
  589. type NoMethod Condition
  590. raw := NoMethod(*s)
  591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  592. }
  593. type ConfigFile struct {
  594. // Content: The contents of the file.
  595. Content string `json:"content,omitempty"`
  596. // ForceSendFields is a list of field names (e.g. "Content") to
  597. // unconditionally include in API requests. By default, fields with
  598. // empty values are omitted from API requests. However, any non-pointer,
  599. // non-interface field appearing in ForceSendFields will be sent to the
  600. // server regardless of whether the field is empty or not. This may be
  601. // used to include empty fields in Patch requests.
  602. ForceSendFields []string `json:"-"`
  603. // NullFields is a list of field names (e.g. "Content") to include in
  604. // API requests with the JSON null value. By default, fields with empty
  605. // values are omitted from API requests. However, any field with an
  606. // empty value appearing in NullFields will be sent to the server as
  607. // null. It is an error if a field in this list has a non-empty value.
  608. // This may be used to include null fields in Patch requests.
  609. NullFields []string `json:"-"`
  610. }
  611. func (s *ConfigFile) MarshalJSON() ([]byte, error) {
  612. type NoMethod ConfigFile
  613. raw := NoMethod(*s)
  614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  615. }
  616. // ConfigurableService: BaseType that describes a service-backed Type.
  617. type ConfigurableService struct {
  618. // CollectionOverrides: Allows resource handling overrides for specific
  619. // collections
  620. CollectionOverrides []*CollectionOverride `json:"collectionOverrides,omitempty"`
  621. // Credential: Credential used when interacting with this type.
  622. Credential *Credential `json:"credential,omitempty"`
  623. // DescriptorUrl: Descriptor Url for the this type.
  624. DescriptorUrl string `json:"descriptorUrl,omitempty"`
  625. // Options: Options to apply when handling any resources in this
  626. // service.
  627. Options *Options `json:"options,omitempty"`
  628. // ForceSendFields is a list of field names (e.g. "CollectionOverrides")
  629. // to unconditionally include in API requests. By default, fields with
  630. // empty values are omitted from API requests. However, any non-pointer,
  631. // non-interface field appearing in ForceSendFields will be sent to the
  632. // server regardless of whether the field is empty or not. This may be
  633. // used to include empty fields in Patch requests.
  634. ForceSendFields []string `json:"-"`
  635. // NullFields is a list of field names (e.g. "CollectionOverrides") to
  636. // include in API requests with the JSON null value. By default, fields
  637. // with empty values are omitted from API requests. However, any field
  638. // with an empty value appearing in NullFields will be sent to the
  639. // server as null. It is an error if a field in this list has a
  640. // non-empty value. This may be used to include null fields in Patch
  641. // requests.
  642. NullFields []string `json:"-"`
  643. }
  644. func (s *ConfigurableService) MarshalJSON() ([]byte, error) {
  645. type NoMethod ConfigurableService
  646. raw := NoMethod(*s)
  647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  648. }
  649. // Credential: The credential used by Deployment Manager and
  650. // TypeProvider. Only one of the options is permitted.
  651. type Credential struct {
  652. // BasicAuth: Basic Auth Credential, only used by TypeProvider.
  653. BasicAuth *BasicAuth `json:"basicAuth,omitempty"`
  654. // ServiceAccount: Service Account Credential, only used by Deployment.
  655. ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
  656. // UseProjectDefault: Specify to use the project default credential,
  657. // only supported by Deployment.
  658. UseProjectDefault bool `json:"useProjectDefault,omitempty"`
  659. // ForceSendFields is a list of field names (e.g. "BasicAuth") 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. "BasicAuth") 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 *Credential) MarshalJSON() ([]byte, error) {
  675. type NoMethod Credential
  676. raw := NoMethod(*s)
  677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  678. }
  679. type Deployment struct {
  680. // Credential: User provided default credential for the deployment.
  681. Credential *Credential `json:"credential,omitempty"`
  682. // Description: An optional user-provided description of the deployment.
  683. Description string `json:"description,omitempty"`
  684. // Fingerprint: Provides a fingerprint to use in requests to modify a
  685. // deployment, such as update(), stop(), and cancelPreview() requests. A
  686. // fingerprint is a randomly generated value that must be provided with
  687. // update(), stop(), and cancelPreview() requests to perform optimistic
  688. // locking. This ensures optimistic concurrency so that only one request
  689. // happens at a time.
  690. //
  691. // The fingerprint is initially generated by Deployment Manager and
  692. // changes after every request to modify data. To get the latest
  693. // fingerprint value, perform a get() request to a deployment.
  694. Fingerprint string `json:"fingerprint,omitempty"`
  695. Id uint64 `json:"id,omitempty,string"`
  696. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  697. InsertTime string `json:"insertTime,omitempty"`
  698. // Labels: Map of labels; provided by the client when the resource is
  699. // created or updated. Specifically: Label keys must be between 1 and 63
  700. // characters long and must conform to the following regular expression:
  701. // [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63
  702. // characters long and must conform to the regular expression
  703. // ([a-z]([-a-z0-9]*[a-z0-9])?)?
  704. Labels []*DeploymentLabelEntry `json:"labels,omitempty"`
  705. // Manifest: Output only. URL of the manifest representing the last
  706. // manifest that was successfully deployed.
  707. Manifest string `json:"manifest,omitempty"`
  708. // Name: Name of the resource; provided by the client when the resource
  709. // is created. The name must be 1-63 characters long, and comply with
  710. // RFC1035. Specifically, the name must be 1-63 characters long and
  711. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  712. // the first character must be a lowercase letter, and all following
  713. // characters must be a dash, lowercase letter, or digit, except the
  714. // last character, which cannot be a dash.
  715. Name string `json:"name,omitempty"`
  716. // Operation: Output only. The Operation that most recently ran, or is
  717. // currently running, on this deployment.
  718. Operation *Operation `json:"operation,omitempty"`
  719. // Outputs: Output only. Map of outputs from the last manifest that
  720. // deployed successfully.
  721. Outputs []*DeploymentOutputsEntry `json:"outputs,omitempty"`
  722. // SelfLink: Output only. Server defined URL for the resource.
  723. SelfLink string `json:"selfLink,omitempty"`
  724. // Target: [Input Only] The parameters that define your deployment,
  725. // including the deployment configuration and relevant templates.
  726. Target *TargetConfiguration `json:"target,omitempty"`
  727. // Update: Output only. If Deployment Manager is currently updating or
  728. // previewing an update to this deployment, the updated configuration
  729. // appears here.
  730. Update *DeploymentUpdate `json:"update,omitempty"`
  731. // UpdateTime: Output only. Update timestamp in RFC3339 text format.
  732. UpdateTime string `json:"updateTime,omitempty"`
  733. // ServerResponse contains the HTTP response code and headers from the
  734. // server.
  735. googleapi.ServerResponse `json:"-"`
  736. // ForceSendFields is a list of field names (e.g. "Credential") to
  737. // unconditionally include in API requests. By default, fields with
  738. // empty values are omitted from API requests. However, any non-pointer,
  739. // non-interface field appearing in ForceSendFields will be sent to the
  740. // server regardless of whether the field is empty or not. This may be
  741. // used to include empty fields in Patch requests.
  742. ForceSendFields []string `json:"-"`
  743. // NullFields is a list of field names (e.g. "Credential") to include in
  744. // API requests with the JSON null value. By default, fields with empty
  745. // values are omitted from API requests. However, any field with an
  746. // empty value appearing in NullFields will be sent to the server as
  747. // null. It is an error if a field in this list has a non-empty value.
  748. // This may be used to include null fields in Patch requests.
  749. NullFields []string `json:"-"`
  750. }
  751. func (s *Deployment) MarshalJSON() ([]byte, error) {
  752. type NoMethod Deployment
  753. raw := NoMethod(*s)
  754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  755. }
  756. type DeploymentLabelEntry struct {
  757. Key string `json:"key,omitempty"`
  758. Value string `json:"value,omitempty"`
  759. // ForceSendFields is a list of field names (e.g. "Key") to
  760. // unconditionally include in API requests. By default, fields with
  761. // empty values are omitted from API requests. However, any non-pointer,
  762. // non-interface field appearing in ForceSendFields will be sent to the
  763. // server regardless of whether the field is empty or not. This may be
  764. // used to include empty fields in Patch requests.
  765. ForceSendFields []string `json:"-"`
  766. // NullFields is a list of field names (e.g. "Key") to include in API
  767. // requests with the JSON null value. By default, fields with empty
  768. // values are omitted from API requests. However, any field with an
  769. // empty value appearing in NullFields will be sent to the server as
  770. // null. It is an error if a field in this list has a non-empty value.
  771. // This may be used to include null fields in Patch requests.
  772. NullFields []string `json:"-"`
  773. }
  774. func (s *DeploymentLabelEntry) MarshalJSON() ([]byte, error) {
  775. type NoMethod DeploymentLabelEntry
  776. raw := NoMethod(*s)
  777. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  778. }
  779. type DeploymentOutputsEntry struct {
  780. Key string `json:"key,omitempty"`
  781. Value string `json:"value,omitempty"`
  782. // ForceSendFields is a list of field names (e.g. "Key") to
  783. // unconditionally include in API requests. By default, fields with
  784. // empty values are omitted from API requests. However, any non-pointer,
  785. // non-interface field appearing in ForceSendFields will be sent to the
  786. // server regardless of whether the field is empty or not. This may be
  787. // used to include empty fields in Patch requests.
  788. ForceSendFields []string `json:"-"`
  789. // NullFields is a list of field names (e.g. "Key") to include in API
  790. // requests with the JSON null value. By default, fields with empty
  791. // values are omitted from API requests. However, any field with an
  792. // empty value appearing in NullFields will be sent to the server as
  793. // null. It is an error if a field in this list has a non-empty value.
  794. // This may be used to include null fields in Patch requests.
  795. NullFields []string `json:"-"`
  796. }
  797. func (s *DeploymentOutputsEntry) MarshalJSON() ([]byte, error) {
  798. type NoMethod DeploymentOutputsEntry
  799. raw := NoMethod(*s)
  800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  801. }
  802. type DeploymentUpdate struct {
  803. // Credential: Output only. The user-provided default credential to use
  804. // when deploying this preview.
  805. Credential *Credential `json:"credential,omitempty"`
  806. // Description: Output only. An optional user-provided description of
  807. // the deployment after the current update has been applied.
  808. Description string `json:"description,omitempty"`
  809. // Labels: Output only. Map of labels; provided by the client when the
  810. // resource is created or updated. Specifically: Label keys must be
  811. // between 1 and 63 characters long and must conform to the following
  812. // regular expression: [a-z]([-a-z0-9]*[a-z0-9])? Label values must be
  813. // between 0 and 63 characters long and must conform to the regular
  814. // expression ([a-z]([-a-z0-9]*[a-z0-9])?)?
  815. Labels []*DeploymentUpdateLabelEntry `json:"labels,omitempty"`
  816. // Manifest: Output only. URL of the manifest representing the update
  817. // configuration of this deployment.
  818. Manifest string `json:"manifest,omitempty"`
  819. // ForceSendFields is a list of field names (e.g. "Credential") to
  820. // unconditionally include in API requests. By default, fields with
  821. // empty values are omitted from API requests. However, any non-pointer,
  822. // non-interface field appearing in ForceSendFields will be sent to the
  823. // server regardless of whether the field is empty or not. This may be
  824. // used to include empty fields in Patch requests.
  825. ForceSendFields []string `json:"-"`
  826. // NullFields is a list of field names (e.g. "Credential") to include in
  827. // API requests with the JSON null value. By default, fields with empty
  828. // values are omitted from API requests. However, any field with an
  829. // empty value appearing in NullFields will be sent to the server as
  830. // null. It is an error if a field in this list has a non-empty value.
  831. // This may be used to include null fields in Patch requests.
  832. NullFields []string `json:"-"`
  833. }
  834. func (s *DeploymentUpdate) MarshalJSON() ([]byte, error) {
  835. type NoMethod DeploymentUpdate
  836. raw := NoMethod(*s)
  837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  838. }
  839. type DeploymentUpdateLabelEntry struct {
  840. Key string `json:"key,omitempty"`
  841. Value string `json:"value,omitempty"`
  842. // ForceSendFields is a list of field names (e.g. "Key") to
  843. // unconditionally include in API requests. By default, fields with
  844. // empty values are omitted from API requests. However, any non-pointer,
  845. // non-interface field appearing in ForceSendFields will be sent to the
  846. // server regardless of whether the field is empty or not. This may be
  847. // used to include empty fields in Patch requests.
  848. ForceSendFields []string `json:"-"`
  849. // NullFields is a list of field names (e.g. "Key") to include in API
  850. // requests with the JSON null value. By default, fields with empty
  851. // values are omitted from API requests. However, any field with an
  852. // empty value appearing in NullFields will be sent to the server as
  853. // null. It is an error if a field in this list has a non-empty value.
  854. // This may be used to include null fields in Patch requests.
  855. NullFields []string `json:"-"`
  856. }
  857. func (s *DeploymentUpdateLabelEntry) MarshalJSON() ([]byte, error) {
  858. type NoMethod DeploymentUpdateLabelEntry
  859. raw := NoMethod(*s)
  860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  861. }
  862. type DeploymentsCancelPreviewRequest struct {
  863. // Fingerprint: Specifies a fingerprint for cancelPreview() requests. A
  864. // fingerprint is a randomly generated value that must be provided in
  865. // cancelPreview() requests to perform optimistic locking. This ensures
  866. // optimistic concurrency so that the deployment does not have
  867. // conflicting requests (e.g. if someone attempts to make a new update
  868. // request while another user attempts to cancel a preview, this would
  869. // prevent one of the requests).
  870. //
  871. // The fingerprint is initially generated by Deployment Manager and
  872. // changes after every request to modify a deployment. To get the latest
  873. // fingerprint value, perform a get() request on the deployment.
  874. Fingerprint string `json:"fingerprint,omitempty"`
  875. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  876. // unconditionally include in API requests. By default, fields with
  877. // empty values are omitted from API requests. However, any non-pointer,
  878. // non-interface field appearing in ForceSendFields will be sent to the
  879. // server regardless of whether the field is empty or not. This may be
  880. // used to include empty fields in Patch requests.
  881. ForceSendFields []string `json:"-"`
  882. // NullFields is a list of field names (e.g. "Fingerprint") to include
  883. // in API requests with the JSON null value. By default, fields with
  884. // empty values are omitted from API requests. However, any field with
  885. // an empty value appearing in NullFields will be sent to the server as
  886. // null. It is an error if a field in this list has a non-empty value.
  887. // This may be used to include null fields in Patch requests.
  888. NullFields []string `json:"-"`
  889. }
  890. func (s *DeploymentsCancelPreviewRequest) MarshalJSON() ([]byte, error) {
  891. type NoMethod DeploymentsCancelPreviewRequest
  892. raw := NoMethod(*s)
  893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  894. }
  895. // DeploymentsListResponse: A response containing a partial list of
  896. // deployments and a page token used to build the next request if the
  897. // request has been truncated.
  898. type DeploymentsListResponse struct {
  899. // Deployments: Output only. The deployments contained in this response.
  900. Deployments []*Deployment `json:"deployments,omitempty"`
  901. // NextPageToken: Output only. A token used to continue a truncated list
  902. // request.
  903. NextPageToken string `json:"nextPageToken,omitempty"`
  904. // ServerResponse contains the HTTP response code and headers from the
  905. // server.
  906. googleapi.ServerResponse `json:"-"`
  907. // ForceSendFields is a list of field names (e.g. "Deployments") to
  908. // unconditionally include in API requests. By default, fields with
  909. // empty values are omitted from API requests. However, any non-pointer,
  910. // non-interface field appearing in ForceSendFields will be sent to the
  911. // server regardless of whether the field is empty or not. This may be
  912. // used to include empty fields in Patch requests.
  913. ForceSendFields []string `json:"-"`
  914. // NullFields is a list of field names (e.g. "Deployments") to include
  915. // in API requests with the JSON null value. By default, fields with
  916. // empty values are omitted from API requests. However, any field with
  917. // an empty value appearing in NullFields will be sent to the server as
  918. // null. It is an error if a field in this list has a non-empty value.
  919. // This may be used to include null fields in Patch requests.
  920. NullFields []string `json:"-"`
  921. }
  922. func (s *DeploymentsListResponse) MarshalJSON() ([]byte, error) {
  923. type NoMethod DeploymentsListResponse
  924. raw := NoMethod(*s)
  925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  926. }
  927. type DeploymentsStopRequest struct {
  928. // Fingerprint: Specifies a fingerprint for stop() requests. A
  929. // fingerprint is a randomly generated value that must be provided in
  930. // stop() requests to perform optimistic locking. This ensures
  931. // optimistic concurrency so that the deployment does not have
  932. // conflicting requests (e.g. if someone attempts to make a new update
  933. // request while another user attempts to stop an ongoing update
  934. // request, this would prevent a collision).
  935. //
  936. // The fingerprint is initially generated by Deployment Manager and
  937. // changes after every request to modify a deployment. To get the latest
  938. // fingerprint value, perform a get() request on the deployment.
  939. Fingerprint string `json:"fingerprint,omitempty"`
  940. // ForceSendFields is a list of field names (e.g. "Fingerprint") to
  941. // unconditionally include in API requests. By default, fields with
  942. // empty values are omitted from API requests. However, any non-pointer,
  943. // non-interface field appearing in ForceSendFields will be sent to the
  944. // server regardless of whether the field is empty or not. This may be
  945. // used to include empty fields in Patch requests.
  946. ForceSendFields []string `json:"-"`
  947. // NullFields is a list of field names (e.g. "Fingerprint") to include
  948. // in API requests with the JSON null value. By default, fields with
  949. // empty values are omitted from API requests. However, any field with
  950. // an empty value appearing in NullFields will be sent to the server as
  951. // null. It is an error if a field in this list has a non-empty value.
  952. // This may be used to include null fields in Patch requests.
  953. NullFields []string `json:"-"`
  954. }
  955. func (s *DeploymentsStopRequest) MarshalJSON() ([]byte, error) {
  956. type NoMethod DeploymentsStopRequest
  957. raw := NoMethod(*s)
  958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  959. }
  960. type Diagnostic struct {
  961. // Field: JsonPath expression on the resource that if non empty,
  962. // indicates that this field needs to be extracted as a diagnostic.
  963. Field string `json:"field,omitempty"`
  964. // Level: Level to record this diagnostic.
  965. Level string `json:"level,omitempty"`
  966. // ForceSendFields is a list of field names (e.g. "Field") to
  967. // unconditionally include in API requests. By default, fields with
  968. // empty values are omitted from API requests. However, any non-pointer,
  969. // non-interface field appearing in ForceSendFields will be sent to the
  970. // server regardless of whether the field is empty or not. This may be
  971. // used to include empty fields in Patch requests.
  972. ForceSendFields []string `json:"-"`
  973. // NullFields is a list of field names (e.g. "Field") to include in API
  974. // requests with the JSON null value. By default, fields with empty
  975. // values are omitted from API requests. However, any field with an
  976. // empty value appearing in NullFields will be sent to the server as
  977. // null. It is an error if a field in this list has a non-empty value.
  978. // This may be used to include null fields in Patch requests.
  979. NullFields []string `json:"-"`
  980. }
  981. func (s *Diagnostic) MarshalJSON() ([]byte, error) {
  982. type NoMethod Diagnostic
  983. raw := NoMethod(*s)
  984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  985. }
  986. // Expr: Represents an expression text. Example:
  987. //
  988. // title: "User account presence" description: "Determines whether the
  989. // request has a user account" expression: "size(request.user) > 0"
  990. type Expr struct {
  991. // Description: An optional description of the expression. This is a
  992. // longer text which describes the expression, e.g. when hovered over it
  993. // in a UI.
  994. Description string `json:"description,omitempty"`
  995. // Expression: Textual representation of an expression in Common
  996. // Expression Language syntax.
  997. //
  998. // The application context of the containing message determines which
  999. // well-known feature set of CEL is supported.
  1000. Expression string `json:"expression,omitempty"`
  1001. // Location: An optional string indicating the location of the
  1002. // expression for error reporting, e.g. a file name and a position in
  1003. // the file.
  1004. Location string `json:"location,omitempty"`
  1005. // Title: An optional title for the expression, i.e. a short string
  1006. // describing its purpose. This can be used e.g. in UIs which allow to
  1007. // enter the expression.
  1008. Title string `json:"title,omitempty"`
  1009. // ForceSendFields is a list of field names (e.g. "Description") to
  1010. // unconditionally include in API requests. By default, fields with
  1011. // empty values are omitted from API requests. However, any non-pointer,
  1012. // non-interface field appearing in ForceSendFields will be sent to the
  1013. // server regardless of whether the field is empty or not. This may be
  1014. // used to include empty fields in Patch requests.
  1015. ForceSendFields []string `json:"-"`
  1016. // NullFields is a list of field names (e.g. "Description") to include
  1017. // in API requests with the JSON null value. By default, fields with
  1018. // empty values are omitted from API requests. However, any field with
  1019. // an empty value appearing in NullFields will be sent to the server as
  1020. // null. It is an error if a field in this list has a non-empty value.
  1021. // This may be used to include null fields in Patch requests.
  1022. NullFields []string `json:"-"`
  1023. }
  1024. func (s *Expr) MarshalJSON() ([]byte, error) {
  1025. type NoMethod Expr
  1026. raw := NoMethod(*s)
  1027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1028. }
  1029. type GlobalSetPolicyRequest struct {
  1030. // Bindings: Flatten Policy to create a backward compatible wire-format.
  1031. // Deprecated. Use 'policy' to specify bindings.
  1032. Bindings []*Binding `json:"bindings,omitempty"`
  1033. // Etag: Flatten Policy to create a backward compatible wire-format.
  1034. // Deprecated. Use 'policy' to specify the etag.
  1035. Etag string `json:"etag,omitempty"`
  1036. // Policy: REQUIRED: The complete policy to be applied to the
  1037. // 'resource'. The size of the policy is limited to a few 10s of KB. An
  1038. // empty policy is in general a valid policy but certain services (like
  1039. // Projects) might reject them.
  1040. Policy *Policy `json:"policy,omitempty"`
  1041. // ForceSendFields is a list of field names (e.g. "Bindings") to
  1042. // unconditionally include in API requests. By default, fields with
  1043. // empty values are omitted from API requests. However, any non-pointer,
  1044. // non-interface field appearing in ForceSendFields will be sent to the
  1045. // server regardless of whether the field is empty or not. This may be
  1046. // used to include empty fields in Patch requests.
  1047. ForceSendFields []string `json:"-"`
  1048. // NullFields is a list of field names (e.g. "Bindings") to include in
  1049. // API requests with the JSON null value. By default, fields with empty
  1050. // values are omitted from API requests. However, any field with an
  1051. // empty value appearing in NullFields will be sent to the server as
  1052. // null. It is an error if a field in this list has a non-empty value.
  1053. // This may be used to include null fields in Patch requests.
  1054. NullFields []string `json:"-"`
  1055. }
  1056. func (s *GlobalSetPolicyRequest) MarshalJSON() ([]byte, error) {
  1057. type NoMethod GlobalSetPolicyRequest
  1058. raw := NoMethod(*s)
  1059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1060. }
  1061. type ImportFile struct {
  1062. // Content: The contents of the file.
  1063. Content string `json:"content,omitempty"`
  1064. // Name: The name of the file.
  1065. Name string `json:"name,omitempty"`
  1066. // ForceSendFields is a list of field names (e.g. "Content") to
  1067. // unconditionally include in API requests. By default, fields with
  1068. // empty values are omitted from API requests. However, any non-pointer,
  1069. // non-interface field appearing in ForceSendFields will be sent to the
  1070. // server regardless of whether the field is empty or not. This may be
  1071. // used to include empty fields in Patch requests.
  1072. ForceSendFields []string `json:"-"`
  1073. // NullFields is a list of field names (e.g. "Content") to include in
  1074. // API requests with the JSON null value. By default, fields with empty
  1075. // values are omitted from API requests. However, any field with an
  1076. // empty value appearing in NullFields will be sent to the server as
  1077. // null. It is an error if a field in this list has a non-empty value.
  1078. // This may be used to include null fields in Patch requests.
  1079. NullFields []string `json:"-"`
  1080. }
  1081. func (s *ImportFile) MarshalJSON() ([]byte, error) {
  1082. type NoMethod ImportFile
  1083. raw := NoMethod(*s)
  1084. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1085. }
  1086. // InputMapping: InputMapping creates a 'virtual' property that will be
  1087. // injected into the properties before sending the request to the
  1088. // underlying API.
  1089. type InputMapping struct {
  1090. // FieldName: The name of the field that is going to be injected.
  1091. FieldName string `json:"fieldName,omitempty"`
  1092. // Location: The location where this mapping applies.
  1093. Location string `json:"location,omitempty"`
  1094. // MethodMatch: Regex to evaluate on method to decide if input applies.
  1095. MethodMatch string `json:"methodMatch,omitempty"`
  1096. // Value: A jsonPath expression to select an element.
  1097. Value string `json:"value,omitempty"`
  1098. // ForceSendFields is a list of field names (e.g. "FieldName") to
  1099. // unconditionally include in API requests. By default, fields with
  1100. // empty values are omitted from API requests. However, any non-pointer,
  1101. // non-interface field appearing in ForceSendFields will be sent to the
  1102. // server regardless of whether the field is empty or not. This may be
  1103. // used to include empty fields in Patch requests.
  1104. ForceSendFields []string `json:"-"`
  1105. // NullFields is a list of field names (e.g. "FieldName") to include in
  1106. // API requests with the JSON null value. By default, fields with empty
  1107. // values are omitted from API requests. However, any field with an
  1108. // empty value appearing in NullFields will be sent to the server as
  1109. // null. It is an error if a field in this list has a non-empty value.
  1110. // This may be used to include null fields in Patch requests.
  1111. NullFields []string `json:"-"`
  1112. }
  1113. func (s *InputMapping) MarshalJSON() ([]byte, error) {
  1114. type NoMethod InputMapping
  1115. raw := NoMethod(*s)
  1116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1117. }
  1118. // LogConfig: Specifies what kind of log the caller must write
  1119. type LogConfig struct {
  1120. // CloudAudit: Cloud audit options.
  1121. CloudAudit *LogConfigCloudAuditOptions `json:"cloudAudit,omitempty"`
  1122. // Counter: Counter options.
  1123. Counter *LogConfigCounterOptions `json:"counter,omitempty"`
  1124. // DataAccess: Data access options.
  1125. DataAccess *LogConfigDataAccessOptions `json:"dataAccess,omitempty"`
  1126. // ForceSendFields is a list of field names (e.g. "CloudAudit") to
  1127. // unconditionally include in API requests. By default, fields with
  1128. // empty values are omitted from API requests. However, any non-pointer,
  1129. // non-interface field appearing in ForceSendFields will be sent to the
  1130. // server regardless of whether the field is empty or not. This may be
  1131. // used to include empty fields in Patch requests.
  1132. ForceSendFields []string `json:"-"`
  1133. // NullFields is a list of field names (e.g. "CloudAudit") to include in
  1134. // API requests with the JSON null value. By default, fields with empty
  1135. // values are omitted from API requests. However, any field with an
  1136. // empty value appearing in NullFields will be sent to the server as
  1137. // null. It is an error if a field in this list has a non-empty value.
  1138. // This may be used to include null fields in Patch requests.
  1139. NullFields []string `json:"-"`
  1140. }
  1141. func (s *LogConfig) MarshalJSON() ([]byte, error) {
  1142. type NoMethod LogConfig
  1143. raw := NoMethod(*s)
  1144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1145. }
  1146. // LogConfigCloudAuditOptions: Write a Cloud Audit log
  1147. type LogConfigCloudAuditOptions struct {
  1148. // AuthorizationLoggingOptions: Information used by the Cloud Audit
  1149. // Logging pipeline.
  1150. AuthorizationLoggingOptions *AuthorizationLoggingOptions `json:"authorizationLoggingOptions,omitempty"`
  1151. // LogName: The log_name to populate in the Cloud Audit Record.
  1152. LogName string `json:"logName,omitempty"`
  1153. // ForceSendFields is a list of field names (e.g.
  1154. // "AuthorizationLoggingOptions") to unconditionally include in API
  1155. // requests. By default, fields with empty values are omitted from API
  1156. // requests. However, any non-pointer, non-interface field appearing in
  1157. // ForceSendFields will be sent to the server regardless of whether the
  1158. // field is empty or not. This may be used to include empty fields in
  1159. // Patch requests.
  1160. ForceSendFields []string `json:"-"`
  1161. // NullFields is a list of field names (e.g.
  1162. // "AuthorizationLoggingOptions") to include in API requests with the
  1163. // JSON null value. By default, fields with empty values are omitted
  1164. // from API requests. However, any field with an empty value appearing
  1165. // in NullFields will be sent to the server as null. It is an error if a
  1166. // field in this list has a non-empty value. This may be used to include
  1167. // null fields in Patch requests.
  1168. NullFields []string `json:"-"`
  1169. }
  1170. func (s *LogConfigCloudAuditOptions) MarshalJSON() ([]byte, error) {
  1171. type NoMethod LogConfigCloudAuditOptions
  1172. raw := NoMethod(*s)
  1173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1174. }
  1175. // LogConfigCounterOptions: Increment a streamz counter with the
  1176. // specified metric and field names.
  1177. //
  1178. // Metric names should start with a '/', generally be lowercase-only,
  1179. // and end in "_count". Field names should not contain an initial slash.
  1180. // The actual exported metric names will have "/iam/policy"
  1181. // prepended.
  1182. //
  1183. // Field names correspond to IAM request parameters and field values are
  1184. // their respective values.
  1185. //
  1186. // Supported field names: - "authority", which is "[token]" if
  1187. // IAMContext.token is present, otherwise the value of
  1188. // IAMContext.authority_selector if present, and otherwise a
  1189. // representation of IAMContext.principal; or - "iam_principal", a
  1190. // representation of IAMContext.principal even if a token or authority
  1191. // selector is present; or - "" (empty string), resulting in a counter
  1192. // with no fields.
  1193. //
  1194. // Examples: counter { metric: "/debug_access_count" field:
  1195. // "iam_principal" } ==> increment counter
  1196. // /iam/policy/backend_debug_access_count {iam_principal=[value of
  1197. // IAMContext.principal]}
  1198. //
  1199. // At this time we do not support multiple field names (though this may
  1200. // be supported in the future).
  1201. type LogConfigCounterOptions struct {
  1202. // Field: The field value to attribute.
  1203. Field string `json:"field,omitempty"`
  1204. // Metric: The metric to update.
  1205. Metric string `json:"metric,omitempty"`
  1206. // ForceSendFields is a list of field names (e.g. "Field") to
  1207. // unconditionally include in API requests. By default, fields with
  1208. // empty values are omitted from API requests. However, any non-pointer,
  1209. // non-interface field appearing in ForceSendFields will be sent to the
  1210. // server regardless of whether the field is empty or not. This may be
  1211. // used to include empty fields in Patch requests.
  1212. ForceSendFields []string `json:"-"`
  1213. // NullFields is a list of field names (e.g. "Field") to include in API
  1214. // requests with the JSON null value. By default, fields with empty
  1215. // values are omitted from API requests. However, any field with an
  1216. // empty value appearing in NullFields will be sent to the server as
  1217. // null. It is an error if a field in this list has a non-empty value.
  1218. // This may be used to include null fields in Patch requests.
  1219. NullFields []string `json:"-"`
  1220. }
  1221. func (s *LogConfigCounterOptions) MarshalJSON() ([]byte, error) {
  1222. type NoMethod LogConfigCounterOptions
  1223. raw := NoMethod(*s)
  1224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1225. }
  1226. // LogConfigDataAccessOptions: Write a Data Access (Gin) log
  1227. type LogConfigDataAccessOptions struct {
  1228. // LogMode: Whether Gin logging should happen in a fail-closed manner at
  1229. // the caller. This is relevant only in the LocalIAM implementation, for
  1230. // now.
  1231. //
  1232. // NOTE: Logging to Gin in a fail-closed manner is currently unsupported
  1233. // while work is being done to satisfy the requirements of go/345.
  1234. // Currently, setting LOG_FAIL_CLOSED mode will have no effect, but
  1235. // still exists because there is active work being done to support it
  1236. // (b/115874152).
  1237. LogMode string `json:"logMode,omitempty"`
  1238. // ForceSendFields is a list of field names (e.g. "LogMode") to
  1239. // unconditionally include in API requests. By default, fields with
  1240. // empty values are omitted from API requests. However, any non-pointer,
  1241. // non-interface field appearing in ForceSendFields will be sent to the
  1242. // server regardless of whether the field is empty or not. This may be
  1243. // used to include empty fields in Patch requests.
  1244. ForceSendFields []string `json:"-"`
  1245. // NullFields is a list of field names (e.g. "LogMode") to include in
  1246. // API requests with the JSON null value. By default, fields with empty
  1247. // values are omitted from API requests. However, any field with an
  1248. // empty value appearing in NullFields will be sent to the server as
  1249. // null. It is an error if a field in this list has a non-empty value.
  1250. // This may be used to include null fields in Patch requests.
  1251. NullFields []string `json:"-"`
  1252. }
  1253. func (s *LogConfigDataAccessOptions) MarshalJSON() ([]byte, error) {
  1254. type NoMethod LogConfigDataAccessOptions
  1255. raw := NoMethod(*s)
  1256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1257. }
  1258. type Manifest struct {
  1259. // Config: Output only. The YAML configuration for this manifest.
  1260. Config *ConfigFile `json:"config,omitempty"`
  1261. // ExpandedConfig: Output only. The fully-expanded configuration file,
  1262. // including any templates and references.
  1263. ExpandedConfig string `json:"expandedConfig,omitempty"`
  1264. Id uint64 `json:"id,omitempty,string"`
  1265. // Imports: Output only. The imported files for this manifest.
  1266. Imports []*ImportFile `json:"imports,omitempty"`
  1267. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  1268. InsertTime string `json:"insertTime,omitempty"`
  1269. // Layout: Output only. The YAML layout for this manifest.
  1270. Layout string `json:"layout,omitempty"`
  1271. // Name: Output only.
  1272. //
  1273. // The name of the manifest.
  1274. Name string `json:"name,omitempty"`
  1275. // SelfLink: Output only. Self link for the manifest.
  1276. SelfLink string `json:"selfLink,omitempty"`
  1277. // ServerResponse contains the HTTP response code and headers from the
  1278. // server.
  1279. googleapi.ServerResponse `json:"-"`
  1280. // ForceSendFields is a list of field names (e.g. "Config") to
  1281. // unconditionally include in API requests. By default, fields with
  1282. // empty values are omitted from API requests. However, any non-pointer,
  1283. // non-interface field appearing in ForceSendFields will be sent to the
  1284. // server regardless of whether the field is empty or not. This may be
  1285. // used to include empty fields in Patch requests.
  1286. ForceSendFields []string `json:"-"`
  1287. // NullFields is a list of field names (e.g. "Config") to include in API
  1288. // requests with the JSON null value. By default, fields with empty
  1289. // values are omitted from API requests. However, any field with an
  1290. // empty value appearing in NullFields will be sent to the server as
  1291. // null. It is an error if a field in this list has a non-empty value.
  1292. // This may be used to include null fields in Patch requests.
  1293. NullFields []string `json:"-"`
  1294. }
  1295. func (s *Manifest) MarshalJSON() ([]byte, error) {
  1296. type NoMethod Manifest
  1297. raw := NoMethod(*s)
  1298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1299. }
  1300. // ManifestsListResponse: A response containing a partial list of
  1301. // manifests and a page token used to build the next request if the
  1302. // request has been truncated.
  1303. type ManifestsListResponse struct {
  1304. // Manifests: Output only. Manifests contained in this list response.
  1305. Manifests []*Manifest `json:"manifests,omitempty"`
  1306. // NextPageToken: Output only. A token used to continue a truncated list
  1307. // request.
  1308. NextPageToken string `json:"nextPageToken,omitempty"`
  1309. // ServerResponse contains the HTTP response code and headers from the
  1310. // server.
  1311. googleapi.ServerResponse `json:"-"`
  1312. // ForceSendFields is a list of field names (e.g. "Manifests") to
  1313. // unconditionally include in API requests. By default, fields with
  1314. // empty values are omitted from API requests. However, any non-pointer,
  1315. // non-interface field appearing in ForceSendFields will be sent to the
  1316. // server regardless of whether the field is empty or not. This may be
  1317. // used to include empty fields in Patch requests.
  1318. ForceSendFields []string `json:"-"`
  1319. // NullFields is a list of field names (e.g. "Manifests") to include in
  1320. // API requests with the JSON null value. By default, fields with empty
  1321. // values are omitted from API requests. However, any field with an
  1322. // empty value appearing in NullFields will be sent to the server as
  1323. // null. It is an error if a field in this list has a non-empty value.
  1324. // This may be used to include null fields in Patch requests.
  1325. NullFields []string `json:"-"`
  1326. }
  1327. func (s *ManifestsListResponse) MarshalJSON() ([]byte, error) {
  1328. type NoMethod ManifestsListResponse
  1329. raw := NoMethod(*s)
  1330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1331. }
  1332. // MethodMap: Deployment Manager will call these methods during the
  1333. // events of creation/deletion/update/get/setIamPolicy
  1334. type MethodMap struct {
  1335. // Create: The action identifier for the create method to be used for
  1336. // this collection
  1337. Create string `json:"create,omitempty"`
  1338. // Delete: The action identifier for the delete method to be used for
  1339. // this collection
  1340. Delete string `json:"delete,omitempty"`
  1341. // Get: The action identifier for the get method to be used for this
  1342. // collection
  1343. Get string `json:"get,omitempty"`
  1344. // SetIamPolicy: The action identifier for the setIamPolicy method to be
  1345. // used for this collection
  1346. SetIamPolicy string `json:"setIamPolicy,omitempty"`
  1347. // Update: The action identifier for the update method to be used for
  1348. // this collection
  1349. Update string `json:"update,omitempty"`
  1350. // ForceSendFields is a list of field names (e.g. "Create") to
  1351. // unconditionally include in API requests. By default, fields with
  1352. // empty values are omitted from API requests. However, any non-pointer,
  1353. // non-interface field appearing in ForceSendFields will be sent to the
  1354. // server regardless of whether the field is empty or not. This may be
  1355. // used to include empty fields in Patch requests.
  1356. ForceSendFields []string `json:"-"`
  1357. // NullFields is a list of field names (e.g. "Create") to include in API
  1358. // requests with the JSON null value. By default, fields with empty
  1359. // values are omitted from API requests. However, any field with an
  1360. // empty value appearing in NullFields will be sent to the server as
  1361. // null. It is an error if a field in this list has a non-empty value.
  1362. // This may be used to include null fields in Patch requests.
  1363. NullFields []string `json:"-"`
  1364. }
  1365. func (s *MethodMap) MarshalJSON() ([]byte, error) {
  1366. type NoMethod MethodMap
  1367. raw := NoMethod(*s)
  1368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1369. }
  1370. // Operation: An Operation resource, used to manage asynchronous API
  1371. // requests. (== resource_for v1.globalOperations ==) (== resource_for
  1372. // beta.globalOperations ==) (== resource_for v1.regionOperations ==)
  1373. // (== resource_for beta.regionOperations ==) (== resource_for
  1374. // v1.zoneOperations ==) (== resource_for beta.zoneOperations ==)
  1375. type Operation struct {
  1376. // ClientOperationId: [Output Only] The value of `requestId` if you
  1377. // provided it in the request. Not present otherwise.
  1378. ClientOperationId string `json:"clientOperationId,omitempty"`
  1379. // CreationTimestamp: [Deprecated] This field is deprecated.
  1380. CreationTimestamp string `json:"creationTimestamp,omitempty"`
  1381. // Description: [Output Only] A textual description of the operation,
  1382. // which is set when the operation is created.
  1383. Description string `json:"description,omitempty"`
  1384. // EndTime: [Output Only] The time that this operation was completed.
  1385. // This value is in RFC3339 text format.
  1386. EndTime string `json:"endTime,omitempty"`
  1387. // Error: [Output Only] If errors are generated during processing of the
  1388. // operation, this field will be populated.
  1389. Error *OperationError `json:"error,omitempty"`
  1390. // HttpErrorMessage: [Output Only] If the operation fails, this field
  1391. // contains the HTTP error message that was returned, such as NOT FOUND.
  1392. HttpErrorMessage string `json:"httpErrorMessage,omitempty"`
  1393. // HttpErrorStatusCode: [Output Only] If the operation fails, this field
  1394. // contains the HTTP error status code that was returned. For example, a
  1395. // 404 means the resource was not found.
  1396. HttpErrorStatusCode int64 `json:"httpErrorStatusCode,omitempty"`
  1397. // Id: [Output Only] The unique identifier for the resource. This
  1398. // identifier is defined by the server.
  1399. Id uint64 `json:"id,omitempty,string"`
  1400. // InsertTime: [Output Only] The time that this operation was requested.
  1401. // This value is in RFC3339 text format.
  1402. InsertTime string `json:"insertTime,omitempty"`
  1403. // Kind: [Output Only] Type of the resource. Always compute#operation
  1404. // for Operation resources.
  1405. Kind string `json:"kind,omitempty"`
  1406. // Name: [Output Only] Name of the resource.
  1407. Name string `json:"name,omitempty"`
  1408. // OperationType: [Output Only] The type of operation, such as insert,
  1409. // update, or delete, and so on.
  1410. OperationType string `json:"operationType,omitempty"`
  1411. // Progress: [Output Only] An optional progress indicator that ranges
  1412. // from 0 to 100. There is no requirement that this be linear or support
  1413. // any granularity of operations. This should not be used to guess when
  1414. // the operation will be complete. This number should monotonically
  1415. // increase as the operation progresses.
  1416. Progress int64 `json:"progress,omitempty"`
  1417. // Region: [Output Only] The URL of the region where the operation
  1418. // resides. Only available when performing regional operations. You must
  1419. // specify this field as part of the HTTP request URL. It is not
  1420. // settable as a field in the request body.
  1421. Region string `json:"region,omitempty"`
  1422. // SelfLink: [Output Only] Server-defined URL for the resource.
  1423. SelfLink string `json:"selfLink,omitempty"`
  1424. // StartTime: [Output Only] The time that this operation was started by
  1425. // the server. This value is in RFC3339 text format.
  1426. StartTime string `json:"startTime,omitempty"`
  1427. // Status: [Output Only] The status of the operation, which can be one
  1428. // of the following: PENDING, RUNNING, or DONE.
  1429. Status string `json:"status,omitempty"`
  1430. // StatusMessage: [Output Only] An optional textual description of the
  1431. // current status of the operation.
  1432. StatusMessage string `json:"statusMessage,omitempty"`
  1433. // TargetId: [Output Only] The unique target ID, which identifies a
  1434. // specific incarnation of the target resource.
  1435. TargetId uint64 `json:"targetId,omitempty,string"`
  1436. // TargetLink: [Output Only] The URL of the resource that the operation
  1437. // modifies. For operations related to creating a snapshot, this points
  1438. // to the persistent disk that the snapshot was created from.
  1439. TargetLink string `json:"targetLink,omitempty"`
  1440. // User: [Output Only] User who requested the operation, for example:
  1441. // user@example.com.
  1442. User string `json:"user,omitempty"`
  1443. // Warnings: [Output Only] If warning messages are generated during
  1444. // processing of the operation, this field will be populated.
  1445. Warnings []*OperationWarnings `json:"warnings,omitempty"`
  1446. // Zone: [Output Only] The URL of the zone where the operation resides.
  1447. // Only available when performing per-zone operations. You must specify
  1448. // this field as part of the HTTP request URL. It is not settable as a
  1449. // field in the request body.
  1450. Zone string `json:"zone,omitempty"`
  1451. // ServerResponse contains the HTTP response code and headers from the
  1452. // server.
  1453. googleapi.ServerResponse `json:"-"`
  1454. // ForceSendFields is a list of field names (e.g. "ClientOperationId")
  1455. // to unconditionally include in API requests. By default, fields with
  1456. // empty values are omitted from API requests. However, any non-pointer,
  1457. // non-interface field appearing in ForceSendFields will be sent to the
  1458. // server regardless of whether the field is empty or not. This may be
  1459. // used to include empty fields in Patch requests.
  1460. ForceSendFields []string `json:"-"`
  1461. // NullFields is a list of field names (e.g. "ClientOperationId") to
  1462. // include in API requests with the JSON null value. By default, fields
  1463. // with empty values are omitted from API requests. However, any field
  1464. // with an empty value appearing in NullFields will be sent to the
  1465. // server as null. It is an error if a field in this list has a
  1466. // non-empty value. This may be used to include null fields in Patch
  1467. // requests.
  1468. NullFields []string `json:"-"`
  1469. }
  1470. func (s *Operation) MarshalJSON() ([]byte, error) {
  1471. type NoMethod Operation
  1472. raw := NoMethod(*s)
  1473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1474. }
  1475. // OperationError: [Output Only] If errors are generated during
  1476. // processing of the operation, this field will be populated.
  1477. type OperationError struct {
  1478. // Errors: [Output Only] The array of errors encountered while
  1479. // processing this operation.
  1480. Errors []*OperationErrorErrors `json:"errors,omitempty"`
  1481. // ForceSendFields is a list of field names (e.g. "Errors") to
  1482. // unconditionally include in API requests. By default, fields with
  1483. // empty values are omitted from API requests. However, any non-pointer,
  1484. // non-interface field appearing in ForceSendFields will be sent to the
  1485. // server regardless of whether the field is empty or not. This may be
  1486. // used to include empty fields in Patch requests.
  1487. ForceSendFields []string `json:"-"`
  1488. // NullFields is a list of field names (e.g. "Errors") to include in API
  1489. // requests with the JSON null value. By default, fields with empty
  1490. // values are omitted from API requests. However, any field with an
  1491. // empty value appearing in NullFields will be sent to the server as
  1492. // null. It is an error if a field in this list has a non-empty value.
  1493. // This may be used to include null fields in Patch requests.
  1494. NullFields []string `json:"-"`
  1495. }
  1496. func (s *OperationError) MarshalJSON() ([]byte, error) {
  1497. type NoMethod OperationError
  1498. raw := NoMethod(*s)
  1499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1500. }
  1501. type OperationErrorErrors struct {
  1502. // Code: [Output Only] The error type identifier for this error.
  1503. Code string `json:"code,omitempty"`
  1504. // Location: [Output Only] Indicates the field in the request that
  1505. // caused the error. This property is optional.
  1506. Location string `json:"location,omitempty"`
  1507. // Message: [Output Only] An optional, human-readable error message.
  1508. Message string `json:"message,omitempty"`
  1509. // ForceSendFields is a list of field names (e.g. "Code") to
  1510. // unconditionally include in API requests. By default, fields with
  1511. // empty values are omitted from API requests. However, any non-pointer,
  1512. // non-interface field appearing in ForceSendFields will be sent to the
  1513. // server regardless of whether the field is empty or not. This may be
  1514. // used to include empty fields in Patch requests.
  1515. ForceSendFields []string `json:"-"`
  1516. // NullFields is a list of field names (e.g. "Code") to include in API
  1517. // requests with the JSON null value. By default, fields with empty
  1518. // values are omitted from API requests. However, any field with an
  1519. // empty value appearing in NullFields will be sent to the server as
  1520. // null. It is an error if a field in this list has a non-empty value.
  1521. // This may be used to include null fields in Patch requests.
  1522. NullFields []string `json:"-"`
  1523. }
  1524. func (s *OperationErrorErrors) MarshalJSON() ([]byte, error) {
  1525. type NoMethod OperationErrorErrors
  1526. raw := NoMethod(*s)
  1527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1528. }
  1529. type OperationWarnings struct {
  1530. // Code: [Output Only] A warning code, if applicable. For example,
  1531. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1532. // the response.
  1533. Code string `json:"code,omitempty"`
  1534. // Data: [Output Only] Metadata about this warning in key: value format.
  1535. // For example:
  1536. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1537. Data []*OperationWarningsData `json:"data,omitempty"`
  1538. // Message: [Output Only] A human-readable description of the warning
  1539. // code.
  1540. Message string `json:"message,omitempty"`
  1541. // ForceSendFields is a list of field names (e.g. "Code") to
  1542. // unconditionally include in API requests. By default, fields with
  1543. // empty values are omitted from API requests. However, any non-pointer,
  1544. // non-interface field appearing in ForceSendFields will be sent to the
  1545. // server regardless of whether the field is empty or not. This may be
  1546. // used to include empty fields in Patch requests.
  1547. ForceSendFields []string `json:"-"`
  1548. // NullFields is a list of field names (e.g. "Code") to include in API
  1549. // requests with the JSON null value. By default, fields with empty
  1550. // values are omitted from API requests. However, any field with an
  1551. // empty value appearing in NullFields will be sent to the server as
  1552. // null. It is an error if a field in this list has a non-empty value.
  1553. // This may be used to include null fields in Patch requests.
  1554. NullFields []string `json:"-"`
  1555. }
  1556. func (s *OperationWarnings) MarshalJSON() ([]byte, error) {
  1557. type NoMethod OperationWarnings
  1558. raw := NoMethod(*s)
  1559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1560. }
  1561. type OperationWarningsData struct {
  1562. // Key: [Output Only] A key that provides more detail on the warning
  1563. // being returned. For example, for warnings where there are no results
  1564. // in a list request for a particular zone, this key might be scope and
  1565. // the key value might be the zone name. Other examples might be a key
  1566. // indicating a deprecated resource and a suggested replacement, or a
  1567. // warning about invalid network settings (for example, if an instance
  1568. // attempts to perform IP forwarding but is not enabled for IP
  1569. // forwarding).
  1570. Key string `json:"key,omitempty"`
  1571. // Value: [Output Only] A warning data value corresponding to the key.
  1572. Value string `json:"value,omitempty"`
  1573. // ForceSendFields is a list of field names (e.g. "Key") to
  1574. // unconditionally include in API requests. By default, fields with
  1575. // empty values are omitted from API requests. However, any non-pointer,
  1576. // non-interface field appearing in ForceSendFields will be sent to the
  1577. // server regardless of whether the field is empty or not. This may be
  1578. // used to include empty fields in Patch requests.
  1579. ForceSendFields []string `json:"-"`
  1580. // NullFields is a list of field names (e.g. "Key") to include in API
  1581. // requests with the JSON null value. By default, fields with empty
  1582. // values are omitted from API requests. However, any field with an
  1583. // empty value appearing in NullFields will be sent to the server as
  1584. // null. It is an error if a field in this list has a non-empty value.
  1585. // This may be used to include null fields in Patch requests.
  1586. NullFields []string `json:"-"`
  1587. }
  1588. func (s *OperationWarningsData) MarshalJSON() ([]byte, error) {
  1589. type NoMethod OperationWarningsData
  1590. raw := NoMethod(*s)
  1591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1592. }
  1593. // OperationsListResponse: A response containing a partial list of
  1594. // operations and a page token used to build the next request if the
  1595. // request has been truncated.
  1596. type OperationsListResponse struct {
  1597. // NextPageToken: Output only. A token used to continue a truncated list
  1598. // request.
  1599. NextPageToken string `json:"nextPageToken,omitempty"`
  1600. // Operations: Output only. Operations contained in this list response.
  1601. Operations []*Operation `json:"operations,omitempty"`
  1602. // ServerResponse contains the HTTP response code and headers from the
  1603. // server.
  1604. googleapi.ServerResponse `json:"-"`
  1605. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1606. // unconditionally include in API requests. By default, fields with
  1607. // empty values are omitted from API requests. However, any non-pointer,
  1608. // non-interface field appearing in ForceSendFields will be sent to the
  1609. // server regardless of whether the field is empty or not. This may be
  1610. // used to include empty fields in Patch requests.
  1611. ForceSendFields []string `json:"-"`
  1612. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1613. // in API requests with the JSON null value. By default, fields with
  1614. // empty values are omitted from API requests. However, any field with
  1615. // an empty value appearing in NullFields will be sent to the server as
  1616. // null. It is an error if a field in this list has a non-empty value.
  1617. // This may be used to include null fields in Patch requests.
  1618. NullFields []string `json:"-"`
  1619. }
  1620. func (s *OperationsListResponse) MarshalJSON() ([]byte, error) {
  1621. type NoMethod OperationsListResponse
  1622. raw := NoMethod(*s)
  1623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1624. }
  1625. // Options: Options allows customized resource handling by Deployment
  1626. // Manager.
  1627. type Options struct {
  1628. // AsyncOptions: Options regarding how to thread async requests.
  1629. AsyncOptions []*AsyncOptions `json:"asyncOptions,omitempty"`
  1630. // InputMappings: The mappings that apply for requests.
  1631. InputMappings []*InputMapping `json:"inputMappings,omitempty"`
  1632. // NameProperty: The json path to the field in the resource JSON body
  1633. // into which the resource name should be mapped. Leaving this empty
  1634. // indicates that there should be no mapping performed.
  1635. NameProperty string `json:"nameProperty,omitempty"`
  1636. // ValidationOptions: Options for how to validate and process properties
  1637. // on a resource.
  1638. ValidationOptions *ValidationOptions `json:"validationOptions,omitempty"`
  1639. // ForceSendFields is a list of field names (e.g. "AsyncOptions") to
  1640. // unconditionally include in API requests. By default, fields with
  1641. // empty values are omitted from API requests. However, any non-pointer,
  1642. // non-interface field appearing in ForceSendFields will be sent to the
  1643. // server regardless of whether the field is empty or not. This may be
  1644. // used to include empty fields in Patch requests.
  1645. ForceSendFields []string `json:"-"`
  1646. // NullFields is a list of field names (e.g. "AsyncOptions") to include
  1647. // in API requests with the JSON null value. By default, fields with
  1648. // empty values are omitted from API requests. However, any field with
  1649. // an empty value appearing in NullFields will be sent to the server as
  1650. // null. It is an error if a field in this list has a non-empty value.
  1651. // This may be used to include null fields in Patch requests.
  1652. NullFields []string `json:"-"`
  1653. }
  1654. func (s *Options) MarshalJSON() ([]byte, error) {
  1655. type NoMethod Options
  1656. raw := NoMethod(*s)
  1657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1658. }
  1659. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  1660. // used to specify access control policies for Cloud Platform
  1661. // resources.
  1662. //
  1663. //
  1664. //
  1665. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  1666. // of `members` to a `role`, where the members can be user accounts,
  1667. // Google groups, Google domains, and service accounts. A `role` is a
  1668. // named list of permissions defined by IAM.
  1669. //
  1670. // **JSON Example**
  1671. //
  1672. // { "bindings": [ { "role": "roles/owner", "members": [
  1673. // "user:mike@example.com", "group:admins@example.com",
  1674. // "domain:google.com",
  1675. // "serviceAccount:my-other-app@appspot.gserviceaccount.com" ] }, {
  1676. // "role": "roles/viewer", "members": ["user:sean@example.com"] } ]
  1677. // }
  1678. //
  1679. // **YAML Example**
  1680. //
  1681. // bindings: - members: - user:mike@example.com -
  1682. // group:admins@example.com - domain:google.com -
  1683. // serviceAccount:my-other-app@appspot.gserviceaccount.com role:
  1684. // roles/owner - members: - user:sean@example.com role:
  1685. // roles/viewer
  1686. //
  1687. //
  1688. //
  1689. // For a description of IAM and its features, see the [IAM developer's
  1690. // guide](https://cloud.google.com/iam/docs).
  1691. type Policy struct {
  1692. // AuditConfigs: Specifies cloud audit logging configuration for this
  1693. // policy.
  1694. AuditConfigs []*AuditConfig `json:"auditConfigs,omitempty"`
  1695. // Bindings: Associates a list of `members` to a `role`. `bindings` with
  1696. // no members will result in an error.
  1697. Bindings []*Binding `json:"bindings,omitempty"`
  1698. // Etag: `etag` is used for optimistic concurrency control as a way to
  1699. // help prevent simultaneous updates of a policy from overwriting each
  1700. // other. It is strongly suggested that systems make use of the `etag`
  1701. // in the read-modify-write cycle to perform policy updates in order to
  1702. // avoid race conditions: An `etag` is returned in the response to
  1703. // `getIamPolicy`, and systems are expected to put that etag in the
  1704. // request to `setIamPolicy` to ensure that their change will be applied
  1705. // to the same version of the policy.
  1706. //
  1707. // If no `etag` is provided in the call to `setIamPolicy`, then the
  1708. // existing policy is overwritten blindly.
  1709. Etag string `json:"etag,omitempty"`
  1710. IamOwned bool `json:"iamOwned,omitempty"`
  1711. // Rules: If more than one rule is specified, the rules are applied in
  1712. // the following manner: - All matching LOG rules are always applied. -
  1713. // If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging
  1714. // will be applied if one or more matching rule requires logging. -
  1715. // Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
  1716. // granted. Logging will be applied if one or more matching rule
  1717. // requires logging. - Otherwise, if no rule applies, permission is
  1718. // denied.
  1719. Rules []*Rule `json:"rules,omitempty"`
  1720. // Version: Deprecated.
  1721. Version int64 `json:"version,omitempty"`
  1722. // ServerResponse contains the HTTP response code and headers from the
  1723. // server.
  1724. googleapi.ServerResponse `json:"-"`
  1725. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  1726. // unconditionally include in API requests. By default, fields with
  1727. // empty values are omitted from API requests. However, any non-pointer,
  1728. // non-interface field appearing in ForceSendFields will be sent to the
  1729. // server regardless of whether the field is empty or not. This may be
  1730. // used to include empty fields in Patch requests.
  1731. ForceSendFields []string `json:"-"`
  1732. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  1733. // in API requests with the JSON null value. By default, fields with
  1734. // empty values are omitted from API requests. However, any field with
  1735. // an empty value appearing in NullFields will be sent to the server as
  1736. // null. It is an error if a field in this list has a non-empty value.
  1737. // This may be used to include null fields in Patch requests.
  1738. NullFields []string `json:"-"`
  1739. }
  1740. func (s *Policy) MarshalJSON() ([]byte, error) {
  1741. type NoMethod Policy
  1742. raw := NoMethod(*s)
  1743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1744. }
  1745. type PollingOptions struct {
  1746. // Diagnostics: An array of diagnostics to be collected by Deployment
  1747. // Manager, these diagnostics will be displayed to the user.
  1748. Diagnostics []*Diagnostic `json:"diagnostics,omitempty"`
  1749. // FailCondition: JsonPath expression that determines if the request
  1750. // failed.
  1751. FailCondition string `json:"failCondition,omitempty"`
  1752. // FinishCondition: JsonPath expression that determines if the request
  1753. // is completed.
  1754. FinishCondition string `json:"finishCondition,omitempty"`
  1755. // PollingLink: JsonPath expression that evaluates to string, it
  1756. // indicates where to poll.
  1757. PollingLink string `json:"pollingLink,omitempty"`
  1758. // TargetLink: JsonPath expression, after polling is completed,
  1759. // indicates where to fetch the resource.
  1760. TargetLink string `json:"targetLink,omitempty"`
  1761. // ForceSendFields is a list of field names (e.g. "Diagnostics") to
  1762. // unconditionally include in API requests. By default, fields with
  1763. // empty values are omitted from API requests. However, any non-pointer,
  1764. // non-interface field appearing in ForceSendFields will be sent to the
  1765. // server regardless of whether the field is empty or not. This may be
  1766. // used to include empty fields in Patch requests.
  1767. ForceSendFields []string `json:"-"`
  1768. // NullFields is a list of field names (e.g. "Diagnostics") to include
  1769. // in API requests with the JSON null value. By default, fields with
  1770. // empty values are omitted from API requests. However, any field with
  1771. // an empty value appearing in NullFields will be sent to the server as
  1772. // null. It is an error if a field in this list has a non-empty value.
  1773. // This may be used to include null fields in Patch requests.
  1774. NullFields []string `json:"-"`
  1775. }
  1776. func (s *PollingOptions) MarshalJSON() ([]byte, error) {
  1777. type NoMethod PollingOptions
  1778. raw := NoMethod(*s)
  1779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1780. }
  1781. type Resource struct {
  1782. // AccessControl: The Access Control Policy set on this resource.
  1783. AccessControl *ResourceAccessControl `json:"accessControl,omitempty"`
  1784. // FinalProperties: Output only. The evaluated properties of the
  1785. // resource with references expanded. Returned as serialized YAML.
  1786. FinalProperties string `json:"finalProperties,omitempty"`
  1787. Id uint64 `json:"id,omitempty,string"`
  1788. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  1789. InsertTime string `json:"insertTime,omitempty"`
  1790. // LastUsedCredential: Output only. The last used credential that
  1791. // successfully created/updated the resource.
  1792. LastUsedCredential *Credential `json:"lastUsedCredential,omitempty"`
  1793. // Manifest: Output only. URL of the manifest representing the current
  1794. // configuration of this resource.
  1795. Manifest string `json:"manifest,omitempty"`
  1796. // Name: Output only. The name of the resource as it appears in the YAML
  1797. // config.
  1798. Name string `json:"name,omitempty"`
  1799. // Properties: Output only. The current properties of the resource
  1800. // before any references have been filled in. Returned as serialized
  1801. // YAML.
  1802. Properties string `json:"properties,omitempty"`
  1803. // RuntimePolicies: Output only. In case this is an action, it will show
  1804. // the runtimePolicies on which this action will run in the deployment
  1805. RuntimePolicies []string `json:"runtimePolicies,omitempty"`
  1806. // Type: Output only. The type of the resource, for example
  1807. // compute.v1.instance, or cloudfunctions.v1beta1.function.
  1808. Type string `json:"type,omitempty"`
  1809. // Update: Output only. If Deployment Manager is currently updating or
  1810. // previewing an update to this resource, the updated configuration
  1811. // appears here.
  1812. Update *ResourceUpdate `json:"update,omitempty"`
  1813. // UpdateTime: Output only. Update timestamp in RFC3339 text format.
  1814. UpdateTime string `json:"updateTime,omitempty"`
  1815. // Url: Output only. The URL of the actual resource.
  1816. Url string `json:"url,omitempty"`
  1817. // Warnings: Output only. If warning messages are generated during
  1818. // processing of this resource, this field will be populated.
  1819. Warnings []*ResourceWarnings `json:"warnings,omitempty"`
  1820. // ServerResponse contains the HTTP response code and headers from the
  1821. // server.
  1822. googleapi.ServerResponse `json:"-"`
  1823. // ForceSendFields is a list of field names (e.g. "AccessControl") to
  1824. // unconditionally include in API requests. By default, fields with
  1825. // empty values are omitted from API requests. However, any non-pointer,
  1826. // non-interface field appearing in ForceSendFields will be sent to the
  1827. // server regardless of whether the field is empty or not. This may be
  1828. // used to include empty fields in Patch requests.
  1829. ForceSendFields []string `json:"-"`
  1830. // NullFields is a list of field names (e.g. "AccessControl") to include
  1831. // in API requests with the JSON null value. By default, fields with
  1832. // empty values are omitted from API requests. However, any field with
  1833. // an empty value appearing in NullFields will be sent to the server as
  1834. // null. It is an error if a field in this list has a non-empty value.
  1835. // This may be used to include null fields in Patch requests.
  1836. NullFields []string `json:"-"`
  1837. }
  1838. func (s *Resource) MarshalJSON() ([]byte, error) {
  1839. type NoMethod Resource
  1840. raw := NoMethod(*s)
  1841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1842. }
  1843. type ResourceWarnings struct {
  1844. // Code: [Output Only] A warning code, if applicable. For example,
  1845. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  1846. // the response.
  1847. Code string `json:"code,omitempty"`
  1848. // Data: [Output Only] Metadata about this warning in key: value format.
  1849. // For example:
  1850. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  1851. Data []*ResourceWarningsData `json:"data,omitempty"`
  1852. // Message: [Output Only] A human-readable description of the warning
  1853. // code.
  1854. Message string `json:"message,omitempty"`
  1855. // ForceSendFields is a list of field names (e.g. "Code") to
  1856. // unconditionally include in API requests. By default, fields with
  1857. // empty values are omitted from API requests. However, any non-pointer,
  1858. // non-interface field appearing in ForceSendFields will be sent to the
  1859. // server regardless of whether the field is empty or not. This may be
  1860. // used to include empty fields in Patch requests.
  1861. ForceSendFields []string `json:"-"`
  1862. // NullFields is a list of field names (e.g. "Code") to include in API
  1863. // requests with the JSON null value. By default, fields with empty
  1864. // values are omitted from API requests. However, any field with an
  1865. // empty value appearing in NullFields will be sent to the server as
  1866. // null. It is an error if a field in this list has a non-empty value.
  1867. // This may be used to include null fields in Patch requests.
  1868. NullFields []string `json:"-"`
  1869. }
  1870. func (s *ResourceWarnings) MarshalJSON() ([]byte, error) {
  1871. type NoMethod ResourceWarnings
  1872. raw := NoMethod(*s)
  1873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1874. }
  1875. type ResourceWarningsData struct {
  1876. // Key: [Output Only] A key that provides more detail on the warning
  1877. // being returned. For example, for warnings where there are no results
  1878. // in a list request for a particular zone, this key might be scope and
  1879. // the key value might be the zone name. Other examples might be a key
  1880. // indicating a deprecated resource and a suggested replacement, or a
  1881. // warning about invalid network settings (for example, if an instance
  1882. // attempts to perform IP forwarding but is not enabled for IP
  1883. // forwarding).
  1884. Key string `json:"key,omitempty"`
  1885. // Value: [Output Only] A warning data value corresponding to the key.
  1886. Value string `json:"value,omitempty"`
  1887. // ForceSendFields is a list of field names (e.g. "Key") to
  1888. // unconditionally include in API requests. By default, fields with
  1889. // empty values are omitted from API requests. However, any non-pointer,
  1890. // non-interface field appearing in ForceSendFields will be sent to the
  1891. // server regardless of whether the field is empty or not. This may be
  1892. // used to include empty fields in Patch requests.
  1893. ForceSendFields []string `json:"-"`
  1894. // NullFields is a list of field names (e.g. "Key") to include in API
  1895. // requests with the JSON null value. By default, fields with empty
  1896. // values are omitted from API requests. However, any field with an
  1897. // empty value appearing in NullFields will be sent to the server as
  1898. // null. It is an error if a field in this list has a non-empty value.
  1899. // This may be used to include null fields in Patch requests.
  1900. NullFields []string `json:"-"`
  1901. }
  1902. func (s *ResourceWarningsData) MarshalJSON() ([]byte, error) {
  1903. type NoMethod ResourceWarningsData
  1904. raw := NoMethod(*s)
  1905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1906. }
  1907. // ResourceAccessControl: The access controls set on the resource.
  1908. type ResourceAccessControl struct {
  1909. // GcpIamPolicy: The GCP IAM Policy to set on the resource.
  1910. GcpIamPolicy string `json:"gcpIamPolicy,omitempty"`
  1911. // ForceSendFields is a list of field names (e.g. "GcpIamPolicy") to
  1912. // unconditionally include in API requests. By default, fields with
  1913. // empty values are omitted from API requests. However, any non-pointer,
  1914. // non-interface field appearing in ForceSendFields will be sent to the
  1915. // server regardless of whether the field is empty or not. This may be
  1916. // used to include empty fields in Patch requests.
  1917. ForceSendFields []string `json:"-"`
  1918. // NullFields is a list of field names (e.g. "GcpIamPolicy") to include
  1919. // in API requests with the JSON null value. By default, fields with
  1920. // empty values are omitted from API requests. However, any field with
  1921. // an empty value appearing in NullFields will be sent to the server as
  1922. // null. It is an error if a field in this list has a non-empty value.
  1923. // This may be used to include null fields in Patch requests.
  1924. NullFields []string `json:"-"`
  1925. }
  1926. func (s *ResourceAccessControl) MarshalJSON() ([]byte, error) {
  1927. type NoMethod ResourceAccessControl
  1928. raw := NoMethod(*s)
  1929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1930. }
  1931. type ResourceUpdate struct {
  1932. // AccessControl: The Access Control Policy to set on this resource
  1933. // after updating the resource itself.
  1934. AccessControl *ResourceAccessControl `json:"accessControl,omitempty"`
  1935. // Credential: Output only. The credential that will be used
  1936. // creating/updating this resource.
  1937. Credential *Credential `json:"credential,omitempty"`
  1938. // Error: Output only. If errors are generated during update of the
  1939. // resource, this field will be populated.
  1940. Error *ResourceUpdateError `json:"error,omitempty"`
  1941. // FinalProperties: Output only. The expanded properties of the resource
  1942. // with reference values expanded. Returned as serialized YAML.
  1943. FinalProperties string `json:"finalProperties,omitempty"`
  1944. // Intent: Output only. The intent of the resource: PREVIEW, UPDATE, or
  1945. // CANCEL.
  1946. Intent string `json:"intent,omitempty"`
  1947. // Manifest: Output only. URL of the manifest representing the update
  1948. // configuration of this resource.
  1949. Manifest string `json:"manifest,omitempty"`
  1950. // Properties: Output only. The set of updated properties for this
  1951. // resource, before references are expanded. Returned as serialized
  1952. // YAML.
  1953. Properties string `json:"properties,omitempty"`
  1954. // RuntimePolicies: Output only. In case this is an action, it will show
  1955. // the runtimePolicies that this action will have after updating the
  1956. // deployment.
  1957. RuntimePolicies []string `json:"runtimePolicies,omitempty"`
  1958. // State: Output only. The state of the resource.
  1959. State string `json:"state,omitempty"`
  1960. // Warnings: Output only. If warning messages are generated during
  1961. // processing of this resource, this field will be populated.
  1962. Warnings []*ResourceUpdateWarnings `json:"warnings,omitempty"`
  1963. // ForceSendFields is a list of field names (e.g. "AccessControl") to
  1964. // unconditionally include in API requests. By default, fields with
  1965. // empty values are omitted from API requests. However, any non-pointer,
  1966. // non-interface field appearing in ForceSendFields will be sent to the
  1967. // server regardless of whether the field is empty or not. This may be
  1968. // used to include empty fields in Patch requests.
  1969. ForceSendFields []string `json:"-"`
  1970. // NullFields is a list of field names (e.g. "AccessControl") to include
  1971. // in API requests with the JSON null value. By default, fields with
  1972. // empty values are omitted from API requests. However, any field with
  1973. // an empty value appearing in NullFields will be sent to the server as
  1974. // null. It is an error if a field in this list has a non-empty value.
  1975. // This may be used to include null fields in Patch requests.
  1976. NullFields []string `json:"-"`
  1977. }
  1978. func (s *ResourceUpdate) MarshalJSON() ([]byte, error) {
  1979. type NoMethod ResourceUpdate
  1980. raw := NoMethod(*s)
  1981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1982. }
  1983. // ResourceUpdateError: Output only. If errors are generated during
  1984. // update of the resource, this field will be populated.
  1985. type ResourceUpdateError struct {
  1986. // Errors: [Output Only] The array of errors encountered while
  1987. // processing this operation.
  1988. Errors []*ResourceUpdateErrorErrors `json:"errors,omitempty"`
  1989. // ForceSendFields is a list of field names (e.g. "Errors") to
  1990. // unconditionally include in API requests. By default, fields with
  1991. // empty values are omitted from API requests. However, any non-pointer,
  1992. // non-interface field appearing in ForceSendFields will be sent to the
  1993. // server regardless of whether the field is empty or not. This may be
  1994. // used to include empty fields in Patch requests.
  1995. ForceSendFields []string `json:"-"`
  1996. // NullFields is a list of field names (e.g. "Errors") to include in API
  1997. // requests with the JSON null value. By default, fields with empty
  1998. // values are omitted from API requests. However, any field with an
  1999. // empty value appearing in NullFields will be sent to the server as
  2000. // null. It is an error if a field in this list has a non-empty value.
  2001. // This may be used to include null fields in Patch requests.
  2002. NullFields []string `json:"-"`
  2003. }
  2004. func (s *ResourceUpdateError) MarshalJSON() ([]byte, error) {
  2005. type NoMethod ResourceUpdateError
  2006. raw := NoMethod(*s)
  2007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2008. }
  2009. type ResourceUpdateErrorErrors struct {
  2010. // Code: [Output Only] The error type identifier for this error.
  2011. Code string `json:"code,omitempty"`
  2012. // Location: [Output Only] Indicates the field in the request that
  2013. // caused the error. This property is optional.
  2014. Location string `json:"location,omitempty"`
  2015. // Message: [Output Only] An optional, human-readable error message.
  2016. Message string `json:"message,omitempty"`
  2017. // ForceSendFields is a list of field names (e.g. "Code") to
  2018. // unconditionally include in API requests. By default, fields with
  2019. // empty values are omitted from API requests. However, any non-pointer,
  2020. // non-interface field appearing in ForceSendFields will be sent to the
  2021. // server regardless of whether the field is empty or not. This may be
  2022. // used to include empty fields in Patch requests.
  2023. ForceSendFields []string `json:"-"`
  2024. // NullFields is a list of field names (e.g. "Code") to include in API
  2025. // requests with the JSON null value. By default, fields with empty
  2026. // values are omitted from API requests. However, any field with an
  2027. // empty value appearing in NullFields will be sent to the server as
  2028. // null. It is an error if a field in this list has a non-empty value.
  2029. // This may be used to include null fields in Patch requests.
  2030. NullFields []string `json:"-"`
  2031. }
  2032. func (s *ResourceUpdateErrorErrors) MarshalJSON() ([]byte, error) {
  2033. type NoMethod ResourceUpdateErrorErrors
  2034. raw := NoMethod(*s)
  2035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2036. }
  2037. type ResourceUpdateWarnings struct {
  2038. // Code: [Output Only] A warning code, if applicable. For example,
  2039. // Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in
  2040. // the response.
  2041. Code string `json:"code,omitempty"`
  2042. // Data: [Output Only] Metadata about this warning in key: value format.
  2043. // For example:
  2044. // "data": [ { "key": "scope", "value": "zones/us-east1-d" }
  2045. Data []*ResourceUpdateWarningsData `json:"data,omitempty"`
  2046. // Message: [Output Only] A human-readable description of the warning
  2047. // code.
  2048. Message string `json:"message,omitempty"`
  2049. // ForceSendFields is a list of field names (e.g. "Code") to
  2050. // unconditionally include in API requests. By default, fields with
  2051. // empty values are omitted from API requests. However, any non-pointer,
  2052. // non-interface field appearing in ForceSendFields will be sent to the
  2053. // server regardless of whether the field is empty or not. This may be
  2054. // used to include empty fields in Patch requests.
  2055. ForceSendFields []string `json:"-"`
  2056. // NullFields is a list of field names (e.g. "Code") to include in API
  2057. // requests with the JSON null value. By default, fields with empty
  2058. // values are omitted from API requests. However, any field with an
  2059. // empty value appearing in NullFields will be sent to the server as
  2060. // null. It is an error if a field in this list has a non-empty value.
  2061. // This may be used to include null fields in Patch requests.
  2062. NullFields []string `json:"-"`
  2063. }
  2064. func (s *ResourceUpdateWarnings) MarshalJSON() ([]byte, error) {
  2065. type NoMethod ResourceUpdateWarnings
  2066. raw := NoMethod(*s)
  2067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2068. }
  2069. type ResourceUpdateWarningsData struct {
  2070. // Key: [Output Only] A key that provides more detail on the warning
  2071. // being returned. For example, for warnings where there are no results
  2072. // in a list request for a particular zone, this key might be scope and
  2073. // the key value might be the zone name. Other examples might be a key
  2074. // indicating a deprecated resource and a suggested replacement, or a
  2075. // warning about invalid network settings (for example, if an instance
  2076. // attempts to perform IP forwarding but is not enabled for IP
  2077. // forwarding).
  2078. Key string `json:"key,omitempty"`
  2079. // Value: [Output Only] A warning data value corresponding to the key.
  2080. Value string `json:"value,omitempty"`
  2081. // ForceSendFields is a list of field names (e.g. "Key") to
  2082. // unconditionally include in API requests. By default, fields with
  2083. // empty values are omitted from API requests. However, any non-pointer,
  2084. // non-interface field appearing in ForceSendFields will be sent to the
  2085. // server regardless of whether the field is empty or not. This may be
  2086. // used to include empty fields in Patch requests.
  2087. ForceSendFields []string `json:"-"`
  2088. // NullFields is a list of field names (e.g. "Key") to include in API
  2089. // requests with the JSON null value. By default, fields with empty
  2090. // values are omitted from API requests. However, any field with an
  2091. // empty value appearing in NullFields will be sent to the server as
  2092. // null. It is an error if a field in this list has a non-empty value.
  2093. // This may be used to include null fields in Patch requests.
  2094. NullFields []string `json:"-"`
  2095. }
  2096. func (s *ResourceUpdateWarningsData) MarshalJSON() ([]byte, error) {
  2097. type NoMethod ResourceUpdateWarningsData
  2098. raw := NoMethod(*s)
  2099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2100. }
  2101. // ResourcesListResponse: A response containing a partial list of
  2102. // resources and a page token used to build the next request if the
  2103. // request has been truncated.
  2104. type ResourcesListResponse struct {
  2105. // NextPageToken: A token used to continue a truncated list request.
  2106. NextPageToken string `json:"nextPageToken,omitempty"`
  2107. // Resources: Resources contained in this list response.
  2108. Resources []*Resource `json:"resources,omitempty"`
  2109. // ServerResponse contains the HTTP response code and headers from the
  2110. // server.
  2111. googleapi.ServerResponse `json:"-"`
  2112. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2113. // unconditionally include in API requests. By default, fields with
  2114. // empty values are omitted from API requests. However, any non-pointer,
  2115. // non-interface field appearing in ForceSendFields will be sent to the
  2116. // server regardless of whether the field is empty or not. This may be
  2117. // used to include empty fields in Patch requests.
  2118. ForceSendFields []string `json:"-"`
  2119. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2120. // in API requests with the JSON null value. By default, fields with
  2121. // empty values are omitted from API requests. However, any field with
  2122. // an empty value appearing in NullFields will be sent to the server as
  2123. // null. It is an error if a field in this list has a non-empty value.
  2124. // This may be used to include null fields in Patch requests.
  2125. NullFields []string `json:"-"`
  2126. }
  2127. func (s *ResourcesListResponse) MarshalJSON() ([]byte, error) {
  2128. type NoMethod ResourcesListResponse
  2129. raw := NoMethod(*s)
  2130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2131. }
  2132. // Rule: A rule to be applied in a Policy.
  2133. type Rule struct {
  2134. // Action: Required
  2135. Action string `json:"action,omitempty"`
  2136. // Conditions: Additional restrictions that must be met. All conditions
  2137. // must pass for the rule to match.
  2138. Conditions []*Condition `json:"conditions,omitempty"`
  2139. // Description: Human-readable description of the rule.
  2140. Description string `json:"description,omitempty"`
  2141. // Ins: If one or more 'in' clauses are specified, the rule matches if
  2142. // the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
  2143. Ins []string `json:"ins,omitempty"`
  2144. // LogConfigs: The config returned to callers of
  2145. // tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
  2146. LogConfigs []*LogConfig `json:"logConfigs,omitempty"`
  2147. // NotIns: If one or more 'not_in' clauses are specified, the rule
  2148. // matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the
  2149. // entries.
  2150. NotIns []string `json:"notIns,omitempty"`
  2151. // Permissions: A permission is a string of form '..' (e.g.,
  2152. // 'storage.buckets.list'). A value of '*' matches all permissions, and
  2153. // a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
  2154. Permissions []string `json:"permissions,omitempty"`
  2155. // ForceSendFields is a list of field names (e.g. "Action") to
  2156. // unconditionally include in API requests. By default, fields with
  2157. // empty values are omitted from API requests. However, any non-pointer,
  2158. // non-interface field appearing in ForceSendFields will be sent to the
  2159. // server regardless of whether the field is empty or not. This may be
  2160. // used to include empty fields in Patch requests.
  2161. ForceSendFields []string `json:"-"`
  2162. // NullFields is a list of field names (e.g. "Action") to include in API
  2163. // requests with the JSON null value. By default, fields with empty
  2164. // values are omitted from API requests. However, any field with an
  2165. // empty value appearing in NullFields will be sent to the server as
  2166. // null. It is an error if a field in this list has a non-empty value.
  2167. // This may be used to include null fields in Patch requests.
  2168. NullFields []string `json:"-"`
  2169. }
  2170. func (s *Rule) MarshalJSON() ([]byte, error) {
  2171. type NoMethod Rule
  2172. raw := NoMethod(*s)
  2173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2174. }
  2175. // ServiceAccount: Service Account used as a credential.
  2176. type ServiceAccount struct {
  2177. // Email: The IAM service account email address like
  2178. // test@myproject.iam.gserviceaccount.com
  2179. Email string `json:"email,omitempty"`
  2180. // ForceSendFields is a list of field names (e.g. "Email") to
  2181. // unconditionally include in API requests. By default, fields with
  2182. // empty values are omitted from API requests. However, any non-pointer,
  2183. // non-interface field appearing in ForceSendFields will be sent to the
  2184. // server regardless of whether the field is empty or not. This may be
  2185. // used to include empty fields in Patch requests.
  2186. ForceSendFields []string `json:"-"`
  2187. // NullFields is a list of field names (e.g. "Email") to include in API
  2188. // requests with the JSON null value. By default, fields with empty
  2189. // values are omitted from API requests. However, any field with an
  2190. // empty value appearing in NullFields will be sent to the server as
  2191. // null. It is an error if a field in this list has a non-empty value.
  2192. // This may be used to include null fields in Patch requests.
  2193. NullFields []string `json:"-"`
  2194. }
  2195. func (s *ServiceAccount) MarshalJSON() ([]byte, error) {
  2196. type NoMethod ServiceAccount
  2197. raw := NoMethod(*s)
  2198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2199. }
  2200. type TargetConfiguration struct {
  2201. // Config: The configuration to use for this deployment.
  2202. Config *ConfigFile `json:"config,omitempty"`
  2203. // Imports: Specifies any files to import for this configuration. This
  2204. // can be used to import templates or other files. For example, you
  2205. // might import a text file in order to use the file in a template.
  2206. Imports []*ImportFile `json:"imports,omitempty"`
  2207. // ForceSendFields is a list of field names (e.g. "Config") to
  2208. // unconditionally include in API requests. By default, fields with
  2209. // empty values are omitted from API requests. However, any non-pointer,
  2210. // non-interface field appearing in ForceSendFields will be sent to the
  2211. // server regardless of whether the field is empty or not. This may be
  2212. // used to include empty fields in Patch requests.
  2213. ForceSendFields []string `json:"-"`
  2214. // NullFields is a list of field names (e.g. "Config") to include in API
  2215. // requests with the JSON null value. By default, fields with empty
  2216. // values are omitted from API requests. However, any field with an
  2217. // empty value appearing in NullFields will be sent to the server as
  2218. // null. It is an error if a field in this list has a non-empty value.
  2219. // This may be used to include null fields in Patch requests.
  2220. NullFields []string `json:"-"`
  2221. }
  2222. func (s *TargetConfiguration) MarshalJSON() ([]byte, error) {
  2223. type NoMethod TargetConfiguration
  2224. raw := NoMethod(*s)
  2225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2226. }
  2227. // TemplateContents: Files that make up the template contents of a
  2228. // template type.
  2229. type TemplateContents struct {
  2230. // Imports: Import files referenced by the main template.
  2231. Imports []*ImportFile `json:"imports,omitempty"`
  2232. // Interpreter: Which interpreter (python or jinja) should be used
  2233. // during expansion.
  2234. Interpreter string `json:"interpreter,omitempty"`
  2235. // MainTemplate: The filename of the mainTemplate
  2236. MainTemplate string `json:"mainTemplate,omitempty"`
  2237. // Schema: The contents of the template schema.
  2238. Schema string `json:"schema,omitempty"`
  2239. // Template: The contents of the main template file.
  2240. Template string `json:"template,omitempty"`
  2241. // ForceSendFields is a list of field names (e.g. "Imports") to
  2242. // unconditionally include in API requests. By default, fields with
  2243. // empty values are omitted from API requests. However, any non-pointer,
  2244. // non-interface field appearing in ForceSendFields will be sent to the
  2245. // server regardless of whether the field is empty or not. This may be
  2246. // used to include empty fields in Patch requests.
  2247. ForceSendFields []string `json:"-"`
  2248. // NullFields is a list of field names (e.g. "Imports") to include in
  2249. // API requests with the JSON null value. By default, fields with empty
  2250. // values are omitted from API requests. However, any field with an
  2251. // empty value appearing in NullFields will be sent to the server as
  2252. // null. It is an error if a field in this list has a non-empty value.
  2253. // This may be used to include null fields in Patch requests.
  2254. NullFields []string `json:"-"`
  2255. }
  2256. func (s *TemplateContents) MarshalJSON() ([]byte, error) {
  2257. type NoMethod TemplateContents
  2258. raw := NoMethod(*s)
  2259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2260. }
  2261. type TestPermissionsRequest struct {
  2262. // Permissions: The set of permissions to check for the 'resource'.
  2263. // Permissions with wildcards (such as '*' or 'storage.*') are not
  2264. // allowed.
  2265. Permissions []string `json:"permissions,omitempty"`
  2266. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2267. // unconditionally include in API requests. By default, fields with
  2268. // empty values are omitted from API requests. However, any non-pointer,
  2269. // non-interface field appearing in ForceSendFields will be sent to the
  2270. // server regardless of whether the field is empty or not. This may be
  2271. // used to include empty fields in Patch requests.
  2272. ForceSendFields []string `json:"-"`
  2273. // NullFields is a list of field names (e.g. "Permissions") to include
  2274. // in API requests with the JSON null value. By default, fields with
  2275. // empty values are omitted from API requests. However, any field with
  2276. // an empty value appearing in NullFields will be sent to the server as
  2277. // null. It is an error if a field in this list has a non-empty value.
  2278. // This may be used to include null fields in Patch requests.
  2279. NullFields []string `json:"-"`
  2280. }
  2281. func (s *TestPermissionsRequest) MarshalJSON() ([]byte, error) {
  2282. type NoMethod TestPermissionsRequest
  2283. raw := NoMethod(*s)
  2284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2285. }
  2286. type TestPermissionsResponse struct {
  2287. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  2288. // the caller is allowed.
  2289. Permissions []string `json:"permissions,omitempty"`
  2290. // ServerResponse contains the HTTP response code and headers from the
  2291. // server.
  2292. googleapi.ServerResponse `json:"-"`
  2293. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2294. // unconditionally include in API requests. By default, fields with
  2295. // empty values are omitted from API requests. However, any non-pointer,
  2296. // non-interface field appearing in ForceSendFields will be sent to the
  2297. // server regardless of whether the field is empty or not. This may be
  2298. // used to include empty fields in Patch requests.
  2299. ForceSendFields []string `json:"-"`
  2300. // NullFields is a list of field names (e.g. "Permissions") to include
  2301. // in API requests with the JSON null value. By default, fields with
  2302. // empty values are omitted from API requests. However, any field with
  2303. // an empty value appearing in NullFields will be sent to the server as
  2304. // null. It is an error if a field in this list has a non-empty value.
  2305. // This may be used to include null fields in Patch requests.
  2306. NullFields []string `json:"-"`
  2307. }
  2308. func (s *TestPermissionsResponse) MarshalJSON() ([]byte, error) {
  2309. type NoMethod TestPermissionsResponse
  2310. raw := NoMethod(*s)
  2311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2312. }
  2313. // Type: A resource type supported by Deployment Manager.
  2314. type Type struct {
  2315. // ConfigurableService: Base Type (configurable service) that backs this
  2316. // Type.
  2317. ConfigurableService *ConfigurableService `json:"configurableService,omitempty"`
  2318. // Description: An optional textual description of the resource;
  2319. // provided by the client when the resource is created.
  2320. Description string `json:"description,omitempty"`
  2321. Id uint64 `json:"id,omitempty,string"`
  2322. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  2323. InsertTime string `json:"insertTime,omitempty"`
  2324. // Labels: Map of labels; provided by the client when the resource is
  2325. // created or updated. Specifically: Label keys must be between 1 and 63
  2326. // characters long and must conform to the following regular expression:
  2327. // [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63
  2328. // characters long and must conform to the regular expression
  2329. // ([a-z]([-a-z0-9]*[a-z0-9])?)?
  2330. Labels []*TypeLabelEntry `json:"labels,omitempty"`
  2331. // Name: Name of the type.
  2332. Name string `json:"name,omitempty"`
  2333. // Operation: Output only. The Operation that most recently ran, or is
  2334. // currently running, on this type.
  2335. Operation *Operation `json:"operation,omitempty"`
  2336. // SelfLink: Output only. Server defined URL for the resource.
  2337. SelfLink string `json:"selfLink,omitempty"`
  2338. // ServerResponse contains the HTTP response code and headers from the
  2339. // server.
  2340. googleapi.ServerResponse `json:"-"`
  2341. // ForceSendFields is a list of field names (e.g. "ConfigurableService")
  2342. // to unconditionally include in API requests. By default, fields with
  2343. // empty values are omitted from API requests. However, any non-pointer,
  2344. // non-interface field appearing in ForceSendFields will be sent to the
  2345. // server regardless of whether the field is empty or not. This may be
  2346. // used to include empty fields in Patch requests.
  2347. ForceSendFields []string `json:"-"`
  2348. // NullFields is a list of field names (e.g. "ConfigurableService") to
  2349. // include in API requests with the JSON null value. By default, fields
  2350. // with empty values are omitted from API requests. However, any field
  2351. // with an empty value appearing in NullFields will be sent to the
  2352. // server as null. It is an error if a field in this list has a
  2353. // non-empty value. This may be used to include null fields in Patch
  2354. // requests.
  2355. NullFields []string `json:"-"`
  2356. }
  2357. func (s *Type) MarshalJSON() ([]byte, error) {
  2358. type NoMethod Type
  2359. raw := NoMethod(*s)
  2360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2361. }
  2362. // TypeInfo: Type Information. Contains detailed information about a
  2363. // composite type, base type, or base type with specific collection.
  2364. type TypeInfo struct {
  2365. // Description: The description of the type.
  2366. Description string `json:"description,omitempty"`
  2367. // DocumentationLink: For swagger 2.0 externalDocs field will be used.
  2368. // For swagger 1.2 this field will be empty.
  2369. DocumentationLink string `json:"documentationLink,omitempty"`
  2370. // Kind: Output only. Type of the output. Always
  2371. // deploymentManager#TypeInfo for TypeInfo.
  2372. Kind string `json:"kind,omitempty"`
  2373. // Name: The base type or composite type name.
  2374. Name string `json:"name,omitempty"`
  2375. // Schema: For base types with a collection, we return a schema and
  2376. // documentation link For template types, we return only a schema
  2377. Schema *TypeInfoSchemaInfo `json:"schema,omitempty"`
  2378. // SelfLink: Output only. Self link for the type provider.
  2379. SelfLink string `json:"selfLink,omitempty"`
  2380. // Title: The title on the API descriptor URL provided.
  2381. Title string `json:"title,omitempty"`
  2382. // ServerResponse contains the HTTP response code and headers from the
  2383. // server.
  2384. googleapi.ServerResponse `json:"-"`
  2385. // ForceSendFields is a list of field names (e.g. "Description") to
  2386. // unconditionally include in API requests. By default, fields with
  2387. // empty values are omitted from API requests. However, any non-pointer,
  2388. // non-interface field appearing in ForceSendFields will be sent to the
  2389. // server regardless of whether the field is empty or not. This may be
  2390. // used to include empty fields in Patch requests.
  2391. ForceSendFields []string `json:"-"`
  2392. // NullFields is a list of field names (e.g. "Description") to include
  2393. // in API requests with the JSON null value. By default, fields with
  2394. // empty values are omitted from API requests. However, any field with
  2395. // an empty value appearing in NullFields will be sent to the server as
  2396. // null. It is an error if a field in this list has a non-empty value.
  2397. // This may be used to include null fields in Patch requests.
  2398. NullFields []string `json:"-"`
  2399. }
  2400. func (s *TypeInfo) MarshalJSON() ([]byte, error) {
  2401. type NoMethod TypeInfo
  2402. raw := NoMethod(*s)
  2403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2404. }
  2405. type TypeInfoSchemaInfo struct {
  2406. // Input: The properties that this composite type or base type
  2407. // collection accept as input, represented as a json blob, format is:
  2408. // JSON Schema Draft V4
  2409. Input string `json:"input,omitempty"`
  2410. // Output: The properties that this composite type or base type
  2411. // collection exposes as output, these properties can be used for
  2412. // references, represented as json blob, format is: JSON Schema Draft V4
  2413. Output string `json:"output,omitempty"`
  2414. // ForceSendFields is a list of field names (e.g. "Input") to
  2415. // unconditionally include in API requests. By default, fields with
  2416. // empty values are omitted from API requests. However, any non-pointer,
  2417. // non-interface field appearing in ForceSendFields will be sent to the
  2418. // server regardless of whether the field is empty or not. This may be
  2419. // used to include empty fields in Patch requests.
  2420. ForceSendFields []string `json:"-"`
  2421. // NullFields is a list of field names (e.g. "Input") to include in API
  2422. // requests with the JSON null value. By default, fields with empty
  2423. // values are omitted from API requests. However, any field with an
  2424. // empty value appearing in NullFields will be sent to the server as
  2425. // null. It is an error if a field in this list has a non-empty value.
  2426. // This may be used to include null fields in Patch requests.
  2427. NullFields []string `json:"-"`
  2428. }
  2429. func (s *TypeInfoSchemaInfo) MarshalJSON() ([]byte, error) {
  2430. type NoMethod TypeInfoSchemaInfo
  2431. raw := NoMethod(*s)
  2432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2433. }
  2434. type TypeLabelEntry struct {
  2435. Key string `json:"key,omitempty"`
  2436. Value string `json:"value,omitempty"`
  2437. // ForceSendFields is a list of field names (e.g. "Key") to
  2438. // unconditionally include in API requests. By default, fields with
  2439. // empty values are omitted from API requests. However, any non-pointer,
  2440. // non-interface field appearing in ForceSendFields will be sent to the
  2441. // server regardless of whether the field is empty or not. This may be
  2442. // used to include empty fields in Patch requests.
  2443. ForceSendFields []string `json:"-"`
  2444. // NullFields is a list of field names (e.g. "Key") to include in API
  2445. // requests with the JSON null value. By default, fields with empty
  2446. // values are omitted from API requests. However, any field with an
  2447. // empty value appearing in NullFields will be sent to the server as
  2448. // null. It is an error if a field in this list has a non-empty value.
  2449. // This may be used to include null fields in Patch requests.
  2450. NullFields []string `json:"-"`
  2451. }
  2452. func (s *TypeLabelEntry) MarshalJSON() ([]byte, error) {
  2453. type NoMethod TypeLabelEntry
  2454. raw := NoMethod(*s)
  2455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2456. }
  2457. // TypeProvider: A type provider that describes a service-backed Type.
  2458. type TypeProvider struct {
  2459. // CollectionOverrides: Allows resource handling overrides for specific
  2460. // collections
  2461. CollectionOverrides []*CollectionOverride `json:"collectionOverrides,omitempty"`
  2462. // Credential: Credential used when interacting with this type.
  2463. Credential *Credential `json:"credential,omitempty"`
  2464. // Description: An optional textual description of the resource;
  2465. // provided by the client when the resource is created.
  2466. Description string `json:"description,omitempty"`
  2467. // DescriptorUrl: Descriptor Url for the this type provider.
  2468. DescriptorUrl string `json:"descriptorUrl,omitempty"`
  2469. // Id: Output only. Unique identifier for the resource defined by the
  2470. // server.
  2471. Id uint64 `json:"id,omitempty,string"`
  2472. // InsertTime: Output only. Creation timestamp in RFC3339 text format.
  2473. InsertTime string `json:"insertTime,omitempty"`
  2474. // Labels: Map of labels; provided by the client when the resource is
  2475. // created or updated. Specifically: Label keys must be between 1 and 63
  2476. // characters long and must conform to the following regular expression:
  2477. // [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63
  2478. // characters long and must conform to the regular expression
  2479. // ([a-z]([-a-z0-9]*[a-z0-9])?)?
  2480. Labels []*TypeProviderLabelEntry `json:"labels,omitempty"`
  2481. // Name: Name of the resource; provided by the client when the resource
  2482. // is created. The name must be 1-63 characters long, and comply with
  2483. // RFC1035. Specifically, the name must be 1-63 characters long and
  2484. // match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means
  2485. // the first character must be a lowercase letter, and all following
  2486. // characters must be a dash, lowercase letter, or digit, except the
  2487. // last character, which cannot be a dash.
  2488. Name string `json:"name,omitempty"`
  2489. // Operation: Output only. The Operation that most recently ran, or is
  2490. // currently running, on this type provider.
  2491. Operation *Operation `json:"operation,omitempty"`
  2492. // Options: Options to apply when handling any resources in this
  2493. // service.
  2494. Options *Options `json:"options,omitempty"`
  2495. // SelfLink: Output only. Self link for the type provider.
  2496. SelfLink string `json:"selfLink,omitempty"`
  2497. // ServerResponse contains the HTTP response code and headers from the
  2498. // server.
  2499. googleapi.ServerResponse `json:"-"`
  2500. // ForceSendFields is a list of field names (e.g. "CollectionOverrides")
  2501. // to unconditionally include in API requests. By default, fields with
  2502. // empty values are omitted from API requests. However, any non-pointer,
  2503. // non-interface field appearing in ForceSendFields will be sent to the
  2504. // server regardless of whether the field is empty or not. This may be
  2505. // used to include empty fields in Patch requests.
  2506. ForceSendFields []string `json:"-"`
  2507. // NullFields is a list of field names (e.g. "CollectionOverrides") to
  2508. // include in API requests with the JSON null value. By default, fields
  2509. // with empty values are omitted from API requests. However, any field
  2510. // with an empty value appearing in NullFields will be sent to the
  2511. // server as null. It is an error if a field in this list has a
  2512. // non-empty value. This may be used to include null fields in Patch
  2513. // requests.
  2514. NullFields []string `json:"-"`
  2515. }
  2516. func (s *TypeProvider) MarshalJSON() ([]byte, error) {
  2517. type NoMethod TypeProvider
  2518. raw := NoMethod(*s)
  2519. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2520. }
  2521. type TypeProviderLabelEntry struct {
  2522. Key string `json:"key,omitempty"`
  2523. Value string `json:"value,omitempty"`
  2524. // ForceSendFields is a list of field names (e.g. "Key") to
  2525. // unconditionally include in API requests. By default, fields with
  2526. // empty values are omitted from API requests. However, any non-pointer,
  2527. // non-interface field appearing in ForceSendFields will be sent to the
  2528. // server regardless of whether the field is empty or not. This may be
  2529. // used to include empty fields in Patch requests.
  2530. ForceSendFields []string `json:"-"`
  2531. // NullFields is a list of field names (e.g. "Key") to include in API
  2532. // requests with the JSON null value. By default, fields with empty
  2533. // values are omitted from API requests. However, any field with an
  2534. // empty value appearing in NullFields will be sent to the server as
  2535. // null. It is an error if a field in this list has a non-empty value.
  2536. // This may be used to include null fields in Patch requests.
  2537. NullFields []string `json:"-"`
  2538. }
  2539. func (s *TypeProviderLabelEntry) MarshalJSON() ([]byte, error) {
  2540. type NoMethod TypeProviderLabelEntry
  2541. raw := NoMethod(*s)
  2542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2543. }
  2544. // TypeProvidersListResponse: A response that returns all Type Providers
  2545. // supported by Deployment Manager
  2546. type TypeProvidersListResponse struct {
  2547. // NextPageToken: A token used to continue a truncated list request.
  2548. NextPageToken string `json:"nextPageToken,omitempty"`
  2549. // TypeProviders: Output only. A list of resource type providers
  2550. // supported by Deployment Manager.
  2551. TypeProviders []*TypeProvider `json:"typeProviders,omitempty"`
  2552. // ServerResponse contains the HTTP response code and headers from the
  2553. // server.
  2554. googleapi.ServerResponse `json:"-"`
  2555. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2556. // unconditionally include in API requests. By default, fields with
  2557. // empty values are omitted from API requests. However, any non-pointer,
  2558. // non-interface field appearing in ForceSendFields will be sent to the
  2559. // server regardless of whether the field is empty or not. This may be
  2560. // used to include empty fields in Patch requests.
  2561. ForceSendFields []string `json:"-"`
  2562. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2563. // in API requests with the JSON null value. By default, fields with
  2564. // empty values are omitted from API requests. However, any field with
  2565. // an empty value appearing in NullFields will be sent to the server as
  2566. // null. It is an error if a field in this list has a non-empty value.
  2567. // This may be used to include null fields in Patch requests.
  2568. NullFields []string `json:"-"`
  2569. }
  2570. func (s *TypeProvidersListResponse) MarshalJSON() ([]byte, error) {
  2571. type NoMethod TypeProvidersListResponse
  2572. raw := NoMethod(*s)
  2573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2574. }
  2575. type TypeProvidersListTypesResponse struct {
  2576. // NextPageToken: A token used to continue a truncated list request.
  2577. NextPageToken string `json:"nextPageToken,omitempty"`
  2578. // Types: Output only. A list of resource type info.
  2579. Types []*TypeInfo `json:"types,omitempty"`
  2580. // ServerResponse contains the HTTP response code and headers from the
  2581. // server.
  2582. googleapi.ServerResponse `json:"-"`
  2583. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2584. // unconditionally include in API requests. By default, fields with
  2585. // empty values are omitted from API requests. However, any non-pointer,
  2586. // non-interface field appearing in ForceSendFields will be sent to the
  2587. // server regardless of whether the field is empty or not. This may be
  2588. // used to include empty fields in Patch requests.
  2589. ForceSendFields []string `json:"-"`
  2590. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2591. // in API requests with the JSON null value. By default, fields with
  2592. // empty values are omitted from API requests. However, any field with
  2593. // an empty value appearing in NullFields will be sent to the server as
  2594. // null. It is an error if a field in this list has a non-empty value.
  2595. // This may be used to include null fields in Patch requests.
  2596. NullFields []string `json:"-"`
  2597. }
  2598. func (s *TypeProvidersListTypesResponse) MarshalJSON() ([]byte, error) {
  2599. type NoMethod TypeProvidersListTypesResponse
  2600. raw := NoMethod(*s)
  2601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2602. }
  2603. // TypesListResponse: A response that returns all Types supported by
  2604. // Deployment Manager
  2605. type TypesListResponse struct {
  2606. // NextPageToken: A token used to continue a truncated list request.
  2607. NextPageToken string `json:"nextPageToken,omitempty"`
  2608. // Types: Output only. A list of resource types supported by Deployment
  2609. // Manager.
  2610. Types []*Type `json:"types,omitempty"`
  2611. // ServerResponse contains the HTTP response code and headers from the
  2612. // server.
  2613. googleapi.ServerResponse `json:"-"`
  2614. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2615. // unconditionally include in API requests. By default, fields with
  2616. // empty values are omitted from API requests. However, any non-pointer,
  2617. // non-interface field appearing in ForceSendFields will be sent to the
  2618. // server regardless of whether the field is empty or not. This may be
  2619. // used to include empty fields in Patch requests.
  2620. ForceSendFields []string `json:"-"`
  2621. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2622. // in API requests with the JSON null value. By default, fields with
  2623. // empty values are omitted from API requests. However, any field with
  2624. // an empty value appearing in NullFields will be sent to the server as
  2625. // null. It is an error if a field in this list has a non-empty value.
  2626. // This may be used to include null fields in Patch requests.
  2627. NullFields []string `json:"-"`
  2628. }
  2629. func (s *TypesListResponse) MarshalJSON() ([]byte, error) {
  2630. type NoMethod TypesListResponse
  2631. raw := NoMethod(*s)
  2632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2633. }
  2634. // ValidationOptions: Options for how to validate and process properties
  2635. // on a resource.
  2636. type ValidationOptions struct {
  2637. // SchemaValidation: Customize how deployment manager will validate the
  2638. // resource against schema errors.
  2639. SchemaValidation string `json:"schemaValidation,omitempty"`
  2640. // UndeclaredProperties: Specify what to do with extra properties when
  2641. // executing a request.
  2642. UndeclaredProperties string `json:"undeclaredProperties,omitempty"`
  2643. // ForceSendFields is a list of field names (e.g. "SchemaValidation") to
  2644. // unconditionally include in API requests. By default, fields with
  2645. // empty values are omitted from API requests. However, any non-pointer,
  2646. // non-interface field appearing in ForceSendFields will be sent to the
  2647. // server regardless of whether the field is empty or not. This may be
  2648. // used to include empty fields in Patch requests.
  2649. ForceSendFields []string `json:"-"`
  2650. // NullFields is a list of field names (e.g. "SchemaValidation") to
  2651. // include in API requests with the JSON null value. By default, fields
  2652. // with empty values are omitted from API requests. However, any field
  2653. // with an empty value appearing in NullFields will be sent to the
  2654. // server as null. It is an error if a field in this list has a
  2655. // non-empty value. This may be used to include null fields in Patch
  2656. // requests.
  2657. NullFields []string `json:"-"`
  2658. }
  2659. func (s *ValidationOptions) MarshalJSON() ([]byte, error) {
  2660. type NoMethod ValidationOptions
  2661. raw := NoMethod(*s)
  2662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2663. }
  2664. // method id "deploymentmanager.compositeTypes.delete":
  2665. type CompositeTypesDeleteCall struct {
  2666. s *Service
  2667. project string
  2668. compositeType string
  2669. urlParams_ gensupport.URLParams
  2670. ctx_ context.Context
  2671. header_ http.Header
  2672. }
  2673. // Delete: Deletes a composite type.
  2674. func (r *CompositeTypesService) Delete(project string, compositeType string) *CompositeTypesDeleteCall {
  2675. c := &CompositeTypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2676. c.project = project
  2677. c.compositeType = compositeType
  2678. return c
  2679. }
  2680. // Fields allows partial responses to be retrieved. See
  2681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2682. // for more information.
  2683. func (c *CompositeTypesDeleteCall) Fields(s ...googleapi.Field) *CompositeTypesDeleteCall {
  2684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2685. return c
  2686. }
  2687. // Context sets the context to be used in this call's Do method. Any
  2688. // pending HTTP request will be aborted if the provided context is
  2689. // canceled.
  2690. func (c *CompositeTypesDeleteCall) Context(ctx context.Context) *CompositeTypesDeleteCall {
  2691. c.ctx_ = ctx
  2692. return c
  2693. }
  2694. // Header returns an http.Header that can be modified by the caller to
  2695. // add HTTP headers to the request.
  2696. func (c *CompositeTypesDeleteCall) Header() http.Header {
  2697. if c.header_ == nil {
  2698. c.header_ = make(http.Header)
  2699. }
  2700. return c.header_
  2701. }
  2702. func (c *CompositeTypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2703. reqHeaders := make(http.Header)
  2704. for k, v := range c.header_ {
  2705. reqHeaders[k] = v
  2706. }
  2707. reqHeaders.Set("User-Agent", c.s.userAgent())
  2708. var body io.Reader = nil
  2709. c.urlParams_.Set("alt", alt)
  2710. c.urlParams_.Set("prettyPrint", "false")
  2711. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/compositeTypes/{compositeType}")
  2712. urls += "?" + c.urlParams_.Encode()
  2713. req, err := http.NewRequest("DELETE", urls, body)
  2714. if err != nil {
  2715. return nil, err
  2716. }
  2717. req.Header = reqHeaders
  2718. googleapi.Expand(req.URL, map[string]string{
  2719. "project": c.project,
  2720. "compositeType": c.compositeType,
  2721. })
  2722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2723. }
  2724. // Do executes the "deploymentmanager.compositeTypes.delete" call.
  2725. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2726. // status code is an error. Response headers are in either
  2727. // *Operation.ServerResponse.Header or (if a response was returned at
  2728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2729. // to check whether the returned error was because
  2730. // http.StatusNotModified was returned.
  2731. func (c *CompositeTypesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2732. gensupport.SetOptions(c.urlParams_, opts...)
  2733. res, err := c.doRequest("json")
  2734. if res != nil && res.StatusCode == http.StatusNotModified {
  2735. if res.Body != nil {
  2736. res.Body.Close()
  2737. }
  2738. return nil, &googleapi.Error{
  2739. Code: res.StatusCode,
  2740. Header: res.Header,
  2741. }
  2742. }
  2743. if err != nil {
  2744. return nil, err
  2745. }
  2746. defer googleapi.CloseBody(res)
  2747. if err := googleapi.CheckResponse(res); err != nil {
  2748. return nil, err
  2749. }
  2750. ret := &Operation{
  2751. ServerResponse: googleapi.ServerResponse{
  2752. Header: res.Header,
  2753. HTTPStatusCode: res.StatusCode,
  2754. },
  2755. }
  2756. target := &ret
  2757. if err := gensupport.DecodeResponse(target, res); err != nil {
  2758. return nil, err
  2759. }
  2760. return ret, nil
  2761. // {
  2762. // "description": "Deletes a composite type.",
  2763. // "httpMethod": "DELETE",
  2764. // "id": "deploymentmanager.compositeTypes.delete",
  2765. // "parameterOrder": [
  2766. // "project",
  2767. // "compositeType"
  2768. // ],
  2769. // "parameters": {
  2770. // "compositeType": {
  2771. // "description": "The name of the type for this request.",
  2772. // "location": "path",
  2773. // "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?",
  2774. // "required": true,
  2775. // "type": "string"
  2776. // },
  2777. // "project": {
  2778. // "description": "The project ID for this request.",
  2779. // "location": "path",
  2780. // "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])?))",
  2781. // "required": true,
  2782. // "type": "string"
  2783. // }
  2784. // },
  2785. // "path": "{project}/global/compositeTypes/{compositeType}",
  2786. // "response": {
  2787. // "$ref": "Operation"
  2788. // },
  2789. // "scopes": [
  2790. // "https://www.googleapis.com/auth/cloud-platform",
  2791. // "https://www.googleapis.com/auth/ndev.cloudman"
  2792. // ]
  2793. // }
  2794. }
  2795. // method id "deploymentmanager.compositeTypes.get":
  2796. type CompositeTypesGetCall struct {
  2797. s *Service
  2798. project string
  2799. compositeType string
  2800. urlParams_ gensupport.URLParams
  2801. ifNoneMatch_ string
  2802. ctx_ context.Context
  2803. header_ http.Header
  2804. }
  2805. // Get: Gets information about a specific composite type.
  2806. func (r *CompositeTypesService) Get(project string, compositeType string) *CompositeTypesGetCall {
  2807. c := &CompositeTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2808. c.project = project
  2809. c.compositeType = compositeType
  2810. return c
  2811. }
  2812. // Fields allows partial responses to be retrieved. See
  2813. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2814. // for more information.
  2815. func (c *CompositeTypesGetCall) Fields(s ...googleapi.Field) *CompositeTypesGetCall {
  2816. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2817. return c
  2818. }
  2819. // IfNoneMatch sets the optional parameter which makes the operation
  2820. // fail if the object's ETag matches the given value. This is useful for
  2821. // getting updates only after the object has changed since the last
  2822. // request. Use googleapi.IsNotModified to check whether the response
  2823. // error from Do is the result of In-None-Match.
  2824. func (c *CompositeTypesGetCall) IfNoneMatch(entityTag string) *CompositeTypesGetCall {
  2825. c.ifNoneMatch_ = entityTag
  2826. return c
  2827. }
  2828. // Context sets the context to be used in this call's Do method. Any
  2829. // pending HTTP request will be aborted if the provided context is
  2830. // canceled.
  2831. func (c *CompositeTypesGetCall) Context(ctx context.Context) *CompositeTypesGetCall {
  2832. c.ctx_ = ctx
  2833. return c
  2834. }
  2835. // Header returns an http.Header that can be modified by the caller to
  2836. // add HTTP headers to the request.
  2837. func (c *CompositeTypesGetCall) Header() http.Header {
  2838. if c.header_ == nil {
  2839. c.header_ = make(http.Header)
  2840. }
  2841. return c.header_
  2842. }
  2843. func (c *CompositeTypesGetCall) doRequest(alt string) (*http.Response, error) {
  2844. reqHeaders := make(http.Header)
  2845. for k, v := range c.header_ {
  2846. reqHeaders[k] = v
  2847. }
  2848. reqHeaders.Set("User-Agent", c.s.userAgent())
  2849. if c.ifNoneMatch_ != "" {
  2850. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2851. }
  2852. var body io.Reader = nil
  2853. c.urlParams_.Set("alt", alt)
  2854. c.urlParams_.Set("prettyPrint", "false")
  2855. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/compositeTypes/{compositeType}")
  2856. urls += "?" + c.urlParams_.Encode()
  2857. req, err := http.NewRequest("GET", urls, body)
  2858. if err != nil {
  2859. return nil, err
  2860. }
  2861. req.Header = reqHeaders
  2862. googleapi.Expand(req.URL, map[string]string{
  2863. "project": c.project,
  2864. "compositeType": c.compositeType,
  2865. })
  2866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2867. }
  2868. // Do executes the "deploymentmanager.compositeTypes.get" call.
  2869. // Exactly one of *CompositeType or error will be non-nil. Any non-2xx
  2870. // status code is an error. Response headers are in either
  2871. // *CompositeType.ServerResponse.Header or (if a response was returned
  2872. // at all) in error.(*googleapi.Error).Header. Use
  2873. // googleapi.IsNotModified to check whether the returned error was
  2874. // because http.StatusNotModified was returned.
  2875. func (c *CompositeTypesGetCall) Do(opts ...googleapi.CallOption) (*CompositeType, error) {
  2876. gensupport.SetOptions(c.urlParams_, opts...)
  2877. res, err := c.doRequest("json")
  2878. if res != nil && res.StatusCode == http.StatusNotModified {
  2879. if res.Body != nil {
  2880. res.Body.Close()
  2881. }
  2882. return nil, &googleapi.Error{
  2883. Code: res.StatusCode,
  2884. Header: res.Header,
  2885. }
  2886. }
  2887. if err != nil {
  2888. return nil, err
  2889. }
  2890. defer googleapi.CloseBody(res)
  2891. if err := googleapi.CheckResponse(res); err != nil {
  2892. return nil, err
  2893. }
  2894. ret := &CompositeType{
  2895. ServerResponse: googleapi.ServerResponse{
  2896. Header: res.Header,
  2897. HTTPStatusCode: res.StatusCode,
  2898. },
  2899. }
  2900. target := &ret
  2901. if err := gensupport.DecodeResponse(target, res); err != nil {
  2902. return nil, err
  2903. }
  2904. return ret, nil
  2905. // {
  2906. // "description": "Gets information about a specific composite type.",
  2907. // "httpMethod": "GET",
  2908. // "id": "deploymentmanager.compositeTypes.get",
  2909. // "parameterOrder": [
  2910. // "project",
  2911. // "compositeType"
  2912. // ],
  2913. // "parameters": {
  2914. // "compositeType": {
  2915. // "description": "The name of the composite type for this request.",
  2916. // "location": "path",
  2917. // "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?",
  2918. // "required": true,
  2919. // "type": "string"
  2920. // },
  2921. // "project": {
  2922. // "description": "The project ID for this request.",
  2923. // "location": "path",
  2924. // "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])?))",
  2925. // "required": true,
  2926. // "type": "string"
  2927. // }
  2928. // },
  2929. // "path": "{project}/global/compositeTypes/{compositeType}",
  2930. // "response": {
  2931. // "$ref": "CompositeType"
  2932. // },
  2933. // "scopes": [
  2934. // "https://www.googleapis.com/auth/cloud-platform",
  2935. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  2936. // "https://www.googleapis.com/auth/ndev.cloudman",
  2937. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  2938. // ]
  2939. // }
  2940. }
  2941. // method id "deploymentmanager.compositeTypes.insert":
  2942. type CompositeTypesInsertCall struct {
  2943. s *Service
  2944. project string
  2945. compositetype *CompositeType
  2946. urlParams_ gensupport.URLParams
  2947. ctx_ context.Context
  2948. header_ http.Header
  2949. }
  2950. // Insert: Creates a composite type.
  2951. func (r *CompositeTypesService) Insert(project string, compositetype *CompositeType) *CompositeTypesInsertCall {
  2952. c := &CompositeTypesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2953. c.project = project
  2954. c.compositetype = compositetype
  2955. return c
  2956. }
  2957. // Fields allows partial responses to be retrieved. See
  2958. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2959. // for more information.
  2960. func (c *CompositeTypesInsertCall) Fields(s ...googleapi.Field) *CompositeTypesInsertCall {
  2961. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2962. return c
  2963. }
  2964. // Context sets the context to be used in this call's Do method. Any
  2965. // pending HTTP request will be aborted if the provided context is
  2966. // canceled.
  2967. func (c *CompositeTypesInsertCall) Context(ctx context.Context) *CompositeTypesInsertCall {
  2968. c.ctx_ = ctx
  2969. return c
  2970. }
  2971. // Header returns an http.Header that can be modified by the caller to
  2972. // add HTTP headers to the request.
  2973. func (c *CompositeTypesInsertCall) Header() http.Header {
  2974. if c.header_ == nil {
  2975. c.header_ = make(http.Header)
  2976. }
  2977. return c.header_
  2978. }
  2979. func (c *CompositeTypesInsertCall) doRequest(alt string) (*http.Response, error) {
  2980. reqHeaders := make(http.Header)
  2981. for k, v := range c.header_ {
  2982. reqHeaders[k] = v
  2983. }
  2984. reqHeaders.Set("User-Agent", c.s.userAgent())
  2985. var body io.Reader = nil
  2986. body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype)
  2987. if err != nil {
  2988. return nil, err
  2989. }
  2990. reqHeaders.Set("Content-Type", "application/json")
  2991. c.urlParams_.Set("alt", alt)
  2992. c.urlParams_.Set("prettyPrint", "false")
  2993. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/compositeTypes")
  2994. urls += "?" + c.urlParams_.Encode()
  2995. req, err := http.NewRequest("POST", urls, body)
  2996. if err != nil {
  2997. return nil, err
  2998. }
  2999. req.Header = reqHeaders
  3000. googleapi.Expand(req.URL, map[string]string{
  3001. "project": c.project,
  3002. })
  3003. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3004. }
  3005. // Do executes the "deploymentmanager.compositeTypes.insert" call.
  3006. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3007. // status code is an error. Response headers are in either
  3008. // *Operation.ServerResponse.Header or (if a response was returned at
  3009. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3010. // to check whether the returned error was because
  3011. // http.StatusNotModified was returned.
  3012. func (c *CompositeTypesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3013. gensupport.SetOptions(c.urlParams_, opts...)
  3014. res, err := c.doRequest("json")
  3015. if res != nil && res.StatusCode == http.StatusNotModified {
  3016. if res.Body != nil {
  3017. res.Body.Close()
  3018. }
  3019. return nil, &googleapi.Error{
  3020. Code: res.StatusCode,
  3021. Header: res.Header,
  3022. }
  3023. }
  3024. if err != nil {
  3025. return nil, err
  3026. }
  3027. defer googleapi.CloseBody(res)
  3028. if err := googleapi.CheckResponse(res); err != nil {
  3029. return nil, err
  3030. }
  3031. ret := &Operation{
  3032. ServerResponse: googleapi.ServerResponse{
  3033. Header: res.Header,
  3034. HTTPStatusCode: res.StatusCode,
  3035. },
  3036. }
  3037. target := &ret
  3038. if err := gensupport.DecodeResponse(target, res); err != nil {
  3039. return nil, err
  3040. }
  3041. return ret, nil
  3042. // {
  3043. // "description": "Creates a composite type.",
  3044. // "httpMethod": "POST",
  3045. // "id": "deploymentmanager.compositeTypes.insert",
  3046. // "parameterOrder": [
  3047. // "project"
  3048. // ],
  3049. // "parameters": {
  3050. // "project": {
  3051. // "description": "The project ID for this request.",
  3052. // "location": "path",
  3053. // "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])?))",
  3054. // "required": true,
  3055. // "type": "string"
  3056. // }
  3057. // },
  3058. // "path": "{project}/global/compositeTypes",
  3059. // "request": {
  3060. // "$ref": "CompositeType"
  3061. // },
  3062. // "response": {
  3063. // "$ref": "Operation"
  3064. // },
  3065. // "scopes": [
  3066. // "https://www.googleapis.com/auth/cloud-platform",
  3067. // "https://www.googleapis.com/auth/ndev.cloudman"
  3068. // ]
  3069. // }
  3070. }
  3071. // method id "deploymentmanager.compositeTypes.list":
  3072. type CompositeTypesListCall struct {
  3073. s *Service
  3074. project string
  3075. urlParams_ gensupport.URLParams
  3076. ifNoneMatch_ string
  3077. ctx_ context.Context
  3078. header_ http.Header
  3079. }
  3080. // List: Lists all composite types for Deployment Manager.
  3081. func (r *CompositeTypesService) List(project string) *CompositeTypesListCall {
  3082. c := &CompositeTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3083. c.project = project
  3084. return c
  3085. }
  3086. // Filter sets the optional parameter "filter": A filter expression that
  3087. // filters resources listed in the response. The expression must specify
  3088. // the field name, a comparison operator, and the value that you want to
  3089. // use for filtering. The value must be a string, a number, or a
  3090. // boolean. The comparison operator must be either =, !=, >, or <.
  3091. //
  3092. // For example, if you are filtering Compute Engine instances, you can
  3093. // exclude instances named example-instance by specifying name !=
  3094. // example-instance.
  3095. //
  3096. // You can also filter nested fields. For example, you could specify
  3097. // scheduling.automaticRestart = false to include instances only if they
  3098. // are not scheduled for automatic restarts. You can use filtering on
  3099. // nested fields to filter based on resource labels.
  3100. //
  3101. // To filter on multiple expressions, provide each separate expression
  3102. // within parentheses. For example, (scheduling.automaticRestart = true)
  3103. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  3104. // AND expression. However, you can include AND and OR expressions
  3105. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  3106. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  3107. // true).
  3108. func (c *CompositeTypesListCall) Filter(filter string) *CompositeTypesListCall {
  3109. c.urlParams_.Set("filter", filter)
  3110. return c
  3111. }
  3112. // MaxResults sets the optional parameter "maxResults": The maximum
  3113. // number of results per page that should be returned. If the number of
  3114. // available results is larger than maxResults, Compute Engine returns a
  3115. // nextPageToken that can be used to get the next page of results in
  3116. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  3117. // (Default: 500)
  3118. func (c *CompositeTypesListCall) MaxResults(maxResults int64) *CompositeTypesListCall {
  3119. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3120. return c
  3121. }
  3122. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  3123. // a certain order. By default, results are returned in alphanumerical
  3124. // order based on the resource name.
  3125. //
  3126. // You can also sort results in descending order based on the creation
  3127. // timestamp using orderBy="creationTimestamp desc". This sorts results
  3128. // based on the creationTimestamp field in reverse chronological order
  3129. // (newest result first). Use this to sort resources like operations so
  3130. // that the newest operation is returned first.
  3131. //
  3132. // Currently, only sorting by name or creationTimestamp desc is
  3133. // supported.
  3134. func (c *CompositeTypesListCall) OrderBy(orderBy string) *CompositeTypesListCall {
  3135. c.urlParams_.Set("orderBy", orderBy)
  3136. return c
  3137. }
  3138. // PageToken sets the optional parameter "pageToken": Specifies a page
  3139. // token to use. Set pageToken to the nextPageToken returned by a
  3140. // previous list request to get the next page of results.
  3141. func (c *CompositeTypesListCall) PageToken(pageToken string) *CompositeTypesListCall {
  3142. c.urlParams_.Set("pageToken", pageToken)
  3143. return c
  3144. }
  3145. // Fields allows partial responses to be retrieved. See
  3146. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3147. // for more information.
  3148. func (c *CompositeTypesListCall) Fields(s ...googleapi.Field) *CompositeTypesListCall {
  3149. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3150. return c
  3151. }
  3152. // IfNoneMatch sets the optional parameter which makes the operation
  3153. // fail if the object's ETag matches the given value. This is useful for
  3154. // getting updates only after the object has changed since the last
  3155. // request. Use googleapi.IsNotModified to check whether the response
  3156. // error from Do is the result of In-None-Match.
  3157. func (c *CompositeTypesListCall) IfNoneMatch(entityTag string) *CompositeTypesListCall {
  3158. c.ifNoneMatch_ = entityTag
  3159. return c
  3160. }
  3161. // Context sets the context to be used in this call's Do method. Any
  3162. // pending HTTP request will be aborted if the provided context is
  3163. // canceled.
  3164. func (c *CompositeTypesListCall) Context(ctx context.Context) *CompositeTypesListCall {
  3165. c.ctx_ = ctx
  3166. return c
  3167. }
  3168. // Header returns an http.Header that can be modified by the caller to
  3169. // add HTTP headers to the request.
  3170. func (c *CompositeTypesListCall) Header() http.Header {
  3171. if c.header_ == nil {
  3172. c.header_ = make(http.Header)
  3173. }
  3174. return c.header_
  3175. }
  3176. func (c *CompositeTypesListCall) doRequest(alt string) (*http.Response, error) {
  3177. reqHeaders := make(http.Header)
  3178. for k, v := range c.header_ {
  3179. reqHeaders[k] = v
  3180. }
  3181. reqHeaders.Set("User-Agent", c.s.userAgent())
  3182. if c.ifNoneMatch_ != "" {
  3183. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3184. }
  3185. var body io.Reader = nil
  3186. c.urlParams_.Set("alt", alt)
  3187. c.urlParams_.Set("prettyPrint", "false")
  3188. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/compositeTypes")
  3189. urls += "?" + c.urlParams_.Encode()
  3190. req, err := http.NewRequest("GET", urls, body)
  3191. if err != nil {
  3192. return nil, err
  3193. }
  3194. req.Header = reqHeaders
  3195. googleapi.Expand(req.URL, map[string]string{
  3196. "project": c.project,
  3197. })
  3198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3199. }
  3200. // Do executes the "deploymentmanager.compositeTypes.list" call.
  3201. // Exactly one of *CompositeTypesListResponse or error will be non-nil.
  3202. // Any non-2xx status code is an error. Response headers are in either
  3203. // *CompositeTypesListResponse.ServerResponse.Header or (if a response
  3204. // was returned at all) in error.(*googleapi.Error).Header. Use
  3205. // googleapi.IsNotModified to check whether the returned error was
  3206. // because http.StatusNotModified was returned.
  3207. func (c *CompositeTypesListCall) Do(opts ...googleapi.CallOption) (*CompositeTypesListResponse, error) {
  3208. gensupport.SetOptions(c.urlParams_, opts...)
  3209. res, err := c.doRequest("json")
  3210. if res != nil && res.StatusCode == http.StatusNotModified {
  3211. if res.Body != nil {
  3212. res.Body.Close()
  3213. }
  3214. return nil, &googleapi.Error{
  3215. Code: res.StatusCode,
  3216. Header: res.Header,
  3217. }
  3218. }
  3219. if err != nil {
  3220. return nil, err
  3221. }
  3222. defer googleapi.CloseBody(res)
  3223. if err := googleapi.CheckResponse(res); err != nil {
  3224. return nil, err
  3225. }
  3226. ret := &CompositeTypesListResponse{
  3227. ServerResponse: googleapi.ServerResponse{
  3228. Header: res.Header,
  3229. HTTPStatusCode: res.StatusCode,
  3230. },
  3231. }
  3232. target := &ret
  3233. if err := gensupport.DecodeResponse(target, res); err != nil {
  3234. return nil, err
  3235. }
  3236. return ret, nil
  3237. // {
  3238. // "description": "Lists all composite types for Deployment Manager.",
  3239. // "httpMethod": "GET",
  3240. // "id": "deploymentmanager.compositeTypes.list",
  3241. // "parameterOrder": [
  3242. // "project"
  3243. // ],
  3244. // "parameters": {
  3245. // "filter": {
  3246. // "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).",
  3247. // "location": "query",
  3248. // "type": "string"
  3249. // },
  3250. // "maxResults": {
  3251. // "default": "500",
  3252. // "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)",
  3253. // "format": "uint32",
  3254. // "location": "query",
  3255. // "minimum": "0",
  3256. // "type": "integer"
  3257. // },
  3258. // "orderBy": {
  3259. // "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.",
  3260. // "location": "query",
  3261. // "type": "string"
  3262. // },
  3263. // "pageToken": {
  3264. // "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.",
  3265. // "location": "query",
  3266. // "type": "string"
  3267. // },
  3268. // "project": {
  3269. // "description": "The project ID for this request.",
  3270. // "location": "path",
  3271. // "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])?))",
  3272. // "required": true,
  3273. // "type": "string"
  3274. // }
  3275. // },
  3276. // "path": "{project}/global/compositeTypes",
  3277. // "response": {
  3278. // "$ref": "CompositeTypesListResponse"
  3279. // },
  3280. // "scopes": [
  3281. // "https://www.googleapis.com/auth/cloud-platform",
  3282. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  3283. // "https://www.googleapis.com/auth/ndev.cloudman",
  3284. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  3285. // ]
  3286. // }
  3287. }
  3288. // Pages invokes f for each page of results.
  3289. // A non-nil error returned from f will halt the iteration.
  3290. // The provided context supersedes any context provided to the Context method.
  3291. func (c *CompositeTypesListCall) Pages(ctx context.Context, f func(*CompositeTypesListResponse) error) error {
  3292. c.ctx_ = ctx
  3293. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3294. for {
  3295. x, err := c.Do()
  3296. if err != nil {
  3297. return err
  3298. }
  3299. if err := f(x); err != nil {
  3300. return err
  3301. }
  3302. if x.NextPageToken == "" {
  3303. return nil
  3304. }
  3305. c.PageToken(x.NextPageToken)
  3306. }
  3307. }
  3308. // method id "deploymentmanager.compositeTypes.patch":
  3309. type CompositeTypesPatchCall struct {
  3310. s *Service
  3311. project string
  3312. compositeType string
  3313. compositetype *CompositeType
  3314. urlParams_ gensupport.URLParams
  3315. ctx_ context.Context
  3316. header_ http.Header
  3317. }
  3318. // Patch: Updates a composite type. This method supports patch
  3319. // semantics.
  3320. func (r *CompositeTypesService) Patch(project string, compositeType string, compositetype *CompositeType) *CompositeTypesPatchCall {
  3321. c := &CompositeTypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3322. c.project = project
  3323. c.compositeType = compositeType
  3324. c.compositetype = compositetype
  3325. return c
  3326. }
  3327. // Fields allows partial responses to be retrieved. See
  3328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3329. // for more information.
  3330. func (c *CompositeTypesPatchCall) Fields(s ...googleapi.Field) *CompositeTypesPatchCall {
  3331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3332. return c
  3333. }
  3334. // Context sets the context to be used in this call's Do method. Any
  3335. // pending HTTP request will be aborted if the provided context is
  3336. // canceled.
  3337. func (c *CompositeTypesPatchCall) Context(ctx context.Context) *CompositeTypesPatchCall {
  3338. c.ctx_ = ctx
  3339. return c
  3340. }
  3341. // Header returns an http.Header that can be modified by the caller to
  3342. // add HTTP headers to the request.
  3343. func (c *CompositeTypesPatchCall) Header() http.Header {
  3344. if c.header_ == nil {
  3345. c.header_ = make(http.Header)
  3346. }
  3347. return c.header_
  3348. }
  3349. func (c *CompositeTypesPatchCall) doRequest(alt string) (*http.Response, error) {
  3350. reqHeaders := make(http.Header)
  3351. for k, v := range c.header_ {
  3352. reqHeaders[k] = v
  3353. }
  3354. reqHeaders.Set("User-Agent", c.s.userAgent())
  3355. var body io.Reader = nil
  3356. body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype)
  3357. if err != nil {
  3358. return nil, err
  3359. }
  3360. reqHeaders.Set("Content-Type", "application/json")
  3361. c.urlParams_.Set("alt", alt)
  3362. c.urlParams_.Set("prettyPrint", "false")
  3363. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/compositeTypes/{compositeType}")
  3364. urls += "?" + c.urlParams_.Encode()
  3365. req, err := http.NewRequest("PATCH", urls, body)
  3366. if err != nil {
  3367. return nil, err
  3368. }
  3369. req.Header = reqHeaders
  3370. googleapi.Expand(req.URL, map[string]string{
  3371. "project": c.project,
  3372. "compositeType": c.compositeType,
  3373. })
  3374. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3375. }
  3376. // Do executes the "deploymentmanager.compositeTypes.patch" call.
  3377. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3378. // status code is an error. Response headers are in either
  3379. // *Operation.ServerResponse.Header or (if a response was returned at
  3380. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3381. // to check whether the returned error was because
  3382. // http.StatusNotModified was returned.
  3383. func (c *CompositeTypesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3384. gensupport.SetOptions(c.urlParams_, opts...)
  3385. res, err := c.doRequest("json")
  3386. if res != nil && res.StatusCode == http.StatusNotModified {
  3387. if res.Body != nil {
  3388. res.Body.Close()
  3389. }
  3390. return nil, &googleapi.Error{
  3391. Code: res.StatusCode,
  3392. Header: res.Header,
  3393. }
  3394. }
  3395. if err != nil {
  3396. return nil, err
  3397. }
  3398. defer googleapi.CloseBody(res)
  3399. if err := googleapi.CheckResponse(res); err != nil {
  3400. return nil, err
  3401. }
  3402. ret := &Operation{
  3403. ServerResponse: googleapi.ServerResponse{
  3404. Header: res.Header,
  3405. HTTPStatusCode: res.StatusCode,
  3406. },
  3407. }
  3408. target := &ret
  3409. if err := gensupport.DecodeResponse(target, res); err != nil {
  3410. return nil, err
  3411. }
  3412. return ret, nil
  3413. // {
  3414. // "description": "Updates a composite type. This method supports patch semantics.",
  3415. // "httpMethod": "PATCH",
  3416. // "id": "deploymentmanager.compositeTypes.patch",
  3417. // "parameterOrder": [
  3418. // "project",
  3419. // "compositeType"
  3420. // ],
  3421. // "parameters": {
  3422. // "compositeType": {
  3423. // "description": "The name of the composite type for this request.",
  3424. // "location": "path",
  3425. // "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?",
  3426. // "required": true,
  3427. // "type": "string"
  3428. // },
  3429. // "project": {
  3430. // "description": "The project ID for this request.",
  3431. // "location": "path",
  3432. // "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])?))",
  3433. // "required": true,
  3434. // "type": "string"
  3435. // }
  3436. // },
  3437. // "path": "{project}/global/compositeTypes/{compositeType}",
  3438. // "request": {
  3439. // "$ref": "CompositeType"
  3440. // },
  3441. // "response": {
  3442. // "$ref": "Operation"
  3443. // },
  3444. // "scopes": [
  3445. // "https://www.googleapis.com/auth/cloud-platform",
  3446. // "https://www.googleapis.com/auth/ndev.cloudman"
  3447. // ]
  3448. // }
  3449. }
  3450. // method id "deploymentmanager.compositeTypes.update":
  3451. type CompositeTypesUpdateCall struct {
  3452. s *Service
  3453. project string
  3454. compositeType string
  3455. compositetype *CompositeType
  3456. urlParams_ gensupport.URLParams
  3457. ctx_ context.Context
  3458. header_ http.Header
  3459. }
  3460. // Update: Updates a composite type.
  3461. func (r *CompositeTypesService) Update(project string, compositeType string, compositetype *CompositeType) *CompositeTypesUpdateCall {
  3462. c := &CompositeTypesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3463. c.project = project
  3464. c.compositeType = compositeType
  3465. c.compositetype = compositetype
  3466. return c
  3467. }
  3468. // Fields allows partial responses to be retrieved. See
  3469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3470. // for more information.
  3471. func (c *CompositeTypesUpdateCall) Fields(s ...googleapi.Field) *CompositeTypesUpdateCall {
  3472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3473. return c
  3474. }
  3475. // Context sets the context to be used in this call's Do method. Any
  3476. // pending HTTP request will be aborted if the provided context is
  3477. // canceled.
  3478. func (c *CompositeTypesUpdateCall) Context(ctx context.Context) *CompositeTypesUpdateCall {
  3479. c.ctx_ = ctx
  3480. return c
  3481. }
  3482. // Header returns an http.Header that can be modified by the caller to
  3483. // add HTTP headers to the request.
  3484. func (c *CompositeTypesUpdateCall) Header() http.Header {
  3485. if c.header_ == nil {
  3486. c.header_ = make(http.Header)
  3487. }
  3488. return c.header_
  3489. }
  3490. func (c *CompositeTypesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3491. reqHeaders := make(http.Header)
  3492. for k, v := range c.header_ {
  3493. reqHeaders[k] = v
  3494. }
  3495. reqHeaders.Set("User-Agent", c.s.userAgent())
  3496. var body io.Reader = nil
  3497. body, err := googleapi.WithoutDataWrapper.JSONReader(c.compositetype)
  3498. if err != nil {
  3499. return nil, err
  3500. }
  3501. reqHeaders.Set("Content-Type", "application/json")
  3502. c.urlParams_.Set("alt", alt)
  3503. c.urlParams_.Set("prettyPrint", "false")
  3504. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/compositeTypes/{compositeType}")
  3505. urls += "?" + c.urlParams_.Encode()
  3506. req, err := http.NewRequest("PUT", urls, body)
  3507. if err != nil {
  3508. return nil, err
  3509. }
  3510. req.Header = reqHeaders
  3511. googleapi.Expand(req.URL, map[string]string{
  3512. "project": c.project,
  3513. "compositeType": c.compositeType,
  3514. })
  3515. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3516. }
  3517. // Do executes the "deploymentmanager.compositeTypes.update" call.
  3518. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3519. // status code is an error. Response headers are in either
  3520. // *Operation.ServerResponse.Header or (if a response was returned at
  3521. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3522. // to check whether the returned error was because
  3523. // http.StatusNotModified was returned.
  3524. func (c *CompositeTypesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3525. gensupport.SetOptions(c.urlParams_, opts...)
  3526. res, err := c.doRequest("json")
  3527. if res != nil && res.StatusCode == http.StatusNotModified {
  3528. if res.Body != nil {
  3529. res.Body.Close()
  3530. }
  3531. return nil, &googleapi.Error{
  3532. Code: res.StatusCode,
  3533. Header: res.Header,
  3534. }
  3535. }
  3536. if err != nil {
  3537. return nil, err
  3538. }
  3539. defer googleapi.CloseBody(res)
  3540. if err := googleapi.CheckResponse(res); err != nil {
  3541. return nil, err
  3542. }
  3543. ret := &Operation{
  3544. ServerResponse: googleapi.ServerResponse{
  3545. Header: res.Header,
  3546. HTTPStatusCode: res.StatusCode,
  3547. },
  3548. }
  3549. target := &ret
  3550. if err := gensupport.DecodeResponse(target, res); err != nil {
  3551. return nil, err
  3552. }
  3553. return ret, nil
  3554. // {
  3555. // "description": "Updates a composite type.",
  3556. // "httpMethod": "PUT",
  3557. // "id": "deploymentmanager.compositeTypes.update",
  3558. // "parameterOrder": [
  3559. // "project",
  3560. // "compositeType"
  3561. // ],
  3562. // "parameters": {
  3563. // "compositeType": {
  3564. // "description": "The name of the composite type for this request.",
  3565. // "location": "path",
  3566. // "pattern": "[a-z](?:[-a-z0-9_.]{0,61}[a-z0-9])?",
  3567. // "required": true,
  3568. // "type": "string"
  3569. // },
  3570. // "project": {
  3571. // "description": "The project ID for this request.",
  3572. // "location": "path",
  3573. // "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])?))",
  3574. // "required": true,
  3575. // "type": "string"
  3576. // }
  3577. // },
  3578. // "path": "{project}/global/compositeTypes/{compositeType}",
  3579. // "request": {
  3580. // "$ref": "CompositeType"
  3581. // },
  3582. // "response": {
  3583. // "$ref": "Operation"
  3584. // },
  3585. // "scopes": [
  3586. // "https://www.googleapis.com/auth/cloud-platform",
  3587. // "https://www.googleapis.com/auth/ndev.cloudman"
  3588. // ]
  3589. // }
  3590. }
  3591. // method id "deploymentmanager.deployments.cancelPreview":
  3592. type DeploymentsCancelPreviewCall struct {
  3593. s *Service
  3594. project string
  3595. deployment string
  3596. deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest
  3597. urlParams_ gensupport.URLParams
  3598. ctx_ context.Context
  3599. header_ http.Header
  3600. }
  3601. // CancelPreview: Cancels and removes the preview currently associated
  3602. // with the deployment.
  3603. func (r *DeploymentsService) CancelPreview(project string, deployment string, deploymentscancelpreviewrequest *DeploymentsCancelPreviewRequest) *DeploymentsCancelPreviewCall {
  3604. c := &DeploymentsCancelPreviewCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3605. c.project = project
  3606. c.deployment = deployment
  3607. c.deploymentscancelpreviewrequest = deploymentscancelpreviewrequest
  3608. return c
  3609. }
  3610. // Fields allows partial responses to be retrieved. See
  3611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3612. // for more information.
  3613. func (c *DeploymentsCancelPreviewCall) Fields(s ...googleapi.Field) *DeploymentsCancelPreviewCall {
  3614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3615. return c
  3616. }
  3617. // Context sets the context to be used in this call's Do method. Any
  3618. // pending HTTP request will be aborted if the provided context is
  3619. // canceled.
  3620. func (c *DeploymentsCancelPreviewCall) Context(ctx context.Context) *DeploymentsCancelPreviewCall {
  3621. c.ctx_ = ctx
  3622. return c
  3623. }
  3624. // Header returns an http.Header that can be modified by the caller to
  3625. // add HTTP headers to the request.
  3626. func (c *DeploymentsCancelPreviewCall) Header() http.Header {
  3627. if c.header_ == nil {
  3628. c.header_ = make(http.Header)
  3629. }
  3630. return c.header_
  3631. }
  3632. func (c *DeploymentsCancelPreviewCall) doRequest(alt string) (*http.Response, error) {
  3633. reqHeaders := make(http.Header)
  3634. for k, v := range c.header_ {
  3635. reqHeaders[k] = v
  3636. }
  3637. reqHeaders.Set("User-Agent", c.s.userAgent())
  3638. var body io.Reader = nil
  3639. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentscancelpreviewrequest)
  3640. if err != nil {
  3641. return nil, err
  3642. }
  3643. reqHeaders.Set("Content-Type", "application/json")
  3644. c.urlParams_.Set("alt", alt)
  3645. c.urlParams_.Set("prettyPrint", "false")
  3646. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/cancelPreview")
  3647. urls += "?" + c.urlParams_.Encode()
  3648. req, err := http.NewRequest("POST", urls, body)
  3649. if err != nil {
  3650. return nil, err
  3651. }
  3652. req.Header = reqHeaders
  3653. googleapi.Expand(req.URL, map[string]string{
  3654. "project": c.project,
  3655. "deployment": c.deployment,
  3656. })
  3657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3658. }
  3659. // Do executes the "deploymentmanager.deployments.cancelPreview" call.
  3660. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3661. // status code is an error. Response headers are in either
  3662. // *Operation.ServerResponse.Header or (if a response was returned at
  3663. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3664. // to check whether the returned error was because
  3665. // http.StatusNotModified was returned.
  3666. func (c *DeploymentsCancelPreviewCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3667. gensupport.SetOptions(c.urlParams_, opts...)
  3668. res, err := c.doRequest("json")
  3669. if res != nil && res.StatusCode == http.StatusNotModified {
  3670. if res.Body != nil {
  3671. res.Body.Close()
  3672. }
  3673. return nil, &googleapi.Error{
  3674. Code: res.StatusCode,
  3675. Header: res.Header,
  3676. }
  3677. }
  3678. if err != nil {
  3679. return nil, err
  3680. }
  3681. defer googleapi.CloseBody(res)
  3682. if err := googleapi.CheckResponse(res); err != nil {
  3683. return nil, err
  3684. }
  3685. ret := &Operation{
  3686. ServerResponse: googleapi.ServerResponse{
  3687. Header: res.Header,
  3688. HTTPStatusCode: res.StatusCode,
  3689. },
  3690. }
  3691. target := &ret
  3692. if err := gensupport.DecodeResponse(target, res); err != nil {
  3693. return nil, err
  3694. }
  3695. return ret, nil
  3696. // {
  3697. // "description": "Cancels and removes the preview currently associated with the deployment.",
  3698. // "httpMethod": "POST",
  3699. // "id": "deploymentmanager.deployments.cancelPreview",
  3700. // "parameterOrder": [
  3701. // "project",
  3702. // "deployment"
  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. // "project": {
  3713. // "description": "The project ID for this request.",
  3714. // "location": "path",
  3715. // "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])?))",
  3716. // "required": true,
  3717. // "type": "string"
  3718. // }
  3719. // },
  3720. // "path": "{project}/global/deployments/{deployment}/cancelPreview",
  3721. // "request": {
  3722. // "$ref": "DeploymentsCancelPreviewRequest"
  3723. // },
  3724. // "response": {
  3725. // "$ref": "Operation"
  3726. // },
  3727. // "scopes": [
  3728. // "https://www.googleapis.com/auth/cloud-platform",
  3729. // "https://www.googleapis.com/auth/ndev.cloudman"
  3730. // ]
  3731. // }
  3732. }
  3733. // method id "deploymentmanager.deployments.delete":
  3734. type DeploymentsDeleteCall struct {
  3735. s *Service
  3736. project string
  3737. deployment string
  3738. urlParams_ gensupport.URLParams
  3739. ctx_ context.Context
  3740. header_ http.Header
  3741. }
  3742. // Delete: Deletes a deployment and all of the resources in the
  3743. // deployment.
  3744. func (r *DeploymentsService) Delete(project string, deployment string) *DeploymentsDeleteCall {
  3745. c := &DeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3746. c.project = project
  3747. c.deployment = deployment
  3748. return c
  3749. }
  3750. // DeletePolicy sets the optional parameter "deletePolicy": Sets the
  3751. // policy to use for deleting resources.
  3752. //
  3753. // Possible values:
  3754. // "ABANDON"
  3755. // "DELETE" (default)
  3756. func (c *DeploymentsDeleteCall) DeletePolicy(deletePolicy string) *DeploymentsDeleteCall {
  3757. c.urlParams_.Set("deletePolicy", deletePolicy)
  3758. return c
  3759. }
  3760. // Fields allows partial responses to be retrieved. See
  3761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3762. // for more information.
  3763. func (c *DeploymentsDeleteCall) Fields(s ...googleapi.Field) *DeploymentsDeleteCall {
  3764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3765. return c
  3766. }
  3767. // Context sets the context to be used in this call's Do method. Any
  3768. // pending HTTP request will be aborted if the provided context is
  3769. // canceled.
  3770. func (c *DeploymentsDeleteCall) Context(ctx context.Context) *DeploymentsDeleteCall {
  3771. c.ctx_ = ctx
  3772. return c
  3773. }
  3774. // Header returns an http.Header that can be modified by the caller to
  3775. // add HTTP headers to the request.
  3776. func (c *DeploymentsDeleteCall) Header() http.Header {
  3777. if c.header_ == nil {
  3778. c.header_ = make(http.Header)
  3779. }
  3780. return c.header_
  3781. }
  3782. func (c *DeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3783. reqHeaders := make(http.Header)
  3784. for k, v := range c.header_ {
  3785. reqHeaders[k] = v
  3786. }
  3787. reqHeaders.Set("User-Agent", c.s.userAgent())
  3788. var body io.Reader = nil
  3789. c.urlParams_.Set("alt", alt)
  3790. c.urlParams_.Set("prettyPrint", "false")
  3791. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}")
  3792. urls += "?" + c.urlParams_.Encode()
  3793. req, err := http.NewRequest("DELETE", urls, body)
  3794. if err != nil {
  3795. return nil, err
  3796. }
  3797. req.Header = reqHeaders
  3798. googleapi.Expand(req.URL, map[string]string{
  3799. "project": c.project,
  3800. "deployment": c.deployment,
  3801. })
  3802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3803. }
  3804. // Do executes the "deploymentmanager.deployments.delete" call.
  3805. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3806. // status code is an error. Response headers are in either
  3807. // *Operation.ServerResponse.Header or (if a response was returned at
  3808. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3809. // to check whether the returned error was because
  3810. // http.StatusNotModified was returned.
  3811. func (c *DeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3812. gensupport.SetOptions(c.urlParams_, opts...)
  3813. res, err := c.doRequest("json")
  3814. if res != nil && res.StatusCode == http.StatusNotModified {
  3815. if res.Body != nil {
  3816. res.Body.Close()
  3817. }
  3818. return nil, &googleapi.Error{
  3819. Code: res.StatusCode,
  3820. Header: res.Header,
  3821. }
  3822. }
  3823. if err != nil {
  3824. return nil, err
  3825. }
  3826. defer googleapi.CloseBody(res)
  3827. if err := googleapi.CheckResponse(res); err != nil {
  3828. return nil, err
  3829. }
  3830. ret := &Operation{
  3831. ServerResponse: googleapi.ServerResponse{
  3832. Header: res.Header,
  3833. HTTPStatusCode: res.StatusCode,
  3834. },
  3835. }
  3836. target := &ret
  3837. if err := gensupport.DecodeResponse(target, res); err != nil {
  3838. return nil, err
  3839. }
  3840. return ret, nil
  3841. // {
  3842. // "description": "Deletes a deployment and all of the resources in the deployment.",
  3843. // "httpMethod": "DELETE",
  3844. // "id": "deploymentmanager.deployments.delete",
  3845. // "parameterOrder": [
  3846. // "project",
  3847. // "deployment"
  3848. // ],
  3849. // "parameters": {
  3850. // "deletePolicy": {
  3851. // "default": "DELETE",
  3852. // "description": "Sets the policy to use for deleting resources.",
  3853. // "enum": [
  3854. // "ABANDON",
  3855. // "DELETE"
  3856. // ],
  3857. // "enumDescriptions": [
  3858. // "",
  3859. // ""
  3860. // ],
  3861. // "location": "query",
  3862. // "type": "string"
  3863. // },
  3864. // "deployment": {
  3865. // "description": "The name of the deployment for this request.",
  3866. // "location": "path",
  3867. // "required": true,
  3868. // "type": "string"
  3869. // },
  3870. // "project": {
  3871. // "description": "The project ID for this request.",
  3872. // "location": "path",
  3873. // "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])?))",
  3874. // "required": true,
  3875. // "type": "string"
  3876. // }
  3877. // },
  3878. // "path": "{project}/global/deployments/{deployment}",
  3879. // "response": {
  3880. // "$ref": "Operation"
  3881. // },
  3882. // "scopes": [
  3883. // "https://www.googleapis.com/auth/cloud-platform",
  3884. // "https://www.googleapis.com/auth/ndev.cloudman"
  3885. // ]
  3886. // }
  3887. }
  3888. // method id "deploymentmanager.deployments.get":
  3889. type DeploymentsGetCall struct {
  3890. s *Service
  3891. project string
  3892. deployment string
  3893. urlParams_ gensupport.URLParams
  3894. ifNoneMatch_ string
  3895. ctx_ context.Context
  3896. header_ http.Header
  3897. }
  3898. // Get: Gets information about a specific deployment.
  3899. func (r *DeploymentsService) Get(project string, deployment string) *DeploymentsGetCall {
  3900. c := &DeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3901. c.project = project
  3902. c.deployment = deployment
  3903. return c
  3904. }
  3905. // Fields allows partial responses to be retrieved. See
  3906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3907. // for more information.
  3908. func (c *DeploymentsGetCall) Fields(s ...googleapi.Field) *DeploymentsGetCall {
  3909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3910. return c
  3911. }
  3912. // IfNoneMatch sets the optional parameter which makes the operation
  3913. // fail if the object's ETag matches the given value. This is useful for
  3914. // getting updates only after the object has changed since the last
  3915. // request. Use googleapi.IsNotModified to check whether the response
  3916. // error from Do is the result of In-None-Match.
  3917. func (c *DeploymentsGetCall) IfNoneMatch(entityTag string) *DeploymentsGetCall {
  3918. c.ifNoneMatch_ = entityTag
  3919. return c
  3920. }
  3921. // Context sets the context to be used in this call's Do method. Any
  3922. // pending HTTP request will be aborted if the provided context is
  3923. // canceled.
  3924. func (c *DeploymentsGetCall) Context(ctx context.Context) *DeploymentsGetCall {
  3925. c.ctx_ = ctx
  3926. return c
  3927. }
  3928. // Header returns an http.Header that can be modified by the caller to
  3929. // add HTTP headers to the request.
  3930. func (c *DeploymentsGetCall) Header() http.Header {
  3931. if c.header_ == nil {
  3932. c.header_ = make(http.Header)
  3933. }
  3934. return c.header_
  3935. }
  3936. func (c *DeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
  3937. reqHeaders := make(http.Header)
  3938. for k, v := range c.header_ {
  3939. reqHeaders[k] = v
  3940. }
  3941. reqHeaders.Set("User-Agent", c.s.userAgent())
  3942. if c.ifNoneMatch_ != "" {
  3943. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3944. }
  3945. var body io.Reader = nil
  3946. c.urlParams_.Set("alt", alt)
  3947. c.urlParams_.Set("prettyPrint", "false")
  3948. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}")
  3949. urls += "?" + c.urlParams_.Encode()
  3950. req, err := http.NewRequest("GET", urls, body)
  3951. if err != nil {
  3952. return nil, err
  3953. }
  3954. req.Header = reqHeaders
  3955. googleapi.Expand(req.URL, map[string]string{
  3956. "project": c.project,
  3957. "deployment": c.deployment,
  3958. })
  3959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3960. }
  3961. // Do executes the "deploymentmanager.deployments.get" call.
  3962. // Exactly one of *Deployment or error will be non-nil. Any non-2xx
  3963. // status code is an error. Response headers are in either
  3964. // *Deployment.ServerResponse.Header or (if a response was returned at
  3965. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3966. // to check whether the returned error was because
  3967. // http.StatusNotModified was returned.
  3968. func (c *DeploymentsGetCall) Do(opts ...googleapi.CallOption) (*Deployment, error) {
  3969. gensupport.SetOptions(c.urlParams_, opts...)
  3970. res, err := c.doRequest("json")
  3971. if res != nil && res.StatusCode == http.StatusNotModified {
  3972. if res.Body != nil {
  3973. res.Body.Close()
  3974. }
  3975. return nil, &googleapi.Error{
  3976. Code: res.StatusCode,
  3977. Header: res.Header,
  3978. }
  3979. }
  3980. if err != nil {
  3981. return nil, err
  3982. }
  3983. defer googleapi.CloseBody(res)
  3984. if err := googleapi.CheckResponse(res); err != nil {
  3985. return nil, err
  3986. }
  3987. ret := &Deployment{
  3988. ServerResponse: googleapi.ServerResponse{
  3989. Header: res.Header,
  3990. HTTPStatusCode: res.StatusCode,
  3991. },
  3992. }
  3993. target := &ret
  3994. if err := gensupport.DecodeResponse(target, res); err != nil {
  3995. return nil, err
  3996. }
  3997. return ret, nil
  3998. // {
  3999. // "description": "Gets information about a specific deployment.",
  4000. // "httpMethod": "GET",
  4001. // "id": "deploymentmanager.deployments.get",
  4002. // "parameterOrder": [
  4003. // "project",
  4004. // "deployment"
  4005. // ],
  4006. // "parameters": {
  4007. // "deployment": {
  4008. // "description": "The name of the deployment for this request.",
  4009. // "location": "path",
  4010. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  4011. // "required": true,
  4012. // "type": "string"
  4013. // },
  4014. // "project": {
  4015. // "description": "The project ID for this request.",
  4016. // "location": "path",
  4017. // "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])?))",
  4018. // "required": true,
  4019. // "type": "string"
  4020. // }
  4021. // },
  4022. // "path": "{project}/global/deployments/{deployment}",
  4023. // "response": {
  4024. // "$ref": "Deployment"
  4025. // },
  4026. // "scopes": [
  4027. // "https://www.googleapis.com/auth/cloud-platform",
  4028. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4029. // "https://www.googleapis.com/auth/ndev.cloudman",
  4030. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  4031. // ]
  4032. // }
  4033. }
  4034. // method id "deploymentmanager.deployments.getIamPolicy":
  4035. type DeploymentsGetIamPolicyCall struct {
  4036. s *Service
  4037. project string
  4038. resource string
  4039. urlParams_ gensupport.URLParams
  4040. ifNoneMatch_ string
  4041. ctx_ context.Context
  4042. header_ http.Header
  4043. }
  4044. // GetIamPolicy: Gets the access control policy for a resource. May be
  4045. // empty if no such policy or resource exists.
  4046. func (r *DeploymentsService) GetIamPolicy(project string, resource string) *DeploymentsGetIamPolicyCall {
  4047. c := &DeploymentsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4048. c.project = project
  4049. c.resource = resource
  4050. return c
  4051. }
  4052. // Fields allows partial responses to be retrieved. See
  4053. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4054. // for more information.
  4055. func (c *DeploymentsGetIamPolicyCall) Fields(s ...googleapi.Field) *DeploymentsGetIamPolicyCall {
  4056. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4057. return c
  4058. }
  4059. // IfNoneMatch sets the optional parameter which makes the operation
  4060. // fail if the object's ETag matches the given value. This is useful for
  4061. // getting updates only after the object has changed since the last
  4062. // request. Use googleapi.IsNotModified to check whether the response
  4063. // error from Do is the result of In-None-Match.
  4064. func (c *DeploymentsGetIamPolicyCall) IfNoneMatch(entityTag string) *DeploymentsGetIamPolicyCall {
  4065. c.ifNoneMatch_ = entityTag
  4066. return c
  4067. }
  4068. // Context sets the context to be used in this call's Do method. Any
  4069. // pending HTTP request will be aborted if the provided context is
  4070. // canceled.
  4071. func (c *DeploymentsGetIamPolicyCall) Context(ctx context.Context) *DeploymentsGetIamPolicyCall {
  4072. c.ctx_ = ctx
  4073. return c
  4074. }
  4075. // Header returns an http.Header that can be modified by the caller to
  4076. // add HTTP headers to the request.
  4077. func (c *DeploymentsGetIamPolicyCall) Header() http.Header {
  4078. if c.header_ == nil {
  4079. c.header_ = make(http.Header)
  4080. }
  4081. return c.header_
  4082. }
  4083. func (c *DeploymentsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4084. reqHeaders := make(http.Header)
  4085. for k, v := range c.header_ {
  4086. reqHeaders[k] = v
  4087. }
  4088. reqHeaders.Set("User-Agent", c.s.userAgent())
  4089. if c.ifNoneMatch_ != "" {
  4090. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4091. }
  4092. var body io.Reader = nil
  4093. c.urlParams_.Set("alt", alt)
  4094. c.urlParams_.Set("prettyPrint", "false")
  4095. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{resource}/getIamPolicy")
  4096. urls += "?" + c.urlParams_.Encode()
  4097. req, err := http.NewRequest("GET", urls, body)
  4098. if err != nil {
  4099. return nil, err
  4100. }
  4101. req.Header = reqHeaders
  4102. googleapi.Expand(req.URL, map[string]string{
  4103. "project": c.project,
  4104. "resource": c.resource,
  4105. })
  4106. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4107. }
  4108. // Do executes the "deploymentmanager.deployments.getIamPolicy" call.
  4109. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  4110. // code is an error. Response headers are in either
  4111. // *Policy.ServerResponse.Header or (if a response was returned at all)
  4112. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4113. // check whether the returned error was because http.StatusNotModified
  4114. // was returned.
  4115. func (c *DeploymentsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4116. gensupport.SetOptions(c.urlParams_, opts...)
  4117. res, err := c.doRequest("json")
  4118. if res != nil && res.StatusCode == http.StatusNotModified {
  4119. if res.Body != nil {
  4120. res.Body.Close()
  4121. }
  4122. return nil, &googleapi.Error{
  4123. Code: res.StatusCode,
  4124. Header: res.Header,
  4125. }
  4126. }
  4127. if err != nil {
  4128. return nil, err
  4129. }
  4130. defer googleapi.CloseBody(res)
  4131. if err := googleapi.CheckResponse(res); err != nil {
  4132. return nil, err
  4133. }
  4134. ret := &Policy{
  4135. ServerResponse: googleapi.ServerResponse{
  4136. Header: res.Header,
  4137. HTTPStatusCode: res.StatusCode,
  4138. },
  4139. }
  4140. target := &ret
  4141. if err := gensupport.DecodeResponse(target, res); err != nil {
  4142. return nil, err
  4143. }
  4144. return ret, nil
  4145. // {
  4146. // "description": "Gets the access control policy for a resource. May be empty if no such policy or resource exists.",
  4147. // "httpMethod": "GET",
  4148. // "id": "deploymentmanager.deployments.getIamPolicy",
  4149. // "parameterOrder": [
  4150. // "project",
  4151. // "resource"
  4152. // ],
  4153. // "parameters": {
  4154. // "project": {
  4155. // "description": "Project ID for this request.",
  4156. // "location": "path",
  4157. // "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])?))",
  4158. // "required": true,
  4159. // "type": "string"
  4160. // },
  4161. // "resource": {
  4162. // "description": "Name or id of the resource for this request.",
  4163. // "location": "path",
  4164. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  4165. // "required": true,
  4166. // "type": "string"
  4167. // }
  4168. // },
  4169. // "path": "{project}/global/deployments/{resource}/getIamPolicy",
  4170. // "response": {
  4171. // "$ref": "Policy"
  4172. // },
  4173. // "scopes": [
  4174. // "https://www.googleapis.com/auth/cloud-platform",
  4175. // "https://www.googleapis.com/auth/ndev.cloudman"
  4176. // ]
  4177. // }
  4178. }
  4179. // method id "deploymentmanager.deployments.insert":
  4180. type DeploymentsInsertCall struct {
  4181. s *Service
  4182. project string
  4183. deployment *Deployment
  4184. urlParams_ gensupport.URLParams
  4185. ctx_ context.Context
  4186. header_ http.Header
  4187. }
  4188. // Insert: Creates a deployment and all of the resources described by
  4189. // the deployment manifest.
  4190. func (r *DeploymentsService) Insert(project string, deployment *Deployment) *DeploymentsInsertCall {
  4191. c := &DeploymentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4192. c.project = project
  4193. c.deployment = deployment
  4194. return c
  4195. }
  4196. // CreatePolicy sets the optional parameter "createPolicy": Sets the
  4197. // policy to use for creating new resources.
  4198. //
  4199. // Possible values:
  4200. // "ACQUIRE"
  4201. // "CREATE"
  4202. // "CREATE_OR_ACQUIRE" (default)
  4203. func (c *DeploymentsInsertCall) CreatePolicy(createPolicy string) *DeploymentsInsertCall {
  4204. c.urlParams_.Set("createPolicy", createPolicy)
  4205. return c
  4206. }
  4207. // Preview sets the optional parameter "preview": If set to true,
  4208. // creates a deployment and creates "shell" resources but does not
  4209. // actually instantiate these resources. This allows you to preview what
  4210. // your deployment looks like. After previewing a deployment, you can
  4211. // deploy your resources by making a request with the update() method or
  4212. // you can use the cancelPreview() method to cancel the preview
  4213. // altogether. Note that the deployment will still exist after you
  4214. // cancel the preview and you must separately delete this deployment if
  4215. // you want to remove it.
  4216. func (c *DeploymentsInsertCall) Preview(preview bool) *DeploymentsInsertCall {
  4217. c.urlParams_.Set("preview", fmt.Sprint(preview))
  4218. return c
  4219. }
  4220. // Fields allows partial responses to be retrieved. See
  4221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4222. // for more information.
  4223. func (c *DeploymentsInsertCall) Fields(s ...googleapi.Field) *DeploymentsInsertCall {
  4224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4225. return c
  4226. }
  4227. // Context sets the context to be used in this call's Do method. Any
  4228. // pending HTTP request will be aborted if the provided context is
  4229. // canceled.
  4230. func (c *DeploymentsInsertCall) Context(ctx context.Context) *DeploymentsInsertCall {
  4231. c.ctx_ = ctx
  4232. return c
  4233. }
  4234. // Header returns an http.Header that can be modified by the caller to
  4235. // add HTTP headers to the request.
  4236. func (c *DeploymentsInsertCall) Header() http.Header {
  4237. if c.header_ == nil {
  4238. c.header_ = make(http.Header)
  4239. }
  4240. return c.header_
  4241. }
  4242. func (c *DeploymentsInsertCall) doRequest(alt string) (*http.Response, error) {
  4243. reqHeaders := make(http.Header)
  4244. for k, v := range c.header_ {
  4245. reqHeaders[k] = v
  4246. }
  4247. reqHeaders.Set("User-Agent", c.s.userAgent())
  4248. var body io.Reader = nil
  4249. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment)
  4250. if err != nil {
  4251. return nil, err
  4252. }
  4253. reqHeaders.Set("Content-Type", "application/json")
  4254. c.urlParams_.Set("alt", alt)
  4255. c.urlParams_.Set("prettyPrint", "false")
  4256. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments")
  4257. urls += "?" + c.urlParams_.Encode()
  4258. req, err := http.NewRequest("POST", urls, body)
  4259. if err != nil {
  4260. return nil, err
  4261. }
  4262. req.Header = reqHeaders
  4263. googleapi.Expand(req.URL, map[string]string{
  4264. "project": c.project,
  4265. })
  4266. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4267. }
  4268. // Do executes the "deploymentmanager.deployments.insert" call.
  4269. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4270. // status code is an error. Response headers are in either
  4271. // *Operation.ServerResponse.Header or (if a response was returned at
  4272. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4273. // to check whether the returned error was because
  4274. // http.StatusNotModified was returned.
  4275. func (c *DeploymentsInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4276. gensupport.SetOptions(c.urlParams_, opts...)
  4277. res, err := c.doRequest("json")
  4278. if res != nil && res.StatusCode == http.StatusNotModified {
  4279. if res.Body != nil {
  4280. res.Body.Close()
  4281. }
  4282. return nil, &googleapi.Error{
  4283. Code: res.StatusCode,
  4284. Header: res.Header,
  4285. }
  4286. }
  4287. if err != nil {
  4288. return nil, err
  4289. }
  4290. defer googleapi.CloseBody(res)
  4291. if err := googleapi.CheckResponse(res); err != nil {
  4292. return nil, err
  4293. }
  4294. ret := &Operation{
  4295. ServerResponse: googleapi.ServerResponse{
  4296. Header: res.Header,
  4297. HTTPStatusCode: res.StatusCode,
  4298. },
  4299. }
  4300. target := &ret
  4301. if err := gensupport.DecodeResponse(target, res); err != nil {
  4302. return nil, err
  4303. }
  4304. return ret, nil
  4305. // {
  4306. // "description": "Creates a deployment and all of the resources described by the deployment manifest.",
  4307. // "httpMethod": "POST",
  4308. // "id": "deploymentmanager.deployments.insert",
  4309. // "parameterOrder": [
  4310. // "project"
  4311. // ],
  4312. // "parameters": {
  4313. // "createPolicy": {
  4314. // "default": "CREATE_OR_ACQUIRE",
  4315. // "description": "Sets the policy to use for creating new resources.",
  4316. // "enum": [
  4317. // "ACQUIRE",
  4318. // "CREATE",
  4319. // "CREATE_OR_ACQUIRE"
  4320. // ],
  4321. // "enumDescriptions": [
  4322. // "",
  4323. // "",
  4324. // ""
  4325. // ],
  4326. // "location": "query",
  4327. // "type": "string"
  4328. // },
  4329. // "preview": {
  4330. // "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.",
  4331. // "location": "query",
  4332. // "type": "boolean"
  4333. // },
  4334. // "project": {
  4335. // "description": "The project ID for this request.",
  4336. // "location": "path",
  4337. // "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])?))",
  4338. // "required": true,
  4339. // "type": "string"
  4340. // }
  4341. // },
  4342. // "path": "{project}/global/deployments",
  4343. // "request": {
  4344. // "$ref": "Deployment"
  4345. // },
  4346. // "response": {
  4347. // "$ref": "Operation"
  4348. // },
  4349. // "scopes": [
  4350. // "https://www.googleapis.com/auth/cloud-platform",
  4351. // "https://www.googleapis.com/auth/ndev.cloudman"
  4352. // ]
  4353. // }
  4354. }
  4355. // method id "deploymentmanager.deployments.list":
  4356. type DeploymentsListCall struct {
  4357. s *Service
  4358. project string
  4359. urlParams_ gensupport.URLParams
  4360. ifNoneMatch_ string
  4361. ctx_ context.Context
  4362. header_ http.Header
  4363. }
  4364. // List: Lists all deployments for a given project.
  4365. func (r *DeploymentsService) List(project string) *DeploymentsListCall {
  4366. c := &DeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4367. c.project = project
  4368. return c
  4369. }
  4370. // Filter sets the optional parameter "filter": A filter expression that
  4371. // filters resources listed in the response. The expression must specify
  4372. // the field name, a comparison operator, and the value that you want to
  4373. // use for filtering. The value must be a string, a number, or a
  4374. // boolean. The comparison operator must be either =, !=, >, or <.
  4375. //
  4376. // For example, if you are filtering Compute Engine instances, you can
  4377. // exclude instances named example-instance by specifying name !=
  4378. // example-instance.
  4379. //
  4380. // You can also filter nested fields. For example, you could specify
  4381. // scheduling.automaticRestart = false to include instances only if they
  4382. // are not scheduled for automatic restarts. You can use filtering on
  4383. // nested fields to filter based on resource labels.
  4384. //
  4385. // To filter on multiple expressions, provide each separate expression
  4386. // within parentheses. For example, (scheduling.automaticRestart = true)
  4387. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  4388. // AND expression. However, you can include AND and OR expressions
  4389. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  4390. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  4391. // true).
  4392. func (c *DeploymentsListCall) Filter(filter string) *DeploymentsListCall {
  4393. c.urlParams_.Set("filter", filter)
  4394. return c
  4395. }
  4396. // MaxResults sets the optional parameter "maxResults": The maximum
  4397. // number of results per page that should be returned. If the number of
  4398. // available results is larger than maxResults, Compute Engine returns a
  4399. // nextPageToken that can be used to get the next page of results in
  4400. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  4401. // (Default: 500)
  4402. func (c *DeploymentsListCall) MaxResults(maxResults int64) *DeploymentsListCall {
  4403. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4404. return c
  4405. }
  4406. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  4407. // a certain order. By default, results are returned in alphanumerical
  4408. // order based on the resource name.
  4409. //
  4410. // You can also sort results in descending order based on the creation
  4411. // timestamp using orderBy="creationTimestamp desc". This sorts results
  4412. // based on the creationTimestamp field in reverse chronological order
  4413. // (newest result first). Use this to sort resources like operations so
  4414. // that the newest operation is returned first.
  4415. //
  4416. // Currently, only sorting by name or creationTimestamp desc is
  4417. // supported.
  4418. func (c *DeploymentsListCall) OrderBy(orderBy string) *DeploymentsListCall {
  4419. c.urlParams_.Set("orderBy", orderBy)
  4420. return c
  4421. }
  4422. // PageToken sets the optional parameter "pageToken": Specifies a page
  4423. // token to use. Set pageToken to the nextPageToken returned by a
  4424. // previous list request to get the next page of results.
  4425. func (c *DeploymentsListCall) PageToken(pageToken string) *DeploymentsListCall {
  4426. c.urlParams_.Set("pageToken", pageToken)
  4427. return c
  4428. }
  4429. // Fields allows partial responses to be retrieved. See
  4430. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4431. // for more information.
  4432. func (c *DeploymentsListCall) Fields(s ...googleapi.Field) *DeploymentsListCall {
  4433. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4434. return c
  4435. }
  4436. // IfNoneMatch sets the optional parameter which makes the operation
  4437. // fail if the object's ETag matches the given value. This is useful for
  4438. // getting updates only after the object has changed since the last
  4439. // request. Use googleapi.IsNotModified to check whether the response
  4440. // error from Do is the result of In-None-Match.
  4441. func (c *DeploymentsListCall) IfNoneMatch(entityTag string) *DeploymentsListCall {
  4442. c.ifNoneMatch_ = entityTag
  4443. return c
  4444. }
  4445. // Context sets the context to be used in this call's Do method. Any
  4446. // pending HTTP request will be aborted if the provided context is
  4447. // canceled.
  4448. func (c *DeploymentsListCall) Context(ctx context.Context) *DeploymentsListCall {
  4449. c.ctx_ = ctx
  4450. return c
  4451. }
  4452. // Header returns an http.Header that can be modified by the caller to
  4453. // add HTTP headers to the request.
  4454. func (c *DeploymentsListCall) Header() http.Header {
  4455. if c.header_ == nil {
  4456. c.header_ = make(http.Header)
  4457. }
  4458. return c.header_
  4459. }
  4460. func (c *DeploymentsListCall) doRequest(alt string) (*http.Response, error) {
  4461. reqHeaders := make(http.Header)
  4462. for k, v := range c.header_ {
  4463. reqHeaders[k] = v
  4464. }
  4465. reqHeaders.Set("User-Agent", c.s.userAgent())
  4466. if c.ifNoneMatch_ != "" {
  4467. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4468. }
  4469. var body io.Reader = nil
  4470. c.urlParams_.Set("alt", alt)
  4471. c.urlParams_.Set("prettyPrint", "false")
  4472. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments")
  4473. urls += "?" + c.urlParams_.Encode()
  4474. req, err := http.NewRequest("GET", urls, body)
  4475. if err != nil {
  4476. return nil, err
  4477. }
  4478. req.Header = reqHeaders
  4479. googleapi.Expand(req.URL, map[string]string{
  4480. "project": c.project,
  4481. })
  4482. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4483. }
  4484. // Do executes the "deploymentmanager.deployments.list" call.
  4485. // Exactly one of *DeploymentsListResponse or error will be non-nil. Any
  4486. // non-2xx status code is an error. Response headers are in either
  4487. // *DeploymentsListResponse.ServerResponse.Header or (if a response was
  4488. // returned at all) in error.(*googleapi.Error).Header. Use
  4489. // googleapi.IsNotModified to check whether the returned error was
  4490. // because http.StatusNotModified was returned.
  4491. func (c *DeploymentsListCall) Do(opts ...googleapi.CallOption) (*DeploymentsListResponse, error) {
  4492. gensupport.SetOptions(c.urlParams_, opts...)
  4493. res, err := c.doRequest("json")
  4494. if res != nil && res.StatusCode == http.StatusNotModified {
  4495. if res.Body != nil {
  4496. res.Body.Close()
  4497. }
  4498. return nil, &googleapi.Error{
  4499. Code: res.StatusCode,
  4500. Header: res.Header,
  4501. }
  4502. }
  4503. if err != nil {
  4504. return nil, err
  4505. }
  4506. defer googleapi.CloseBody(res)
  4507. if err := googleapi.CheckResponse(res); err != nil {
  4508. return nil, err
  4509. }
  4510. ret := &DeploymentsListResponse{
  4511. ServerResponse: googleapi.ServerResponse{
  4512. Header: res.Header,
  4513. HTTPStatusCode: res.StatusCode,
  4514. },
  4515. }
  4516. target := &ret
  4517. if err := gensupport.DecodeResponse(target, res); err != nil {
  4518. return nil, err
  4519. }
  4520. return ret, nil
  4521. // {
  4522. // "description": "Lists all deployments for a given project.",
  4523. // "httpMethod": "GET",
  4524. // "id": "deploymentmanager.deployments.list",
  4525. // "parameterOrder": [
  4526. // "project"
  4527. // ],
  4528. // "parameters": {
  4529. // "filter": {
  4530. // "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).",
  4531. // "location": "query",
  4532. // "type": "string"
  4533. // },
  4534. // "maxResults": {
  4535. // "default": "500",
  4536. // "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)",
  4537. // "format": "uint32",
  4538. // "location": "query",
  4539. // "minimum": "0",
  4540. // "type": "integer"
  4541. // },
  4542. // "orderBy": {
  4543. // "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.",
  4544. // "location": "query",
  4545. // "type": "string"
  4546. // },
  4547. // "pageToken": {
  4548. // "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.",
  4549. // "location": "query",
  4550. // "type": "string"
  4551. // },
  4552. // "project": {
  4553. // "description": "The project ID for this request.",
  4554. // "location": "path",
  4555. // "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])?))",
  4556. // "required": true,
  4557. // "type": "string"
  4558. // }
  4559. // },
  4560. // "path": "{project}/global/deployments",
  4561. // "response": {
  4562. // "$ref": "DeploymentsListResponse"
  4563. // },
  4564. // "scopes": [
  4565. // "https://www.googleapis.com/auth/cloud-platform",
  4566. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  4567. // "https://www.googleapis.com/auth/ndev.cloudman",
  4568. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  4569. // ]
  4570. // }
  4571. }
  4572. // Pages invokes f for each page of results.
  4573. // A non-nil error returned from f will halt the iteration.
  4574. // The provided context supersedes any context provided to the Context method.
  4575. func (c *DeploymentsListCall) Pages(ctx context.Context, f func(*DeploymentsListResponse) error) error {
  4576. c.ctx_ = ctx
  4577. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4578. for {
  4579. x, err := c.Do()
  4580. if err != nil {
  4581. return err
  4582. }
  4583. if err := f(x); err != nil {
  4584. return err
  4585. }
  4586. if x.NextPageToken == "" {
  4587. return nil
  4588. }
  4589. c.PageToken(x.NextPageToken)
  4590. }
  4591. }
  4592. // method id "deploymentmanager.deployments.patch":
  4593. type DeploymentsPatchCall struct {
  4594. s *Service
  4595. project string
  4596. deployment string
  4597. deployment2 *Deployment
  4598. urlParams_ gensupport.URLParams
  4599. ctx_ context.Context
  4600. header_ http.Header
  4601. }
  4602. // Patch: Updates a deployment and all of the resources described by the
  4603. // deployment manifest. This method supports patch semantics.
  4604. func (r *DeploymentsService) Patch(project string, deployment string, deployment2 *Deployment) *DeploymentsPatchCall {
  4605. c := &DeploymentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4606. c.project = project
  4607. c.deployment = deployment
  4608. c.deployment2 = deployment2
  4609. return c
  4610. }
  4611. // CreatePolicy sets the optional parameter "createPolicy": Sets the
  4612. // policy to use for creating new resources.
  4613. //
  4614. // Possible values:
  4615. // "ACQUIRE"
  4616. // "CREATE"
  4617. // "CREATE_OR_ACQUIRE" (default)
  4618. func (c *DeploymentsPatchCall) CreatePolicy(createPolicy string) *DeploymentsPatchCall {
  4619. c.urlParams_.Set("createPolicy", createPolicy)
  4620. return c
  4621. }
  4622. // DeletePolicy sets the optional parameter "deletePolicy": Sets the
  4623. // policy to use for deleting resources.
  4624. //
  4625. // Possible values:
  4626. // "ABANDON"
  4627. // "DELETE" (default)
  4628. func (c *DeploymentsPatchCall) DeletePolicy(deletePolicy string) *DeploymentsPatchCall {
  4629. c.urlParams_.Set("deletePolicy", deletePolicy)
  4630. return c
  4631. }
  4632. // Preview sets the optional parameter "preview": If set to true,
  4633. // updates the deployment and creates and updates the "shell" resources
  4634. // but does not actually alter or instantiate these resources. This
  4635. // allows you to preview what your deployment will look like. You can
  4636. // use this intent to preview how an update would affect your
  4637. // deployment. You must provide a target.config with a configuration if
  4638. // this is set to true. After previewing a deployment, you can deploy
  4639. // your resources by making a request with the update() or you can
  4640. // cancelPreview() to remove the preview altogether. Note that the
  4641. // deployment will still exist after you cancel the preview and you must
  4642. // separately delete this deployment if you want to remove it.
  4643. func (c *DeploymentsPatchCall) Preview(preview bool) *DeploymentsPatchCall {
  4644. c.urlParams_.Set("preview", fmt.Sprint(preview))
  4645. return c
  4646. }
  4647. // Fields allows partial responses to be retrieved. See
  4648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4649. // for more information.
  4650. func (c *DeploymentsPatchCall) Fields(s ...googleapi.Field) *DeploymentsPatchCall {
  4651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4652. return c
  4653. }
  4654. // Context sets the context to be used in this call's Do method. Any
  4655. // pending HTTP request will be aborted if the provided context is
  4656. // canceled.
  4657. func (c *DeploymentsPatchCall) Context(ctx context.Context) *DeploymentsPatchCall {
  4658. c.ctx_ = ctx
  4659. return c
  4660. }
  4661. // Header returns an http.Header that can be modified by the caller to
  4662. // add HTTP headers to the request.
  4663. func (c *DeploymentsPatchCall) Header() http.Header {
  4664. if c.header_ == nil {
  4665. c.header_ = make(http.Header)
  4666. }
  4667. return c.header_
  4668. }
  4669. func (c *DeploymentsPatchCall) doRequest(alt string) (*http.Response, error) {
  4670. reqHeaders := make(http.Header)
  4671. for k, v := range c.header_ {
  4672. reqHeaders[k] = v
  4673. }
  4674. reqHeaders.Set("User-Agent", c.s.userAgent())
  4675. var body io.Reader = nil
  4676. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2)
  4677. if err != nil {
  4678. return nil, err
  4679. }
  4680. reqHeaders.Set("Content-Type", "application/json")
  4681. c.urlParams_.Set("alt", alt)
  4682. c.urlParams_.Set("prettyPrint", "false")
  4683. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}")
  4684. urls += "?" + c.urlParams_.Encode()
  4685. req, err := http.NewRequest("PATCH", urls, body)
  4686. if err != nil {
  4687. return nil, err
  4688. }
  4689. req.Header = reqHeaders
  4690. googleapi.Expand(req.URL, map[string]string{
  4691. "project": c.project,
  4692. "deployment": c.deployment,
  4693. })
  4694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4695. }
  4696. // Do executes the "deploymentmanager.deployments.patch" call.
  4697. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4698. // status code is an error. Response headers are in either
  4699. // *Operation.ServerResponse.Header or (if a response was returned at
  4700. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4701. // to check whether the returned error was because
  4702. // http.StatusNotModified was returned.
  4703. func (c *DeploymentsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4704. gensupport.SetOptions(c.urlParams_, opts...)
  4705. res, err := c.doRequest("json")
  4706. if res != nil && res.StatusCode == http.StatusNotModified {
  4707. if res.Body != nil {
  4708. res.Body.Close()
  4709. }
  4710. return nil, &googleapi.Error{
  4711. Code: res.StatusCode,
  4712. Header: res.Header,
  4713. }
  4714. }
  4715. if err != nil {
  4716. return nil, err
  4717. }
  4718. defer googleapi.CloseBody(res)
  4719. if err := googleapi.CheckResponse(res); err != nil {
  4720. return nil, err
  4721. }
  4722. ret := &Operation{
  4723. ServerResponse: googleapi.ServerResponse{
  4724. Header: res.Header,
  4725. HTTPStatusCode: res.StatusCode,
  4726. },
  4727. }
  4728. target := &ret
  4729. if err := gensupport.DecodeResponse(target, res); err != nil {
  4730. return nil, err
  4731. }
  4732. return ret, nil
  4733. // {
  4734. // "description": "Updates a deployment and all of the resources described by the deployment manifest. This method supports patch semantics.",
  4735. // "httpMethod": "PATCH",
  4736. // "id": "deploymentmanager.deployments.patch",
  4737. // "parameterOrder": [
  4738. // "project",
  4739. // "deployment"
  4740. // ],
  4741. // "parameters": {
  4742. // "createPolicy": {
  4743. // "default": "CREATE_OR_ACQUIRE",
  4744. // "description": "Sets the policy to use for creating new resources.",
  4745. // "enum": [
  4746. // "ACQUIRE",
  4747. // "CREATE",
  4748. // "CREATE_OR_ACQUIRE"
  4749. // ],
  4750. // "enumDescriptions": [
  4751. // "",
  4752. // "",
  4753. // ""
  4754. // ],
  4755. // "location": "query",
  4756. // "type": "string"
  4757. // },
  4758. // "deletePolicy": {
  4759. // "default": "DELETE",
  4760. // "description": "Sets the policy to use for deleting resources.",
  4761. // "enum": [
  4762. // "ABANDON",
  4763. // "DELETE"
  4764. // ],
  4765. // "enumDescriptions": [
  4766. // "",
  4767. // ""
  4768. // ],
  4769. // "location": "query",
  4770. // "type": "string"
  4771. // },
  4772. // "deployment": {
  4773. // "description": "The name of the deployment for this request.",
  4774. // "location": "path",
  4775. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  4776. // "required": true,
  4777. // "type": "string"
  4778. // },
  4779. // "preview": {
  4780. // "default": "false",
  4781. // "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.",
  4782. // "location": "query",
  4783. // "type": "boolean"
  4784. // },
  4785. // "project": {
  4786. // "description": "The project ID for this request.",
  4787. // "location": "path",
  4788. // "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])?))",
  4789. // "required": true,
  4790. // "type": "string"
  4791. // }
  4792. // },
  4793. // "path": "{project}/global/deployments/{deployment}",
  4794. // "request": {
  4795. // "$ref": "Deployment"
  4796. // },
  4797. // "response": {
  4798. // "$ref": "Operation"
  4799. // },
  4800. // "scopes": [
  4801. // "https://www.googleapis.com/auth/cloud-platform",
  4802. // "https://www.googleapis.com/auth/ndev.cloudman"
  4803. // ]
  4804. // }
  4805. }
  4806. // method id "deploymentmanager.deployments.setIamPolicy":
  4807. type DeploymentsSetIamPolicyCall struct {
  4808. s *Service
  4809. project string
  4810. resource string
  4811. globalsetpolicyrequest *GlobalSetPolicyRequest
  4812. urlParams_ gensupport.URLParams
  4813. ctx_ context.Context
  4814. header_ http.Header
  4815. }
  4816. // SetIamPolicy: Sets the access control policy on the specified
  4817. // resource. Replaces any existing policy.
  4818. func (r *DeploymentsService) SetIamPolicy(project string, resource string, globalsetpolicyrequest *GlobalSetPolicyRequest) *DeploymentsSetIamPolicyCall {
  4819. c := &DeploymentsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4820. c.project = project
  4821. c.resource = resource
  4822. c.globalsetpolicyrequest = globalsetpolicyrequest
  4823. return c
  4824. }
  4825. // Fields allows partial responses to be retrieved. See
  4826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4827. // for more information.
  4828. func (c *DeploymentsSetIamPolicyCall) Fields(s ...googleapi.Field) *DeploymentsSetIamPolicyCall {
  4829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4830. return c
  4831. }
  4832. // Context sets the context to be used in this call's Do method. Any
  4833. // pending HTTP request will be aborted if the provided context is
  4834. // canceled.
  4835. func (c *DeploymentsSetIamPolicyCall) Context(ctx context.Context) *DeploymentsSetIamPolicyCall {
  4836. c.ctx_ = ctx
  4837. return c
  4838. }
  4839. // Header returns an http.Header that can be modified by the caller to
  4840. // add HTTP headers to the request.
  4841. func (c *DeploymentsSetIamPolicyCall) Header() http.Header {
  4842. if c.header_ == nil {
  4843. c.header_ = make(http.Header)
  4844. }
  4845. return c.header_
  4846. }
  4847. func (c *DeploymentsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4848. reqHeaders := make(http.Header)
  4849. for k, v := range c.header_ {
  4850. reqHeaders[k] = v
  4851. }
  4852. reqHeaders.Set("User-Agent", c.s.userAgent())
  4853. var body io.Reader = nil
  4854. body, err := googleapi.WithoutDataWrapper.JSONReader(c.globalsetpolicyrequest)
  4855. if err != nil {
  4856. return nil, err
  4857. }
  4858. reqHeaders.Set("Content-Type", "application/json")
  4859. c.urlParams_.Set("alt", alt)
  4860. c.urlParams_.Set("prettyPrint", "false")
  4861. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{resource}/setIamPolicy")
  4862. urls += "?" + c.urlParams_.Encode()
  4863. req, err := http.NewRequest("POST", urls, body)
  4864. if err != nil {
  4865. return nil, err
  4866. }
  4867. req.Header = reqHeaders
  4868. googleapi.Expand(req.URL, map[string]string{
  4869. "project": c.project,
  4870. "resource": c.resource,
  4871. })
  4872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4873. }
  4874. // Do executes the "deploymentmanager.deployments.setIamPolicy" call.
  4875. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  4876. // code is an error. Response headers are in either
  4877. // *Policy.ServerResponse.Header or (if a response was returned at all)
  4878. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4879. // check whether the returned error was because http.StatusNotModified
  4880. // was returned.
  4881. func (c *DeploymentsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4882. gensupport.SetOptions(c.urlParams_, opts...)
  4883. res, err := c.doRequest("json")
  4884. if res != nil && res.StatusCode == http.StatusNotModified {
  4885. if res.Body != nil {
  4886. res.Body.Close()
  4887. }
  4888. return nil, &googleapi.Error{
  4889. Code: res.StatusCode,
  4890. Header: res.Header,
  4891. }
  4892. }
  4893. if err != nil {
  4894. return nil, err
  4895. }
  4896. defer googleapi.CloseBody(res)
  4897. if err := googleapi.CheckResponse(res); err != nil {
  4898. return nil, err
  4899. }
  4900. ret := &Policy{
  4901. ServerResponse: googleapi.ServerResponse{
  4902. Header: res.Header,
  4903. HTTPStatusCode: res.StatusCode,
  4904. },
  4905. }
  4906. target := &ret
  4907. if err := gensupport.DecodeResponse(target, res); err != nil {
  4908. return nil, err
  4909. }
  4910. return ret, nil
  4911. // {
  4912. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  4913. // "httpMethod": "POST",
  4914. // "id": "deploymentmanager.deployments.setIamPolicy",
  4915. // "parameterOrder": [
  4916. // "project",
  4917. // "resource"
  4918. // ],
  4919. // "parameters": {
  4920. // "project": {
  4921. // "description": "Project ID for this request.",
  4922. // "location": "path",
  4923. // "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])?))",
  4924. // "required": true,
  4925. // "type": "string"
  4926. // },
  4927. // "resource": {
  4928. // "description": "Name or id of the resource for this request.",
  4929. // "location": "path",
  4930. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  4931. // "required": true,
  4932. // "type": "string"
  4933. // }
  4934. // },
  4935. // "path": "{project}/global/deployments/{resource}/setIamPolicy",
  4936. // "request": {
  4937. // "$ref": "GlobalSetPolicyRequest"
  4938. // },
  4939. // "response": {
  4940. // "$ref": "Policy"
  4941. // },
  4942. // "scopes": [
  4943. // "https://www.googleapis.com/auth/cloud-platform",
  4944. // "https://www.googleapis.com/auth/ndev.cloudman"
  4945. // ]
  4946. // }
  4947. }
  4948. // method id "deploymentmanager.deployments.stop":
  4949. type DeploymentsStopCall struct {
  4950. s *Service
  4951. project string
  4952. deployment string
  4953. deploymentsstoprequest *DeploymentsStopRequest
  4954. urlParams_ gensupport.URLParams
  4955. ctx_ context.Context
  4956. header_ http.Header
  4957. }
  4958. // Stop: Stops an ongoing operation. This does not roll back any work
  4959. // that has already been completed, but prevents any new work from being
  4960. // started.
  4961. func (r *DeploymentsService) Stop(project string, deployment string, deploymentsstoprequest *DeploymentsStopRequest) *DeploymentsStopCall {
  4962. c := &DeploymentsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4963. c.project = project
  4964. c.deployment = deployment
  4965. c.deploymentsstoprequest = deploymentsstoprequest
  4966. return c
  4967. }
  4968. // Fields allows partial responses to be retrieved. See
  4969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4970. // for more information.
  4971. func (c *DeploymentsStopCall) Fields(s ...googleapi.Field) *DeploymentsStopCall {
  4972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4973. return c
  4974. }
  4975. // Context sets the context to be used in this call's Do method. Any
  4976. // pending HTTP request will be aborted if the provided context is
  4977. // canceled.
  4978. func (c *DeploymentsStopCall) Context(ctx context.Context) *DeploymentsStopCall {
  4979. c.ctx_ = ctx
  4980. return c
  4981. }
  4982. // Header returns an http.Header that can be modified by the caller to
  4983. // add HTTP headers to the request.
  4984. func (c *DeploymentsStopCall) Header() http.Header {
  4985. if c.header_ == nil {
  4986. c.header_ = make(http.Header)
  4987. }
  4988. return c.header_
  4989. }
  4990. func (c *DeploymentsStopCall) doRequest(alt string) (*http.Response, error) {
  4991. reqHeaders := make(http.Header)
  4992. for k, v := range c.header_ {
  4993. reqHeaders[k] = v
  4994. }
  4995. reqHeaders.Set("User-Agent", c.s.userAgent())
  4996. var body io.Reader = nil
  4997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentsstoprequest)
  4998. if err != nil {
  4999. return nil, err
  5000. }
  5001. reqHeaders.Set("Content-Type", "application/json")
  5002. c.urlParams_.Set("alt", alt)
  5003. c.urlParams_.Set("prettyPrint", "false")
  5004. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/stop")
  5005. urls += "?" + c.urlParams_.Encode()
  5006. req, err := http.NewRequest("POST", urls, body)
  5007. if err != nil {
  5008. return nil, err
  5009. }
  5010. req.Header = reqHeaders
  5011. googleapi.Expand(req.URL, map[string]string{
  5012. "project": c.project,
  5013. "deployment": c.deployment,
  5014. })
  5015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5016. }
  5017. // Do executes the "deploymentmanager.deployments.stop" call.
  5018. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5019. // status code is an error. Response headers are in either
  5020. // *Operation.ServerResponse.Header or (if a response was returned at
  5021. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5022. // to check whether the returned error was because
  5023. // http.StatusNotModified was returned.
  5024. func (c *DeploymentsStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5025. gensupport.SetOptions(c.urlParams_, opts...)
  5026. res, err := c.doRequest("json")
  5027. if res != nil && res.StatusCode == http.StatusNotModified {
  5028. if res.Body != nil {
  5029. res.Body.Close()
  5030. }
  5031. return nil, &googleapi.Error{
  5032. Code: res.StatusCode,
  5033. Header: res.Header,
  5034. }
  5035. }
  5036. if err != nil {
  5037. return nil, err
  5038. }
  5039. defer googleapi.CloseBody(res)
  5040. if err := googleapi.CheckResponse(res); err != nil {
  5041. return nil, err
  5042. }
  5043. ret := &Operation{
  5044. ServerResponse: googleapi.ServerResponse{
  5045. Header: res.Header,
  5046. HTTPStatusCode: res.StatusCode,
  5047. },
  5048. }
  5049. target := &ret
  5050. if err := gensupport.DecodeResponse(target, res); err != nil {
  5051. return nil, err
  5052. }
  5053. return ret, nil
  5054. // {
  5055. // "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.",
  5056. // "httpMethod": "POST",
  5057. // "id": "deploymentmanager.deployments.stop",
  5058. // "parameterOrder": [
  5059. // "project",
  5060. // "deployment"
  5061. // ],
  5062. // "parameters": {
  5063. // "deployment": {
  5064. // "description": "The name of the deployment for this request.",
  5065. // "location": "path",
  5066. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  5067. // "required": true,
  5068. // "type": "string"
  5069. // },
  5070. // "project": {
  5071. // "description": "The project ID for this request.",
  5072. // "location": "path",
  5073. // "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])?))",
  5074. // "required": true,
  5075. // "type": "string"
  5076. // }
  5077. // },
  5078. // "path": "{project}/global/deployments/{deployment}/stop",
  5079. // "request": {
  5080. // "$ref": "DeploymentsStopRequest"
  5081. // },
  5082. // "response": {
  5083. // "$ref": "Operation"
  5084. // },
  5085. // "scopes": [
  5086. // "https://www.googleapis.com/auth/cloud-platform",
  5087. // "https://www.googleapis.com/auth/ndev.cloudman"
  5088. // ]
  5089. // }
  5090. }
  5091. // method id "deploymentmanager.deployments.testIamPermissions":
  5092. type DeploymentsTestIamPermissionsCall struct {
  5093. s *Service
  5094. project string
  5095. resource string
  5096. testpermissionsrequest *TestPermissionsRequest
  5097. urlParams_ gensupport.URLParams
  5098. ctx_ context.Context
  5099. header_ http.Header
  5100. }
  5101. // TestIamPermissions: Returns permissions that a caller has on the
  5102. // specified resource.
  5103. func (r *DeploymentsService) TestIamPermissions(project string, resource string, testpermissionsrequest *TestPermissionsRequest) *DeploymentsTestIamPermissionsCall {
  5104. c := &DeploymentsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5105. c.project = project
  5106. c.resource = resource
  5107. c.testpermissionsrequest = testpermissionsrequest
  5108. return c
  5109. }
  5110. // Fields allows partial responses to be retrieved. See
  5111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5112. // for more information.
  5113. func (c *DeploymentsTestIamPermissionsCall) Fields(s ...googleapi.Field) *DeploymentsTestIamPermissionsCall {
  5114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5115. return c
  5116. }
  5117. // Context sets the context to be used in this call's Do method. Any
  5118. // pending HTTP request will be aborted if the provided context is
  5119. // canceled.
  5120. func (c *DeploymentsTestIamPermissionsCall) Context(ctx context.Context) *DeploymentsTestIamPermissionsCall {
  5121. c.ctx_ = ctx
  5122. return c
  5123. }
  5124. // Header returns an http.Header that can be modified by the caller to
  5125. // add HTTP headers to the request.
  5126. func (c *DeploymentsTestIamPermissionsCall) Header() http.Header {
  5127. if c.header_ == nil {
  5128. c.header_ = make(http.Header)
  5129. }
  5130. return c.header_
  5131. }
  5132. func (c *DeploymentsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  5133. reqHeaders := make(http.Header)
  5134. for k, v := range c.header_ {
  5135. reqHeaders[k] = v
  5136. }
  5137. reqHeaders.Set("User-Agent", c.s.userAgent())
  5138. var body io.Reader = nil
  5139. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testpermissionsrequest)
  5140. if err != nil {
  5141. return nil, err
  5142. }
  5143. reqHeaders.Set("Content-Type", "application/json")
  5144. c.urlParams_.Set("alt", alt)
  5145. c.urlParams_.Set("prettyPrint", "false")
  5146. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{resource}/testIamPermissions")
  5147. urls += "?" + c.urlParams_.Encode()
  5148. req, err := http.NewRequest("POST", urls, body)
  5149. if err != nil {
  5150. return nil, err
  5151. }
  5152. req.Header = reqHeaders
  5153. googleapi.Expand(req.URL, map[string]string{
  5154. "project": c.project,
  5155. "resource": c.resource,
  5156. })
  5157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5158. }
  5159. // Do executes the "deploymentmanager.deployments.testIamPermissions" call.
  5160. // Exactly one of *TestPermissionsResponse or error will be non-nil. Any
  5161. // non-2xx status code is an error. Response headers are in either
  5162. // *TestPermissionsResponse.ServerResponse.Header or (if a response was
  5163. // returned at all) in error.(*googleapi.Error).Header. Use
  5164. // googleapi.IsNotModified to check whether the returned error was
  5165. // because http.StatusNotModified was returned.
  5166. func (c *DeploymentsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestPermissionsResponse, error) {
  5167. gensupport.SetOptions(c.urlParams_, opts...)
  5168. res, err := c.doRequest("json")
  5169. if res != nil && res.StatusCode == http.StatusNotModified {
  5170. if res.Body != nil {
  5171. res.Body.Close()
  5172. }
  5173. return nil, &googleapi.Error{
  5174. Code: res.StatusCode,
  5175. Header: res.Header,
  5176. }
  5177. }
  5178. if err != nil {
  5179. return nil, err
  5180. }
  5181. defer googleapi.CloseBody(res)
  5182. if err := googleapi.CheckResponse(res); err != nil {
  5183. return nil, err
  5184. }
  5185. ret := &TestPermissionsResponse{
  5186. ServerResponse: googleapi.ServerResponse{
  5187. Header: res.Header,
  5188. HTTPStatusCode: res.StatusCode,
  5189. },
  5190. }
  5191. target := &ret
  5192. if err := gensupport.DecodeResponse(target, res); err != nil {
  5193. return nil, err
  5194. }
  5195. return ret, nil
  5196. // {
  5197. // "description": "Returns permissions that a caller has on the specified resource.",
  5198. // "httpMethod": "POST",
  5199. // "id": "deploymentmanager.deployments.testIamPermissions",
  5200. // "parameterOrder": [
  5201. // "project",
  5202. // "resource"
  5203. // ],
  5204. // "parameters": {
  5205. // "project": {
  5206. // "description": "Project ID for this request.",
  5207. // "location": "path",
  5208. // "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])?))",
  5209. // "required": true,
  5210. // "type": "string"
  5211. // },
  5212. // "resource": {
  5213. // "description": "Name or id of the resource for this request.",
  5214. // "location": "path",
  5215. // "pattern": "[a-z](?:[-a-z0-9_]{0,61}[a-z0-9])?|[1-9][0-9]{0,19}",
  5216. // "required": true,
  5217. // "type": "string"
  5218. // }
  5219. // },
  5220. // "path": "{project}/global/deployments/{resource}/testIamPermissions",
  5221. // "request": {
  5222. // "$ref": "TestPermissionsRequest"
  5223. // },
  5224. // "response": {
  5225. // "$ref": "TestPermissionsResponse"
  5226. // },
  5227. // "scopes": [
  5228. // "https://www.googleapis.com/auth/cloud-platform",
  5229. // "https://www.googleapis.com/auth/ndev.cloudman"
  5230. // ]
  5231. // }
  5232. }
  5233. // method id "deploymentmanager.deployments.update":
  5234. type DeploymentsUpdateCall struct {
  5235. s *Service
  5236. project string
  5237. deployment string
  5238. deployment2 *Deployment
  5239. urlParams_ gensupport.URLParams
  5240. ctx_ context.Context
  5241. header_ http.Header
  5242. }
  5243. // Update: Updates a deployment and all of the resources described by
  5244. // the deployment manifest.
  5245. func (r *DeploymentsService) Update(project string, deployment string, deployment2 *Deployment) *DeploymentsUpdateCall {
  5246. c := &DeploymentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5247. c.project = project
  5248. c.deployment = deployment
  5249. c.deployment2 = deployment2
  5250. return c
  5251. }
  5252. // CreatePolicy sets the optional parameter "createPolicy": Sets the
  5253. // policy to use for creating new resources.
  5254. //
  5255. // Possible values:
  5256. // "ACQUIRE"
  5257. // "CREATE"
  5258. // "CREATE_OR_ACQUIRE" (default)
  5259. func (c *DeploymentsUpdateCall) CreatePolicy(createPolicy string) *DeploymentsUpdateCall {
  5260. c.urlParams_.Set("createPolicy", createPolicy)
  5261. return c
  5262. }
  5263. // DeletePolicy sets the optional parameter "deletePolicy": Sets the
  5264. // policy to use for deleting resources.
  5265. //
  5266. // Possible values:
  5267. // "ABANDON"
  5268. // "DELETE" (default)
  5269. func (c *DeploymentsUpdateCall) DeletePolicy(deletePolicy string) *DeploymentsUpdateCall {
  5270. c.urlParams_.Set("deletePolicy", deletePolicy)
  5271. return c
  5272. }
  5273. // Preview sets the optional parameter "preview": If set to true,
  5274. // updates the deployment and creates and updates the "shell" resources
  5275. // but does not actually alter or instantiate these resources. This
  5276. // allows you to preview what your deployment will look like. You can
  5277. // use this intent to preview how an update would affect your
  5278. // deployment. You must provide a target.config with a configuration if
  5279. // this is set to true. After previewing a deployment, you can deploy
  5280. // your resources by making a request with the update() or you can
  5281. // cancelPreview() to remove the preview altogether. Note that the
  5282. // deployment will still exist after you cancel the preview and you must
  5283. // separately delete this deployment if you want to remove it.
  5284. func (c *DeploymentsUpdateCall) Preview(preview bool) *DeploymentsUpdateCall {
  5285. c.urlParams_.Set("preview", fmt.Sprint(preview))
  5286. return c
  5287. }
  5288. // Fields allows partial responses to be retrieved. See
  5289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5290. // for more information.
  5291. func (c *DeploymentsUpdateCall) Fields(s ...googleapi.Field) *DeploymentsUpdateCall {
  5292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5293. return c
  5294. }
  5295. // Context sets the context to be used in this call's Do method. Any
  5296. // pending HTTP request will be aborted if the provided context is
  5297. // canceled.
  5298. func (c *DeploymentsUpdateCall) Context(ctx context.Context) *DeploymentsUpdateCall {
  5299. c.ctx_ = ctx
  5300. return c
  5301. }
  5302. // Header returns an http.Header that can be modified by the caller to
  5303. // add HTTP headers to the request.
  5304. func (c *DeploymentsUpdateCall) Header() http.Header {
  5305. if c.header_ == nil {
  5306. c.header_ = make(http.Header)
  5307. }
  5308. return c.header_
  5309. }
  5310. func (c *DeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  5311. reqHeaders := make(http.Header)
  5312. for k, v := range c.header_ {
  5313. reqHeaders[k] = v
  5314. }
  5315. reqHeaders.Set("User-Agent", c.s.userAgent())
  5316. var body io.Reader = nil
  5317. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deployment2)
  5318. if err != nil {
  5319. return nil, err
  5320. }
  5321. reqHeaders.Set("Content-Type", "application/json")
  5322. c.urlParams_.Set("alt", alt)
  5323. c.urlParams_.Set("prettyPrint", "false")
  5324. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}")
  5325. urls += "?" + c.urlParams_.Encode()
  5326. req, err := http.NewRequest("PUT", urls, body)
  5327. if err != nil {
  5328. return nil, err
  5329. }
  5330. req.Header = reqHeaders
  5331. googleapi.Expand(req.URL, map[string]string{
  5332. "project": c.project,
  5333. "deployment": c.deployment,
  5334. })
  5335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5336. }
  5337. // Do executes the "deploymentmanager.deployments.update" call.
  5338. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5339. // status code is an error. Response headers are in either
  5340. // *Operation.ServerResponse.Header or (if a response was returned at
  5341. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5342. // to check whether the returned error was because
  5343. // http.StatusNotModified was returned.
  5344. func (c *DeploymentsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5345. gensupport.SetOptions(c.urlParams_, opts...)
  5346. res, err := c.doRequest("json")
  5347. if res != nil && res.StatusCode == http.StatusNotModified {
  5348. if res.Body != nil {
  5349. res.Body.Close()
  5350. }
  5351. return nil, &googleapi.Error{
  5352. Code: res.StatusCode,
  5353. Header: res.Header,
  5354. }
  5355. }
  5356. if err != nil {
  5357. return nil, err
  5358. }
  5359. defer googleapi.CloseBody(res)
  5360. if err := googleapi.CheckResponse(res); err != nil {
  5361. return nil, err
  5362. }
  5363. ret := &Operation{
  5364. ServerResponse: googleapi.ServerResponse{
  5365. Header: res.Header,
  5366. HTTPStatusCode: res.StatusCode,
  5367. },
  5368. }
  5369. target := &ret
  5370. if err := gensupport.DecodeResponse(target, res); err != nil {
  5371. return nil, err
  5372. }
  5373. return ret, nil
  5374. // {
  5375. // "description": "Updates a deployment and all of the resources described by the deployment manifest.",
  5376. // "httpMethod": "PUT",
  5377. // "id": "deploymentmanager.deployments.update",
  5378. // "parameterOrder": [
  5379. // "project",
  5380. // "deployment"
  5381. // ],
  5382. // "parameters": {
  5383. // "createPolicy": {
  5384. // "default": "CREATE_OR_ACQUIRE",
  5385. // "description": "Sets the policy to use for creating new resources.",
  5386. // "enum": [
  5387. // "ACQUIRE",
  5388. // "CREATE",
  5389. // "CREATE_OR_ACQUIRE"
  5390. // ],
  5391. // "enumDescriptions": [
  5392. // "",
  5393. // "",
  5394. // ""
  5395. // ],
  5396. // "location": "query",
  5397. // "type": "string"
  5398. // },
  5399. // "deletePolicy": {
  5400. // "default": "DELETE",
  5401. // "description": "Sets the policy to use for deleting resources.",
  5402. // "enum": [
  5403. // "ABANDON",
  5404. // "DELETE"
  5405. // ],
  5406. // "enumDescriptions": [
  5407. // "",
  5408. // ""
  5409. // ],
  5410. // "location": "query",
  5411. // "type": "string"
  5412. // },
  5413. // "deployment": {
  5414. // "description": "The name of the deployment for this request.",
  5415. // "location": "path",
  5416. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  5417. // "required": true,
  5418. // "type": "string"
  5419. // },
  5420. // "preview": {
  5421. // "default": "false",
  5422. // "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.",
  5423. // "location": "query",
  5424. // "type": "boolean"
  5425. // },
  5426. // "project": {
  5427. // "description": "The project ID for this request.",
  5428. // "location": "path",
  5429. // "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])?))",
  5430. // "required": true,
  5431. // "type": "string"
  5432. // }
  5433. // },
  5434. // "path": "{project}/global/deployments/{deployment}",
  5435. // "request": {
  5436. // "$ref": "Deployment"
  5437. // },
  5438. // "response": {
  5439. // "$ref": "Operation"
  5440. // },
  5441. // "scopes": [
  5442. // "https://www.googleapis.com/auth/cloud-platform",
  5443. // "https://www.googleapis.com/auth/ndev.cloudman"
  5444. // ]
  5445. // }
  5446. }
  5447. // method id "deploymentmanager.manifests.get":
  5448. type ManifestsGetCall struct {
  5449. s *Service
  5450. project string
  5451. deployment string
  5452. manifest string
  5453. urlParams_ gensupport.URLParams
  5454. ifNoneMatch_ string
  5455. ctx_ context.Context
  5456. header_ http.Header
  5457. }
  5458. // Get: Gets information about a specific manifest.
  5459. func (r *ManifestsService) Get(project string, deployment string, manifest string) *ManifestsGetCall {
  5460. c := &ManifestsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5461. c.project = project
  5462. c.deployment = deployment
  5463. c.manifest = manifest
  5464. return c
  5465. }
  5466. // Fields allows partial responses to be retrieved. See
  5467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5468. // for more information.
  5469. func (c *ManifestsGetCall) Fields(s ...googleapi.Field) *ManifestsGetCall {
  5470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5471. return c
  5472. }
  5473. // IfNoneMatch sets the optional parameter which makes the operation
  5474. // fail if the object's ETag matches the given value. This is useful for
  5475. // getting updates only after the object has changed since the last
  5476. // request. Use googleapi.IsNotModified to check whether the response
  5477. // error from Do is the result of In-None-Match.
  5478. func (c *ManifestsGetCall) IfNoneMatch(entityTag string) *ManifestsGetCall {
  5479. c.ifNoneMatch_ = entityTag
  5480. return c
  5481. }
  5482. // Context sets the context to be used in this call's Do method. Any
  5483. // pending HTTP request will be aborted if the provided context is
  5484. // canceled.
  5485. func (c *ManifestsGetCall) Context(ctx context.Context) *ManifestsGetCall {
  5486. c.ctx_ = ctx
  5487. return c
  5488. }
  5489. // Header returns an http.Header that can be modified by the caller to
  5490. // add HTTP headers to the request.
  5491. func (c *ManifestsGetCall) Header() http.Header {
  5492. if c.header_ == nil {
  5493. c.header_ = make(http.Header)
  5494. }
  5495. return c.header_
  5496. }
  5497. func (c *ManifestsGetCall) doRequest(alt string) (*http.Response, error) {
  5498. reqHeaders := make(http.Header)
  5499. for k, v := range c.header_ {
  5500. reqHeaders[k] = v
  5501. }
  5502. reqHeaders.Set("User-Agent", c.s.userAgent())
  5503. if c.ifNoneMatch_ != "" {
  5504. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5505. }
  5506. var body io.Reader = nil
  5507. c.urlParams_.Set("alt", alt)
  5508. c.urlParams_.Set("prettyPrint", "false")
  5509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests/{manifest}")
  5510. urls += "?" + c.urlParams_.Encode()
  5511. req, err := http.NewRequest("GET", urls, body)
  5512. if err != nil {
  5513. return nil, err
  5514. }
  5515. req.Header = reqHeaders
  5516. googleapi.Expand(req.URL, map[string]string{
  5517. "project": c.project,
  5518. "deployment": c.deployment,
  5519. "manifest": c.manifest,
  5520. })
  5521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5522. }
  5523. // Do executes the "deploymentmanager.manifests.get" call.
  5524. // Exactly one of *Manifest or error will be non-nil. Any non-2xx status
  5525. // code is an error. Response headers are in either
  5526. // *Manifest.ServerResponse.Header or (if a response was returned at
  5527. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5528. // to check whether the returned error was because
  5529. // http.StatusNotModified was returned.
  5530. func (c *ManifestsGetCall) Do(opts ...googleapi.CallOption) (*Manifest, error) {
  5531. gensupport.SetOptions(c.urlParams_, opts...)
  5532. res, err := c.doRequest("json")
  5533. if res != nil && res.StatusCode == http.StatusNotModified {
  5534. if res.Body != nil {
  5535. res.Body.Close()
  5536. }
  5537. return nil, &googleapi.Error{
  5538. Code: res.StatusCode,
  5539. Header: res.Header,
  5540. }
  5541. }
  5542. if err != nil {
  5543. return nil, err
  5544. }
  5545. defer googleapi.CloseBody(res)
  5546. if err := googleapi.CheckResponse(res); err != nil {
  5547. return nil, err
  5548. }
  5549. ret := &Manifest{
  5550. ServerResponse: googleapi.ServerResponse{
  5551. Header: res.Header,
  5552. HTTPStatusCode: res.StatusCode,
  5553. },
  5554. }
  5555. target := &ret
  5556. if err := gensupport.DecodeResponse(target, res); err != nil {
  5557. return nil, err
  5558. }
  5559. return ret, nil
  5560. // {
  5561. // "description": "Gets information about a specific manifest.",
  5562. // "httpMethod": "GET",
  5563. // "id": "deploymentmanager.manifests.get",
  5564. // "parameterOrder": [
  5565. // "project",
  5566. // "deployment",
  5567. // "manifest"
  5568. // ],
  5569. // "parameters": {
  5570. // "deployment": {
  5571. // "description": "The name of the deployment for this request.",
  5572. // "location": "path",
  5573. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  5574. // "required": true,
  5575. // "type": "string"
  5576. // },
  5577. // "manifest": {
  5578. // "description": "The name of the manifest for this request.",
  5579. // "location": "path",
  5580. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  5581. // "required": true,
  5582. // "type": "string"
  5583. // },
  5584. // "project": {
  5585. // "description": "The project ID for this request.",
  5586. // "location": "path",
  5587. // "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])?))",
  5588. // "required": true,
  5589. // "type": "string"
  5590. // }
  5591. // },
  5592. // "path": "{project}/global/deployments/{deployment}/manifests/{manifest}",
  5593. // "response": {
  5594. // "$ref": "Manifest"
  5595. // },
  5596. // "scopes": [
  5597. // "https://www.googleapis.com/auth/cloud-platform",
  5598. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  5599. // "https://www.googleapis.com/auth/ndev.cloudman",
  5600. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  5601. // ]
  5602. // }
  5603. }
  5604. // method id "deploymentmanager.manifests.list":
  5605. type ManifestsListCall struct {
  5606. s *Service
  5607. project string
  5608. deployment string
  5609. urlParams_ gensupport.URLParams
  5610. ifNoneMatch_ string
  5611. ctx_ context.Context
  5612. header_ http.Header
  5613. }
  5614. // List: Lists all manifests for a given deployment.
  5615. func (r *ManifestsService) List(project string, deployment string) *ManifestsListCall {
  5616. c := &ManifestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5617. c.project = project
  5618. c.deployment = deployment
  5619. return c
  5620. }
  5621. // Filter sets the optional parameter "filter": A filter expression that
  5622. // filters resources listed in the response. The expression must specify
  5623. // the field name, a comparison operator, and the value that you want to
  5624. // use for filtering. The value must be a string, a number, or a
  5625. // boolean. The comparison operator must be either =, !=, >, or <.
  5626. //
  5627. // For example, if you are filtering Compute Engine instances, you can
  5628. // exclude instances named example-instance by specifying name !=
  5629. // example-instance.
  5630. //
  5631. // You can also filter nested fields. For example, you could specify
  5632. // scheduling.automaticRestart = false to include instances only if they
  5633. // are not scheduled for automatic restarts. You can use filtering on
  5634. // nested fields to filter based on resource labels.
  5635. //
  5636. // To filter on multiple expressions, provide each separate expression
  5637. // within parentheses. For example, (scheduling.automaticRestart = true)
  5638. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  5639. // AND expression. However, you can include AND and OR expressions
  5640. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  5641. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  5642. // true).
  5643. func (c *ManifestsListCall) Filter(filter string) *ManifestsListCall {
  5644. c.urlParams_.Set("filter", filter)
  5645. return c
  5646. }
  5647. // MaxResults sets the optional parameter "maxResults": The maximum
  5648. // number of results per page that should be returned. If the number of
  5649. // available results is larger than maxResults, Compute Engine returns a
  5650. // nextPageToken that can be used to get the next page of results in
  5651. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  5652. // (Default: 500)
  5653. func (c *ManifestsListCall) MaxResults(maxResults int64) *ManifestsListCall {
  5654. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5655. return c
  5656. }
  5657. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  5658. // a certain order. By default, results are returned in alphanumerical
  5659. // order based on the resource name.
  5660. //
  5661. // You can also sort results in descending order based on the creation
  5662. // timestamp using orderBy="creationTimestamp desc". This sorts results
  5663. // based on the creationTimestamp field in reverse chronological order
  5664. // (newest result first). Use this to sort resources like operations so
  5665. // that the newest operation is returned first.
  5666. //
  5667. // Currently, only sorting by name or creationTimestamp desc is
  5668. // supported.
  5669. func (c *ManifestsListCall) OrderBy(orderBy string) *ManifestsListCall {
  5670. c.urlParams_.Set("orderBy", orderBy)
  5671. return c
  5672. }
  5673. // PageToken sets the optional parameter "pageToken": Specifies a page
  5674. // token to use. Set pageToken to the nextPageToken returned by a
  5675. // previous list request to get the next page of results.
  5676. func (c *ManifestsListCall) PageToken(pageToken string) *ManifestsListCall {
  5677. c.urlParams_.Set("pageToken", pageToken)
  5678. return c
  5679. }
  5680. // Fields allows partial responses to be retrieved. See
  5681. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5682. // for more information.
  5683. func (c *ManifestsListCall) Fields(s ...googleapi.Field) *ManifestsListCall {
  5684. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5685. return c
  5686. }
  5687. // IfNoneMatch sets the optional parameter which makes the operation
  5688. // fail if the object's ETag matches the given value. This is useful for
  5689. // getting updates only after the object has changed since the last
  5690. // request. Use googleapi.IsNotModified to check whether the response
  5691. // error from Do is the result of In-None-Match.
  5692. func (c *ManifestsListCall) IfNoneMatch(entityTag string) *ManifestsListCall {
  5693. c.ifNoneMatch_ = entityTag
  5694. return c
  5695. }
  5696. // Context sets the context to be used in this call's Do method. Any
  5697. // pending HTTP request will be aborted if the provided context is
  5698. // canceled.
  5699. func (c *ManifestsListCall) Context(ctx context.Context) *ManifestsListCall {
  5700. c.ctx_ = ctx
  5701. return c
  5702. }
  5703. // Header returns an http.Header that can be modified by the caller to
  5704. // add HTTP headers to the request.
  5705. func (c *ManifestsListCall) Header() http.Header {
  5706. if c.header_ == nil {
  5707. c.header_ = make(http.Header)
  5708. }
  5709. return c.header_
  5710. }
  5711. func (c *ManifestsListCall) doRequest(alt string) (*http.Response, error) {
  5712. reqHeaders := make(http.Header)
  5713. for k, v := range c.header_ {
  5714. reqHeaders[k] = v
  5715. }
  5716. reqHeaders.Set("User-Agent", c.s.userAgent())
  5717. if c.ifNoneMatch_ != "" {
  5718. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5719. }
  5720. var body io.Reader = nil
  5721. c.urlParams_.Set("alt", alt)
  5722. c.urlParams_.Set("prettyPrint", "false")
  5723. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/manifests")
  5724. urls += "?" + c.urlParams_.Encode()
  5725. req, err := http.NewRequest("GET", urls, body)
  5726. if err != nil {
  5727. return nil, err
  5728. }
  5729. req.Header = reqHeaders
  5730. googleapi.Expand(req.URL, map[string]string{
  5731. "project": c.project,
  5732. "deployment": c.deployment,
  5733. })
  5734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5735. }
  5736. // Do executes the "deploymentmanager.manifests.list" call.
  5737. // Exactly one of *ManifestsListResponse or error will be non-nil. Any
  5738. // non-2xx status code is an error. Response headers are in either
  5739. // *ManifestsListResponse.ServerResponse.Header or (if a response was
  5740. // returned at all) in error.(*googleapi.Error).Header. Use
  5741. // googleapi.IsNotModified to check whether the returned error was
  5742. // because http.StatusNotModified was returned.
  5743. func (c *ManifestsListCall) Do(opts ...googleapi.CallOption) (*ManifestsListResponse, error) {
  5744. gensupport.SetOptions(c.urlParams_, opts...)
  5745. res, err := c.doRequest("json")
  5746. if res != nil && res.StatusCode == http.StatusNotModified {
  5747. if res.Body != nil {
  5748. res.Body.Close()
  5749. }
  5750. return nil, &googleapi.Error{
  5751. Code: res.StatusCode,
  5752. Header: res.Header,
  5753. }
  5754. }
  5755. if err != nil {
  5756. return nil, err
  5757. }
  5758. defer googleapi.CloseBody(res)
  5759. if err := googleapi.CheckResponse(res); err != nil {
  5760. return nil, err
  5761. }
  5762. ret := &ManifestsListResponse{
  5763. ServerResponse: googleapi.ServerResponse{
  5764. Header: res.Header,
  5765. HTTPStatusCode: res.StatusCode,
  5766. },
  5767. }
  5768. target := &ret
  5769. if err := gensupport.DecodeResponse(target, res); err != nil {
  5770. return nil, err
  5771. }
  5772. return ret, nil
  5773. // {
  5774. // "description": "Lists all manifests for a given deployment.",
  5775. // "httpMethod": "GET",
  5776. // "id": "deploymentmanager.manifests.list",
  5777. // "parameterOrder": [
  5778. // "project",
  5779. // "deployment"
  5780. // ],
  5781. // "parameters": {
  5782. // "deployment": {
  5783. // "description": "The name of the deployment for this request.",
  5784. // "location": "path",
  5785. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  5786. // "required": true,
  5787. // "type": "string"
  5788. // },
  5789. // "filter": {
  5790. // "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).",
  5791. // "location": "query",
  5792. // "type": "string"
  5793. // },
  5794. // "maxResults": {
  5795. // "default": "500",
  5796. // "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)",
  5797. // "format": "uint32",
  5798. // "location": "query",
  5799. // "minimum": "0",
  5800. // "type": "integer"
  5801. // },
  5802. // "orderBy": {
  5803. // "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.",
  5804. // "location": "query",
  5805. // "type": "string"
  5806. // },
  5807. // "pageToken": {
  5808. // "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.",
  5809. // "location": "query",
  5810. // "type": "string"
  5811. // },
  5812. // "project": {
  5813. // "description": "The project ID for this request.",
  5814. // "location": "path",
  5815. // "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])?))",
  5816. // "required": true,
  5817. // "type": "string"
  5818. // }
  5819. // },
  5820. // "path": "{project}/global/deployments/{deployment}/manifests",
  5821. // "response": {
  5822. // "$ref": "ManifestsListResponse"
  5823. // },
  5824. // "scopes": [
  5825. // "https://www.googleapis.com/auth/cloud-platform",
  5826. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  5827. // "https://www.googleapis.com/auth/ndev.cloudman",
  5828. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  5829. // ]
  5830. // }
  5831. }
  5832. // Pages invokes f for each page of results.
  5833. // A non-nil error returned from f will halt the iteration.
  5834. // The provided context supersedes any context provided to the Context method.
  5835. func (c *ManifestsListCall) Pages(ctx context.Context, f func(*ManifestsListResponse) error) error {
  5836. c.ctx_ = ctx
  5837. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5838. for {
  5839. x, err := c.Do()
  5840. if err != nil {
  5841. return err
  5842. }
  5843. if err := f(x); err != nil {
  5844. return err
  5845. }
  5846. if x.NextPageToken == "" {
  5847. return nil
  5848. }
  5849. c.PageToken(x.NextPageToken)
  5850. }
  5851. }
  5852. // method id "deploymentmanager.operations.get":
  5853. type OperationsGetCall struct {
  5854. s *Service
  5855. project string
  5856. operation string
  5857. urlParams_ gensupport.URLParams
  5858. ifNoneMatch_ string
  5859. ctx_ context.Context
  5860. header_ http.Header
  5861. }
  5862. // Get: Gets information about a specific operation.
  5863. func (r *OperationsService) Get(project string, operation string) *OperationsGetCall {
  5864. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5865. c.project = project
  5866. c.operation = operation
  5867. return c
  5868. }
  5869. // Fields allows partial responses to be retrieved. See
  5870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5871. // for more information.
  5872. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  5873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5874. return c
  5875. }
  5876. // IfNoneMatch sets the optional parameter which makes the operation
  5877. // fail if the object's ETag matches the given value. This is useful for
  5878. // getting updates only after the object has changed since the last
  5879. // request. Use googleapi.IsNotModified to check whether the response
  5880. // error from Do is the result of In-None-Match.
  5881. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  5882. c.ifNoneMatch_ = entityTag
  5883. return c
  5884. }
  5885. // Context sets the context to be used in this call's Do method. Any
  5886. // pending HTTP request will be aborted if the provided context is
  5887. // canceled.
  5888. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  5889. c.ctx_ = ctx
  5890. return c
  5891. }
  5892. // Header returns an http.Header that can be modified by the caller to
  5893. // add HTTP headers to the request.
  5894. func (c *OperationsGetCall) Header() http.Header {
  5895. if c.header_ == nil {
  5896. c.header_ = make(http.Header)
  5897. }
  5898. return c.header_
  5899. }
  5900. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  5901. reqHeaders := make(http.Header)
  5902. for k, v := range c.header_ {
  5903. reqHeaders[k] = v
  5904. }
  5905. reqHeaders.Set("User-Agent", c.s.userAgent())
  5906. if c.ifNoneMatch_ != "" {
  5907. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5908. }
  5909. var body io.Reader = nil
  5910. c.urlParams_.Set("alt", alt)
  5911. c.urlParams_.Set("prettyPrint", "false")
  5912. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations/{operation}")
  5913. urls += "?" + c.urlParams_.Encode()
  5914. req, err := http.NewRequest("GET", urls, body)
  5915. if err != nil {
  5916. return nil, err
  5917. }
  5918. req.Header = reqHeaders
  5919. googleapi.Expand(req.URL, map[string]string{
  5920. "project": c.project,
  5921. "operation": c.operation,
  5922. })
  5923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5924. }
  5925. // Do executes the "deploymentmanager.operations.get" call.
  5926. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5927. // status code is an error. Response headers are in either
  5928. // *Operation.ServerResponse.Header or (if a response was returned at
  5929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5930. // to check whether the returned error was because
  5931. // http.StatusNotModified was returned.
  5932. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5933. gensupport.SetOptions(c.urlParams_, opts...)
  5934. res, err := c.doRequest("json")
  5935. if res != nil && res.StatusCode == http.StatusNotModified {
  5936. if res.Body != nil {
  5937. res.Body.Close()
  5938. }
  5939. return nil, &googleapi.Error{
  5940. Code: res.StatusCode,
  5941. Header: res.Header,
  5942. }
  5943. }
  5944. if err != nil {
  5945. return nil, err
  5946. }
  5947. defer googleapi.CloseBody(res)
  5948. if err := googleapi.CheckResponse(res); err != nil {
  5949. return nil, err
  5950. }
  5951. ret := &Operation{
  5952. ServerResponse: googleapi.ServerResponse{
  5953. Header: res.Header,
  5954. HTTPStatusCode: res.StatusCode,
  5955. },
  5956. }
  5957. target := &ret
  5958. if err := gensupport.DecodeResponse(target, res); err != nil {
  5959. return nil, err
  5960. }
  5961. return ret, nil
  5962. // {
  5963. // "description": "Gets information about a specific operation.",
  5964. // "httpMethod": "GET",
  5965. // "id": "deploymentmanager.operations.get",
  5966. // "parameterOrder": [
  5967. // "project",
  5968. // "operation"
  5969. // ],
  5970. // "parameters": {
  5971. // "operation": {
  5972. // "description": "The name of the operation for this request.",
  5973. // "location": "path",
  5974. // "required": true,
  5975. // "type": "string"
  5976. // },
  5977. // "project": {
  5978. // "description": "The project ID for this request.",
  5979. // "location": "path",
  5980. // "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])?))",
  5981. // "required": true,
  5982. // "type": "string"
  5983. // }
  5984. // },
  5985. // "path": "{project}/global/operations/{operation}",
  5986. // "response": {
  5987. // "$ref": "Operation"
  5988. // },
  5989. // "scopes": [
  5990. // "https://www.googleapis.com/auth/cloud-platform",
  5991. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  5992. // "https://www.googleapis.com/auth/ndev.cloudman",
  5993. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  5994. // ]
  5995. // }
  5996. }
  5997. // method id "deploymentmanager.operations.list":
  5998. type OperationsListCall struct {
  5999. s *Service
  6000. project string
  6001. urlParams_ gensupport.URLParams
  6002. ifNoneMatch_ string
  6003. ctx_ context.Context
  6004. header_ http.Header
  6005. }
  6006. // List: Lists all operations for a project.
  6007. func (r *OperationsService) List(project string) *OperationsListCall {
  6008. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6009. c.project = project
  6010. return c
  6011. }
  6012. // Filter sets the optional parameter "filter": A filter expression that
  6013. // filters resources listed in the response. The expression must specify
  6014. // the field name, a comparison operator, and the value that you want to
  6015. // use for filtering. The value must be a string, a number, or a
  6016. // boolean. The comparison operator must be either =, !=, >, or <.
  6017. //
  6018. // For example, if you are filtering Compute Engine instances, you can
  6019. // exclude instances named example-instance by specifying name !=
  6020. // example-instance.
  6021. //
  6022. // You can also filter nested fields. For example, you could specify
  6023. // scheduling.automaticRestart = false to include instances only if they
  6024. // are not scheduled for automatic restarts. You can use filtering on
  6025. // nested fields to filter based on resource labels.
  6026. //
  6027. // To filter on multiple expressions, provide each separate expression
  6028. // within parentheses. For example, (scheduling.automaticRestart = true)
  6029. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  6030. // AND expression. However, you can include AND and OR expressions
  6031. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  6032. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  6033. // true).
  6034. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  6035. c.urlParams_.Set("filter", filter)
  6036. return c
  6037. }
  6038. // MaxResults sets the optional parameter "maxResults": The maximum
  6039. // number of results per page that should be returned. If the number of
  6040. // available results is larger than maxResults, Compute Engine returns a
  6041. // nextPageToken that can be used to get the next page of results in
  6042. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  6043. // (Default: 500)
  6044. func (c *OperationsListCall) MaxResults(maxResults int64) *OperationsListCall {
  6045. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6046. return c
  6047. }
  6048. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  6049. // a certain order. By default, results are returned in alphanumerical
  6050. // order based on the resource name.
  6051. //
  6052. // You can also sort results in descending order based on the creation
  6053. // timestamp using orderBy="creationTimestamp desc". This sorts results
  6054. // based on the creationTimestamp field in reverse chronological order
  6055. // (newest result first). Use this to sort resources like operations so
  6056. // that the newest operation is returned first.
  6057. //
  6058. // Currently, only sorting by name or creationTimestamp desc is
  6059. // supported.
  6060. func (c *OperationsListCall) OrderBy(orderBy string) *OperationsListCall {
  6061. c.urlParams_.Set("orderBy", orderBy)
  6062. return c
  6063. }
  6064. // PageToken sets the optional parameter "pageToken": Specifies a page
  6065. // token to use. Set pageToken to the nextPageToken returned by a
  6066. // previous list request to get the next page of results.
  6067. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  6068. c.urlParams_.Set("pageToken", pageToken)
  6069. return c
  6070. }
  6071. // Fields allows partial responses to be retrieved. See
  6072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6073. // for more information.
  6074. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  6075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6076. return c
  6077. }
  6078. // IfNoneMatch sets the optional parameter which makes the operation
  6079. // fail if the object's ETag matches the given value. This is useful for
  6080. // getting updates only after the object has changed since the last
  6081. // request. Use googleapi.IsNotModified to check whether the response
  6082. // error from Do is the result of In-None-Match.
  6083. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  6084. c.ifNoneMatch_ = entityTag
  6085. return c
  6086. }
  6087. // Context sets the context to be used in this call's Do method. Any
  6088. // pending HTTP request will be aborted if the provided context is
  6089. // canceled.
  6090. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  6091. c.ctx_ = ctx
  6092. return c
  6093. }
  6094. // Header returns an http.Header that can be modified by the caller to
  6095. // add HTTP headers to the request.
  6096. func (c *OperationsListCall) Header() http.Header {
  6097. if c.header_ == nil {
  6098. c.header_ = make(http.Header)
  6099. }
  6100. return c.header_
  6101. }
  6102. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  6103. reqHeaders := make(http.Header)
  6104. for k, v := range c.header_ {
  6105. reqHeaders[k] = v
  6106. }
  6107. reqHeaders.Set("User-Agent", c.s.userAgent())
  6108. if c.ifNoneMatch_ != "" {
  6109. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6110. }
  6111. var body io.Reader = nil
  6112. c.urlParams_.Set("alt", alt)
  6113. c.urlParams_.Set("prettyPrint", "false")
  6114. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/operations")
  6115. urls += "?" + c.urlParams_.Encode()
  6116. req, err := http.NewRequest("GET", urls, body)
  6117. if err != nil {
  6118. return nil, err
  6119. }
  6120. req.Header = reqHeaders
  6121. googleapi.Expand(req.URL, map[string]string{
  6122. "project": c.project,
  6123. })
  6124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6125. }
  6126. // Do executes the "deploymentmanager.operations.list" call.
  6127. // Exactly one of *OperationsListResponse or error will be non-nil. Any
  6128. // non-2xx status code is an error. Response headers are in either
  6129. // *OperationsListResponse.ServerResponse.Header or (if a response was
  6130. // returned at all) in error.(*googleapi.Error).Header. Use
  6131. // googleapi.IsNotModified to check whether the returned error was
  6132. // because http.StatusNotModified was returned.
  6133. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*OperationsListResponse, error) {
  6134. gensupport.SetOptions(c.urlParams_, opts...)
  6135. res, err := c.doRequest("json")
  6136. if res != nil && res.StatusCode == http.StatusNotModified {
  6137. if res.Body != nil {
  6138. res.Body.Close()
  6139. }
  6140. return nil, &googleapi.Error{
  6141. Code: res.StatusCode,
  6142. Header: res.Header,
  6143. }
  6144. }
  6145. if err != nil {
  6146. return nil, err
  6147. }
  6148. defer googleapi.CloseBody(res)
  6149. if err := googleapi.CheckResponse(res); err != nil {
  6150. return nil, err
  6151. }
  6152. ret := &OperationsListResponse{
  6153. ServerResponse: googleapi.ServerResponse{
  6154. Header: res.Header,
  6155. HTTPStatusCode: res.StatusCode,
  6156. },
  6157. }
  6158. target := &ret
  6159. if err := gensupport.DecodeResponse(target, res); err != nil {
  6160. return nil, err
  6161. }
  6162. return ret, nil
  6163. // {
  6164. // "description": "Lists all operations for a project.",
  6165. // "httpMethod": "GET",
  6166. // "id": "deploymentmanager.operations.list",
  6167. // "parameterOrder": [
  6168. // "project"
  6169. // ],
  6170. // "parameters": {
  6171. // "filter": {
  6172. // "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).",
  6173. // "location": "query",
  6174. // "type": "string"
  6175. // },
  6176. // "maxResults": {
  6177. // "default": "500",
  6178. // "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)",
  6179. // "format": "uint32",
  6180. // "location": "query",
  6181. // "minimum": "0",
  6182. // "type": "integer"
  6183. // },
  6184. // "orderBy": {
  6185. // "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.",
  6186. // "location": "query",
  6187. // "type": "string"
  6188. // },
  6189. // "pageToken": {
  6190. // "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.",
  6191. // "location": "query",
  6192. // "type": "string"
  6193. // },
  6194. // "project": {
  6195. // "description": "The project ID for this request.",
  6196. // "location": "path",
  6197. // "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])?))",
  6198. // "required": true,
  6199. // "type": "string"
  6200. // }
  6201. // },
  6202. // "path": "{project}/global/operations",
  6203. // "response": {
  6204. // "$ref": "OperationsListResponse"
  6205. // },
  6206. // "scopes": [
  6207. // "https://www.googleapis.com/auth/cloud-platform",
  6208. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6209. // "https://www.googleapis.com/auth/ndev.cloudman",
  6210. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  6211. // ]
  6212. // }
  6213. }
  6214. // Pages invokes f for each page of results.
  6215. // A non-nil error returned from f will halt the iteration.
  6216. // The provided context supersedes any context provided to the Context method.
  6217. func (c *OperationsListCall) Pages(ctx context.Context, f func(*OperationsListResponse) error) error {
  6218. c.ctx_ = ctx
  6219. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6220. for {
  6221. x, err := c.Do()
  6222. if err != nil {
  6223. return err
  6224. }
  6225. if err := f(x); err != nil {
  6226. return err
  6227. }
  6228. if x.NextPageToken == "" {
  6229. return nil
  6230. }
  6231. c.PageToken(x.NextPageToken)
  6232. }
  6233. }
  6234. // method id "deploymentmanager.resources.get":
  6235. type ResourcesGetCall struct {
  6236. s *Service
  6237. project string
  6238. deployment string
  6239. resource string
  6240. urlParams_ gensupport.URLParams
  6241. ifNoneMatch_ string
  6242. ctx_ context.Context
  6243. header_ http.Header
  6244. }
  6245. // Get: Gets information about a single resource.
  6246. func (r *ResourcesService) Get(project string, deployment string, resource string) *ResourcesGetCall {
  6247. c := &ResourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6248. c.project = project
  6249. c.deployment = deployment
  6250. c.resource = resource
  6251. return c
  6252. }
  6253. // Fields allows partial responses to be retrieved. See
  6254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6255. // for more information.
  6256. func (c *ResourcesGetCall) Fields(s ...googleapi.Field) *ResourcesGetCall {
  6257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6258. return c
  6259. }
  6260. // IfNoneMatch sets the optional parameter which makes the operation
  6261. // fail if the object's ETag matches the given value. This is useful for
  6262. // getting updates only after the object has changed since the last
  6263. // request. Use googleapi.IsNotModified to check whether the response
  6264. // error from Do is the result of In-None-Match.
  6265. func (c *ResourcesGetCall) IfNoneMatch(entityTag string) *ResourcesGetCall {
  6266. c.ifNoneMatch_ = entityTag
  6267. return c
  6268. }
  6269. // Context sets the context to be used in this call's Do method. Any
  6270. // pending HTTP request will be aborted if the provided context is
  6271. // canceled.
  6272. func (c *ResourcesGetCall) Context(ctx context.Context) *ResourcesGetCall {
  6273. c.ctx_ = ctx
  6274. return c
  6275. }
  6276. // Header returns an http.Header that can be modified by the caller to
  6277. // add HTTP headers to the request.
  6278. func (c *ResourcesGetCall) Header() http.Header {
  6279. if c.header_ == nil {
  6280. c.header_ = make(http.Header)
  6281. }
  6282. return c.header_
  6283. }
  6284. func (c *ResourcesGetCall) doRequest(alt string) (*http.Response, error) {
  6285. reqHeaders := make(http.Header)
  6286. for k, v := range c.header_ {
  6287. reqHeaders[k] = v
  6288. }
  6289. reqHeaders.Set("User-Agent", c.s.userAgent())
  6290. if c.ifNoneMatch_ != "" {
  6291. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6292. }
  6293. var body io.Reader = nil
  6294. c.urlParams_.Set("alt", alt)
  6295. c.urlParams_.Set("prettyPrint", "false")
  6296. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources/{resource}")
  6297. urls += "?" + c.urlParams_.Encode()
  6298. req, err := http.NewRequest("GET", urls, body)
  6299. if err != nil {
  6300. return nil, err
  6301. }
  6302. req.Header = reqHeaders
  6303. googleapi.Expand(req.URL, map[string]string{
  6304. "project": c.project,
  6305. "deployment": c.deployment,
  6306. "resource": c.resource,
  6307. })
  6308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6309. }
  6310. // Do executes the "deploymentmanager.resources.get" call.
  6311. // Exactly one of *Resource or error will be non-nil. Any non-2xx status
  6312. // code is an error. Response headers are in either
  6313. // *Resource.ServerResponse.Header or (if a response was returned at
  6314. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6315. // to check whether the returned error was because
  6316. // http.StatusNotModified was returned.
  6317. func (c *ResourcesGetCall) Do(opts ...googleapi.CallOption) (*Resource, error) {
  6318. gensupport.SetOptions(c.urlParams_, opts...)
  6319. res, err := c.doRequest("json")
  6320. if res != nil && res.StatusCode == http.StatusNotModified {
  6321. if res.Body != nil {
  6322. res.Body.Close()
  6323. }
  6324. return nil, &googleapi.Error{
  6325. Code: res.StatusCode,
  6326. Header: res.Header,
  6327. }
  6328. }
  6329. if err != nil {
  6330. return nil, err
  6331. }
  6332. defer googleapi.CloseBody(res)
  6333. if err := googleapi.CheckResponse(res); err != nil {
  6334. return nil, err
  6335. }
  6336. ret := &Resource{
  6337. ServerResponse: googleapi.ServerResponse{
  6338. Header: res.Header,
  6339. HTTPStatusCode: res.StatusCode,
  6340. },
  6341. }
  6342. target := &ret
  6343. if err := gensupport.DecodeResponse(target, res); err != nil {
  6344. return nil, err
  6345. }
  6346. return ret, nil
  6347. // {
  6348. // "description": "Gets information about a single resource.",
  6349. // "httpMethod": "GET",
  6350. // "id": "deploymentmanager.resources.get",
  6351. // "parameterOrder": [
  6352. // "project",
  6353. // "deployment",
  6354. // "resource"
  6355. // ],
  6356. // "parameters": {
  6357. // "deployment": {
  6358. // "description": "The name of the deployment for this request.",
  6359. // "location": "path",
  6360. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  6361. // "required": true,
  6362. // "type": "string"
  6363. // },
  6364. // "project": {
  6365. // "description": "The project ID for this request.",
  6366. // "location": "path",
  6367. // "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])?))",
  6368. // "required": true,
  6369. // "type": "string"
  6370. // },
  6371. // "resource": {
  6372. // "description": "The name of the resource for this request.",
  6373. // "location": "path",
  6374. // "required": true,
  6375. // "type": "string"
  6376. // }
  6377. // },
  6378. // "path": "{project}/global/deployments/{deployment}/resources/{resource}",
  6379. // "response": {
  6380. // "$ref": "Resource"
  6381. // },
  6382. // "scopes": [
  6383. // "https://www.googleapis.com/auth/cloud-platform",
  6384. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6385. // "https://www.googleapis.com/auth/ndev.cloudman",
  6386. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  6387. // ]
  6388. // }
  6389. }
  6390. // method id "deploymentmanager.resources.list":
  6391. type ResourcesListCall struct {
  6392. s *Service
  6393. project string
  6394. deployment string
  6395. urlParams_ gensupport.URLParams
  6396. ifNoneMatch_ string
  6397. ctx_ context.Context
  6398. header_ http.Header
  6399. }
  6400. // List: Lists all resources in a given deployment.
  6401. func (r *ResourcesService) List(project string, deployment string) *ResourcesListCall {
  6402. c := &ResourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6403. c.project = project
  6404. c.deployment = deployment
  6405. return c
  6406. }
  6407. // Filter sets the optional parameter "filter": A filter expression that
  6408. // filters resources listed in the response. The expression must specify
  6409. // the field name, a comparison operator, and the value that you want to
  6410. // use for filtering. The value must be a string, a number, or a
  6411. // boolean. The comparison operator must be either =, !=, >, or <.
  6412. //
  6413. // For example, if you are filtering Compute Engine instances, you can
  6414. // exclude instances named example-instance by specifying name !=
  6415. // example-instance.
  6416. //
  6417. // You can also filter nested fields. For example, you could specify
  6418. // scheduling.automaticRestart = false to include instances only if they
  6419. // are not scheduled for automatic restarts. You can use filtering on
  6420. // nested fields to filter based on resource labels.
  6421. //
  6422. // To filter on multiple expressions, provide each separate expression
  6423. // within parentheses. For example, (scheduling.automaticRestart = true)
  6424. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  6425. // AND expression. However, you can include AND and OR expressions
  6426. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  6427. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  6428. // true).
  6429. func (c *ResourcesListCall) Filter(filter string) *ResourcesListCall {
  6430. c.urlParams_.Set("filter", filter)
  6431. return c
  6432. }
  6433. // MaxResults sets the optional parameter "maxResults": The maximum
  6434. // number of results per page that should be returned. If the number of
  6435. // available results is larger than maxResults, Compute Engine returns a
  6436. // nextPageToken that can be used to get the next page of results in
  6437. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  6438. // (Default: 500)
  6439. func (c *ResourcesListCall) MaxResults(maxResults int64) *ResourcesListCall {
  6440. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6441. return c
  6442. }
  6443. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  6444. // a certain order. By default, results are returned in alphanumerical
  6445. // order based on the resource name.
  6446. //
  6447. // You can also sort results in descending order based on the creation
  6448. // timestamp using orderBy="creationTimestamp desc". This sorts results
  6449. // based on the creationTimestamp field in reverse chronological order
  6450. // (newest result first). Use this to sort resources like operations so
  6451. // that the newest operation is returned first.
  6452. //
  6453. // Currently, only sorting by name or creationTimestamp desc is
  6454. // supported.
  6455. func (c *ResourcesListCall) OrderBy(orderBy string) *ResourcesListCall {
  6456. c.urlParams_.Set("orderBy", orderBy)
  6457. return c
  6458. }
  6459. // PageToken sets the optional parameter "pageToken": Specifies a page
  6460. // token to use. Set pageToken to the nextPageToken returned by a
  6461. // previous list request to get the next page of results.
  6462. func (c *ResourcesListCall) PageToken(pageToken string) *ResourcesListCall {
  6463. c.urlParams_.Set("pageToken", pageToken)
  6464. return c
  6465. }
  6466. // Fields allows partial responses to be retrieved. See
  6467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6468. // for more information.
  6469. func (c *ResourcesListCall) Fields(s ...googleapi.Field) *ResourcesListCall {
  6470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6471. return c
  6472. }
  6473. // IfNoneMatch sets the optional parameter which makes the operation
  6474. // fail if the object's ETag matches the given value. This is useful for
  6475. // getting updates only after the object has changed since the last
  6476. // request. Use googleapi.IsNotModified to check whether the response
  6477. // error from Do is the result of In-None-Match.
  6478. func (c *ResourcesListCall) IfNoneMatch(entityTag string) *ResourcesListCall {
  6479. c.ifNoneMatch_ = entityTag
  6480. return c
  6481. }
  6482. // Context sets the context to be used in this call's Do method. Any
  6483. // pending HTTP request will be aborted if the provided context is
  6484. // canceled.
  6485. func (c *ResourcesListCall) Context(ctx context.Context) *ResourcesListCall {
  6486. c.ctx_ = ctx
  6487. return c
  6488. }
  6489. // Header returns an http.Header that can be modified by the caller to
  6490. // add HTTP headers to the request.
  6491. func (c *ResourcesListCall) Header() http.Header {
  6492. if c.header_ == nil {
  6493. c.header_ = make(http.Header)
  6494. }
  6495. return c.header_
  6496. }
  6497. func (c *ResourcesListCall) doRequest(alt string) (*http.Response, error) {
  6498. reqHeaders := make(http.Header)
  6499. for k, v := range c.header_ {
  6500. reqHeaders[k] = v
  6501. }
  6502. reqHeaders.Set("User-Agent", c.s.userAgent())
  6503. if c.ifNoneMatch_ != "" {
  6504. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6505. }
  6506. var body io.Reader = nil
  6507. c.urlParams_.Set("alt", alt)
  6508. c.urlParams_.Set("prettyPrint", "false")
  6509. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/deployments/{deployment}/resources")
  6510. urls += "?" + c.urlParams_.Encode()
  6511. req, err := http.NewRequest("GET", urls, body)
  6512. if err != nil {
  6513. return nil, err
  6514. }
  6515. req.Header = reqHeaders
  6516. googleapi.Expand(req.URL, map[string]string{
  6517. "project": c.project,
  6518. "deployment": c.deployment,
  6519. })
  6520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6521. }
  6522. // Do executes the "deploymentmanager.resources.list" call.
  6523. // Exactly one of *ResourcesListResponse or error will be non-nil. Any
  6524. // non-2xx status code is an error. Response headers are in either
  6525. // *ResourcesListResponse.ServerResponse.Header or (if a response was
  6526. // returned at all) in error.(*googleapi.Error).Header. Use
  6527. // googleapi.IsNotModified to check whether the returned error was
  6528. // because http.StatusNotModified was returned.
  6529. func (c *ResourcesListCall) Do(opts ...googleapi.CallOption) (*ResourcesListResponse, error) {
  6530. gensupport.SetOptions(c.urlParams_, opts...)
  6531. res, err := c.doRequest("json")
  6532. if res != nil && res.StatusCode == http.StatusNotModified {
  6533. if res.Body != nil {
  6534. res.Body.Close()
  6535. }
  6536. return nil, &googleapi.Error{
  6537. Code: res.StatusCode,
  6538. Header: res.Header,
  6539. }
  6540. }
  6541. if err != nil {
  6542. return nil, err
  6543. }
  6544. defer googleapi.CloseBody(res)
  6545. if err := googleapi.CheckResponse(res); err != nil {
  6546. return nil, err
  6547. }
  6548. ret := &ResourcesListResponse{
  6549. ServerResponse: googleapi.ServerResponse{
  6550. Header: res.Header,
  6551. HTTPStatusCode: res.StatusCode,
  6552. },
  6553. }
  6554. target := &ret
  6555. if err := gensupport.DecodeResponse(target, res); err != nil {
  6556. return nil, err
  6557. }
  6558. return ret, nil
  6559. // {
  6560. // "description": "Lists all resources in a given deployment.",
  6561. // "httpMethod": "GET",
  6562. // "id": "deploymentmanager.resources.list",
  6563. // "parameterOrder": [
  6564. // "project",
  6565. // "deployment"
  6566. // ],
  6567. // "parameters": {
  6568. // "deployment": {
  6569. // "description": "The name of the deployment for this request.",
  6570. // "location": "path",
  6571. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  6572. // "required": true,
  6573. // "type": "string"
  6574. // },
  6575. // "filter": {
  6576. // "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).",
  6577. // "location": "query",
  6578. // "type": "string"
  6579. // },
  6580. // "maxResults": {
  6581. // "default": "500",
  6582. // "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)",
  6583. // "format": "uint32",
  6584. // "location": "query",
  6585. // "minimum": "0",
  6586. // "type": "integer"
  6587. // },
  6588. // "orderBy": {
  6589. // "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.",
  6590. // "location": "query",
  6591. // "type": "string"
  6592. // },
  6593. // "pageToken": {
  6594. // "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.",
  6595. // "location": "query",
  6596. // "type": "string"
  6597. // },
  6598. // "project": {
  6599. // "description": "The project ID for this request.",
  6600. // "location": "path",
  6601. // "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])?))",
  6602. // "required": true,
  6603. // "type": "string"
  6604. // }
  6605. // },
  6606. // "path": "{project}/global/deployments/{deployment}/resources",
  6607. // "response": {
  6608. // "$ref": "ResourcesListResponse"
  6609. // },
  6610. // "scopes": [
  6611. // "https://www.googleapis.com/auth/cloud-platform",
  6612. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6613. // "https://www.googleapis.com/auth/ndev.cloudman",
  6614. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  6615. // ]
  6616. // }
  6617. }
  6618. // Pages invokes f for each page of results.
  6619. // A non-nil error returned from f will halt the iteration.
  6620. // The provided context supersedes any context provided to the Context method.
  6621. func (c *ResourcesListCall) Pages(ctx context.Context, f func(*ResourcesListResponse) error) error {
  6622. c.ctx_ = ctx
  6623. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6624. for {
  6625. x, err := c.Do()
  6626. if err != nil {
  6627. return err
  6628. }
  6629. if err := f(x); err != nil {
  6630. return err
  6631. }
  6632. if x.NextPageToken == "" {
  6633. return nil
  6634. }
  6635. c.PageToken(x.NextPageToken)
  6636. }
  6637. }
  6638. // method id "deploymentmanager.typeProviders.delete":
  6639. type TypeProvidersDeleteCall struct {
  6640. s *Service
  6641. project string
  6642. typeProvider string
  6643. urlParams_ gensupport.URLParams
  6644. ctx_ context.Context
  6645. header_ http.Header
  6646. }
  6647. // Delete: Deletes a type provider.
  6648. func (r *TypeProvidersService) Delete(project string, typeProvider string) *TypeProvidersDeleteCall {
  6649. c := &TypeProvidersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6650. c.project = project
  6651. c.typeProvider = typeProvider
  6652. return c
  6653. }
  6654. // Fields allows partial responses to be retrieved. See
  6655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6656. // for more information.
  6657. func (c *TypeProvidersDeleteCall) Fields(s ...googleapi.Field) *TypeProvidersDeleteCall {
  6658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6659. return c
  6660. }
  6661. // Context sets the context to be used in this call's Do method. Any
  6662. // pending HTTP request will be aborted if the provided context is
  6663. // canceled.
  6664. func (c *TypeProvidersDeleteCall) Context(ctx context.Context) *TypeProvidersDeleteCall {
  6665. c.ctx_ = ctx
  6666. return c
  6667. }
  6668. // Header returns an http.Header that can be modified by the caller to
  6669. // add HTTP headers to the request.
  6670. func (c *TypeProvidersDeleteCall) Header() http.Header {
  6671. if c.header_ == nil {
  6672. c.header_ = make(http.Header)
  6673. }
  6674. return c.header_
  6675. }
  6676. func (c *TypeProvidersDeleteCall) doRequest(alt string) (*http.Response, error) {
  6677. reqHeaders := make(http.Header)
  6678. for k, v := range c.header_ {
  6679. reqHeaders[k] = v
  6680. }
  6681. reqHeaders.Set("User-Agent", c.s.userAgent())
  6682. var body io.Reader = nil
  6683. c.urlParams_.Set("alt", alt)
  6684. c.urlParams_.Set("prettyPrint", "false")
  6685. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/typeProviders/{typeProvider}")
  6686. urls += "?" + c.urlParams_.Encode()
  6687. req, err := http.NewRequest("DELETE", urls, body)
  6688. if err != nil {
  6689. return nil, err
  6690. }
  6691. req.Header = reqHeaders
  6692. googleapi.Expand(req.URL, map[string]string{
  6693. "project": c.project,
  6694. "typeProvider": c.typeProvider,
  6695. })
  6696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6697. }
  6698. // Do executes the "deploymentmanager.typeProviders.delete" call.
  6699. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6700. // status code is an error. Response headers are in either
  6701. // *Operation.ServerResponse.Header or (if a response was returned at
  6702. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6703. // to check whether the returned error was because
  6704. // http.StatusNotModified was returned.
  6705. func (c *TypeProvidersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6706. gensupport.SetOptions(c.urlParams_, opts...)
  6707. res, err := c.doRequest("json")
  6708. if res != nil && res.StatusCode == http.StatusNotModified {
  6709. if res.Body != nil {
  6710. res.Body.Close()
  6711. }
  6712. return nil, &googleapi.Error{
  6713. Code: res.StatusCode,
  6714. Header: res.Header,
  6715. }
  6716. }
  6717. if err != nil {
  6718. return nil, err
  6719. }
  6720. defer googleapi.CloseBody(res)
  6721. if err := googleapi.CheckResponse(res); err != nil {
  6722. return nil, err
  6723. }
  6724. ret := &Operation{
  6725. ServerResponse: googleapi.ServerResponse{
  6726. Header: res.Header,
  6727. HTTPStatusCode: res.StatusCode,
  6728. },
  6729. }
  6730. target := &ret
  6731. if err := gensupport.DecodeResponse(target, res); err != nil {
  6732. return nil, err
  6733. }
  6734. return ret, nil
  6735. // {
  6736. // "description": "Deletes a type provider.",
  6737. // "httpMethod": "DELETE",
  6738. // "id": "deploymentmanager.typeProviders.delete",
  6739. // "parameterOrder": [
  6740. // "project",
  6741. // "typeProvider"
  6742. // ],
  6743. // "parameters": {
  6744. // "project": {
  6745. // "description": "The project ID for this request.",
  6746. // "location": "path",
  6747. // "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])?))",
  6748. // "required": true,
  6749. // "type": "string"
  6750. // },
  6751. // "typeProvider": {
  6752. // "description": "The name of the type provider for this request.",
  6753. // "location": "path",
  6754. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  6755. // "required": true,
  6756. // "type": "string"
  6757. // }
  6758. // },
  6759. // "path": "{project}/global/typeProviders/{typeProvider}",
  6760. // "response": {
  6761. // "$ref": "Operation"
  6762. // },
  6763. // "scopes": [
  6764. // "https://www.googleapis.com/auth/cloud-platform",
  6765. // "https://www.googleapis.com/auth/ndev.cloudman"
  6766. // ]
  6767. // }
  6768. }
  6769. // method id "deploymentmanager.typeProviders.get":
  6770. type TypeProvidersGetCall struct {
  6771. s *Service
  6772. project string
  6773. typeProvider string
  6774. urlParams_ gensupport.URLParams
  6775. ifNoneMatch_ string
  6776. ctx_ context.Context
  6777. header_ http.Header
  6778. }
  6779. // Get: Gets information about a specific type provider.
  6780. func (r *TypeProvidersService) Get(project string, typeProvider string) *TypeProvidersGetCall {
  6781. c := &TypeProvidersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6782. c.project = project
  6783. c.typeProvider = typeProvider
  6784. return c
  6785. }
  6786. // Fields allows partial responses to be retrieved. See
  6787. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6788. // for more information.
  6789. func (c *TypeProvidersGetCall) Fields(s ...googleapi.Field) *TypeProvidersGetCall {
  6790. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6791. return c
  6792. }
  6793. // IfNoneMatch sets the optional parameter which makes the operation
  6794. // fail if the object's ETag matches the given value. This is useful for
  6795. // getting updates only after the object has changed since the last
  6796. // request. Use googleapi.IsNotModified to check whether the response
  6797. // error from Do is the result of In-None-Match.
  6798. func (c *TypeProvidersGetCall) IfNoneMatch(entityTag string) *TypeProvidersGetCall {
  6799. c.ifNoneMatch_ = entityTag
  6800. return c
  6801. }
  6802. // Context sets the context to be used in this call's Do method. Any
  6803. // pending HTTP request will be aborted if the provided context is
  6804. // canceled.
  6805. func (c *TypeProvidersGetCall) Context(ctx context.Context) *TypeProvidersGetCall {
  6806. c.ctx_ = ctx
  6807. return c
  6808. }
  6809. // Header returns an http.Header that can be modified by the caller to
  6810. // add HTTP headers to the request.
  6811. func (c *TypeProvidersGetCall) Header() http.Header {
  6812. if c.header_ == nil {
  6813. c.header_ = make(http.Header)
  6814. }
  6815. return c.header_
  6816. }
  6817. func (c *TypeProvidersGetCall) doRequest(alt string) (*http.Response, error) {
  6818. reqHeaders := make(http.Header)
  6819. for k, v := range c.header_ {
  6820. reqHeaders[k] = v
  6821. }
  6822. reqHeaders.Set("User-Agent", c.s.userAgent())
  6823. if c.ifNoneMatch_ != "" {
  6824. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6825. }
  6826. var body io.Reader = nil
  6827. c.urlParams_.Set("alt", alt)
  6828. c.urlParams_.Set("prettyPrint", "false")
  6829. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/typeProviders/{typeProvider}")
  6830. urls += "?" + c.urlParams_.Encode()
  6831. req, err := http.NewRequest("GET", urls, body)
  6832. if err != nil {
  6833. return nil, err
  6834. }
  6835. req.Header = reqHeaders
  6836. googleapi.Expand(req.URL, map[string]string{
  6837. "project": c.project,
  6838. "typeProvider": c.typeProvider,
  6839. })
  6840. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6841. }
  6842. // Do executes the "deploymentmanager.typeProviders.get" call.
  6843. // Exactly one of *TypeProvider or error will be non-nil. Any non-2xx
  6844. // status code is an error. Response headers are in either
  6845. // *TypeProvider.ServerResponse.Header or (if a response was returned at
  6846. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6847. // to check whether the returned error was because
  6848. // http.StatusNotModified was returned.
  6849. func (c *TypeProvidersGetCall) Do(opts ...googleapi.CallOption) (*TypeProvider, error) {
  6850. gensupport.SetOptions(c.urlParams_, opts...)
  6851. res, err := c.doRequest("json")
  6852. if res != nil && res.StatusCode == http.StatusNotModified {
  6853. if res.Body != nil {
  6854. res.Body.Close()
  6855. }
  6856. return nil, &googleapi.Error{
  6857. Code: res.StatusCode,
  6858. Header: res.Header,
  6859. }
  6860. }
  6861. if err != nil {
  6862. return nil, err
  6863. }
  6864. defer googleapi.CloseBody(res)
  6865. if err := googleapi.CheckResponse(res); err != nil {
  6866. return nil, err
  6867. }
  6868. ret := &TypeProvider{
  6869. ServerResponse: googleapi.ServerResponse{
  6870. Header: res.Header,
  6871. HTTPStatusCode: res.StatusCode,
  6872. },
  6873. }
  6874. target := &ret
  6875. if err := gensupport.DecodeResponse(target, res); err != nil {
  6876. return nil, err
  6877. }
  6878. return ret, nil
  6879. // {
  6880. // "description": "Gets information about a specific type provider.",
  6881. // "httpMethod": "GET",
  6882. // "id": "deploymentmanager.typeProviders.get",
  6883. // "parameterOrder": [
  6884. // "project",
  6885. // "typeProvider"
  6886. // ],
  6887. // "parameters": {
  6888. // "project": {
  6889. // "description": "The project ID for this request.",
  6890. // "location": "path",
  6891. // "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])?))",
  6892. // "required": true,
  6893. // "type": "string"
  6894. // },
  6895. // "typeProvider": {
  6896. // "description": "The name of the type provider for this request.",
  6897. // "location": "path",
  6898. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  6899. // "required": true,
  6900. // "type": "string"
  6901. // }
  6902. // },
  6903. // "path": "{project}/global/typeProviders/{typeProvider}",
  6904. // "response": {
  6905. // "$ref": "TypeProvider"
  6906. // },
  6907. // "scopes": [
  6908. // "https://www.googleapis.com/auth/cloud-platform",
  6909. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  6910. // "https://www.googleapis.com/auth/ndev.cloudman",
  6911. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  6912. // ]
  6913. // }
  6914. }
  6915. // method id "deploymentmanager.typeProviders.getType":
  6916. type TypeProvidersGetTypeCall struct {
  6917. s *Service
  6918. project string
  6919. typeProvider string
  6920. type_ string
  6921. urlParams_ gensupport.URLParams
  6922. ifNoneMatch_ string
  6923. ctx_ context.Context
  6924. header_ http.Header
  6925. }
  6926. // GetType: Gets a type info for a type provided by a TypeProvider.
  6927. func (r *TypeProvidersService) GetType(project string, typeProvider string, type_ string) *TypeProvidersGetTypeCall {
  6928. c := &TypeProvidersGetTypeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6929. c.project = project
  6930. c.typeProvider = typeProvider
  6931. c.type_ = type_
  6932. return c
  6933. }
  6934. // Fields allows partial responses to be retrieved. See
  6935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6936. // for more information.
  6937. func (c *TypeProvidersGetTypeCall) Fields(s ...googleapi.Field) *TypeProvidersGetTypeCall {
  6938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6939. return c
  6940. }
  6941. // IfNoneMatch sets the optional parameter which makes the operation
  6942. // fail if the object's ETag matches the given value. This is useful for
  6943. // getting updates only after the object has changed since the last
  6944. // request. Use googleapi.IsNotModified to check whether the response
  6945. // error from Do is the result of In-None-Match.
  6946. func (c *TypeProvidersGetTypeCall) IfNoneMatch(entityTag string) *TypeProvidersGetTypeCall {
  6947. c.ifNoneMatch_ = entityTag
  6948. return c
  6949. }
  6950. // Context sets the context to be used in this call's Do method. Any
  6951. // pending HTTP request will be aborted if the provided context is
  6952. // canceled.
  6953. func (c *TypeProvidersGetTypeCall) Context(ctx context.Context) *TypeProvidersGetTypeCall {
  6954. c.ctx_ = ctx
  6955. return c
  6956. }
  6957. // Header returns an http.Header that can be modified by the caller to
  6958. // add HTTP headers to the request.
  6959. func (c *TypeProvidersGetTypeCall) Header() http.Header {
  6960. if c.header_ == nil {
  6961. c.header_ = make(http.Header)
  6962. }
  6963. return c.header_
  6964. }
  6965. func (c *TypeProvidersGetTypeCall) doRequest(alt string) (*http.Response, error) {
  6966. reqHeaders := make(http.Header)
  6967. for k, v := range c.header_ {
  6968. reqHeaders[k] = v
  6969. }
  6970. reqHeaders.Set("User-Agent", c.s.userAgent())
  6971. if c.ifNoneMatch_ != "" {
  6972. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6973. }
  6974. var body io.Reader = nil
  6975. c.urlParams_.Set("alt", alt)
  6976. c.urlParams_.Set("prettyPrint", "false")
  6977. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/typeProviders/{typeProvider}/types/{type}")
  6978. urls += "?" + c.urlParams_.Encode()
  6979. req, err := http.NewRequest("GET", urls, body)
  6980. if err != nil {
  6981. return nil, err
  6982. }
  6983. req.Header = reqHeaders
  6984. googleapi.Expand(req.URL, map[string]string{
  6985. "project": c.project,
  6986. "typeProvider": c.typeProvider,
  6987. "type": c.type_,
  6988. })
  6989. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6990. }
  6991. // Do executes the "deploymentmanager.typeProviders.getType" call.
  6992. // Exactly one of *TypeInfo or error will be non-nil. Any non-2xx status
  6993. // code is an error. Response headers are in either
  6994. // *TypeInfo.ServerResponse.Header or (if a response was returned at
  6995. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6996. // to check whether the returned error was because
  6997. // http.StatusNotModified was returned.
  6998. func (c *TypeProvidersGetTypeCall) Do(opts ...googleapi.CallOption) (*TypeInfo, error) {
  6999. gensupport.SetOptions(c.urlParams_, opts...)
  7000. res, err := c.doRequest("json")
  7001. if res != nil && res.StatusCode == http.StatusNotModified {
  7002. if res.Body != nil {
  7003. res.Body.Close()
  7004. }
  7005. return nil, &googleapi.Error{
  7006. Code: res.StatusCode,
  7007. Header: res.Header,
  7008. }
  7009. }
  7010. if err != nil {
  7011. return nil, err
  7012. }
  7013. defer googleapi.CloseBody(res)
  7014. if err := googleapi.CheckResponse(res); err != nil {
  7015. return nil, err
  7016. }
  7017. ret := &TypeInfo{
  7018. ServerResponse: googleapi.ServerResponse{
  7019. Header: res.Header,
  7020. HTTPStatusCode: res.StatusCode,
  7021. },
  7022. }
  7023. target := &ret
  7024. if err := gensupport.DecodeResponse(target, res); err != nil {
  7025. return nil, err
  7026. }
  7027. return ret, nil
  7028. // {
  7029. // "description": "Gets a type info for a type provided by a TypeProvider.",
  7030. // "httpMethod": "GET",
  7031. // "id": "deploymentmanager.typeProviders.getType",
  7032. // "parameterOrder": [
  7033. // "project",
  7034. // "typeProvider",
  7035. // "type"
  7036. // ],
  7037. // "parameters": {
  7038. // "project": {
  7039. // "description": "The project ID for this request.",
  7040. // "location": "path",
  7041. // "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])?))",
  7042. // "required": true,
  7043. // "type": "string"
  7044. // },
  7045. // "type": {
  7046. // "description": "The name of the type provider type for this request.",
  7047. // "location": "path",
  7048. // "required": true,
  7049. // "type": "string"
  7050. // },
  7051. // "typeProvider": {
  7052. // "description": "The name of the type provider for this request.",
  7053. // "location": "path",
  7054. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7055. // "required": true,
  7056. // "type": "string"
  7057. // }
  7058. // },
  7059. // "path": "{project}/global/typeProviders/{typeProvider}/types/{type}",
  7060. // "response": {
  7061. // "$ref": "TypeInfo"
  7062. // },
  7063. // "scopes": [
  7064. // "https://www.googleapis.com/auth/cloud-platform",
  7065. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7066. // "https://www.googleapis.com/auth/ndev.cloudman",
  7067. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  7068. // ]
  7069. // }
  7070. }
  7071. // method id "deploymentmanager.typeProviders.insert":
  7072. type TypeProvidersInsertCall struct {
  7073. s *Service
  7074. project string
  7075. typeprovider *TypeProvider
  7076. urlParams_ gensupport.URLParams
  7077. ctx_ context.Context
  7078. header_ http.Header
  7079. }
  7080. // Insert: Creates a type provider.
  7081. func (r *TypeProvidersService) Insert(project string, typeprovider *TypeProvider) *TypeProvidersInsertCall {
  7082. c := &TypeProvidersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7083. c.project = project
  7084. c.typeprovider = typeprovider
  7085. return c
  7086. }
  7087. // Fields allows partial responses to be retrieved. See
  7088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7089. // for more information.
  7090. func (c *TypeProvidersInsertCall) Fields(s ...googleapi.Field) *TypeProvidersInsertCall {
  7091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7092. return c
  7093. }
  7094. // Context sets the context to be used in this call's Do method. Any
  7095. // pending HTTP request will be aborted if the provided context is
  7096. // canceled.
  7097. func (c *TypeProvidersInsertCall) Context(ctx context.Context) *TypeProvidersInsertCall {
  7098. c.ctx_ = ctx
  7099. return c
  7100. }
  7101. // Header returns an http.Header that can be modified by the caller to
  7102. // add HTTP headers to the request.
  7103. func (c *TypeProvidersInsertCall) Header() http.Header {
  7104. if c.header_ == nil {
  7105. c.header_ = make(http.Header)
  7106. }
  7107. return c.header_
  7108. }
  7109. func (c *TypeProvidersInsertCall) doRequest(alt string) (*http.Response, error) {
  7110. reqHeaders := make(http.Header)
  7111. for k, v := range c.header_ {
  7112. reqHeaders[k] = v
  7113. }
  7114. reqHeaders.Set("User-Agent", c.s.userAgent())
  7115. var body io.Reader = nil
  7116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider)
  7117. if err != nil {
  7118. return nil, err
  7119. }
  7120. reqHeaders.Set("Content-Type", "application/json")
  7121. c.urlParams_.Set("alt", alt)
  7122. c.urlParams_.Set("prettyPrint", "false")
  7123. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/typeProviders")
  7124. urls += "?" + c.urlParams_.Encode()
  7125. req, err := http.NewRequest("POST", urls, body)
  7126. if err != nil {
  7127. return nil, err
  7128. }
  7129. req.Header = reqHeaders
  7130. googleapi.Expand(req.URL, map[string]string{
  7131. "project": c.project,
  7132. })
  7133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7134. }
  7135. // Do executes the "deploymentmanager.typeProviders.insert" call.
  7136. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7137. // status code is an error. Response headers are in either
  7138. // *Operation.ServerResponse.Header or (if a response was returned at
  7139. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7140. // to check whether the returned error was because
  7141. // http.StatusNotModified was returned.
  7142. func (c *TypeProvidersInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7143. gensupport.SetOptions(c.urlParams_, opts...)
  7144. res, err := c.doRequest("json")
  7145. if res != nil && res.StatusCode == http.StatusNotModified {
  7146. if res.Body != nil {
  7147. res.Body.Close()
  7148. }
  7149. return nil, &googleapi.Error{
  7150. Code: res.StatusCode,
  7151. Header: res.Header,
  7152. }
  7153. }
  7154. if err != nil {
  7155. return nil, err
  7156. }
  7157. defer googleapi.CloseBody(res)
  7158. if err := googleapi.CheckResponse(res); err != nil {
  7159. return nil, err
  7160. }
  7161. ret := &Operation{
  7162. ServerResponse: googleapi.ServerResponse{
  7163. Header: res.Header,
  7164. HTTPStatusCode: res.StatusCode,
  7165. },
  7166. }
  7167. target := &ret
  7168. if err := gensupport.DecodeResponse(target, res); err != nil {
  7169. return nil, err
  7170. }
  7171. return ret, nil
  7172. // {
  7173. // "description": "Creates a type provider.",
  7174. // "httpMethod": "POST",
  7175. // "id": "deploymentmanager.typeProviders.insert",
  7176. // "parameterOrder": [
  7177. // "project"
  7178. // ],
  7179. // "parameters": {
  7180. // "project": {
  7181. // "description": "The project ID for this request.",
  7182. // "location": "path",
  7183. // "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])?))",
  7184. // "required": true,
  7185. // "type": "string"
  7186. // }
  7187. // },
  7188. // "path": "{project}/global/typeProviders",
  7189. // "request": {
  7190. // "$ref": "TypeProvider"
  7191. // },
  7192. // "response": {
  7193. // "$ref": "Operation"
  7194. // },
  7195. // "scopes": [
  7196. // "https://www.googleapis.com/auth/cloud-platform",
  7197. // "https://www.googleapis.com/auth/ndev.cloudman"
  7198. // ]
  7199. // }
  7200. }
  7201. // method id "deploymentmanager.typeProviders.list":
  7202. type TypeProvidersListCall struct {
  7203. s *Service
  7204. project string
  7205. urlParams_ gensupport.URLParams
  7206. ifNoneMatch_ string
  7207. ctx_ context.Context
  7208. header_ http.Header
  7209. }
  7210. // List: Lists all resource type providers for Deployment Manager.
  7211. func (r *TypeProvidersService) List(project string) *TypeProvidersListCall {
  7212. c := &TypeProvidersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7213. c.project = project
  7214. return c
  7215. }
  7216. // Filter sets the optional parameter "filter": A filter expression that
  7217. // filters resources listed in the response. The expression must specify
  7218. // the field name, a comparison operator, and the value that you want to
  7219. // use for filtering. The value must be a string, a number, or a
  7220. // boolean. The comparison operator must be either =, !=, >, or <.
  7221. //
  7222. // For example, if you are filtering Compute Engine instances, you can
  7223. // exclude instances named example-instance by specifying name !=
  7224. // example-instance.
  7225. //
  7226. // You can also filter nested fields. For example, you could specify
  7227. // scheduling.automaticRestart = false to include instances only if they
  7228. // are not scheduled for automatic restarts. You can use filtering on
  7229. // nested fields to filter based on resource labels.
  7230. //
  7231. // To filter on multiple expressions, provide each separate expression
  7232. // within parentheses. For example, (scheduling.automaticRestart = true)
  7233. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  7234. // AND expression. However, you can include AND and OR expressions
  7235. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  7236. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  7237. // true).
  7238. func (c *TypeProvidersListCall) Filter(filter string) *TypeProvidersListCall {
  7239. c.urlParams_.Set("filter", filter)
  7240. return c
  7241. }
  7242. // MaxResults sets the optional parameter "maxResults": The maximum
  7243. // number of results per page that should be returned. If the number of
  7244. // available results is larger than maxResults, Compute Engine returns a
  7245. // nextPageToken that can be used to get the next page of results in
  7246. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  7247. // (Default: 500)
  7248. func (c *TypeProvidersListCall) MaxResults(maxResults int64) *TypeProvidersListCall {
  7249. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7250. return c
  7251. }
  7252. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  7253. // a certain order. By default, results are returned in alphanumerical
  7254. // order based on the resource name.
  7255. //
  7256. // You can also sort results in descending order based on the creation
  7257. // timestamp using orderBy="creationTimestamp desc". This sorts results
  7258. // based on the creationTimestamp field in reverse chronological order
  7259. // (newest result first). Use this to sort resources like operations so
  7260. // that the newest operation is returned first.
  7261. //
  7262. // Currently, only sorting by name or creationTimestamp desc is
  7263. // supported.
  7264. func (c *TypeProvidersListCall) OrderBy(orderBy string) *TypeProvidersListCall {
  7265. c.urlParams_.Set("orderBy", orderBy)
  7266. return c
  7267. }
  7268. // PageToken sets the optional parameter "pageToken": Specifies a page
  7269. // token to use. Set pageToken to the nextPageToken returned by a
  7270. // previous list request to get the next page of results.
  7271. func (c *TypeProvidersListCall) PageToken(pageToken string) *TypeProvidersListCall {
  7272. c.urlParams_.Set("pageToken", pageToken)
  7273. return c
  7274. }
  7275. // Fields allows partial responses to be retrieved. See
  7276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7277. // for more information.
  7278. func (c *TypeProvidersListCall) Fields(s ...googleapi.Field) *TypeProvidersListCall {
  7279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7280. return c
  7281. }
  7282. // IfNoneMatch sets the optional parameter which makes the operation
  7283. // fail if the object's ETag matches the given value. This is useful for
  7284. // getting updates only after the object has changed since the last
  7285. // request. Use googleapi.IsNotModified to check whether the response
  7286. // error from Do is the result of In-None-Match.
  7287. func (c *TypeProvidersListCall) IfNoneMatch(entityTag string) *TypeProvidersListCall {
  7288. c.ifNoneMatch_ = entityTag
  7289. return c
  7290. }
  7291. // Context sets the context to be used in this call's Do method. Any
  7292. // pending HTTP request will be aborted if the provided context is
  7293. // canceled.
  7294. func (c *TypeProvidersListCall) Context(ctx context.Context) *TypeProvidersListCall {
  7295. c.ctx_ = ctx
  7296. return c
  7297. }
  7298. // Header returns an http.Header that can be modified by the caller to
  7299. // add HTTP headers to the request.
  7300. func (c *TypeProvidersListCall) Header() http.Header {
  7301. if c.header_ == nil {
  7302. c.header_ = make(http.Header)
  7303. }
  7304. return c.header_
  7305. }
  7306. func (c *TypeProvidersListCall) doRequest(alt string) (*http.Response, error) {
  7307. reqHeaders := make(http.Header)
  7308. for k, v := range c.header_ {
  7309. reqHeaders[k] = v
  7310. }
  7311. reqHeaders.Set("User-Agent", c.s.userAgent())
  7312. if c.ifNoneMatch_ != "" {
  7313. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7314. }
  7315. var body io.Reader = nil
  7316. c.urlParams_.Set("alt", alt)
  7317. c.urlParams_.Set("prettyPrint", "false")
  7318. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/typeProviders")
  7319. urls += "?" + c.urlParams_.Encode()
  7320. req, err := http.NewRequest("GET", urls, body)
  7321. if err != nil {
  7322. return nil, err
  7323. }
  7324. req.Header = reqHeaders
  7325. googleapi.Expand(req.URL, map[string]string{
  7326. "project": c.project,
  7327. })
  7328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7329. }
  7330. // Do executes the "deploymentmanager.typeProviders.list" call.
  7331. // Exactly one of *TypeProvidersListResponse or error will be non-nil.
  7332. // Any non-2xx status code is an error. Response headers are in either
  7333. // *TypeProvidersListResponse.ServerResponse.Header or (if a response
  7334. // was returned at all) in error.(*googleapi.Error).Header. Use
  7335. // googleapi.IsNotModified to check whether the returned error was
  7336. // because http.StatusNotModified was returned.
  7337. func (c *TypeProvidersListCall) Do(opts ...googleapi.CallOption) (*TypeProvidersListResponse, error) {
  7338. gensupport.SetOptions(c.urlParams_, opts...)
  7339. res, err := c.doRequest("json")
  7340. if res != nil && res.StatusCode == http.StatusNotModified {
  7341. if res.Body != nil {
  7342. res.Body.Close()
  7343. }
  7344. return nil, &googleapi.Error{
  7345. Code: res.StatusCode,
  7346. Header: res.Header,
  7347. }
  7348. }
  7349. if err != nil {
  7350. return nil, err
  7351. }
  7352. defer googleapi.CloseBody(res)
  7353. if err := googleapi.CheckResponse(res); err != nil {
  7354. return nil, err
  7355. }
  7356. ret := &TypeProvidersListResponse{
  7357. ServerResponse: googleapi.ServerResponse{
  7358. Header: res.Header,
  7359. HTTPStatusCode: res.StatusCode,
  7360. },
  7361. }
  7362. target := &ret
  7363. if err := gensupport.DecodeResponse(target, res); err != nil {
  7364. return nil, err
  7365. }
  7366. return ret, nil
  7367. // {
  7368. // "description": "Lists all resource type providers for Deployment Manager.",
  7369. // "httpMethod": "GET",
  7370. // "id": "deploymentmanager.typeProviders.list",
  7371. // "parameterOrder": [
  7372. // "project"
  7373. // ],
  7374. // "parameters": {
  7375. // "filter": {
  7376. // "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).",
  7377. // "location": "query",
  7378. // "type": "string"
  7379. // },
  7380. // "maxResults": {
  7381. // "default": "500",
  7382. // "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)",
  7383. // "format": "uint32",
  7384. // "location": "query",
  7385. // "minimum": "0",
  7386. // "type": "integer"
  7387. // },
  7388. // "orderBy": {
  7389. // "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.",
  7390. // "location": "query",
  7391. // "type": "string"
  7392. // },
  7393. // "pageToken": {
  7394. // "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.",
  7395. // "location": "query",
  7396. // "type": "string"
  7397. // },
  7398. // "project": {
  7399. // "description": "The project ID for this request.",
  7400. // "location": "path",
  7401. // "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])?))",
  7402. // "required": true,
  7403. // "type": "string"
  7404. // }
  7405. // },
  7406. // "path": "{project}/global/typeProviders",
  7407. // "response": {
  7408. // "$ref": "TypeProvidersListResponse"
  7409. // },
  7410. // "scopes": [
  7411. // "https://www.googleapis.com/auth/cloud-platform",
  7412. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7413. // "https://www.googleapis.com/auth/ndev.cloudman",
  7414. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  7415. // ]
  7416. // }
  7417. }
  7418. // Pages invokes f for each page of results.
  7419. // A non-nil error returned from f will halt the iteration.
  7420. // The provided context supersedes any context provided to the Context method.
  7421. func (c *TypeProvidersListCall) Pages(ctx context.Context, f func(*TypeProvidersListResponse) error) error {
  7422. c.ctx_ = ctx
  7423. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7424. for {
  7425. x, err := c.Do()
  7426. if err != nil {
  7427. return err
  7428. }
  7429. if err := f(x); err != nil {
  7430. return err
  7431. }
  7432. if x.NextPageToken == "" {
  7433. return nil
  7434. }
  7435. c.PageToken(x.NextPageToken)
  7436. }
  7437. }
  7438. // method id "deploymentmanager.typeProviders.listTypes":
  7439. type TypeProvidersListTypesCall struct {
  7440. s *Service
  7441. project string
  7442. typeProvider string
  7443. urlParams_ gensupport.URLParams
  7444. ifNoneMatch_ string
  7445. ctx_ context.Context
  7446. header_ http.Header
  7447. }
  7448. // ListTypes: Lists all the type info for a TypeProvider.
  7449. func (r *TypeProvidersService) ListTypes(project string, typeProvider string) *TypeProvidersListTypesCall {
  7450. c := &TypeProvidersListTypesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7451. c.project = project
  7452. c.typeProvider = typeProvider
  7453. return c
  7454. }
  7455. // Filter sets the optional parameter "filter": A filter expression that
  7456. // filters resources listed in the response. The expression must specify
  7457. // the field name, a comparison operator, and the value that you want to
  7458. // use for filtering. The value must be a string, a number, or a
  7459. // boolean. The comparison operator must be either =, !=, >, or <.
  7460. //
  7461. // For example, if you are filtering Compute Engine instances, you can
  7462. // exclude instances named example-instance by specifying name !=
  7463. // example-instance.
  7464. //
  7465. // You can also filter nested fields. For example, you could specify
  7466. // scheduling.automaticRestart = false to include instances only if they
  7467. // are not scheduled for automatic restarts. You can use filtering on
  7468. // nested fields to filter based on resource labels.
  7469. //
  7470. // To filter on multiple expressions, provide each separate expression
  7471. // within parentheses. For example, (scheduling.automaticRestart = true)
  7472. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  7473. // AND expression. However, you can include AND and OR expressions
  7474. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  7475. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  7476. // true).
  7477. func (c *TypeProvidersListTypesCall) Filter(filter string) *TypeProvidersListTypesCall {
  7478. c.urlParams_.Set("filter", filter)
  7479. return c
  7480. }
  7481. // MaxResults sets the optional parameter "maxResults": The maximum
  7482. // number of results per page that should be returned. If the number of
  7483. // available results is larger than maxResults, Compute Engine returns a
  7484. // nextPageToken that can be used to get the next page of results in
  7485. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  7486. // (Default: 500)
  7487. func (c *TypeProvidersListTypesCall) MaxResults(maxResults int64) *TypeProvidersListTypesCall {
  7488. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7489. return c
  7490. }
  7491. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  7492. // a certain order. By default, results are returned in alphanumerical
  7493. // order based on the resource name.
  7494. //
  7495. // You can also sort results in descending order based on the creation
  7496. // timestamp using orderBy="creationTimestamp desc". This sorts results
  7497. // based on the creationTimestamp field in reverse chronological order
  7498. // (newest result first). Use this to sort resources like operations so
  7499. // that the newest operation is returned first.
  7500. //
  7501. // Currently, only sorting by name or creationTimestamp desc is
  7502. // supported.
  7503. func (c *TypeProvidersListTypesCall) OrderBy(orderBy string) *TypeProvidersListTypesCall {
  7504. c.urlParams_.Set("orderBy", orderBy)
  7505. return c
  7506. }
  7507. // PageToken sets the optional parameter "pageToken": Specifies a page
  7508. // token to use. Set pageToken to the nextPageToken returned by a
  7509. // previous list request to get the next page of results.
  7510. func (c *TypeProvidersListTypesCall) PageToken(pageToken string) *TypeProvidersListTypesCall {
  7511. c.urlParams_.Set("pageToken", pageToken)
  7512. return c
  7513. }
  7514. // Fields allows partial responses to be retrieved. See
  7515. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7516. // for more information.
  7517. func (c *TypeProvidersListTypesCall) Fields(s ...googleapi.Field) *TypeProvidersListTypesCall {
  7518. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7519. return c
  7520. }
  7521. // IfNoneMatch sets the optional parameter which makes the operation
  7522. // fail if the object's ETag matches the given value. This is useful for
  7523. // getting updates only after the object has changed since the last
  7524. // request. Use googleapi.IsNotModified to check whether the response
  7525. // error from Do is the result of In-None-Match.
  7526. func (c *TypeProvidersListTypesCall) IfNoneMatch(entityTag string) *TypeProvidersListTypesCall {
  7527. c.ifNoneMatch_ = entityTag
  7528. return c
  7529. }
  7530. // Context sets the context to be used in this call's Do method. Any
  7531. // pending HTTP request will be aborted if the provided context is
  7532. // canceled.
  7533. func (c *TypeProvidersListTypesCall) Context(ctx context.Context) *TypeProvidersListTypesCall {
  7534. c.ctx_ = ctx
  7535. return c
  7536. }
  7537. // Header returns an http.Header that can be modified by the caller to
  7538. // add HTTP headers to the request.
  7539. func (c *TypeProvidersListTypesCall) Header() http.Header {
  7540. if c.header_ == nil {
  7541. c.header_ = make(http.Header)
  7542. }
  7543. return c.header_
  7544. }
  7545. func (c *TypeProvidersListTypesCall) doRequest(alt string) (*http.Response, error) {
  7546. reqHeaders := make(http.Header)
  7547. for k, v := range c.header_ {
  7548. reqHeaders[k] = v
  7549. }
  7550. reqHeaders.Set("User-Agent", c.s.userAgent())
  7551. if c.ifNoneMatch_ != "" {
  7552. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7553. }
  7554. var body io.Reader = nil
  7555. c.urlParams_.Set("alt", alt)
  7556. c.urlParams_.Set("prettyPrint", "false")
  7557. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/typeProviders/{typeProvider}/types")
  7558. urls += "?" + c.urlParams_.Encode()
  7559. req, err := http.NewRequest("GET", urls, body)
  7560. if err != nil {
  7561. return nil, err
  7562. }
  7563. req.Header = reqHeaders
  7564. googleapi.Expand(req.URL, map[string]string{
  7565. "project": c.project,
  7566. "typeProvider": c.typeProvider,
  7567. })
  7568. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7569. }
  7570. // Do executes the "deploymentmanager.typeProviders.listTypes" call.
  7571. // Exactly one of *TypeProvidersListTypesResponse or error will be
  7572. // non-nil. Any non-2xx status code is an error. Response headers are in
  7573. // either *TypeProvidersListTypesResponse.ServerResponse.Header or (if a
  7574. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7575. // googleapi.IsNotModified to check whether the returned error was
  7576. // because http.StatusNotModified was returned.
  7577. func (c *TypeProvidersListTypesCall) Do(opts ...googleapi.CallOption) (*TypeProvidersListTypesResponse, error) {
  7578. gensupport.SetOptions(c.urlParams_, opts...)
  7579. res, err := c.doRequest("json")
  7580. if res != nil && res.StatusCode == http.StatusNotModified {
  7581. if res.Body != nil {
  7582. res.Body.Close()
  7583. }
  7584. return nil, &googleapi.Error{
  7585. Code: res.StatusCode,
  7586. Header: res.Header,
  7587. }
  7588. }
  7589. if err != nil {
  7590. return nil, err
  7591. }
  7592. defer googleapi.CloseBody(res)
  7593. if err := googleapi.CheckResponse(res); err != nil {
  7594. return nil, err
  7595. }
  7596. ret := &TypeProvidersListTypesResponse{
  7597. ServerResponse: googleapi.ServerResponse{
  7598. Header: res.Header,
  7599. HTTPStatusCode: res.StatusCode,
  7600. },
  7601. }
  7602. target := &ret
  7603. if err := gensupport.DecodeResponse(target, res); err != nil {
  7604. return nil, err
  7605. }
  7606. return ret, nil
  7607. // {
  7608. // "description": "Lists all the type info for a TypeProvider.",
  7609. // "httpMethod": "GET",
  7610. // "id": "deploymentmanager.typeProviders.listTypes",
  7611. // "parameterOrder": [
  7612. // "project",
  7613. // "typeProvider"
  7614. // ],
  7615. // "parameters": {
  7616. // "filter": {
  7617. // "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).",
  7618. // "location": "query",
  7619. // "type": "string"
  7620. // },
  7621. // "maxResults": {
  7622. // "default": "500",
  7623. // "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)",
  7624. // "format": "uint32",
  7625. // "location": "query",
  7626. // "minimum": "0",
  7627. // "type": "integer"
  7628. // },
  7629. // "orderBy": {
  7630. // "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.",
  7631. // "location": "query",
  7632. // "type": "string"
  7633. // },
  7634. // "pageToken": {
  7635. // "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.",
  7636. // "location": "query",
  7637. // "type": "string"
  7638. // },
  7639. // "project": {
  7640. // "description": "The project ID for this request.",
  7641. // "location": "path",
  7642. // "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])?))",
  7643. // "required": true,
  7644. // "type": "string"
  7645. // },
  7646. // "typeProvider": {
  7647. // "description": "The name of the type provider for this request.",
  7648. // "location": "path",
  7649. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7650. // "required": true,
  7651. // "type": "string"
  7652. // }
  7653. // },
  7654. // "path": "{project}/global/typeProviders/{typeProvider}/types",
  7655. // "response": {
  7656. // "$ref": "TypeProvidersListTypesResponse"
  7657. // },
  7658. // "scopes": [
  7659. // "https://www.googleapis.com/auth/cloud-platform",
  7660. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  7661. // "https://www.googleapis.com/auth/ndev.cloudman",
  7662. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  7663. // ]
  7664. // }
  7665. }
  7666. // Pages invokes f for each page of results.
  7667. // A non-nil error returned from f will halt the iteration.
  7668. // The provided context supersedes any context provided to the Context method.
  7669. func (c *TypeProvidersListTypesCall) Pages(ctx context.Context, f func(*TypeProvidersListTypesResponse) error) error {
  7670. c.ctx_ = ctx
  7671. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7672. for {
  7673. x, err := c.Do()
  7674. if err != nil {
  7675. return err
  7676. }
  7677. if err := f(x); err != nil {
  7678. return err
  7679. }
  7680. if x.NextPageToken == "" {
  7681. return nil
  7682. }
  7683. c.PageToken(x.NextPageToken)
  7684. }
  7685. }
  7686. // method id "deploymentmanager.typeProviders.patch":
  7687. type TypeProvidersPatchCall struct {
  7688. s *Service
  7689. project string
  7690. typeProvider string
  7691. typeprovider *TypeProvider
  7692. urlParams_ gensupport.URLParams
  7693. ctx_ context.Context
  7694. header_ http.Header
  7695. }
  7696. // Patch: Updates a type provider. This method supports patch semantics.
  7697. func (r *TypeProvidersService) Patch(project string, typeProvider string, typeprovider *TypeProvider) *TypeProvidersPatchCall {
  7698. c := &TypeProvidersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7699. c.project = project
  7700. c.typeProvider = typeProvider
  7701. c.typeprovider = typeprovider
  7702. return c
  7703. }
  7704. // Fields allows partial responses to be retrieved. See
  7705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7706. // for more information.
  7707. func (c *TypeProvidersPatchCall) Fields(s ...googleapi.Field) *TypeProvidersPatchCall {
  7708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7709. return c
  7710. }
  7711. // Context sets the context to be used in this call's Do method. Any
  7712. // pending HTTP request will be aborted if the provided context is
  7713. // canceled.
  7714. func (c *TypeProvidersPatchCall) Context(ctx context.Context) *TypeProvidersPatchCall {
  7715. c.ctx_ = ctx
  7716. return c
  7717. }
  7718. // Header returns an http.Header that can be modified by the caller to
  7719. // add HTTP headers to the request.
  7720. func (c *TypeProvidersPatchCall) Header() http.Header {
  7721. if c.header_ == nil {
  7722. c.header_ = make(http.Header)
  7723. }
  7724. return c.header_
  7725. }
  7726. func (c *TypeProvidersPatchCall) doRequest(alt string) (*http.Response, error) {
  7727. reqHeaders := make(http.Header)
  7728. for k, v := range c.header_ {
  7729. reqHeaders[k] = v
  7730. }
  7731. reqHeaders.Set("User-Agent", c.s.userAgent())
  7732. var body io.Reader = nil
  7733. body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider)
  7734. if err != nil {
  7735. return nil, err
  7736. }
  7737. reqHeaders.Set("Content-Type", "application/json")
  7738. c.urlParams_.Set("alt", alt)
  7739. c.urlParams_.Set("prettyPrint", "false")
  7740. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/typeProviders/{typeProvider}")
  7741. urls += "?" + c.urlParams_.Encode()
  7742. req, err := http.NewRequest("PATCH", urls, body)
  7743. if err != nil {
  7744. return nil, err
  7745. }
  7746. req.Header = reqHeaders
  7747. googleapi.Expand(req.URL, map[string]string{
  7748. "project": c.project,
  7749. "typeProvider": c.typeProvider,
  7750. })
  7751. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7752. }
  7753. // Do executes the "deploymentmanager.typeProviders.patch" call.
  7754. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7755. // status code is an error. Response headers are in either
  7756. // *Operation.ServerResponse.Header or (if a response was returned at
  7757. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7758. // to check whether the returned error was because
  7759. // http.StatusNotModified was returned.
  7760. func (c *TypeProvidersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7761. gensupport.SetOptions(c.urlParams_, opts...)
  7762. res, err := c.doRequest("json")
  7763. if res != nil && res.StatusCode == http.StatusNotModified {
  7764. if res.Body != nil {
  7765. res.Body.Close()
  7766. }
  7767. return nil, &googleapi.Error{
  7768. Code: res.StatusCode,
  7769. Header: res.Header,
  7770. }
  7771. }
  7772. if err != nil {
  7773. return nil, err
  7774. }
  7775. defer googleapi.CloseBody(res)
  7776. if err := googleapi.CheckResponse(res); err != nil {
  7777. return nil, err
  7778. }
  7779. ret := &Operation{
  7780. ServerResponse: googleapi.ServerResponse{
  7781. Header: res.Header,
  7782. HTTPStatusCode: res.StatusCode,
  7783. },
  7784. }
  7785. target := &ret
  7786. if err := gensupport.DecodeResponse(target, res); err != nil {
  7787. return nil, err
  7788. }
  7789. return ret, nil
  7790. // {
  7791. // "description": "Updates a type provider. This method supports patch semantics.",
  7792. // "httpMethod": "PATCH",
  7793. // "id": "deploymentmanager.typeProviders.patch",
  7794. // "parameterOrder": [
  7795. // "project",
  7796. // "typeProvider"
  7797. // ],
  7798. // "parameters": {
  7799. // "project": {
  7800. // "description": "The project ID for this request.",
  7801. // "location": "path",
  7802. // "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])?))",
  7803. // "required": true,
  7804. // "type": "string"
  7805. // },
  7806. // "typeProvider": {
  7807. // "description": "The name of the type provider for this request.",
  7808. // "location": "path",
  7809. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7810. // "required": true,
  7811. // "type": "string"
  7812. // }
  7813. // },
  7814. // "path": "{project}/global/typeProviders/{typeProvider}",
  7815. // "request": {
  7816. // "$ref": "TypeProvider"
  7817. // },
  7818. // "response": {
  7819. // "$ref": "Operation"
  7820. // },
  7821. // "scopes": [
  7822. // "https://www.googleapis.com/auth/cloud-platform",
  7823. // "https://www.googleapis.com/auth/ndev.cloudman"
  7824. // ]
  7825. // }
  7826. }
  7827. // method id "deploymentmanager.typeProviders.update":
  7828. type TypeProvidersUpdateCall struct {
  7829. s *Service
  7830. project string
  7831. typeProvider string
  7832. typeprovider *TypeProvider
  7833. urlParams_ gensupport.URLParams
  7834. ctx_ context.Context
  7835. header_ http.Header
  7836. }
  7837. // Update: Updates a type provider.
  7838. func (r *TypeProvidersService) Update(project string, typeProvider string, typeprovider *TypeProvider) *TypeProvidersUpdateCall {
  7839. c := &TypeProvidersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7840. c.project = project
  7841. c.typeProvider = typeProvider
  7842. c.typeprovider = typeprovider
  7843. return c
  7844. }
  7845. // Fields allows partial responses to be retrieved. See
  7846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7847. // for more information.
  7848. func (c *TypeProvidersUpdateCall) Fields(s ...googleapi.Field) *TypeProvidersUpdateCall {
  7849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7850. return c
  7851. }
  7852. // Context sets the context to be used in this call's Do method. Any
  7853. // pending HTTP request will be aborted if the provided context is
  7854. // canceled.
  7855. func (c *TypeProvidersUpdateCall) Context(ctx context.Context) *TypeProvidersUpdateCall {
  7856. c.ctx_ = ctx
  7857. return c
  7858. }
  7859. // Header returns an http.Header that can be modified by the caller to
  7860. // add HTTP headers to the request.
  7861. func (c *TypeProvidersUpdateCall) Header() http.Header {
  7862. if c.header_ == nil {
  7863. c.header_ = make(http.Header)
  7864. }
  7865. return c.header_
  7866. }
  7867. func (c *TypeProvidersUpdateCall) doRequest(alt string) (*http.Response, error) {
  7868. reqHeaders := make(http.Header)
  7869. for k, v := range c.header_ {
  7870. reqHeaders[k] = v
  7871. }
  7872. reqHeaders.Set("User-Agent", c.s.userAgent())
  7873. var body io.Reader = nil
  7874. body, err := googleapi.WithoutDataWrapper.JSONReader(c.typeprovider)
  7875. if err != nil {
  7876. return nil, err
  7877. }
  7878. reqHeaders.Set("Content-Type", "application/json")
  7879. c.urlParams_.Set("alt", alt)
  7880. c.urlParams_.Set("prettyPrint", "false")
  7881. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/typeProviders/{typeProvider}")
  7882. urls += "?" + c.urlParams_.Encode()
  7883. req, err := http.NewRequest("PUT", urls, body)
  7884. if err != nil {
  7885. return nil, err
  7886. }
  7887. req.Header = reqHeaders
  7888. googleapi.Expand(req.URL, map[string]string{
  7889. "project": c.project,
  7890. "typeProvider": c.typeProvider,
  7891. })
  7892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7893. }
  7894. // Do executes the "deploymentmanager.typeProviders.update" call.
  7895. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7896. // status code is an error. Response headers are in either
  7897. // *Operation.ServerResponse.Header or (if a response was returned at
  7898. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7899. // to check whether the returned error was because
  7900. // http.StatusNotModified was returned.
  7901. func (c *TypeProvidersUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7902. gensupport.SetOptions(c.urlParams_, opts...)
  7903. res, err := c.doRequest("json")
  7904. if res != nil && res.StatusCode == http.StatusNotModified {
  7905. if res.Body != nil {
  7906. res.Body.Close()
  7907. }
  7908. return nil, &googleapi.Error{
  7909. Code: res.StatusCode,
  7910. Header: res.Header,
  7911. }
  7912. }
  7913. if err != nil {
  7914. return nil, err
  7915. }
  7916. defer googleapi.CloseBody(res)
  7917. if err := googleapi.CheckResponse(res); err != nil {
  7918. return nil, err
  7919. }
  7920. ret := &Operation{
  7921. ServerResponse: googleapi.ServerResponse{
  7922. Header: res.Header,
  7923. HTTPStatusCode: res.StatusCode,
  7924. },
  7925. }
  7926. target := &ret
  7927. if err := gensupport.DecodeResponse(target, res); err != nil {
  7928. return nil, err
  7929. }
  7930. return ret, nil
  7931. // {
  7932. // "description": "Updates a type provider.",
  7933. // "httpMethod": "PUT",
  7934. // "id": "deploymentmanager.typeProviders.update",
  7935. // "parameterOrder": [
  7936. // "project",
  7937. // "typeProvider"
  7938. // ],
  7939. // "parameters": {
  7940. // "project": {
  7941. // "description": "The project ID for this request.",
  7942. // "location": "path",
  7943. // "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])?))",
  7944. // "required": true,
  7945. // "type": "string"
  7946. // },
  7947. // "typeProvider": {
  7948. // "description": "The name of the type provider for this request.",
  7949. // "location": "path",
  7950. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  7951. // "required": true,
  7952. // "type": "string"
  7953. // }
  7954. // },
  7955. // "path": "{project}/global/typeProviders/{typeProvider}",
  7956. // "request": {
  7957. // "$ref": "TypeProvider"
  7958. // },
  7959. // "response": {
  7960. // "$ref": "Operation"
  7961. // },
  7962. // "scopes": [
  7963. // "https://www.googleapis.com/auth/cloud-platform",
  7964. // "https://www.googleapis.com/auth/ndev.cloudman"
  7965. // ]
  7966. // }
  7967. }
  7968. // method id "deploymentmanager.types.delete":
  7969. type TypesDeleteCall struct {
  7970. s *Service
  7971. project string
  7972. type_ string
  7973. urlParams_ gensupport.URLParams
  7974. ctx_ context.Context
  7975. header_ http.Header
  7976. }
  7977. // Delete: Deletes a type and all of the resources in the type.
  7978. func (r *TypesService) Delete(project string, type_ string) *TypesDeleteCall {
  7979. c := &TypesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7980. c.project = project
  7981. c.type_ = type_
  7982. return c
  7983. }
  7984. // Fields allows partial responses to be retrieved. See
  7985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7986. // for more information.
  7987. func (c *TypesDeleteCall) Fields(s ...googleapi.Field) *TypesDeleteCall {
  7988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7989. return c
  7990. }
  7991. // Context sets the context to be used in this call's Do method. Any
  7992. // pending HTTP request will be aborted if the provided context is
  7993. // canceled.
  7994. func (c *TypesDeleteCall) Context(ctx context.Context) *TypesDeleteCall {
  7995. c.ctx_ = ctx
  7996. return c
  7997. }
  7998. // Header returns an http.Header that can be modified by the caller to
  7999. // add HTTP headers to the request.
  8000. func (c *TypesDeleteCall) Header() http.Header {
  8001. if c.header_ == nil {
  8002. c.header_ = make(http.Header)
  8003. }
  8004. return c.header_
  8005. }
  8006. func (c *TypesDeleteCall) doRequest(alt string) (*http.Response, error) {
  8007. reqHeaders := make(http.Header)
  8008. for k, v := range c.header_ {
  8009. reqHeaders[k] = v
  8010. }
  8011. reqHeaders.Set("User-Agent", c.s.userAgent())
  8012. var body io.Reader = nil
  8013. c.urlParams_.Set("alt", alt)
  8014. c.urlParams_.Set("prettyPrint", "false")
  8015. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types/{type}")
  8016. urls += "?" + c.urlParams_.Encode()
  8017. req, err := http.NewRequest("DELETE", urls, body)
  8018. if err != nil {
  8019. return nil, err
  8020. }
  8021. req.Header = reqHeaders
  8022. googleapi.Expand(req.URL, map[string]string{
  8023. "project": c.project,
  8024. "type": c.type_,
  8025. })
  8026. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8027. }
  8028. // Do executes the "deploymentmanager.types.delete" call.
  8029. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8030. // status code is an error. Response headers are in either
  8031. // *Operation.ServerResponse.Header or (if a response was returned at
  8032. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8033. // to check whether the returned error was because
  8034. // http.StatusNotModified was returned.
  8035. func (c *TypesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8036. gensupport.SetOptions(c.urlParams_, opts...)
  8037. res, err := c.doRequest("json")
  8038. if res != nil && res.StatusCode == http.StatusNotModified {
  8039. if res.Body != nil {
  8040. res.Body.Close()
  8041. }
  8042. return nil, &googleapi.Error{
  8043. Code: res.StatusCode,
  8044. Header: res.Header,
  8045. }
  8046. }
  8047. if err != nil {
  8048. return nil, err
  8049. }
  8050. defer googleapi.CloseBody(res)
  8051. if err := googleapi.CheckResponse(res); err != nil {
  8052. return nil, err
  8053. }
  8054. ret := &Operation{
  8055. ServerResponse: googleapi.ServerResponse{
  8056. Header: res.Header,
  8057. HTTPStatusCode: res.StatusCode,
  8058. },
  8059. }
  8060. target := &ret
  8061. if err := gensupport.DecodeResponse(target, res); err != nil {
  8062. return nil, err
  8063. }
  8064. return ret, nil
  8065. // {
  8066. // "description": "Deletes a type and all of the resources in the type.",
  8067. // "httpMethod": "DELETE",
  8068. // "id": "deploymentmanager.types.delete",
  8069. // "parameterOrder": [
  8070. // "project",
  8071. // "type"
  8072. // ],
  8073. // "parameters": {
  8074. // "project": {
  8075. // "description": "The project ID for this request.",
  8076. // "location": "path",
  8077. // "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])?))",
  8078. // "required": true,
  8079. // "type": "string"
  8080. // },
  8081. // "type": {
  8082. // "description": "The name of the type for this request.",
  8083. // "location": "path",
  8084. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8085. // "required": true,
  8086. // "type": "string"
  8087. // }
  8088. // },
  8089. // "path": "{project}/global/types/{type}",
  8090. // "response": {
  8091. // "$ref": "Operation"
  8092. // },
  8093. // "scopes": [
  8094. // "https://www.googleapis.com/auth/cloud-platform",
  8095. // "https://www.googleapis.com/auth/ndev.cloudman"
  8096. // ]
  8097. // }
  8098. }
  8099. // method id "deploymentmanager.types.get":
  8100. type TypesGetCall struct {
  8101. s *Service
  8102. project string
  8103. type_ string
  8104. urlParams_ gensupport.URLParams
  8105. ifNoneMatch_ string
  8106. ctx_ context.Context
  8107. header_ http.Header
  8108. }
  8109. // Get: Gets information about a specific type.
  8110. func (r *TypesService) Get(project string, type_ string) *TypesGetCall {
  8111. c := &TypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8112. c.project = project
  8113. c.type_ = type_
  8114. return c
  8115. }
  8116. // Fields allows partial responses to be retrieved. See
  8117. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8118. // for more information.
  8119. func (c *TypesGetCall) Fields(s ...googleapi.Field) *TypesGetCall {
  8120. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8121. return c
  8122. }
  8123. // IfNoneMatch sets the optional parameter which makes the operation
  8124. // fail if the object's ETag matches the given value. This is useful for
  8125. // getting updates only after the object has changed since the last
  8126. // request. Use googleapi.IsNotModified to check whether the response
  8127. // error from Do is the result of In-None-Match.
  8128. func (c *TypesGetCall) IfNoneMatch(entityTag string) *TypesGetCall {
  8129. c.ifNoneMatch_ = entityTag
  8130. return c
  8131. }
  8132. // Context sets the context to be used in this call's Do method. Any
  8133. // pending HTTP request will be aborted if the provided context is
  8134. // canceled.
  8135. func (c *TypesGetCall) Context(ctx context.Context) *TypesGetCall {
  8136. c.ctx_ = ctx
  8137. return c
  8138. }
  8139. // Header returns an http.Header that can be modified by the caller to
  8140. // add HTTP headers to the request.
  8141. func (c *TypesGetCall) Header() http.Header {
  8142. if c.header_ == nil {
  8143. c.header_ = make(http.Header)
  8144. }
  8145. return c.header_
  8146. }
  8147. func (c *TypesGetCall) doRequest(alt string) (*http.Response, error) {
  8148. reqHeaders := make(http.Header)
  8149. for k, v := range c.header_ {
  8150. reqHeaders[k] = v
  8151. }
  8152. reqHeaders.Set("User-Agent", c.s.userAgent())
  8153. if c.ifNoneMatch_ != "" {
  8154. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8155. }
  8156. var body io.Reader = nil
  8157. c.urlParams_.Set("alt", alt)
  8158. c.urlParams_.Set("prettyPrint", "false")
  8159. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types/{type}")
  8160. urls += "?" + c.urlParams_.Encode()
  8161. req, err := http.NewRequest("GET", urls, body)
  8162. if err != nil {
  8163. return nil, err
  8164. }
  8165. req.Header = reqHeaders
  8166. googleapi.Expand(req.URL, map[string]string{
  8167. "project": c.project,
  8168. "type": c.type_,
  8169. })
  8170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8171. }
  8172. // Do executes the "deploymentmanager.types.get" call.
  8173. // Exactly one of *Type or error will be non-nil. Any non-2xx status
  8174. // code is an error. Response headers are in either
  8175. // *Type.ServerResponse.Header or (if a response was returned at all) in
  8176. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8177. // whether the returned error was because http.StatusNotModified was
  8178. // returned.
  8179. func (c *TypesGetCall) Do(opts ...googleapi.CallOption) (*Type, error) {
  8180. gensupport.SetOptions(c.urlParams_, opts...)
  8181. res, err := c.doRequest("json")
  8182. if res != nil && res.StatusCode == http.StatusNotModified {
  8183. if res.Body != nil {
  8184. res.Body.Close()
  8185. }
  8186. return nil, &googleapi.Error{
  8187. Code: res.StatusCode,
  8188. Header: res.Header,
  8189. }
  8190. }
  8191. if err != nil {
  8192. return nil, err
  8193. }
  8194. defer googleapi.CloseBody(res)
  8195. if err := googleapi.CheckResponse(res); err != nil {
  8196. return nil, err
  8197. }
  8198. ret := &Type{
  8199. ServerResponse: googleapi.ServerResponse{
  8200. Header: res.Header,
  8201. HTTPStatusCode: res.StatusCode,
  8202. },
  8203. }
  8204. target := &ret
  8205. if err := gensupport.DecodeResponse(target, res); err != nil {
  8206. return nil, err
  8207. }
  8208. return ret, nil
  8209. // {
  8210. // "description": "Gets information about a specific type.",
  8211. // "httpMethod": "GET",
  8212. // "id": "deploymentmanager.types.get",
  8213. // "parameterOrder": [
  8214. // "project",
  8215. // "type"
  8216. // ],
  8217. // "parameters": {
  8218. // "project": {
  8219. // "description": "The project ID for this request.",
  8220. // "location": "path",
  8221. // "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])?))",
  8222. // "required": true,
  8223. // "type": "string"
  8224. // },
  8225. // "type": {
  8226. // "description": "The name of the type for this request.",
  8227. // "location": "path",
  8228. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8229. // "required": true,
  8230. // "type": "string"
  8231. // }
  8232. // },
  8233. // "path": "{project}/global/types/{type}",
  8234. // "response": {
  8235. // "$ref": "Type"
  8236. // },
  8237. // "scopes": [
  8238. // "https://www.googleapis.com/auth/cloud-platform",
  8239. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  8240. // "https://www.googleapis.com/auth/ndev.cloudman",
  8241. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  8242. // ]
  8243. // }
  8244. }
  8245. // method id "deploymentmanager.types.insert":
  8246. type TypesInsertCall struct {
  8247. s *Service
  8248. project string
  8249. type_ *Type
  8250. urlParams_ gensupport.URLParams
  8251. ctx_ context.Context
  8252. header_ http.Header
  8253. }
  8254. // Insert: Creates a type.
  8255. func (r *TypesService) Insert(project string, type_ *Type) *TypesInsertCall {
  8256. c := &TypesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8257. c.project = project
  8258. c.type_ = type_
  8259. return c
  8260. }
  8261. // Fields allows partial responses to be retrieved. See
  8262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8263. // for more information.
  8264. func (c *TypesInsertCall) Fields(s ...googleapi.Field) *TypesInsertCall {
  8265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8266. return c
  8267. }
  8268. // Context sets the context to be used in this call's Do method. Any
  8269. // pending HTTP request will be aborted if the provided context is
  8270. // canceled.
  8271. func (c *TypesInsertCall) Context(ctx context.Context) *TypesInsertCall {
  8272. c.ctx_ = ctx
  8273. return c
  8274. }
  8275. // Header returns an http.Header that can be modified by the caller to
  8276. // add HTTP headers to the request.
  8277. func (c *TypesInsertCall) Header() http.Header {
  8278. if c.header_ == nil {
  8279. c.header_ = make(http.Header)
  8280. }
  8281. return c.header_
  8282. }
  8283. func (c *TypesInsertCall) doRequest(alt string) (*http.Response, error) {
  8284. reqHeaders := make(http.Header)
  8285. for k, v := range c.header_ {
  8286. reqHeaders[k] = v
  8287. }
  8288. reqHeaders.Set("User-Agent", c.s.userAgent())
  8289. var body io.Reader = nil
  8290. body, err := googleapi.WithoutDataWrapper.JSONReader(c.type_)
  8291. if err != nil {
  8292. return nil, err
  8293. }
  8294. reqHeaders.Set("Content-Type", "application/json")
  8295. c.urlParams_.Set("alt", alt)
  8296. c.urlParams_.Set("prettyPrint", "false")
  8297. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types")
  8298. urls += "?" + c.urlParams_.Encode()
  8299. req, err := http.NewRequest("POST", urls, body)
  8300. if err != nil {
  8301. return nil, err
  8302. }
  8303. req.Header = reqHeaders
  8304. googleapi.Expand(req.URL, map[string]string{
  8305. "project": c.project,
  8306. })
  8307. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8308. }
  8309. // Do executes the "deploymentmanager.types.insert" call.
  8310. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8311. // status code is an error. Response headers are in either
  8312. // *Operation.ServerResponse.Header or (if a response was returned at
  8313. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8314. // to check whether the returned error was because
  8315. // http.StatusNotModified was returned.
  8316. func (c *TypesInsertCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8317. gensupport.SetOptions(c.urlParams_, opts...)
  8318. res, err := c.doRequest("json")
  8319. if res != nil && res.StatusCode == http.StatusNotModified {
  8320. if res.Body != nil {
  8321. res.Body.Close()
  8322. }
  8323. return nil, &googleapi.Error{
  8324. Code: res.StatusCode,
  8325. Header: res.Header,
  8326. }
  8327. }
  8328. if err != nil {
  8329. return nil, err
  8330. }
  8331. defer googleapi.CloseBody(res)
  8332. if err := googleapi.CheckResponse(res); err != nil {
  8333. return nil, err
  8334. }
  8335. ret := &Operation{
  8336. ServerResponse: googleapi.ServerResponse{
  8337. Header: res.Header,
  8338. HTTPStatusCode: res.StatusCode,
  8339. },
  8340. }
  8341. target := &ret
  8342. if err := gensupport.DecodeResponse(target, res); err != nil {
  8343. return nil, err
  8344. }
  8345. return ret, nil
  8346. // {
  8347. // "description": "Creates a type.",
  8348. // "httpMethod": "POST",
  8349. // "id": "deploymentmanager.types.insert",
  8350. // "parameterOrder": [
  8351. // "project"
  8352. // ],
  8353. // "parameters": {
  8354. // "project": {
  8355. // "description": "The project ID for this request.",
  8356. // "location": "path",
  8357. // "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])?))",
  8358. // "required": true,
  8359. // "type": "string"
  8360. // }
  8361. // },
  8362. // "path": "{project}/global/types",
  8363. // "request": {
  8364. // "$ref": "Type"
  8365. // },
  8366. // "response": {
  8367. // "$ref": "Operation"
  8368. // },
  8369. // "scopes": [
  8370. // "https://www.googleapis.com/auth/cloud-platform",
  8371. // "https://www.googleapis.com/auth/ndev.cloudman"
  8372. // ]
  8373. // }
  8374. }
  8375. // method id "deploymentmanager.types.list":
  8376. type TypesListCall struct {
  8377. s *Service
  8378. project string
  8379. urlParams_ gensupport.URLParams
  8380. ifNoneMatch_ string
  8381. ctx_ context.Context
  8382. header_ http.Header
  8383. }
  8384. // List: Lists all resource types for Deployment Manager.
  8385. func (r *TypesService) List(project string) *TypesListCall {
  8386. c := &TypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8387. c.project = project
  8388. return c
  8389. }
  8390. // Filter sets the optional parameter "filter": A filter expression that
  8391. // filters resources listed in the response. The expression must specify
  8392. // the field name, a comparison operator, and the value that you want to
  8393. // use for filtering. The value must be a string, a number, or a
  8394. // boolean. The comparison operator must be either =, !=, >, or <.
  8395. //
  8396. // For example, if you are filtering Compute Engine instances, you can
  8397. // exclude instances named example-instance by specifying name !=
  8398. // example-instance.
  8399. //
  8400. // You can also filter nested fields. For example, you could specify
  8401. // scheduling.automaticRestart = false to include instances only if they
  8402. // are not scheduled for automatic restarts. You can use filtering on
  8403. // nested fields to filter based on resource labels.
  8404. //
  8405. // To filter on multiple expressions, provide each separate expression
  8406. // within parentheses. For example, (scheduling.automaticRestart = true)
  8407. // (cpuPlatform = "Intel Skylake"). By default, each expression is an
  8408. // AND expression. However, you can include AND and OR expressions
  8409. // explicitly. For example, (cpuPlatform = "Intel Skylake") OR
  8410. // (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart =
  8411. // true).
  8412. func (c *TypesListCall) Filter(filter string) *TypesListCall {
  8413. c.urlParams_.Set("filter", filter)
  8414. return c
  8415. }
  8416. // MaxResults sets the optional parameter "maxResults": The maximum
  8417. // number of results per page that should be returned. If the number of
  8418. // available results is larger than maxResults, Compute Engine returns a
  8419. // nextPageToken that can be used to get the next page of results in
  8420. // subsequent list requests. Acceptable values are 0 to 500, inclusive.
  8421. // (Default: 500)
  8422. func (c *TypesListCall) MaxResults(maxResults int64) *TypesListCall {
  8423. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8424. return c
  8425. }
  8426. // OrderBy sets the optional parameter "orderBy": Sorts list results by
  8427. // a certain order. By default, results are returned in alphanumerical
  8428. // order based on the resource name.
  8429. //
  8430. // You can also sort results in descending order based on the creation
  8431. // timestamp using orderBy="creationTimestamp desc". This sorts results
  8432. // based on the creationTimestamp field in reverse chronological order
  8433. // (newest result first). Use this to sort resources like operations so
  8434. // that the newest operation is returned first.
  8435. //
  8436. // Currently, only sorting by name or creationTimestamp desc is
  8437. // supported.
  8438. func (c *TypesListCall) OrderBy(orderBy string) *TypesListCall {
  8439. c.urlParams_.Set("orderBy", orderBy)
  8440. return c
  8441. }
  8442. // PageToken sets the optional parameter "pageToken": Specifies a page
  8443. // token to use. Set pageToken to the nextPageToken returned by a
  8444. // previous list request to get the next page of results.
  8445. func (c *TypesListCall) PageToken(pageToken string) *TypesListCall {
  8446. c.urlParams_.Set("pageToken", pageToken)
  8447. return c
  8448. }
  8449. // Fields allows partial responses to be retrieved. See
  8450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8451. // for more information.
  8452. func (c *TypesListCall) Fields(s ...googleapi.Field) *TypesListCall {
  8453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8454. return c
  8455. }
  8456. // IfNoneMatch sets the optional parameter which makes the operation
  8457. // fail if the object's ETag matches the given value. This is useful for
  8458. // getting updates only after the object has changed since the last
  8459. // request. Use googleapi.IsNotModified to check whether the response
  8460. // error from Do is the result of In-None-Match.
  8461. func (c *TypesListCall) IfNoneMatch(entityTag string) *TypesListCall {
  8462. c.ifNoneMatch_ = entityTag
  8463. return c
  8464. }
  8465. // Context sets the context to be used in this call's Do method. Any
  8466. // pending HTTP request will be aborted if the provided context is
  8467. // canceled.
  8468. func (c *TypesListCall) Context(ctx context.Context) *TypesListCall {
  8469. c.ctx_ = ctx
  8470. return c
  8471. }
  8472. // Header returns an http.Header that can be modified by the caller to
  8473. // add HTTP headers to the request.
  8474. func (c *TypesListCall) Header() http.Header {
  8475. if c.header_ == nil {
  8476. c.header_ = make(http.Header)
  8477. }
  8478. return c.header_
  8479. }
  8480. func (c *TypesListCall) doRequest(alt string) (*http.Response, error) {
  8481. reqHeaders := make(http.Header)
  8482. for k, v := range c.header_ {
  8483. reqHeaders[k] = v
  8484. }
  8485. reqHeaders.Set("User-Agent", c.s.userAgent())
  8486. if c.ifNoneMatch_ != "" {
  8487. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8488. }
  8489. var body io.Reader = nil
  8490. c.urlParams_.Set("alt", alt)
  8491. c.urlParams_.Set("prettyPrint", "false")
  8492. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types")
  8493. urls += "?" + c.urlParams_.Encode()
  8494. req, err := http.NewRequest("GET", urls, body)
  8495. if err != nil {
  8496. return nil, err
  8497. }
  8498. req.Header = reqHeaders
  8499. googleapi.Expand(req.URL, map[string]string{
  8500. "project": c.project,
  8501. })
  8502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8503. }
  8504. // Do executes the "deploymentmanager.types.list" call.
  8505. // Exactly one of *TypesListResponse or error will be non-nil. Any
  8506. // non-2xx status code is an error. Response headers are in either
  8507. // *TypesListResponse.ServerResponse.Header or (if a response was
  8508. // returned at all) in error.(*googleapi.Error).Header. Use
  8509. // googleapi.IsNotModified to check whether the returned error was
  8510. // because http.StatusNotModified was returned.
  8511. func (c *TypesListCall) Do(opts ...googleapi.CallOption) (*TypesListResponse, error) {
  8512. gensupport.SetOptions(c.urlParams_, opts...)
  8513. res, err := c.doRequest("json")
  8514. if res != nil && res.StatusCode == http.StatusNotModified {
  8515. if res.Body != nil {
  8516. res.Body.Close()
  8517. }
  8518. return nil, &googleapi.Error{
  8519. Code: res.StatusCode,
  8520. Header: res.Header,
  8521. }
  8522. }
  8523. if err != nil {
  8524. return nil, err
  8525. }
  8526. defer googleapi.CloseBody(res)
  8527. if err := googleapi.CheckResponse(res); err != nil {
  8528. return nil, err
  8529. }
  8530. ret := &TypesListResponse{
  8531. ServerResponse: googleapi.ServerResponse{
  8532. Header: res.Header,
  8533. HTTPStatusCode: res.StatusCode,
  8534. },
  8535. }
  8536. target := &ret
  8537. if err := gensupport.DecodeResponse(target, res); err != nil {
  8538. return nil, err
  8539. }
  8540. return ret, nil
  8541. // {
  8542. // "description": "Lists all resource types for Deployment Manager.",
  8543. // "httpMethod": "GET",
  8544. // "id": "deploymentmanager.types.list",
  8545. // "parameterOrder": [
  8546. // "project"
  8547. // ],
  8548. // "parameters": {
  8549. // "filter": {
  8550. // "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).",
  8551. // "location": "query",
  8552. // "type": "string"
  8553. // },
  8554. // "maxResults": {
  8555. // "default": "500",
  8556. // "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)",
  8557. // "format": "uint32",
  8558. // "location": "query",
  8559. // "minimum": "0",
  8560. // "type": "integer"
  8561. // },
  8562. // "orderBy": {
  8563. // "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.",
  8564. // "location": "query",
  8565. // "type": "string"
  8566. // },
  8567. // "pageToken": {
  8568. // "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.",
  8569. // "location": "query",
  8570. // "type": "string"
  8571. // },
  8572. // "project": {
  8573. // "description": "The project ID for this request.",
  8574. // "location": "path",
  8575. // "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])?))",
  8576. // "required": true,
  8577. // "type": "string"
  8578. // }
  8579. // },
  8580. // "path": "{project}/global/types",
  8581. // "response": {
  8582. // "$ref": "TypesListResponse"
  8583. // },
  8584. // "scopes": [
  8585. // "https://www.googleapis.com/auth/cloud-platform",
  8586. // "https://www.googleapis.com/auth/cloud-platform.read-only",
  8587. // "https://www.googleapis.com/auth/ndev.cloudman",
  8588. // "https://www.googleapis.com/auth/ndev.cloudman.readonly"
  8589. // ]
  8590. // }
  8591. }
  8592. // Pages invokes f for each page of results.
  8593. // A non-nil error returned from f will halt the iteration.
  8594. // The provided context supersedes any context provided to the Context method.
  8595. func (c *TypesListCall) Pages(ctx context.Context, f func(*TypesListResponse) error) error {
  8596. c.ctx_ = ctx
  8597. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8598. for {
  8599. x, err := c.Do()
  8600. if err != nil {
  8601. return err
  8602. }
  8603. if err := f(x); err != nil {
  8604. return err
  8605. }
  8606. if x.NextPageToken == "" {
  8607. return nil
  8608. }
  8609. c.PageToken(x.NextPageToken)
  8610. }
  8611. }
  8612. // method id "deploymentmanager.types.patch":
  8613. type TypesPatchCall struct {
  8614. s *Service
  8615. project string
  8616. type_ string
  8617. type_2 *Type
  8618. urlParams_ gensupport.URLParams
  8619. ctx_ context.Context
  8620. header_ http.Header
  8621. }
  8622. // Patch: Updates a type. This method supports patch semantics.
  8623. func (r *TypesService) Patch(project string, type_ string, type_2 *Type) *TypesPatchCall {
  8624. c := &TypesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8625. c.project = project
  8626. c.type_ = type_
  8627. c.type_2 = type_2
  8628. return c
  8629. }
  8630. // Fields allows partial responses to be retrieved. See
  8631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8632. // for more information.
  8633. func (c *TypesPatchCall) Fields(s ...googleapi.Field) *TypesPatchCall {
  8634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8635. return c
  8636. }
  8637. // Context sets the context to be used in this call's Do method. Any
  8638. // pending HTTP request will be aborted if the provided context is
  8639. // canceled.
  8640. func (c *TypesPatchCall) Context(ctx context.Context) *TypesPatchCall {
  8641. c.ctx_ = ctx
  8642. return c
  8643. }
  8644. // Header returns an http.Header that can be modified by the caller to
  8645. // add HTTP headers to the request.
  8646. func (c *TypesPatchCall) Header() http.Header {
  8647. if c.header_ == nil {
  8648. c.header_ = make(http.Header)
  8649. }
  8650. return c.header_
  8651. }
  8652. func (c *TypesPatchCall) doRequest(alt string) (*http.Response, error) {
  8653. reqHeaders := make(http.Header)
  8654. for k, v := range c.header_ {
  8655. reqHeaders[k] = v
  8656. }
  8657. reqHeaders.Set("User-Agent", c.s.userAgent())
  8658. var body io.Reader = nil
  8659. body, err := googleapi.WithoutDataWrapper.JSONReader(c.type_2)
  8660. if err != nil {
  8661. return nil, err
  8662. }
  8663. reqHeaders.Set("Content-Type", "application/json")
  8664. c.urlParams_.Set("alt", alt)
  8665. c.urlParams_.Set("prettyPrint", "false")
  8666. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types/{type}")
  8667. urls += "?" + c.urlParams_.Encode()
  8668. req, err := http.NewRequest("PATCH", urls, body)
  8669. if err != nil {
  8670. return nil, err
  8671. }
  8672. req.Header = reqHeaders
  8673. googleapi.Expand(req.URL, map[string]string{
  8674. "project": c.project,
  8675. "type": c.type_,
  8676. })
  8677. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8678. }
  8679. // Do executes the "deploymentmanager.types.patch" call.
  8680. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8681. // status code is an error. Response headers are in either
  8682. // *Operation.ServerResponse.Header or (if a response was returned at
  8683. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8684. // to check whether the returned error was because
  8685. // http.StatusNotModified was returned.
  8686. func (c *TypesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8687. gensupport.SetOptions(c.urlParams_, opts...)
  8688. res, err := c.doRequest("json")
  8689. if res != nil && res.StatusCode == http.StatusNotModified {
  8690. if res.Body != nil {
  8691. res.Body.Close()
  8692. }
  8693. return nil, &googleapi.Error{
  8694. Code: res.StatusCode,
  8695. Header: res.Header,
  8696. }
  8697. }
  8698. if err != nil {
  8699. return nil, err
  8700. }
  8701. defer googleapi.CloseBody(res)
  8702. if err := googleapi.CheckResponse(res); err != nil {
  8703. return nil, err
  8704. }
  8705. ret := &Operation{
  8706. ServerResponse: googleapi.ServerResponse{
  8707. Header: res.Header,
  8708. HTTPStatusCode: res.StatusCode,
  8709. },
  8710. }
  8711. target := &ret
  8712. if err := gensupport.DecodeResponse(target, res); err != nil {
  8713. return nil, err
  8714. }
  8715. return ret, nil
  8716. // {
  8717. // "description": "Updates a type. This method supports patch semantics.",
  8718. // "httpMethod": "PATCH",
  8719. // "id": "deploymentmanager.types.patch",
  8720. // "parameterOrder": [
  8721. // "project",
  8722. // "type"
  8723. // ],
  8724. // "parameters": {
  8725. // "project": {
  8726. // "description": "The project ID for this request.",
  8727. // "location": "path",
  8728. // "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])?))",
  8729. // "required": true,
  8730. // "type": "string"
  8731. // },
  8732. // "type": {
  8733. // "description": "The name of the type for this request.",
  8734. // "location": "path",
  8735. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8736. // "required": true,
  8737. // "type": "string"
  8738. // }
  8739. // },
  8740. // "path": "{project}/global/types/{type}",
  8741. // "request": {
  8742. // "$ref": "Type"
  8743. // },
  8744. // "response": {
  8745. // "$ref": "Operation"
  8746. // },
  8747. // "scopes": [
  8748. // "https://www.googleapis.com/auth/cloud-platform",
  8749. // "https://www.googleapis.com/auth/ndev.cloudman"
  8750. // ]
  8751. // }
  8752. }
  8753. // method id "deploymentmanager.types.update":
  8754. type TypesUpdateCall struct {
  8755. s *Service
  8756. project string
  8757. type_ string
  8758. type_2 *Type
  8759. urlParams_ gensupport.URLParams
  8760. ctx_ context.Context
  8761. header_ http.Header
  8762. }
  8763. // Update: Updates a type.
  8764. func (r *TypesService) Update(project string, type_ string, type_2 *Type) *TypesUpdateCall {
  8765. c := &TypesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8766. c.project = project
  8767. c.type_ = type_
  8768. c.type_2 = type_2
  8769. return c
  8770. }
  8771. // Fields allows partial responses to be retrieved. See
  8772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8773. // for more information.
  8774. func (c *TypesUpdateCall) Fields(s ...googleapi.Field) *TypesUpdateCall {
  8775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8776. return c
  8777. }
  8778. // Context sets the context to be used in this call's Do method. Any
  8779. // pending HTTP request will be aborted if the provided context is
  8780. // canceled.
  8781. func (c *TypesUpdateCall) Context(ctx context.Context) *TypesUpdateCall {
  8782. c.ctx_ = ctx
  8783. return c
  8784. }
  8785. // Header returns an http.Header that can be modified by the caller to
  8786. // add HTTP headers to the request.
  8787. func (c *TypesUpdateCall) Header() http.Header {
  8788. if c.header_ == nil {
  8789. c.header_ = make(http.Header)
  8790. }
  8791. return c.header_
  8792. }
  8793. func (c *TypesUpdateCall) doRequest(alt string) (*http.Response, error) {
  8794. reqHeaders := make(http.Header)
  8795. for k, v := range c.header_ {
  8796. reqHeaders[k] = v
  8797. }
  8798. reqHeaders.Set("User-Agent", c.s.userAgent())
  8799. var body io.Reader = nil
  8800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.type_2)
  8801. if err != nil {
  8802. return nil, err
  8803. }
  8804. reqHeaders.Set("Content-Type", "application/json")
  8805. c.urlParams_.Set("alt", alt)
  8806. c.urlParams_.Set("prettyPrint", "false")
  8807. urls := googleapi.ResolveRelative(c.s.BasePath, "{project}/global/types/{type}")
  8808. urls += "?" + c.urlParams_.Encode()
  8809. req, err := http.NewRequest("PUT", urls, body)
  8810. if err != nil {
  8811. return nil, err
  8812. }
  8813. req.Header = reqHeaders
  8814. googleapi.Expand(req.URL, map[string]string{
  8815. "project": c.project,
  8816. "type": c.type_,
  8817. })
  8818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8819. }
  8820. // Do executes the "deploymentmanager.types.update" call.
  8821. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8822. // status code is an error. Response headers are in either
  8823. // *Operation.ServerResponse.Header or (if a response was returned at
  8824. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8825. // to check whether the returned error was because
  8826. // http.StatusNotModified was returned.
  8827. func (c *TypesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8828. gensupport.SetOptions(c.urlParams_, opts...)
  8829. res, err := c.doRequest("json")
  8830. if res != nil && res.StatusCode == http.StatusNotModified {
  8831. if res.Body != nil {
  8832. res.Body.Close()
  8833. }
  8834. return nil, &googleapi.Error{
  8835. Code: res.StatusCode,
  8836. Header: res.Header,
  8837. }
  8838. }
  8839. if err != nil {
  8840. return nil, err
  8841. }
  8842. defer googleapi.CloseBody(res)
  8843. if err := googleapi.CheckResponse(res); err != nil {
  8844. return nil, err
  8845. }
  8846. ret := &Operation{
  8847. ServerResponse: googleapi.ServerResponse{
  8848. Header: res.Header,
  8849. HTTPStatusCode: res.StatusCode,
  8850. },
  8851. }
  8852. target := &ret
  8853. if err := gensupport.DecodeResponse(target, res); err != nil {
  8854. return nil, err
  8855. }
  8856. return ret, nil
  8857. // {
  8858. // "description": "Updates a type.",
  8859. // "httpMethod": "PUT",
  8860. // "id": "deploymentmanager.types.update",
  8861. // "parameterOrder": [
  8862. // "project",
  8863. // "type"
  8864. // ],
  8865. // "parameters": {
  8866. // "project": {
  8867. // "description": "The project ID for this request.",
  8868. // "location": "path",
  8869. // "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])?))",
  8870. // "required": true,
  8871. // "type": "string"
  8872. // },
  8873. // "type": {
  8874. // "description": "The name of the type for this request.",
  8875. // "location": "path",
  8876. // "pattern": "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?",
  8877. // "required": true,
  8878. // "type": "string"
  8879. // }
  8880. // },
  8881. // "path": "{project}/global/types/{type}",
  8882. // "request": {
  8883. // "$ref": "Type"
  8884. // },
  8885. // "response": {
  8886. // "$ref": "Operation"
  8887. // },
  8888. // "scopes": [
  8889. // "https://www.googleapis.com/auth/cloud-platform",
  8890. // "https://www.googleapis.com/auth/ndev.cloudman"
  8891. // ]
  8892. // }
  8893. }