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

5415 satır
193 KiB

  1. // Copyright YEAR 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 appengine provides access to the Google App Engine Admin API.
  6. //
  7. // For product documentation, see: https://cloud.google.com/appengine/docs/admin-api/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/appengine/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // appengineService, err := appengine.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. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // appengineService, err := appengine.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // appengineService, err := appengine.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package appengine // import "google.golang.org/api/appengine/v1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "appengine:v1"
  67. const apiName = "appengine"
  68. const apiVersion = "v1"
  69. const basePath = "https://appengine.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new APIService.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new APIService. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*APIService, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &APIService{client: client, BasePath: basePath}
  105. s.Apps = NewAppsService(s)
  106. return s, nil
  107. }
  108. type APIService struct {
  109. client *http.Client
  110. BasePath string // API endpoint base URL
  111. UserAgent string // optional additional User-Agent fragment
  112. Apps *AppsService
  113. }
  114. func (s *APIService) userAgent() string {
  115. if s.UserAgent == "" {
  116. return googleapi.UserAgent
  117. }
  118. return googleapi.UserAgent + " " + s.UserAgent
  119. }
  120. func NewAppsService(s *APIService) *AppsService {
  121. rs := &AppsService{s: s}
  122. rs.Locations = NewAppsLocationsService(s)
  123. rs.Operations = NewAppsOperationsService(s)
  124. rs.Services = NewAppsServicesService(s)
  125. return rs
  126. }
  127. type AppsService struct {
  128. s *APIService
  129. Locations *AppsLocationsService
  130. Operations *AppsOperationsService
  131. Services *AppsServicesService
  132. }
  133. func NewAppsLocationsService(s *APIService) *AppsLocationsService {
  134. rs := &AppsLocationsService{s: s}
  135. return rs
  136. }
  137. type AppsLocationsService struct {
  138. s *APIService
  139. }
  140. func NewAppsOperationsService(s *APIService) *AppsOperationsService {
  141. rs := &AppsOperationsService{s: s}
  142. return rs
  143. }
  144. type AppsOperationsService struct {
  145. s *APIService
  146. }
  147. func NewAppsServicesService(s *APIService) *AppsServicesService {
  148. rs := &AppsServicesService{s: s}
  149. rs.Versions = NewAppsServicesVersionsService(s)
  150. return rs
  151. }
  152. type AppsServicesService struct {
  153. s *APIService
  154. Versions *AppsServicesVersionsService
  155. }
  156. func NewAppsServicesVersionsService(s *APIService) *AppsServicesVersionsService {
  157. rs := &AppsServicesVersionsService{s: s}
  158. rs.Instances = NewAppsServicesVersionsInstancesService(s)
  159. return rs
  160. }
  161. type AppsServicesVersionsService struct {
  162. s *APIService
  163. Instances *AppsServicesVersionsInstancesService
  164. }
  165. func NewAppsServicesVersionsInstancesService(s *APIService) *AppsServicesVersionsInstancesService {
  166. rs := &AppsServicesVersionsInstancesService{s: s}
  167. return rs
  168. }
  169. type AppsServicesVersionsInstancesService struct {
  170. s *APIService
  171. }
  172. // ApiConfigHandler: [Google Cloud
  173. // Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/)
  174. // configuration for API handlers.
  175. type ApiConfigHandler struct {
  176. // AuthFailAction: Action to take when users access resources that
  177. // require authentication. Defaults to `redirect`.
  178. //
  179. // Possible values:
  180. // "AUTH_FAIL_ACTION_UNSPECIFIED"
  181. // "AUTH_FAIL_ACTION_REDIRECT"
  182. // "AUTH_FAIL_ACTION_UNAUTHORIZED"
  183. AuthFailAction string `json:"authFailAction,omitempty"`
  184. // Login: Level of login required to access this resource. Defaults to
  185. // `optional`.
  186. //
  187. // Possible values:
  188. // "LOGIN_UNSPECIFIED"
  189. // "LOGIN_OPTIONAL"
  190. // "LOGIN_ADMIN"
  191. // "LOGIN_REQUIRED"
  192. Login string `json:"login,omitempty"`
  193. // Script: Path to the script from the application root directory.
  194. Script string `json:"script,omitempty"`
  195. // SecurityLevel: Security (HTTPS) enforcement for this URL.
  196. //
  197. // Possible values:
  198. // "SECURE_UNSPECIFIED"
  199. // "SECURE_DEFAULT"
  200. // "SECURE_NEVER"
  201. // "SECURE_OPTIONAL"
  202. // "SECURE_ALWAYS"
  203. SecurityLevel string `json:"securityLevel,omitempty"`
  204. // Url: URL to serve the endpoint at.
  205. Url string `json:"url,omitempty"`
  206. // ForceSendFields is a list of field names (e.g. "AuthFailAction") to
  207. // unconditionally include in API requests. By default, fields with
  208. // empty values are omitted from API requests. However, any non-pointer,
  209. // non-interface field appearing in ForceSendFields will be sent to the
  210. // server regardless of whether the field is empty or not. This may be
  211. // used to include empty fields in Patch requests.
  212. ForceSendFields []string `json:"-"`
  213. // NullFields is a list of field names (e.g. "AuthFailAction") to
  214. // include in API requests with the JSON null value. By default, fields
  215. // with empty values are omitted from API requests. However, any field
  216. // with an empty value appearing in NullFields will be sent to the
  217. // server as null. It is an error if a field in this list has a
  218. // non-empty value. This may be used to include null fields in Patch
  219. // requests.
  220. NullFields []string `json:"-"`
  221. }
  222. func (s *ApiConfigHandler) MarshalJSON() ([]byte, error) {
  223. type NoMethod ApiConfigHandler
  224. raw := NoMethod(*s)
  225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  226. }
  227. // ApiEndpointHandler: Uses Google Cloud Endpoints to handle requests.
  228. type ApiEndpointHandler struct {
  229. // ScriptPath: Path to the script from the application root directory.
  230. ScriptPath string `json:"scriptPath,omitempty"`
  231. // ForceSendFields is a list of field names (e.g. "ScriptPath") to
  232. // unconditionally include in API requests. By default, fields with
  233. // empty values are omitted from API requests. However, any non-pointer,
  234. // non-interface field appearing in ForceSendFields will be sent to the
  235. // server regardless of whether the field is empty or not. This may be
  236. // used to include empty fields in Patch requests.
  237. ForceSendFields []string `json:"-"`
  238. // NullFields is a list of field names (e.g. "ScriptPath") to include in
  239. // API requests with the JSON null value. By default, fields with empty
  240. // values are omitted from API requests. However, any field with an
  241. // empty value appearing in NullFields will be sent to the server as
  242. // null. It is an error if a field in this list has a non-empty value.
  243. // This may be used to include null fields in Patch requests.
  244. NullFields []string `json:"-"`
  245. }
  246. func (s *ApiEndpointHandler) MarshalJSON() ([]byte, error) {
  247. type NoMethod ApiEndpointHandler
  248. raw := NoMethod(*s)
  249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  250. }
  251. // Application: An Application resource contains the top-level
  252. // configuration of an App Engine application.
  253. type Application struct {
  254. // AuthDomain: Google Apps authentication domain that controls which
  255. // users can access this application. Defaults to open access for any
  256. // Google Account.
  257. AuthDomain string `json:"authDomain,omitempty"`
  258. // CodeBucket: Google Cloud Storage bucket that can be used for storing
  259. // files associated with this application. This bucket is associated
  260. // with the application and can be used by the gcloud deployment
  261. // commands. @OutputOnly
  262. CodeBucket string `json:"codeBucket,omitempty"`
  263. // DefaultBucket: Google Cloud Storage bucket that can be used by this
  264. // application to store content. @OutputOnly
  265. DefaultBucket string `json:"defaultBucket,omitempty"`
  266. // DefaultCookieExpiration: Cookie expiration policy for this
  267. // application. @OutputOnly
  268. DefaultCookieExpiration string `json:"defaultCookieExpiration,omitempty"`
  269. // DefaultHostname: Hostname used to reach this application, as resolved
  270. // by App Engine. @OutputOnly
  271. DefaultHostname string `json:"defaultHostname,omitempty"`
  272. // DispatchRules: HTTP path dispatch rules for requests to the
  273. // application that do not explicitly target a service or version. Rules
  274. // are order-dependent. @OutputOnly
  275. DispatchRules []*UrlDispatchRule `json:"dispatchRules,omitempty"`
  276. // Id: Identifier of the Application resource. This identifier is
  277. // equivalent to the project ID of the Google Cloud Platform project
  278. // where you want to deploy your application. Example: `myapp`.
  279. Id string `json:"id,omitempty"`
  280. // LocationId: Location from which this application will be run.
  281. // Application instances will run out of data centers in the chosen
  282. // location, which is also where all of the application's end user
  283. // content is stored. Defaults to `us-central`. Options are:
  284. // `us-central` - Central US `europe-west` - Western Europe `us-east1` -
  285. // Eastern US
  286. LocationId string `json:"locationId,omitempty"`
  287. // Name: Full path to the Application resource in the API. Example:
  288. // `apps/myapp`. @OutputOnly
  289. Name string `json:"name,omitempty"`
  290. // ServerResponse contains the HTTP response code and headers from the
  291. // server.
  292. googleapi.ServerResponse `json:"-"`
  293. // ForceSendFields is a list of field names (e.g. "AuthDomain") to
  294. // unconditionally include in API requests. By default, fields with
  295. // empty values are omitted from API requests. However, any non-pointer,
  296. // non-interface field appearing in ForceSendFields will be sent to the
  297. // server regardless of whether the field is empty or not. This may be
  298. // used to include empty fields in Patch requests.
  299. ForceSendFields []string `json:"-"`
  300. // NullFields is a list of field names (e.g. "AuthDomain") to include in
  301. // API requests with the JSON null value. By default, fields with empty
  302. // values are omitted from API requests. However, any field with an
  303. // empty value appearing in NullFields will be sent to the server as
  304. // null. It is an error if a field in this list has a non-empty value.
  305. // This may be used to include null fields in Patch requests.
  306. NullFields []string `json:"-"`
  307. }
  308. func (s *Application) MarshalJSON() ([]byte, error) {
  309. type NoMethod Application
  310. raw := NoMethod(*s)
  311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  312. }
  313. // AutomaticScaling: Automatic scaling is based on request rate,
  314. // response latencies, and other application metrics.
  315. type AutomaticScaling struct {
  316. // CoolDownPeriod: Amount of time that the
  317. // [Autoscaler](https://cloud.google.com/compute/docs/autoscaler/)
  318. // should wait between changes to the number of virtual machines. Only
  319. // applicable for VM runtimes.
  320. CoolDownPeriod string `json:"coolDownPeriod,omitempty"`
  321. // CpuUtilization: Target scaling by CPU usage.
  322. CpuUtilization *CpuUtilization `json:"cpuUtilization,omitempty"`
  323. // DiskUtilization: Target scaling by disk usage.
  324. DiskUtilization *DiskUtilization `json:"diskUtilization,omitempty"`
  325. // MaxConcurrentRequests: Number of concurrent requests an automatic
  326. // scaling instance can accept before the scheduler spawns a new
  327. // instance. Defaults to a runtime-specific value.
  328. MaxConcurrentRequests int64 `json:"maxConcurrentRequests,omitempty"`
  329. // MaxIdleInstances: Maximum number of idle instances that should be
  330. // maintained for this version.
  331. MaxIdleInstances int64 `json:"maxIdleInstances,omitempty"`
  332. // MaxPendingLatency: Maximum amount of time that a request should wait
  333. // in the pending queue before starting a new instance to handle it.
  334. MaxPendingLatency string `json:"maxPendingLatency,omitempty"`
  335. // MaxTotalInstances: Maximum number of instances that should be started
  336. // to handle requests.
  337. MaxTotalInstances int64 `json:"maxTotalInstances,omitempty"`
  338. // MinIdleInstances: Minimum number of idle instances that should be
  339. // maintained for this version. Only applicable for the default version
  340. // of a service.
  341. MinIdleInstances int64 `json:"minIdleInstances,omitempty"`
  342. // MinPendingLatency: Minimum amount of time a request should wait in
  343. // the pending queue before starting a new instance to handle it.
  344. MinPendingLatency string `json:"minPendingLatency,omitempty"`
  345. // MinTotalInstances: Minimum number of instances that should be
  346. // maintained for this version.
  347. MinTotalInstances int64 `json:"minTotalInstances,omitempty"`
  348. // NetworkUtilization: Target scaling by network usage.
  349. NetworkUtilization *NetworkUtilization `json:"networkUtilization,omitempty"`
  350. // RequestUtilization: Target scaling by request utilization.
  351. RequestUtilization *RequestUtilization `json:"requestUtilization,omitempty"`
  352. // ForceSendFields is a list of field names (e.g. "CoolDownPeriod") to
  353. // unconditionally include in API requests. By default, fields with
  354. // empty values are omitted from API requests. However, any non-pointer,
  355. // non-interface field appearing in ForceSendFields will be sent to the
  356. // server regardless of whether the field is empty or not. This may be
  357. // used to include empty fields in Patch requests.
  358. ForceSendFields []string `json:"-"`
  359. // NullFields is a list of field names (e.g. "CoolDownPeriod") to
  360. // include in API requests with the JSON null value. By default, fields
  361. // with empty values are omitted from API requests. However, any field
  362. // with an empty value appearing in NullFields will be sent to the
  363. // server as null. It is an error if a field in this list has a
  364. // non-empty value. This may be used to include null fields in Patch
  365. // requests.
  366. NullFields []string `json:"-"`
  367. }
  368. func (s *AutomaticScaling) MarshalJSON() ([]byte, error) {
  369. type NoMethod AutomaticScaling
  370. raw := NoMethod(*s)
  371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  372. }
  373. // BasicScaling: A service with basic scaling will create an instance
  374. // when the application receives a request. The instance will be turned
  375. // down when the app becomes idle. Basic scaling is ideal for work that
  376. // is intermittent or driven by user activity.
  377. type BasicScaling struct {
  378. // IdleTimeout: Duration of time after the last request that an instance
  379. // must wait before the instance is shut down.
  380. IdleTimeout string `json:"idleTimeout,omitempty"`
  381. // MaxInstances: Maximum number of instances to create for this version.
  382. MaxInstances int64 `json:"maxInstances,omitempty"`
  383. // ForceSendFields is a list of field names (e.g. "IdleTimeout") to
  384. // unconditionally include in API requests. By default, fields with
  385. // empty values are omitted from API requests. However, any non-pointer,
  386. // non-interface field appearing in ForceSendFields will be sent to the
  387. // server regardless of whether the field is empty or not. This may be
  388. // used to include empty fields in Patch requests.
  389. ForceSendFields []string `json:"-"`
  390. // NullFields is a list of field names (e.g. "IdleTimeout") to include
  391. // in API requests with the JSON null value. By default, fields with
  392. // empty values are omitted from API requests. However, any field with
  393. // an empty value appearing in NullFields will be sent to the server as
  394. // null. It is an error if a field in this list has a non-empty value.
  395. // This may be used to include null fields in Patch requests.
  396. NullFields []string `json:"-"`
  397. }
  398. func (s *BasicScaling) MarshalJSON() ([]byte, error) {
  399. type NoMethod BasicScaling
  400. raw := NoMethod(*s)
  401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  402. }
  403. // ContainerInfo: Docker image that is used to start a VM container for
  404. // the version you deploy.
  405. type ContainerInfo struct {
  406. // Image: URI to the hosted container image in a Docker repository. The
  407. // URI must be fully qualified and include a tag or digest. Examples:
  408. // "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest"
  409. Image string `json:"image,omitempty"`
  410. // ForceSendFields is a list of field names (e.g. "Image") to
  411. // unconditionally include in API requests. By default, fields with
  412. // empty values are omitted from API requests. However, any non-pointer,
  413. // non-interface field appearing in ForceSendFields will be sent to the
  414. // server regardless of whether the field is empty or not. This may be
  415. // used to include empty fields in Patch requests.
  416. ForceSendFields []string `json:"-"`
  417. // NullFields is a list of field names (e.g. "Image") to include in API
  418. // requests with the JSON null value. By default, fields with empty
  419. // values are omitted from API requests. However, any field with an
  420. // empty value appearing in NullFields will be sent to the server as
  421. // null. It is an error if a field in this list has a non-empty value.
  422. // This may be used to include null fields in Patch requests.
  423. NullFields []string `json:"-"`
  424. }
  425. func (s *ContainerInfo) MarshalJSON() ([]byte, error) {
  426. type NoMethod ContainerInfo
  427. raw := NoMethod(*s)
  428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  429. }
  430. // CpuUtilization: Target scaling by CPU usage.
  431. type CpuUtilization struct {
  432. // AggregationWindowLength: Period of time over which CPU utilization is
  433. // calculated.
  434. AggregationWindowLength string `json:"aggregationWindowLength,omitempty"`
  435. // TargetUtilization: Target CPU utilization ratio to maintain when
  436. // scaling. Must be between 0 and 1.
  437. TargetUtilization float64 `json:"targetUtilization,omitempty"`
  438. // ForceSendFields is a list of field names (e.g.
  439. // "AggregationWindowLength") to unconditionally include in API
  440. // requests. By default, fields with empty values are omitted from API
  441. // requests. However, any non-pointer, non-interface field appearing in
  442. // ForceSendFields will be sent to the server regardless of whether the
  443. // field is empty or not. This may be used to include empty fields in
  444. // Patch requests.
  445. ForceSendFields []string `json:"-"`
  446. // NullFields is a list of field names (e.g. "AggregationWindowLength")
  447. // to include in API requests with the JSON null value. By default,
  448. // fields with empty values are omitted from API requests. However, any
  449. // field with an empty value appearing in NullFields will be sent to the
  450. // server as null. It is an error if a field in this list has a
  451. // non-empty value. This may be used to include null fields in Patch
  452. // requests.
  453. NullFields []string `json:"-"`
  454. }
  455. func (s *CpuUtilization) MarshalJSON() ([]byte, error) {
  456. type NoMethod CpuUtilization
  457. raw := NoMethod(*s)
  458. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  459. }
  460. func (s *CpuUtilization) UnmarshalJSON(data []byte) error {
  461. type NoMethod CpuUtilization
  462. var s1 struct {
  463. TargetUtilization gensupport.JSONFloat64 `json:"targetUtilization"`
  464. *NoMethod
  465. }
  466. s1.NoMethod = (*NoMethod)(s)
  467. if err := json.Unmarshal(data, &s1); err != nil {
  468. return err
  469. }
  470. s.TargetUtilization = float64(s1.TargetUtilization)
  471. return nil
  472. }
  473. // DebugInstanceRequest: Request message for `Instances.DebugInstance`.
  474. type DebugInstanceRequest struct {
  475. }
  476. // Deployment: Code and application artifacts used to deploy a version
  477. // to App Engine.
  478. type Deployment struct {
  479. // Container: A Docker image that App Engine uses to run the version.
  480. // Only applicable for instances in App Engine flexible environment.
  481. Container *ContainerInfo `json:"container,omitempty"`
  482. // Files: Manifest of the files stored in Google Cloud Storage that are
  483. // included as part of this version. All files must be readable using
  484. // the credentials supplied with this call.
  485. Files map[string]FileInfo `json:"files,omitempty"`
  486. // Zip: The zip file for this deployment, if this is a zip deployment.
  487. Zip *ZipInfo `json:"zip,omitempty"`
  488. // ForceSendFields is a list of field names (e.g. "Container") to
  489. // unconditionally include in API requests. By default, fields with
  490. // empty values are omitted from API requests. However, any non-pointer,
  491. // non-interface field appearing in ForceSendFields will be sent to the
  492. // server regardless of whether the field is empty or not. This may be
  493. // used to include empty fields in Patch requests.
  494. ForceSendFields []string `json:"-"`
  495. // NullFields is a list of field names (e.g. "Container") to include in
  496. // API requests with the JSON null value. By default, fields with empty
  497. // values are omitted from API requests. However, any field with an
  498. // empty value appearing in NullFields will be sent to the server as
  499. // null. It is an error if a field in this list has a non-empty value.
  500. // This may be used to include null fields in Patch requests.
  501. NullFields []string `json:"-"`
  502. }
  503. func (s *Deployment) MarshalJSON() ([]byte, error) {
  504. type NoMethod Deployment
  505. raw := NoMethod(*s)
  506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  507. }
  508. // DiskUtilization: Target scaling by disk usage. Only applicable for VM
  509. // runtimes.
  510. type DiskUtilization struct {
  511. // TargetReadBytesPerSecond: Target bytes read per second.
  512. TargetReadBytesPerSecond int64 `json:"targetReadBytesPerSecond,omitempty"`
  513. // TargetReadOpsPerSecond: Target ops read per seconds.
  514. TargetReadOpsPerSecond int64 `json:"targetReadOpsPerSecond,omitempty"`
  515. // TargetWriteBytesPerSecond: Target bytes written per second.
  516. TargetWriteBytesPerSecond int64 `json:"targetWriteBytesPerSecond,omitempty"`
  517. // TargetWriteOpsPerSecond: Target ops written per second.
  518. TargetWriteOpsPerSecond int64 `json:"targetWriteOpsPerSecond,omitempty"`
  519. // ForceSendFields is a list of field names (e.g.
  520. // "TargetReadBytesPerSecond") to unconditionally include in API
  521. // requests. By default, fields with empty values are omitted from API
  522. // requests. However, any non-pointer, non-interface field appearing in
  523. // ForceSendFields will be sent to the server regardless of whether the
  524. // field is empty or not. This may be used to include empty fields in
  525. // Patch requests.
  526. ForceSendFields []string `json:"-"`
  527. // NullFields is a list of field names (e.g. "TargetReadBytesPerSecond")
  528. // to include in API requests with the JSON null value. By default,
  529. // fields with empty values are omitted from API requests. However, any
  530. // field with an empty value appearing in NullFields will be sent to the
  531. // server as null. It is an error if a field in this list has a
  532. // non-empty value. This may be used to include null fields in Patch
  533. // requests.
  534. NullFields []string `json:"-"`
  535. }
  536. func (s *DiskUtilization) MarshalJSON() ([]byte, error) {
  537. type NoMethod DiskUtilization
  538. raw := NoMethod(*s)
  539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  540. }
  541. // ErrorHandler: Custom static error page to be served when an error
  542. // occurs.
  543. type ErrorHandler struct {
  544. // ErrorCode: Error condition this handler applies to.
  545. //
  546. // Possible values:
  547. // "ERROR_CODE_UNSPECIFIED"
  548. // "ERROR_CODE_DEFAULT"
  549. // "ERROR_CODE_OVER_QUOTA"
  550. // "ERROR_CODE_DOS_API_DENIAL"
  551. // "ERROR_CODE_TIMEOUT"
  552. ErrorCode string `json:"errorCode,omitempty"`
  553. // MimeType: MIME type of file. Defaults to `text/html`.
  554. MimeType string `json:"mimeType,omitempty"`
  555. // StaticFile: Static file content to be served for this error.
  556. StaticFile string `json:"staticFile,omitempty"`
  557. // ForceSendFields is a list of field names (e.g. "ErrorCode") to
  558. // unconditionally include in API requests. By default, fields with
  559. // empty values are omitted from API requests. However, any non-pointer,
  560. // non-interface field appearing in ForceSendFields will be sent to the
  561. // server regardless of whether the field is empty or not. This may be
  562. // used to include empty fields in Patch requests.
  563. ForceSendFields []string `json:"-"`
  564. // NullFields is a list of field names (e.g. "ErrorCode") to include in
  565. // API requests with the JSON null value. By default, fields with empty
  566. // values are omitted from API requests. However, any field with an
  567. // empty value appearing in NullFields will be sent to the server as
  568. // null. It is an error if a field in this list has a non-empty value.
  569. // This may be used to include null fields in Patch requests.
  570. NullFields []string `json:"-"`
  571. }
  572. func (s *ErrorHandler) MarshalJSON() ([]byte, error) {
  573. type NoMethod ErrorHandler
  574. raw := NoMethod(*s)
  575. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  576. }
  577. // FileInfo: Single source file that is part of the version to be
  578. // deployed. Each source file that is deployed must be specified
  579. // separately.
  580. type FileInfo struct {
  581. // MimeType: The MIME type of the file. Defaults to the value from
  582. // Google Cloud Storage.
  583. MimeType string `json:"mimeType,omitempty"`
  584. // Sha1Sum: The SHA1 hash of the file, in hex.
  585. Sha1Sum string `json:"sha1Sum,omitempty"`
  586. // SourceUrl: URL source to use to fetch this file. Must be a URL to a
  587. // resource in Google Cloud Storage in the form
  588. // 'http(s)://storage.googleapis.com/\/\'.
  589. SourceUrl string `json:"sourceUrl,omitempty"`
  590. // ForceSendFields is a list of field names (e.g. "MimeType") to
  591. // unconditionally include in API requests. By default, fields with
  592. // empty values are omitted from API requests. However, any non-pointer,
  593. // non-interface field appearing in ForceSendFields will be sent to the
  594. // server regardless of whether the field is empty or not. This may be
  595. // used to include empty fields in Patch requests.
  596. ForceSendFields []string `json:"-"`
  597. // NullFields is a list of field names (e.g. "MimeType") to include in
  598. // API requests with the JSON null value. By default, fields with empty
  599. // values are omitted from API requests. However, any field with an
  600. // empty value appearing in NullFields will be sent to the server as
  601. // null. It is an error if a field in this list has a non-empty value.
  602. // This may be used to include null fields in Patch requests.
  603. NullFields []string `json:"-"`
  604. }
  605. func (s *FileInfo) MarshalJSON() ([]byte, error) {
  606. type NoMethod FileInfo
  607. raw := NoMethod(*s)
  608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  609. }
  610. // HealthCheck: Health checking configuration for VM instances.
  611. // Unhealthy instances are killed and replaced with new instances. Only
  612. // applicable for instances in App Engine flexible environment.
  613. type HealthCheck struct {
  614. // CheckInterval: Interval between health checks.
  615. CheckInterval string `json:"checkInterval,omitempty"`
  616. // DisableHealthCheck: Whether to explicitly disable health checks for
  617. // this instance.
  618. DisableHealthCheck bool `json:"disableHealthCheck,omitempty"`
  619. // HealthyThreshold: Number of consecutive successful health checks
  620. // required before receiving traffic.
  621. HealthyThreshold int64 `json:"healthyThreshold,omitempty"`
  622. // Host: Host header to send when performing an HTTP health check.
  623. // Example: "myapp.appspot.com"
  624. Host string `json:"host,omitempty"`
  625. // RestartThreshold: Number of consecutive failed health checks required
  626. // before an instance is restarted.
  627. RestartThreshold int64 `json:"restartThreshold,omitempty"`
  628. // Timeout: Time before the health check is considered failed.
  629. Timeout string `json:"timeout,omitempty"`
  630. // UnhealthyThreshold: Number of consecutive failed health checks
  631. // required before removing traffic.
  632. UnhealthyThreshold int64 `json:"unhealthyThreshold,omitempty"`
  633. // ForceSendFields is a list of field names (e.g. "CheckInterval") to
  634. // unconditionally include in API requests. By default, fields with
  635. // empty values are omitted from API requests. However, any non-pointer,
  636. // non-interface field appearing in ForceSendFields will be sent to the
  637. // server regardless of whether the field is empty or not. This may be
  638. // used to include empty fields in Patch requests.
  639. ForceSendFields []string `json:"-"`
  640. // NullFields is a list of field names (e.g. "CheckInterval") to include
  641. // in API requests with the JSON null value. By default, fields with
  642. // empty values are omitted from API requests. However, any field with
  643. // an empty value appearing in NullFields will be sent to the server as
  644. // null. It is an error if a field in this list has a non-empty value.
  645. // This may be used to include null fields in Patch requests.
  646. NullFields []string `json:"-"`
  647. }
  648. func (s *HealthCheck) MarshalJSON() ([]byte, error) {
  649. type NoMethod HealthCheck
  650. raw := NoMethod(*s)
  651. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  652. }
  653. // Instance: An Instance resource is the computing unit that App Engine
  654. // uses to automatically scale an application.
  655. type Instance struct {
  656. // AppEngineRelease: App Engine release this instance is running on.
  657. // @OutputOnly
  658. AppEngineRelease string `json:"appEngineRelease,omitempty"`
  659. // Availability: Availability of the instance. @OutputOnly
  660. //
  661. // Possible values:
  662. // "UNSPECIFIED"
  663. // "RESIDENT"
  664. // "DYNAMIC"
  665. Availability string `json:"availability,omitempty"`
  666. // AverageLatency: Average latency (ms) over the last minute.
  667. // @OutputOnly
  668. AverageLatency int64 `json:"averageLatency,omitempty"`
  669. // Errors: Number of errors since this instance was started. @OutputOnly
  670. Errors int64 `json:"errors,omitempty"`
  671. // Id: Relative name of the instance within the version. Example:
  672. // `instance-1`. @OutputOnly
  673. Id string `json:"id,omitempty"`
  674. // MemoryUsage: Total memory in use (bytes). @OutputOnly
  675. MemoryUsage int64 `json:"memoryUsage,omitempty,string"`
  676. // Name: Full path to the Instance resource in the API. Example:
  677. // `apps/myapp/services/default/versions/v1/instances/instance-1`.
  678. // @OutputOnly
  679. Name string `json:"name,omitempty"`
  680. // Qps: Average queries per second (QPS) over the last minute.
  681. // @OutputOnly
  682. Qps float64 `json:"qps,omitempty"`
  683. // Requests: Number of requests since this instance was started.
  684. // @OutputOnly
  685. Requests int64 `json:"requests,omitempty"`
  686. // StartTime: Time that this instance was started. @OutputOnly
  687. StartTime string `json:"startTime,omitempty"`
  688. // VmDebugEnabled: Whether this instance is in debug mode. Only
  689. // applicable for instances in App Engine flexible environment.
  690. // @OutputOnly
  691. VmDebugEnabled bool `json:"vmDebugEnabled,omitempty"`
  692. // VmId: Virtual machine ID of this instance. Only applicable for
  693. // instances in App Engine flexible environment. @OutputOnly
  694. VmId string `json:"vmId,omitempty"`
  695. // VmName: Name of the virtual machine where this instance lives. Only
  696. // applicable for instances in App Engine flexible environment.
  697. // @OutputOnly
  698. VmName string `json:"vmName,omitempty"`
  699. // VmStatus: Status of the virtual machine where this instance lives.
  700. // Only applicable for instances in App Engine flexible environment.
  701. // @OutputOnly
  702. VmStatus string `json:"vmStatus,omitempty"`
  703. // VmZoneName: Zone where the virtual machine is located. Only
  704. // applicable for instances in App Engine flexible environment.
  705. // @OutputOnly
  706. VmZoneName string `json:"vmZoneName,omitempty"`
  707. // ServerResponse contains the HTTP response code and headers from the
  708. // server.
  709. googleapi.ServerResponse `json:"-"`
  710. // ForceSendFields is a list of field names (e.g. "AppEngineRelease") to
  711. // unconditionally include in API requests. By default, fields with
  712. // empty values are omitted from API requests. However, any non-pointer,
  713. // non-interface field appearing in ForceSendFields will be sent to the
  714. // server regardless of whether the field is empty or not. This may be
  715. // used to include empty fields in Patch requests.
  716. ForceSendFields []string `json:"-"`
  717. // NullFields is a list of field names (e.g. "AppEngineRelease") to
  718. // include in API requests with the JSON null value. By default, fields
  719. // with empty values are omitted from API requests. However, any field
  720. // with an empty value appearing in NullFields will be sent to the
  721. // server as null. It is an error if a field in this list has a
  722. // non-empty value. This may be used to include null fields in Patch
  723. // requests.
  724. NullFields []string `json:"-"`
  725. }
  726. func (s *Instance) MarshalJSON() ([]byte, error) {
  727. type NoMethod Instance
  728. raw := NoMethod(*s)
  729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  730. }
  731. func (s *Instance) UnmarshalJSON(data []byte) error {
  732. type NoMethod Instance
  733. var s1 struct {
  734. Qps gensupport.JSONFloat64 `json:"qps"`
  735. *NoMethod
  736. }
  737. s1.NoMethod = (*NoMethod)(s)
  738. if err := json.Unmarshal(data, &s1); err != nil {
  739. return err
  740. }
  741. s.Qps = float64(s1.Qps)
  742. return nil
  743. }
  744. // Library: Third-party Python runtime library that is required by the
  745. // application.
  746. type Library struct {
  747. // Name: Name of the library. Example: "django".
  748. Name string `json:"name,omitempty"`
  749. // Version: Version of the library to select, or "latest".
  750. Version string `json:"version,omitempty"`
  751. // ForceSendFields is a list of field names (e.g. "Name") to
  752. // unconditionally include in API requests. By default, fields with
  753. // empty values are omitted from API requests. However, any non-pointer,
  754. // non-interface field appearing in ForceSendFields will be sent to the
  755. // server regardless of whether the field is empty or not. This may be
  756. // used to include empty fields in Patch requests.
  757. ForceSendFields []string `json:"-"`
  758. // NullFields is a list of field names (e.g. "Name") to include in API
  759. // requests with the JSON null value. By default, fields with empty
  760. // values are omitted from API requests. However, any field with an
  761. // empty value appearing in NullFields will be sent to the server as
  762. // null. It is an error if a field in this list has a non-empty value.
  763. // This may be used to include null fields in Patch requests.
  764. NullFields []string `json:"-"`
  765. }
  766. func (s *Library) MarshalJSON() ([]byte, error) {
  767. type NoMethod Library
  768. raw := NoMethod(*s)
  769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  770. }
  771. // ListInstancesResponse: Response message for
  772. // `Instances.ListInstances`.
  773. type ListInstancesResponse struct {
  774. // Instances: The instances belonging to the requested version.
  775. Instances []*Instance `json:"instances,omitempty"`
  776. // NextPageToken: Continuation token for fetching the next page of
  777. // results.
  778. NextPageToken string `json:"nextPageToken,omitempty"`
  779. // ServerResponse contains the HTTP response code and headers from the
  780. // server.
  781. googleapi.ServerResponse `json:"-"`
  782. // ForceSendFields is a list of field names (e.g. "Instances") 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. "Instances") to include in
  790. // API 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 *ListInstancesResponse) MarshalJSON() ([]byte, error) {
  798. type NoMethod ListInstancesResponse
  799. raw := NoMethod(*s)
  800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  801. }
  802. // ListLocationsResponse: The response message for
  803. // LocationService.ListLocations.
  804. type ListLocationsResponse struct {
  805. // Locations: A list of locations that matches the specified filter in
  806. // the request.
  807. Locations []*Location `json:"locations,omitempty"`
  808. // NextPageToken: The standard List next-page token.
  809. NextPageToken string `json:"nextPageToken,omitempty"`
  810. // ServerResponse contains the HTTP response code and headers from the
  811. // server.
  812. googleapi.ServerResponse `json:"-"`
  813. // ForceSendFields is a list of field names (e.g. "Locations") to
  814. // unconditionally include in API requests. By default, fields with
  815. // empty values are omitted from API requests. However, any non-pointer,
  816. // non-interface field appearing in ForceSendFields will be sent to the
  817. // server regardless of whether the field is empty or not. This may be
  818. // used to include empty fields in Patch requests.
  819. ForceSendFields []string `json:"-"`
  820. // NullFields is a list of field names (e.g. "Locations") to include in
  821. // API requests with the JSON null value. By default, fields with empty
  822. // values are omitted from API requests. However, any field with an
  823. // empty value appearing in NullFields will be sent to the server as
  824. // null. It is an error if a field in this list has a non-empty value.
  825. // This may be used to include null fields in Patch requests.
  826. NullFields []string `json:"-"`
  827. }
  828. func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
  829. type NoMethod ListLocationsResponse
  830. raw := NoMethod(*s)
  831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  832. }
  833. // ListOperationsResponse: The response message for
  834. // Operations.ListOperations.
  835. type ListOperationsResponse struct {
  836. // NextPageToken: The standard List next-page token.
  837. NextPageToken string `json:"nextPageToken,omitempty"`
  838. // Operations: A list of operations that matches the specified filter in
  839. // the request.
  840. Operations []*Operation `json:"operations,omitempty"`
  841. // ServerResponse contains the HTTP response code and headers from the
  842. // server.
  843. googleapi.ServerResponse `json:"-"`
  844. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  845. // unconditionally include in API requests. By default, fields with
  846. // empty values are omitted from API requests. However, any non-pointer,
  847. // non-interface field appearing in ForceSendFields will be sent to the
  848. // server regardless of whether the field is empty or not. This may be
  849. // used to include empty fields in Patch requests.
  850. ForceSendFields []string `json:"-"`
  851. // NullFields is a list of field names (e.g. "NextPageToken") to include
  852. // in API requests with the JSON null value. By default, fields with
  853. // empty values are omitted from API requests. However, any field with
  854. // an empty value appearing in NullFields will be sent to the server as
  855. // null. It is an error if a field in this list has a non-empty value.
  856. // This may be used to include null fields in Patch requests.
  857. NullFields []string `json:"-"`
  858. }
  859. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  860. type NoMethod ListOperationsResponse
  861. raw := NoMethod(*s)
  862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  863. }
  864. // ListServicesResponse: Response message for `Services.ListServices`.
  865. type ListServicesResponse struct {
  866. // NextPageToken: Continuation token for fetching the next page of
  867. // results.
  868. NextPageToken string `json:"nextPageToken,omitempty"`
  869. // Services: The services belonging to the requested application.
  870. Services []*Service `json:"services,omitempty"`
  871. // ServerResponse contains the HTTP response code and headers from the
  872. // server.
  873. googleapi.ServerResponse `json:"-"`
  874. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  875. // unconditionally include in API requests. By default, fields with
  876. // empty values are omitted from API requests. However, any non-pointer,
  877. // non-interface field appearing in ForceSendFields will be sent to the
  878. // server regardless of whether the field is empty or not. This may be
  879. // used to include empty fields in Patch requests.
  880. ForceSendFields []string `json:"-"`
  881. // NullFields is a list of field names (e.g. "NextPageToken") to include
  882. // in API requests with the JSON null value. By default, fields with
  883. // empty values are omitted from API requests. However, any field with
  884. // an empty value appearing in NullFields will be sent to the server as
  885. // null. It is an error if a field in this list has a non-empty value.
  886. // This may be used to include null fields in Patch requests.
  887. NullFields []string `json:"-"`
  888. }
  889. func (s *ListServicesResponse) MarshalJSON() ([]byte, error) {
  890. type NoMethod ListServicesResponse
  891. raw := NoMethod(*s)
  892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  893. }
  894. // ListVersionsResponse: Response message for `Versions.ListVersions`.
  895. type ListVersionsResponse struct {
  896. // NextPageToken: Continuation token for fetching the next page of
  897. // results.
  898. NextPageToken string `json:"nextPageToken,omitempty"`
  899. // Versions: The versions belonging to the requested service.
  900. Versions []*Version `json:"versions,omitempty"`
  901. // ServerResponse contains the HTTP response code and headers from the
  902. // server.
  903. googleapi.ServerResponse `json:"-"`
  904. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  905. // unconditionally include in API requests. By default, fields with
  906. // empty values are omitted from API requests. However, any non-pointer,
  907. // non-interface field appearing in ForceSendFields will be sent to the
  908. // server regardless of whether the field is empty or not. This may be
  909. // used to include empty fields in Patch requests.
  910. ForceSendFields []string `json:"-"`
  911. // NullFields is a list of field names (e.g. "NextPageToken") to include
  912. // in API requests with the JSON null value. By default, fields with
  913. // empty values are omitted from API requests. However, any field with
  914. // an empty value appearing in NullFields will be sent to the server as
  915. // null. It is an error if a field in this list has a non-empty value.
  916. // This may be used to include null fields in Patch requests.
  917. NullFields []string `json:"-"`
  918. }
  919. func (s *ListVersionsResponse) MarshalJSON() ([]byte, error) {
  920. type NoMethod ListVersionsResponse
  921. raw := NoMethod(*s)
  922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  923. }
  924. // Location: A resource that represents Google Cloud Platform location.
  925. type Location struct {
  926. // Labels: Cross-service attributes for the location. For example
  927. // {"cloud.googleapis.com/region": "us-east1"}
  928. Labels map[string]string `json:"labels,omitempty"`
  929. // LocationId: The cononical id for this location. For example:
  930. // "us-east1".
  931. LocationId string `json:"locationId,omitempty"`
  932. // Metadata: Service-specific metadata. For example the available
  933. // capacity at the given location.
  934. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  935. // Name: Resource name for the location, which may vary between
  936. // implementations. For example:
  937. // "projects/example-project/locations/us-east1"
  938. Name string `json:"name,omitempty"`
  939. // ServerResponse contains the HTTP response code and headers from the
  940. // server.
  941. googleapi.ServerResponse `json:"-"`
  942. // ForceSendFields is a list of field names (e.g. "Labels") to
  943. // unconditionally include in API requests. By default, fields with
  944. // empty values are omitted from API requests. However, any non-pointer,
  945. // non-interface field appearing in ForceSendFields will be sent to the
  946. // server regardless of whether the field is empty or not. This may be
  947. // used to include empty fields in Patch requests.
  948. ForceSendFields []string `json:"-"`
  949. // NullFields is a list of field names (e.g. "Labels") to include in API
  950. // requests with the JSON null value. By default, fields with empty
  951. // values are omitted from API requests. However, any field with an
  952. // empty value appearing in NullFields will be sent to the server as
  953. // null. It is an error if a field in this list has a non-empty value.
  954. // This may be used to include null fields in Patch requests.
  955. NullFields []string `json:"-"`
  956. }
  957. func (s *Location) MarshalJSON() ([]byte, error) {
  958. type NoMethod Location
  959. raw := NoMethod(*s)
  960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  961. }
  962. // LocationMetadata: Metadata for the given
  963. // google.cloud.location.Location.
  964. type LocationMetadata struct {
  965. // FlexibleEnvironmentAvailable: App Engine Flexible Environment is
  966. // available in the given location. @OutputOnly
  967. FlexibleEnvironmentAvailable bool `json:"flexibleEnvironmentAvailable,omitempty"`
  968. // StandardEnvironmentAvailable: App Engine Standard Environment is
  969. // available in the given location. @OutputOnly
  970. StandardEnvironmentAvailable bool `json:"standardEnvironmentAvailable,omitempty"`
  971. // ForceSendFields is a list of field names (e.g.
  972. // "FlexibleEnvironmentAvailable") to unconditionally include in API
  973. // requests. By default, fields with empty values are omitted from API
  974. // requests. However, any non-pointer, non-interface field appearing in
  975. // ForceSendFields will be sent to the server regardless of whether the
  976. // field is empty or not. This may be used to include empty fields in
  977. // Patch requests.
  978. ForceSendFields []string `json:"-"`
  979. // NullFields is a list of field names (e.g.
  980. // "FlexibleEnvironmentAvailable") to include in API requests with the
  981. // JSON null value. By default, fields with empty values are omitted
  982. // from API requests. However, any field with an empty value appearing
  983. // in NullFields will be sent to the server as null. It is an error if a
  984. // field in this list has a non-empty value. This may be used to include
  985. // null fields in Patch requests.
  986. NullFields []string `json:"-"`
  987. }
  988. func (s *LocationMetadata) MarshalJSON() ([]byte, error) {
  989. type NoMethod LocationMetadata
  990. raw := NoMethod(*s)
  991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  992. }
  993. // ManualScaling: A service with manual scaling runs continuously,
  994. // allowing you to perform complex initialization and rely on the state
  995. // of its memory over time.
  996. type ManualScaling struct {
  997. // Instances: Number of instances to assign to the service at the start.
  998. // This number can later be altered by using the [Modules
  999. // API](https://cloud.google.com/appengine/docs/python/modules/functions)
  1000. // `set_num_instances()` function.
  1001. Instances int64 `json:"instances,omitempty"`
  1002. // ForceSendFields is a list of field names (e.g. "Instances") to
  1003. // unconditionally include in API requests. By default, fields with
  1004. // empty values are omitted from API requests. However, any non-pointer,
  1005. // non-interface field appearing in ForceSendFields will be sent to the
  1006. // server regardless of whether the field is empty or not. This may be
  1007. // used to include empty fields in Patch requests.
  1008. ForceSendFields []string `json:"-"`
  1009. // NullFields is a list of field names (e.g. "Instances") to include in
  1010. // API requests with the JSON null value. By default, fields with empty
  1011. // values are omitted from API requests. However, any field with an
  1012. // empty value appearing in NullFields will be sent to the server as
  1013. // null. It is an error if a field in this list has a non-empty value.
  1014. // This may be used to include null fields in Patch requests.
  1015. NullFields []string `json:"-"`
  1016. }
  1017. func (s *ManualScaling) MarshalJSON() ([]byte, error) {
  1018. type NoMethod ManualScaling
  1019. raw := NoMethod(*s)
  1020. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1021. }
  1022. // Network: Extra network settings. Only applicable for VM runtimes.
  1023. type Network struct {
  1024. // ForwardedPorts: List of ports, or port pairs, to forward from the
  1025. // virtual machine to the application container.
  1026. ForwardedPorts []string `json:"forwardedPorts,omitempty"`
  1027. // InstanceTag: Tag to apply to the VM instance during creation.
  1028. InstanceTag string `json:"instanceTag,omitempty"`
  1029. // Name: Google Cloud Platform network where the virtual machines are
  1030. // created. Specify the short name, not the resource path. Defaults to
  1031. // `default`.
  1032. Name string `json:"name,omitempty"`
  1033. // ForceSendFields is a list of field names (e.g. "ForwardedPorts") to
  1034. // unconditionally include in API requests. By default, fields with
  1035. // empty values are omitted from API requests. However, any non-pointer,
  1036. // non-interface field appearing in ForceSendFields will be sent to the
  1037. // server regardless of whether the field is empty or not. This may be
  1038. // used to include empty fields in Patch requests.
  1039. ForceSendFields []string `json:"-"`
  1040. // NullFields is a list of field names (e.g. "ForwardedPorts") to
  1041. // include in API requests with the JSON null value. By default, fields
  1042. // with empty values are omitted from API requests. However, any field
  1043. // with an empty value appearing in NullFields will be sent to the
  1044. // server as null. It is an error if a field in this list has a
  1045. // non-empty value. This may be used to include null fields in Patch
  1046. // requests.
  1047. NullFields []string `json:"-"`
  1048. }
  1049. func (s *Network) MarshalJSON() ([]byte, error) {
  1050. type NoMethod Network
  1051. raw := NoMethod(*s)
  1052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1053. }
  1054. // NetworkUtilization: Target scaling by network usage. Only applicable
  1055. // for VM runtimes.
  1056. type NetworkUtilization struct {
  1057. // TargetReceivedBytesPerSecond: Target bytes received per second.
  1058. TargetReceivedBytesPerSecond int64 `json:"targetReceivedBytesPerSecond,omitempty"`
  1059. // TargetReceivedPacketsPerSecond: Target packets received per second.
  1060. TargetReceivedPacketsPerSecond int64 `json:"targetReceivedPacketsPerSecond,omitempty"`
  1061. // TargetSentBytesPerSecond: Target bytes sent per second.
  1062. TargetSentBytesPerSecond int64 `json:"targetSentBytesPerSecond,omitempty"`
  1063. // TargetSentPacketsPerSecond: Target packets sent per second.
  1064. TargetSentPacketsPerSecond int64 `json:"targetSentPacketsPerSecond,omitempty"`
  1065. // ForceSendFields is a list of field names (e.g.
  1066. // "TargetReceivedBytesPerSecond") to unconditionally include in API
  1067. // requests. By default, fields with empty values are omitted from API
  1068. // requests. However, any non-pointer, non-interface field appearing in
  1069. // ForceSendFields will be sent to the server regardless of whether the
  1070. // field is empty or not. This may be used to include empty fields in
  1071. // Patch requests.
  1072. ForceSendFields []string `json:"-"`
  1073. // NullFields is a list of field names (e.g.
  1074. // "TargetReceivedBytesPerSecond") to include in API requests with the
  1075. // JSON null value. By default, fields with empty values are omitted
  1076. // from API requests. However, any field with an empty value appearing
  1077. // in NullFields will be sent to the server as null. It is an error if a
  1078. // field in this list has a non-empty value. This may be used to include
  1079. // null fields in Patch requests.
  1080. NullFields []string `json:"-"`
  1081. }
  1082. func (s *NetworkUtilization) MarshalJSON() ([]byte, error) {
  1083. type NoMethod NetworkUtilization
  1084. raw := NoMethod(*s)
  1085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1086. }
  1087. // Operation: This resource represents a long-running operation that is
  1088. // the result of a network API call.
  1089. type Operation struct {
  1090. // Done: If the value is `false`, it means the operation is still in
  1091. // progress. If true, the operation is completed, and either `error` or
  1092. // `response` is available.
  1093. Done bool `json:"done,omitempty"`
  1094. // Error: The error result of the operation in case of failure.
  1095. Error *Status `json:"error,omitempty"`
  1096. // Metadata: Service-specific metadata associated with the operation. It
  1097. // typically contains progress information and common metadata such as
  1098. // create time. Some services might not provide such metadata. Any
  1099. // method that returns a long-running operation should document the
  1100. // metadata type, if any.
  1101. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1102. // Name: The server-assigned name, which is only unique within the same
  1103. // service that originally returns it. If you use the default HTTP
  1104. // mapping, the `name` should have the format of
  1105. // `operations/some/unique/name`.
  1106. Name string `json:"name,omitempty"`
  1107. // Response: The normal response of the operation in case of success. If
  1108. // the original method returns no data on success, such as `Delete`, the
  1109. // response is `google.protobuf.Empty`. If the original method is
  1110. // standard `Get`/`Create`/`Update`, the response should be the
  1111. // resource. For other methods, the response should have the type
  1112. // `XxxResponse`, where `Xxx` is the original method name. For example,
  1113. // if the original method name is `TakeSnapshot()`, the inferred
  1114. // response type is `TakeSnapshotResponse`.
  1115. Response googleapi.RawMessage `json:"response,omitempty"`
  1116. // ServerResponse contains the HTTP response code and headers from the
  1117. // server.
  1118. googleapi.ServerResponse `json:"-"`
  1119. // ForceSendFields is a list of field names (e.g. "Done") to
  1120. // unconditionally include in API requests. By default, fields with
  1121. // empty values are omitted from API requests. However, any non-pointer,
  1122. // non-interface field appearing in ForceSendFields will be sent to the
  1123. // server regardless of whether the field is empty or not. This may be
  1124. // used to include empty fields in Patch requests.
  1125. ForceSendFields []string `json:"-"`
  1126. // NullFields is a list of field names (e.g. "Done") to include in API
  1127. // requests with the JSON null value. By default, fields with empty
  1128. // values are omitted from API requests. However, any field with an
  1129. // empty value appearing in NullFields will be sent to the server as
  1130. // null. It is an error if a field in this list has a non-empty value.
  1131. // This may be used to include null fields in Patch requests.
  1132. NullFields []string `json:"-"`
  1133. }
  1134. func (s *Operation) MarshalJSON() ([]byte, error) {
  1135. type NoMethod Operation
  1136. raw := NoMethod(*s)
  1137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1138. }
  1139. // OperationMetadata: Metadata for the given
  1140. // google.longrunning.Operation.
  1141. type OperationMetadata struct {
  1142. // EndTime: Timestamp that this operation completed. @OutputOnly
  1143. EndTime string `json:"endTime,omitempty"`
  1144. // InsertTime: Timestamp that this operation was created. @OutputOnly
  1145. InsertTime string `json:"insertTime,omitempty"`
  1146. // Method: API method that initiated this operation. Example:
  1147. // `google.appengine.v1beta4.Version.CreateVersion`. @OutputOnly
  1148. Method string `json:"method,omitempty"`
  1149. // OperationType: Type of this operation. Deprecated, use method field
  1150. // instead. Example: "create_version". @OutputOnly
  1151. OperationType string `json:"operationType,omitempty"`
  1152. // Target: Name of the resource that this operation is acting on.
  1153. // Example: `apps/myapp/modules/default`. @OutputOnly
  1154. Target string `json:"target,omitempty"`
  1155. // User: User who requested this operation. @OutputOnly
  1156. User string `json:"user,omitempty"`
  1157. // ForceSendFields is a list of field names (e.g. "EndTime") to
  1158. // unconditionally include in API requests. By default, fields with
  1159. // empty values are omitted from API requests. However, any non-pointer,
  1160. // non-interface field appearing in ForceSendFields will be sent to the
  1161. // server regardless of whether the field is empty or not. This may be
  1162. // used to include empty fields in Patch requests.
  1163. ForceSendFields []string `json:"-"`
  1164. // NullFields is a list of field names (e.g. "EndTime") to include in
  1165. // API requests with the JSON null value. By default, fields with empty
  1166. // values are omitted from API requests. However, any field with an
  1167. // empty value appearing in NullFields will be sent to the server as
  1168. // null. It is an error if a field in this list has a non-empty value.
  1169. // This may be used to include null fields in Patch requests.
  1170. NullFields []string `json:"-"`
  1171. }
  1172. func (s *OperationMetadata) MarshalJSON() ([]byte, error) {
  1173. type NoMethod OperationMetadata
  1174. raw := NoMethod(*s)
  1175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1176. }
  1177. // OperationMetadataV1: Metadata for the given
  1178. // google.longrunning.Operation.
  1179. type OperationMetadataV1 struct {
  1180. // EndTime: Time that this operation completed. @OutputOnly
  1181. EndTime string `json:"endTime,omitempty"`
  1182. // InsertTime: Time that this operation was created. @OutputOnly
  1183. InsertTime string `json:"insertTime,omitempty"`
  1184. // Method: API method that initiated this operation. Example:
  1185. // `google.appengine.v1.Versions.CreateVersion`. @OutputOnly
  1186. Method string `json:"method,omitempty"`
  1187. // Target: Name of the resource that this operation is acting on.
  1188. // Example: `apps/myapp/services/default`. @OutputOnly
  1189. Target string `json:"target,omitempty"`
  1190. // User: User who requested this operation. @OutputOnly
  1191. User string `json:"user,omitempty"`
  1192. // ForceSendFields is a list of field names (e.g. "EndTime") to
  1193. // unconditionally include in API requests. By default, fields with
  1194. // empty values are omitted from API requests. However, any non-pointer,
  1195. // non-interface field appearing in ForceSendFields will be sent to the
  1196. // server regardless of whether the field is empty or not. This may be
  1197. // used to include empty fields in Patch requests.
  1198. ForceSendFields []string `json:"-"`
  1199. // NullFields is a list of field names (e.g. "EndTime") to include in
  1200. // API requests with the JSON null value. By default, fields with empty
  1201. // values are omitted from API requests. However, any field with an
  1202. // empty value appearing in NullFields will be sent to the server as
  1203. // null. It is an error if a field in this list has a non-empty value.
  1204. // This may be used to include null fields in Patch requests.
  1205. NullFields []string `json:"-"`
  1206. }
  1207. func (s *OperationMetadataV1) MarshalJSON() ([]byte, error) {
  1208. type NoMethod OperationMetadataV1
  1209. raw := NoMethod(*s)
  1210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1211. }
  1212. // OperationMetadataV1Beta5: Metadata for the given
  1213. // google.longrunning.Operation.
  1214. type OperationMetadataV1Beta5 struct {
  1215. // EndTime: Timestamp that this operation completed. @OutputOnly
  1216. EndTime string `json:"endTime,omitempty"`
  1217. // InsertTime: Timestamp that this operation was created. @OutputOnly
  1218. InsertTime string `json:"insertTime,omitempty"`
  1219. // Method: API method name that initiated this operation. Example:
  1220. // `google.appengine.v1beta5.Version.CreateVersion`. @OutputOnly
  1221. Method string `json:"method,omitempty"`
  1222. // Target: Name of the resource that this operation is acting on.
  1223. // Example: `apps/myapp/services/default`. @OutputOnly
  1224. Target string `json:"target,omitempty"`
  1225. // User: User who requested this operation. @OutputOnly
  1226. User string `json:"user,omitempty"`
  1227. // ForceSendFields is a list of field names (e.g. "EndTime") to
  1228. // unconditionally include in API requests. By default, fields with
  1229. // empty values are omitted from API requests. However, any non-pointer,
  1230. // non-interface field appearing in ForceSendFields will be sent to the
  1231. // server regardless of whether the field is empty or not. This may be
  1232. // used to include empty fields in Patch requests.
  1233. ForceSendFields []string `json:"-"`
  1234. // NullFields is a list of field names (e.g. "EndTime") to include in
  1235. // API requests with the JSON null value. By default, fields with empty
  1236. // values are omitted from API requests. However, any field with an
  1237. // empty value appearing in NullFields will be sent to the server as
  1238. // null. It is an error if a field in this list has a non-empty value.
  1239. // This may be used to include null fields in Patch requests.
  1240. NullFields []string `json:"-"`
  1241. }
  1242. func (s *OperationMetadataV1Beta5) MarshalJSON() ([]byte, error) {
  1243. type NoMethod OperationMetadataV1Beta5
  1244. raw := NoMethod(*s)
  1245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1246. }
  1247. // RepairApplicationRequest: Request message for
  1248. // 'Applications.RepairApplication'.
  1249. type RepairApplicationRequest struct {
  1250. }
  1251. // RequestUtilization: Target scaling by request utilization. Only
  1252. // applicable for VM runtimes.
  1253. type RequestUtilization struct {
  1254. // TargetConcurrentRequests: Target number of concurrent requests.
  1255. TargetConcurrentRequests int64 `json:"targetConcurrentRequests,omitempty"`
  1256. // TargetRequestCountPerSecond: Target requests per second.
  1257. TargetRequestCountPerSecond int64 `json:"targetRequestCountPerSecond,omitempty"`
  1258. // ForceSendFields is a list of field names (e.g.
  1259. // "TargetConcurrentRequests") to unconditionally include in API
  1260. // requests. By default, fields with empty values are omitted from API
  1261. // requests. However, any non-pointer, non-interface field appearing in
  1262. // ForceSendFields will be sent to the server regardless of whether the
  1263. // field is empty or not. This may be used to include empty fields in
  1264. // Patch requests.
  1265. ForceSendFields []string `json:"-"`
  1266. // NullFields is a list of field names (e.g. "TargetConcurrentRequests")
  1267. // to include in API requests with the JSON null value. By default,
  1268. // fields with empty values are omitted from API requests. However, any
  1269. // field with an empty value appearing in NullFields will be sent to the
  1270. // server as null. It is an error if a field in this list has a
  1271. // non-empty value. This may be used to include null fields in Patch
  1272. // requests.
  1273. NullFields []string `json:"-"`
  1274. }
  1275. func (s *RequestUtilization) MarshalJSON() ([]byte, error) {
  1276. type NoMethod RequestUtilization
  1277. raw := NoMethod(*s)
  1278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1279. }
  1280. // Resources: Machine resources for a version.
  1281. type Resources struct {
  1282. // Cpu: Number of CPU cores needed.
  1283. Cpu float64 `json:"cpu,omitempty"`
  1284. // DiskGb: Disk size (GB) needed.
  1285. DiskGb float64 `json:"diskGb,omitempty"`
  1286. // MemoryGb: Memory (GB) needed.
  1287. MemoryGb float64 `json:"memoryGb,omitempty"`
  1288. // ForceSendFields is a list of field names (e.g. "Cpu") to
  1289. // unconditionally include in API requests. By default, fields with
  1290. // empty values are omitted from API requests. However, any non-pointer,
  1291. // non-interface field appearing in ForceSendFields will be sent to the
  1292. // server regardless of whether the field is empty or not. This may be
  1293. // used to include empty fields in Patch requests.
  1294. ForceSendFields []string `json:"-"`
  1295. // NullFields is a list of field names (e.g. "Cpu") to include in API
  1296. // requests with the JSON null value. By default, fields with empty
  1297. // values are omitted from API requests. However, any field with an
  1298. // empty value appearing in NullFields will be sent to the server as
  1299. // null. It is an error if a field in this list has a non-empty value.
  1300. // This may be used to include null fields in Patch requests.
  1301. NullFields []string `json:"-"`
  1302. }
  1303. func (s *Resources) MarshalJSON() ([]byte, error) {
  1304. type NoMethod Resources
  1305. raw := NoMethod(*s)
  1306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1307. }
  1308. func (s *Resources) UnmarshalJSON(data []byte) error {
  1309. type NoMethod Resources
  1310. var s1 struct {
  1311. Cpu gensupport.JSONFloat64 `json:"cpu"`
  1312. DiskGb gensupport.JSONFloat64 `json:"diskGb"`
  1313. MemoryGb gensupport.JSONFloat64 `json:"memoryGb"`
  1314. *NoMethod
  1315. }
  1316. s1.NoMethod = (*NoMethod)(s)
  1317. if err := json.Unmarshal(data, &s1); err != nil {
  1318. return err
  1319. }
  1320. s.Cpu = float64(s1.Cpu)
  1321. s.DiskGb = float64(s1.DiskGb)
  1322. s.MemoryGb = float64(s1.MemoryGb)
  1323. return nil
  1324. }
  1325. // ScriptHandler: Executes a script to handle the request that matches
  1326. // the URL pattern.
  1327. type ScriptHandler struct {
  1328. // ScriptPath: Path to the script from the application root directory.
  1329. ScriptPath string `json:"scriptPath,omitempty"`
  1330. // ForceSendFields is a list of field names (e.g. "ScriptPath") to
  1331. // unconditionally include in API requests. By default, fields with
  1332. // empty values are omitted from API requests. However, any non-pointer,
  1333. // non-interface field appearing in ForceSendFields will be sent to the
  1334. // server regardless of whether the field is empty or not. This may be
  1335. // used to include empty fields in Patch requests.
  1336. ForceSendFields []string `json:"-"`
  1337. // NullFields is a list of field names (e.g. "ScriptPath") to include in
  1338. // API requests with the JSON null value. By default, fields with empty
  1339. // values are omitted from API requests. However, any field with an
  1340. // empty value appearing in NullFields will be sent to the server as
  1341. // null. It is an error if a field in this list has a non-empty value.
  1342. // This may be used to include null fields in Patch requests.
  1343. NullFields []string `json:"-"`
  1344. }
  1345. func (s *ScriptHandler) MarshalJSON() ([]byte, error) {
  1346. type NoMethod ScriptHandler
  1347. raw := NoMethod(*s)
  1348. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1349. }
  1350. // Service: A Service resource is a logical component of an application
  1351. // that can share state and communicate in a secure fashion with other
  1352. // services. For example, an application that handles customer requests
  1353. // might include separate services to handle tasks such as backend data
  1354. // analysis or API requests from mobile devices. Each service has a
  1355. // collection of versions that define a specific set of code used to
  1356. // implement the functionality of that service.
  1357. type Service struct {
  1358. // Id: Relative name of the service within the application. Example:
  1359. // `default`. @OutputOnly
  1360. Id string `json:"id,omitempty"`
  1361. // Name: Full path to the Service resource in the API. Example:
  1362. // `apps/myapp/services/default`. @OutputOnly
  1363. Name string `json:"name,omitempty"`
  1364. // Split: Mapping that defines fractional HTTP traffic diversion to
  1365. // different versions within the service.
  1366. Split *TrafficSplit `json:"split,omitempty"`
  1367. // ServerResponse contains the HTTP response code and headers from the
  1368. // server.
  1369. googleapi.ServerResponse `json:"-"`
  1370. // ForceSendFields is a list of field names (e.g. "Id") to
  1371. // unconditionally include in API requests. By default, fields with
  1372. // empty values are omitted from API requests. However, any non-pointer,
  1373. // non-interface field appearing in ForceSendFields will be sent to the
  1374. // server regardless of whether the field is empty or not. This may be
  1375. // used to include empty fields in Patch requests.
  1376. ForceSendFields []string `json:"-"`
  1377. // NullFields is a list of field names (e.g. "Id") to include in API
  1378. // requests with the JSON null value. By default, fields with empty
  1379. // values are omitted from API requests. However, any field with an
  1380. // empty value appearing in NullFields will be sent to the server as
  1381. // null. It is an error if a field in this list has a non-empty value.
  1382. // This may be used to include null fields in Patch requests.
  1383. NullFields []string `json:"-"`
  1384. }
  1385. func (s *Service) MarshalJSON() ([]byte, error) {
  1386. type NoMethod Service
  1387. raw := NoMethod(*s)
  1388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1389. }
  1390. // StaticFilesHandler: Files served directly to the user for a given
  1391. // URL, such as images, CSS stylesheets, or JavaScript source files.
  1392. // Static file handlers describe which files in the application
  1393. // directory are static files, and which URLs serve them.
  1394. type StaticFilesHandler struct {
  1395. // ApplicationReadable: Whether files should also be uploaded as code
  1396. // data. By default, files declared in static file handlers are uploaded
  1397. // as static data and are only served to end users; they cannot be read
  1398. // by the application. If enabled, uploads are charged against both your
  1399. // code and static data storage resource quotas.
  1400. ApplicationReadable bool `json:"applicationReadable,omitempty"`
  1401. // Expiration: Time a static file served by this handler should be
  1402. // cached by web proxies and browsers.
  1403. Expiration string `json:"expiration,omitempty"`
  1404. // HttpHeaders: HTTP headers to use for all responses from these URLs.
  1405. HttpHeaders map[string]string `json:"httpHeaders,omitempty"`
  1406. // MimeType: MIME type used to serve all files served by this handler.
  1407. // Defaults to file-specific MIME types, which are derived from each
  1408. // file's filename extension.
  1409. MimeType string `json:"mimeType,omitempty"`
  1410. // Path: Path to the static files matched by the URL pattern, from the
  1411. // application root directory. The path can refer to text matched in
  1412. // groupings in the URL pattern.
  1413. Path string `json:"path,omitempty"`
  1414. // RequireMatchingFile: Whether this handler should match the request if
  1415. // the file referenced by the handler does not exist.
  1416. RequireMatchingFile bool `json:"requireMatchingFile,omitempty"`
  1417. // UploadPathRegex: Regular expression that matches the file paths for
  1418. // all files that should be referenced by this handler.
  1419. UploadPathRegex string `json:"uploadPathRegex,omitempty"`
  1420. // ForceSendFields is a list of field names (e.g. "ApplicationReadable")
  1421. // to unconditionally include in API requests. By default, fields with
  1422. // empty values are omitted from API requests. However, any non-pointer,
  1423. // non-interface field appearing in ForceSendFields will be sent to the
  1424. // server regardless of whether the field is empty or not. This may be
  1425. // used to include empty fields in Patch requests.
  1426. ForceSendFields []string `json:"-"`
  1427. // NullFields is a list of field names (e.g. "ApplicationReadable") to
  1428. // include in API requests with the JSON null value. By default, fields
  1429. // with empty values are omitted from API requests. However, any field
  1430. // with an empty value appearing in NullFields will be sent to the
  1431. // server as null. It is an error if a field in this list has a
  1432. // non-empty value. This may be used to include null fields in Patch
  1433. // requests.
  1434. NullFields []string `json:"-"`
  1435. }
  1436. func (s *StaticFilesHandler) MarshalJSON() ([]byte, error) {
  1437. type NoMethod StaticFilesHandler
  1438. raw := NoMethod(*s)
  1439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1440. }
  1441. // Status: The `Status` type defines a logical error model that is
  1442. // suitable for different programming environments, including REST APIs
  1443. // and RPC APIs. It is used by [gRPC](https://github.com/grpc). The
  1444. // error model is designed to be: - Simple to use and understand for
  1445. // most users - Flexible enough to meet unexpected needs # Overview The
  1446. // `Status` message contains three pieces of data: error code, error
  1447. // message, and error details. The error code should be an enum value of
  1448. // google.rpc.Code, but it may accept additional error codes if needed.
  1449. // The error message should be a developer-facing English message that
  1450. // helps developers *understand* and *resolve* the error. If a localized
  1451. // user-facing error message is needed, put the localized message in the
  1452. // error details or localize it in the client. The optional error
  1453. // details may contain arbitrary information about the error. There is a
  1454. // predefined set of error detail types in the package `google.rpc`
  1455. // which can be used for common error conditions. # Language mapping The
  1456. // `Status` message is the logical representation of the error model,
  1457. // but it is not necessarily the actual wire format. When the `Status`
  1458. // message is exposed in different client libraries and different wire
  1459. // protocols, it can be mapped differently. For example, it will likely
  1460. // be mapped to some exceptions in Java, but more likely mapped to some
  1461. // error codes in C. # Other uses The error model and the `Status`
  1462. // message can be used in a variety of environments, either with or
  1463. // without APIs, to provide a consistent developer experience across
  1464. // different environments. Example uses of this error model include: -
  1465. // Partial errors. If a service needs to return partial errors to the
  1466. // client, it may embed the `Status` in the normal response to indicate
  1467. // the partial errors. - Workflow errors. A typical workflow has
  1468. // multiple steps. Each step may have a `Status` message for error
  1469. // reporting purpose. - Batch operations. If a client uses batch request
  1470. // and batch response, the `Status` message should be used directly
  1471. // inside batch response, one for each error sub-response. -
  1472. // Asynchronous operations. If an API call embeds asynchronous operation
  1473. // results in its response, the status of those operations should be
  1474. // represented directly using the `Status` message. - Logging. If some
  1475. // API errors are stored in logs, the message `Status` could be used
  1476. // directly after any stripping needed for security/privacy reasons.
  1477. type Status struct {
  1478. // Code: The status code, which should be an enum value of
  1479. // google.rpc.Code.
  1480. Code int64 `json:"code,omitempty"`
  1481. // Details: A list of messages that carry the error details. There will
  1482. // be a common set of message types for APIs to use.
  1483. Details []googleapi.RawMessage `json:"details,omitempty"`
  1484. // Message: A developer-facing error message, which should be in
  1485. // English. Any user-facing error message should be localized and sent
  1486. // in the google.rpc.Status.details field, or localized by the client.
  1487. Message string `json:"message,omitempty"`
  1488. // ForceSendFields is a list of field names (e.g. "Code") to
  1489. // unconditionally include in API requests. By default, fields with
  1490. // empty values are omitted from API requests. However, any non-pointer,
  1491. // non-interface field appearing in ForceSendFields will be sent to the
  1492. // server regardless of whether the field is empty or not. This may be
  1493. // used to include empty fields in Patch requests.
  1494. ForceSendFields []string `json:"-"`
  1495. // NullFields is a list of field names (e.g. "Code") to include in API
  1496. // requests with the JSON null value. By default, fields with empty
  1497. // values are omitted from API requests. However, any field with an
  1498. // empty value appearing in NullFields will be sent to the server as
  1499. // null. It is an error if a field in this list has a non-empty value.
  1500. // This may be used to include null fields in Patch requests.
  1501. NullFields []string `json:"-"`
  1502. }
  1503. func (s *Status) MarshalJSON() ([]byte, error) {
  1504. type NoMethod Status
  1505. raw := NoMethod(*s)
  1506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1507. }
  1508. // TrafficSplit: Traffic routing configuration for versions within a
  1509. // single service. Traffic splits define how traffic directed to the
  1510. // service is assigned to versions.
  1511. type TrafficSplit struct {
  1512. // Allocations: Mapping from version IDs within the service to
  1513. // fractional (0.000, 1] allocations of traffic for that version. Each
  1514. // version can be specified only once, but some versions in the service
  1515. // may not have any traffic allocation. Services that have traffic
  1516. // allocated cannot be deleted until either the service is deleted or
  1517. // their traffic allocation is removed. Allocations must sum to 1. Up to
  1518. // two decimal place precision is supported for IP-based splits and up
  1519. // to three decimal places is supported for cookie-based splits.
  1520. Allocations map[string]float64 `json:"allocations,omitempty"`
  1521. // ShardBy: Mechanism used to determine which version a request is sent
  1522. // to. The traffic selection algorithm will be stable for either type
  1523. // until allocations are changed.
  1524. //
  1525. // Possible values:
  1526. // "UNSPECIFIED"
  1527. // "COOKIE"
  1528. // "IP"
  1529. ShardBy string `json:"shardBy,omitempty"`
  1530. // ForceSendFields is a list of field names (e.g. "Allocations") to
  1531. // unconditionally include in API requests. By default, fields with
  1532. // empty values are omitted from API requests. However, any non-pointer,
  1533. // non-interface field appearing in ForceSendFields will be sent to the
  1534. // server regardless of whether the field is empty or not. This may be
  1535. // used to include empty fields in Patch requests.
  1536. ForceSendFields []string `json:"-"`
  1537. // NullFields is a list of field names (e.g. "Allocations") to include
  1538. // in API requests with the JSON null value. By default, fields with
  1539. // empty values are omitted from API requests. However, any field with
  1540. // an empty value appearing in NullFields will be sent to the server as
  1541. // null. It is an error if a field in this list has a non-empty value.
  1542. // This may be used to include null fields in Patch requests.
  1543. NullFields []string `json:"-"`
  1544. }
  1545. func (s *TrafficSplit) MarshalJSON() ([]byte, error) {
  1546. type NoMethod TrafficSplit
  1547. raw := NoMethod(*s)
  1548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1549. }
  1550. // UrlDispatchRule: Rules to match an HTTP request and dispatch that
  1551. // request to a service.
  1552. type UrlDispatchRule struct {
  1553. // Domain: Domain name to match against. The wildcard "*" is supported
  1554. // if specified before a period: "*.". Defaults to matching all
  1555. // domains: "*".
  1556. Domain string `json:"domain,omitempty"`
  1557. // Path: Pathname within the host. Must start with a "/". A single
  1558. // "*" can be included at the end of the path. The sum of the lengths
  1559. // of the domain and path may not exceed 100 characters.
  1560. Path string `json:"path,omitempty"`
  1561. // Service: Resource ID of a service in this application that should
  1562. // serve the matched request. The service must already exist. Example:
  1563. // `default`.
  1564. Service string `json:"service,omitempty"`
  1565. // ForceSendFields is a list of field names (e.g. "Domain") to
  1566. // unconditionally include in API requests. By default, fields with
  1567. // empty values are omitted from API requests. However, any non-pointer,
  1568. // non-interface field appearing in ForceSendFields will be sent to the
  1569. // server regardless of whether the field is empty or not. This may be
  1570. // used to include empty fields in Patch requests.
  1571. ForceSendFields []string `json:"-"`
  1572. // NullFields is a list of field names (e.g. "Domain") to include in API
  1573. // requests with the JSON null value. By default, fields with empty
  1574. // values are omitted from API requests. However, any field with an
  1575. // empty value appearing in NullFields will be sent to the server as
  1576. // null. It is an error if a field in this list has a non-empty value.
  1577. // This may be used to include null fields in Patch requests.
  1578. NullFields []string `json:"-"`
  1579. }
  1580. func (s *UrlDispatchRule) MarshalJSON() ([]byte, error) {
  1581. type NoMethod UrlDispatchRule
  1582. raw := NoMethod(*s)
  1583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1584. }
  1585. // UrlMap: URL pattern and description of how the URL should be handled.
  1586. // App Engine can handle URLs by executing application code or by
  1587. // serving static files uploaded with the version, such as images, CSS,
  1588. // or JavaScript.
  1589. type UrlMap struct {
  1590. // ApiEndpoint: Uses API Endpoints to handle requests.
  1591. ApiEndpoint *ApiEndpointHandler `json:"apiEndpoint,omitempty"`
  1592. // AuthFailAction: Action to take when users access resources that
  1593. // require authentication. Defaults to `redirect`.
  1594. //
  1595. // Possible values:
  1596. // "AUTH_FAIL_ACTION_UNSPECIFIED"
  1597. // "AUTH_FAIL_ACTION_REDIRECT"
  1598. // "AUTH_FAIL_ACTION_UNAUTHORIZED"
  1599. AuthFailAction string `json:"authFailAction,omitempty"`
  1600. // Login: Level of login required to access this resource.
  1601. //
  1602. // Possible values:
  1603. // "LOGIN_UNSPECIFIED"
  1604. // "LOGIN_OPTIONAL"
  1605. // "LOGIN_ADMIN"
  1606. // "LOGIN_REQUIRED"
  1607. Login string `json:"login,omitempty"`
  1608. // RedirectHttpResponseCode: `30x` code to use when performing redirects
  1609. // for the `secure` field. Defaults to `302`.
  1610. //
  1611. // Possible values:
  1612. // "REDIRECT_HTTP_RESPONSE_CODE_UNSPECIFIED"
  1613. // "REDIRECT_HTTP_RESPONSE_CODE_301"
  1614. // "REDIRECT_HTTP_RESPONSE_CODE_302"
  1615. // "REDIRECT_HTTP_RESPONSE_CODE_303"
  1616. // "REDIRECT_HTTP_RESPONSE_CODE_307"
  1617. RedirectHttpResponseCode string `json:"redirectHttpResponseCode,omitempty"`
  1618. // Script: Executes a script to handle the request that matches this URL
  1619. // pattern.
  1620. Script *ScriptHandler `json:"script,omitempty"`
  1621. // SecurityLevel: Security (HTTPS) enforcement for this URL.
  1622. //
  1623. // Possible values:
  1624. // "SECURE_UNSPECIFIED"
  1625. // "SECURE_DEFAULT"
  1626. // "SECURE_NEVER"
  1627. // "SECURE_OPTIONAL"
  1628. // "SECURE_ALWAYS"
  1629. SecurityLevel string `json:"securityLevel,omitempty"`
  1630. // StaticFiles: Returns the contents of a file, such as an image, as the
  1631. // response.
  1632. StaticFiles *StaticFilesHandler `json:"staticFiles,omitempty"`
  1633. // UrlRegex: URL prefix. Uses regular expression syntax, which means
  1634. // regexp special characters must be escaped, but should not contain
  1635. // groupings. All URLs that begin with this prefix are handled by this
  1636. // handler, using the portion of the URL after the prefix as part of the
  1637. // file path.
  1638. UrlRegex string `json:"urlRegex,omitempty"`
  1639. // ForceSendFields is a list of field names (e.g. "ApiEndpoint") 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. "ApiEndpoint") 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 *UrlMap) MarshalJSON() ([]byte, error) {
  1655. type NoMethod UrlMap
  1656. raw := NoMethod(*s)
  1657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1658. }
  1659. // Version: A Version resource is a specific set of source code and
  1660. // configuration files that are deployed into a service.
  1661. type Version struct {
  1662. // ApiConfig: Serving configuration for [Google Cloud
  1663. // Endpoints](https://cloud.google.com/appengine/docs/python/endpoints/).
  1664. // Only returned in `GET` requests if `view=FULL` is set.
  1665. ApiConfig *ApiConfigHandler `json:"apiConfig,omitempty"`
  1666. // AutomaticScaling: Automatic scaling is based on request rate,
  1667. // response latencies, and other application metrics.
  1668. AutomaticScaling *AutomaticScaling `json:"automaticScaling,omitempty"`
  1669. // BasicScaling: A service with basic scaling will create an instance
  1670. // when the application receives a request. The instance will be turned
  1671. // down when the app becomes idle. Basic scaling is ideal for work that
  1672. // is intermittent or driven by user activity.
  1673. BasicScaling *BasicScaling `json:"basicScaling,omitempty"`
  1674. // BetaSettings: Metadata settings that are supplied to this version to
  1675. // enable beta runtime features.
  1676. BetaSettings map[string]string `json:"betaSettings,omitempty"`
  1677. // CreateTime: Time that this version was created. @OutputOnly
  1678. CreateTime string `json:"createTime,omitempty"`
  1679. // CreatedBy: Email address of the user who created this version.
  1680. // @OutputOnly
  1681. CreatedBy string `json:"createdBy,omitempty"`
  1682. // DefaultExpiration: Duration that static files should be cached by web
  1683. // proxies and browsers. Only applicable if the corresponding
  1684. // [StaticFilesHandler](https://cloud.google.com/appengine/docs/admin-api
  1685. // /reference/rest/v1/apps.services.versions#staticfileshandler) does
  1686. // not specify its own expiration time. Only returned in `GET` requests
  1687. // if `view=FULL` is set.
  1688. DefaultExpiration string `json:"defaultExpiration,omitempty"`
  1689. // Deployment: Code and application artifacts that make up this version.
  1690. // Only returned in `GET` requests if `view=FULL` is set.
  1691. Deployment *Deployment `json:"deployment,omitempty"`
  1692. // DiskUsageBytes: Total size in bytes of all the files that are
  1693. // included in this version and curerntly hosted on the App Engine disk.
  1694. // @OutputOnly
  1695. DiskUsageBytes int64 `json:"diskUsageBytes,omitempty,string"`
  1696. // Env: App Engine execution environment for this version. Defaults to
  1697. // `standard`.
  1698. Env string `json:"env,omitempty"`
  1699. // EnvVariables: Environment variables available to the application.
  1700. // Only returned in `GET` requests if `view=FULL` is set.
  1701. EnvVariables map[string]string `json:"envVariables,omitempty"`
  1702. // ErrorHandlers: Custom static error pages. Limited to 10KB per page.
  1703. // Only returned in `GET` requests if `view=FULL` is set.
  1704. ErrorHandlers []*ErrorHandler `json:"errorHandlers,omitempty"`
  1705. // Handlers: An ordered list of URL-matching patterns that should be
  1706. // applied to incoming requests. The first matching URL handles the
  1707. // request and other request handlers are not attempted. Only returned
  1708. // in `GET` requests if `view=FULL` is set.
  1709. Handlers []*UrlMap `json:"handlers,omitempty"`
  1710. // HealthCheck: Configures health checking for VM instances. Unhealthy
  1711. // instances are stopped and replaced with new instances. Only
  1712. // applicable for VM runtimes. Only returned in `GET` requests if
  1713. // `view=FULL` is set.
  1714. HealthCheck *HealthCheck `json:"healthCheck,omitempty"`
  1715. // Id: Relative name of the version within the service. Example: `v1`.
  1716. // Version names can contain only lowercase letters, numbers, or
  1717. // hyphens. Reserved names: "default", "latest", and any name with the
  1718. // prefix "ah-".
  1719. Id string `json:"id,omitempty"`
  1720. // InboundServices: Before an application can receive email or XMPP
  1721. // messages, the application must be configured to enable the service.
  1722. //
  1723. // Possible values:
  1724. // "INBOUND_SERVICE_UNSPECIFIED" - Not specified.
  1725. // "INBOUND_SERVICE_MAIL" - Allows an application to receive mail.
  1726. // "INBOUND_SERVICE_MAIL_BOUNCE" - Allows an application to receive
  1727. // email-bound notifications.
  1728. // "INBOUND_SERVICE_XMPP_ERROR" - Allows an application to receive
  1729. // error stanzas.
  1730. // "INBOUND_SERVICE_XMPP_MESSAGE" - Allows an application to receive
  1731. // instant messages.
  1732. // "INBOUND_SERVICE_XMPP_SUBSCRIBE" - Allows an application to receive
  1733. // user subscription POSTs.
  1734. // "INBOUND_SERVICE_XMPP_PRESENCE" - Allows an application to receive
  1735. // a user's chat presence.
  1736. // "INBOUND_SERVICE_CHANNEL_PRESENCE" - Registers an application for
  1737. // notifications when a client connects or disconnects from a channel.
  1738. // "INBOUND_SERVICE_WARMUP" - Enables warmup requests.
  1739. InboundServices []string `json:"inboundServices,omitempty"`
  1740. // InstanceClass: Instance class that is used to run this version. Valid
  1741. // values are: * AutomaticScaling: `F1`, `F2`, `F4`, `F4_1G` *
  1742. // ManualScaling or BasicScaling: `B1`, `B2`, `B4`, `B8`, `B4_1G`
  1743. // Defaults to `F1` for AutomaticScaling and `B1` for ManualScaling or
  1744. // BasicScaling.
  1745. InstanceClass string `json:"instanceClass,omitempty"`
  1746. // Libraries: Configuration for third-party Python runtime libraries
  1747. // that are required by the application. Only returned in `GET` requests
  1748. // if `view=FULL` is set.
  1749. Libraries []*Library `json:"libraries,omitempty"`
  1750. // ManualScaling: A service with manual scaling runs continuously,
  1751. // allowing you to perform complex initialization and rely on the state
  1752. // of its memory over time.
  1753. ManualScaling *ManualScaling `json:"manualScaling,omitempty"`
  1754. // Name: Full path to the Version resource in the API. Example:
  1755. // `apps/myapp/services/default/versions/v1`. @OutputOnly
  1756. Name string `json:"name,omitempty"`
  1757. // Network: Extra network settings. Only applicable for VM runtimes.
  1758. Network *Network `json:"network,omitempty"`
  1759. // NobuildFilesRegex: Files that match this pattern will not be built
  1760. // into this version. Only applicable for Go runtimes. Only returned in
  1761. // `GET` requests if `view=FULL` is set.
  1762. NobuildFilesRegex string `json:"nobuildFilesRegex,omitempty"`
  1763. // Resources: Machine resources for this version. Only applicable for VM
  1764. // runtimes.
  1765. Resources *Resources `json:"resources,omitempty"`
  1766. // Runtime: Desired runtime. Example: `python27`.
  1767. Runtime string `json:"runtime,omitempty"`
  1768. // ServingStatus: Current serving status of this version. Only the
  1769. // versions with a `SERVING` status create instances and can be billed.
  1770. // `SERVING_STATUS_UNSPECIFIED` is an invalid value. Defaults to
  1771. // `SERVING`.
  1772. //
  1773. // Possible values:
  1774. // "SERVING_STATUS_UNSPECIFIED"
  1775. // "SERVING"
  1776. // "STOPPED"
  1777. ServingStatus string `json:"servingStatus,omitempty"`
  1778. // Threadsafe: Whether multiple requests can be dispatched to this
  1779. // version at once.
  1780. Threadsafe bool `json:"threadsafe,omitempty"`
  1781. // VersionUrl: Serving URL for this version. Example:
  1782. // "https://myversion-dot-myservice-dot-myapp.appspot.com" @OutputOnly
  1783. VersionUrl string `json:"versionUrl,omitempty"`
  1784. // Vm: Whether to deploy this version in a container on a virtual
  1785. // machine.
  1786. Vm bool `json:"vm,omitempty"`
  1787. // ServerResponse contains the HTTP response code and headers from the
  1788. // server.
  1789. googleapi.ServerResponse `json:"-"`
  1790. // ForceSendFields is a list of field names (e.g. "ApiConfig") to
  1791. // unconditionally include in API requests. By default, fields with
  1792. // empty values are omitted from API requests. However, any non-pointer,
  1793. // non-interface field appearing in ForceSendFields will be sent to the
  1794. // server regardless of whether the field is empty or not. This may be
  1795. // used to include empty fields in Patch requests.
  1796. ForceSendFields []string `json:"-"`
  1797. // NullFields is a list of field names (e.g. "ApiConfig") to include in
  1798. // API requests with the JSON null value. By default, fields with empty
  1799. // values are omitted from API requests. However, any field with an
  1800. // empty value appearing in NullFields will be sent to the server as
  1801. // null. It is an error if a field in this list has a non-empty value.
  1802. // This may be used to include null fields in Patch requests.
  1803. NullFields []string `json:"-"`
  1804. }
  1805. func (s *Version) MarshalJSON() ([]byte, error) {
  1806. type NoMethod Version
  1807. raw := NoMethod(*s)
  1808. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1809. }
  1810. type ZipInfo struct {
  1811. // FilesCount: An estimate of the number of files in a zip for a zip
  1812. // deployment. If set, must be greater than or equal to the actual
  1813. // number of files. Used for optimizing performance; if not provided,
  1814. // deployment may be slow.
  1815. FilesCount int64 `json:"filesCount,omitempty"`
  1816. // SourceUrl: URL of the zip file to deploy from. Must be a URL to a
  1817. // resource in Google Cloud Storage in the form
  1818. // 'http(s)://storage.googleapis.com/\/\'.
  1819. SourceUrl string `json:"sourceUrl,omitempty"`
  1820. // ForceSendFields is a list of field names (e.g. "FilesCount") to
  1821. // unconditionally include in API requests. By default, fields with
  1822. // empty values are omitted from API requests. However, any non-pointer,
  1823. // non-interface field appearing in ForceSendFields will be sent to the
  1824. // server regardless of whether the field is empty or not. This may be
  1825. // used to include empty fields in Patch requests.
  1826. ForceSendFields []string `json:"-"`
  1827. // NullFields is a list of field names (e.g. "FilesCount") to include in
  1828. // API requests with the JSON null value. By default, fields with empty
  1829. // values are omitted from API requests. However, any field with an
  1830. // empty value appearing in NullFields will be sent to the server as
  1831. // null. It is an error if a field in this list has a non-empty value.
  1832. // This may be used to include null fields in Patch requests.
  1833. NullFields []string `json:"-"`
  1834. }
  1835. func (s *ZipInfo) MarshalJSON() ([]byte, error) {
  1836. type NoMethod ZipInfo
  1837. raw := NoMethod(*s)
  1838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1839. }
  1840. // method id "appengine.apps.get":
  1841. type AppsGetCall struct {
  1842. s *APIService
  1843. appsId string
  1844. urlParams_ gensupport.URLParams
  1845. ifNoneMatch_ string
  1846. ctx_ context.Context
  1847. header_ http.Header
  1848. }
  1849. // Get: Gets information about an application.
  1850. func (r *AppsService) Get(appsId string) *AppsGetCall {
  1851. c := &AppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1852. c.appsId = appsId
  1853. return c
  1854. }
  1855. // Fields allows partial responses to be retrieved. See
  1856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1857. // for more information.
  1858. func (c *AppsGetCall) Fields(s ...googleapi.Field) *AppsGetCall {
  1859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1860. return c
  1861. }
  1862. // IfNoneMatch sets the optional parameter which makes the operation
  1863. // fail if the object's ETag matches the given value. This is useful for
  1864. // getting updates only after the object has changed since the last
  1865. // request. Use googleapi.IsNotModified to check whether the response
  1866. // error from Do is the result of In-None-Match.
  1867. func (c *AppsGetCall) IfNoneMatch(entityTag string) *AppsGetCall {
  1868. c.ifNoneMatch_ = entityTag
  1869. return c
  1870. }
  1871. // Context sets the context to be used in this call's Do method. Any
  1872. // pending HTTP request will be aborted if the provided context is
  1873. // canceled.
  1874. func (c *AppsGetCall) Context(ctx context.Context) *AppsGetCall {
  1875. c.ctx_ = ctx
  1876. return c
  1877. }
  1878. // Header returns an http.Header that can be modified by the caller to
  1879. // add HTTP headers to the request.
  1880. func (c *AppsGetCall) Header() http.Header {
  1881. if c.header_ == nil {
  1882. c.header_ = make(http.Header)
  1883. }
  1884. return c.header_
  1885. }
  1886. func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) {
  1887. reqHeaders := make(http.Header)
  1888. for k, v := range c.header_ {
  1889. reqHeaders[k] = v
  1890. }
  1891. reqHeaders.Set("User-Agent", c.s.userAgent())
  1892. if c.ifNoneMatch_ != "" {
  1893. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1894. }
  1895. var body io.Reader = nil
  1896. c.urlParams_.Set("alt", alt)
  1897. c.urlParams_.Set("prettyPrint", "false")
  1898. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}")
  1899. urls += "?" + c.urlParams_.Encode()
  1900. req, err := http.NewRequest("GET", urls, body)
  1901. if err != nil {
  1902. return nil, err
  1903. }
  1904. req.Header = reqHeaders
  1905. googleapi.Expand(req.URL, map[string]string{
  1906. "appsId": c.appsId,
  1907. })
  1908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1909. }
  1910. // Do executes the "appengine.apps.get" call.
  1911. // Exactly one of *Application or error will be non-nil. Any non-2xx
  1912. // status code is an error. Response headers are in either
  1913. // *Application.ServerResponse.Header or (if a response was returned at
  1914. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1915. // to check whether the returned error was because
  1916. // http.StatusNotModified was returned.
  1917. func (c *AppsGetCall) Do(opts ...googleapi.CallOption) (*Application, error) {
  1918. gensupport.SetOptions(c.urlParams_, opts...)
  1919. res, err := c.doRequest("json")
  1920. if res != nil && res.StatusCode == http.StatusNotModified {
  1921. if res.Body != nil {
  1922. res.Body.Close()
  1923. }
  1924. return nil, &googleapi.Error{
  1925. Code: res.StatusCode,
  1926. Header: res.Header,
  1927. }
  1928. }
  1929. if err != nil {
  1930. return nil, err
  1931. }
  1932. defer googleapi.CloseBody(res)
  1933. if err := googleapi.CheckResponse(res); err != nil {
  1934. return nil, err
  1935. }
  1936. ret := &Application{
  1937. ServerResponse: googleapi.ServerResponse{
  1938. Header: res.Header,
  1939. HTTPStatusCode: res.StatusCode,
  1940. },
  1941. }
  1942. target := &ret
  1943. if err := gensupport.DecodeResponse(target, res); err != nil {
  1944. return nil, err
  1945. }
  1946. return ret, nil
  1947. // {
  1948. // "description": "Gets information about an application.",
  1949. // "httpMethod": "GET",
  1950. // "id": "appengine.apps.get",
  1951. // "parameterOrder": [
  1952. // "appsId"
  1953. // ],
  1954. // "parameters": {
  1955. // "appsId": {
  1956. // "description": "Part of `name`. Name of the Application resource to get. Example: `apps/myapp`.",
  1957. // "location": "path",
  1958. // "required": true,
  1959. // "type": "string"
  1960. // }
  1961. // },
  1962. // "path": "v1/apps/{appsId}",
  1963. // "response": {
  1964. // "$ref": "Application"
  1965. // },
  1966. // "scopes": [
  1967. // "https://www.googleapis.com/auth/cloud-platform"
  1968. // ]
  1969. // }
  1970. }
  1971. // method id "appengine.apps.repair":
  1972. type AppsRepairCall struct {
  1973. s *APIService
  1974. appsId string
  1975. repairapplicationrequest *RepairApplicationRequest
  1976. urlParams_ gensupport.URLParams
  1977. ctx_ context.Context
  1978. header_ http.Header
  1979. }
  1980. // Repair: Recreates the required App Engine features for the
  1981. // application in your project, for example a Cloud Storage bucket or
  1982. // App Engine service account. Use this method if you receive an error
  1983. // message about a missing feature, for example "*Error retrieving the
  1984. // App Engine service account*".
  1985. func (r *AppsService) Repair(appsId string, repairapplicationrequest *RepairApplicationRequest) *AppsRepairCall {
  1986. c := &AppsRepairCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1987. c.appsId = appsId
  1988. c.repairapplicationrequest = repairapplicationrequest
  1989. return c
  1990. }
  1991. // Fields allows partial responses to be retrieved. See
  1992. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1993. // for more information.
  1994. func (c *AppsRepairCall) Fields(s ...googleapi.Field) *AppsRepairCall {
  1995. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1996. return c
  1997. }
  1998. // Context sets the context to be used in this call's Do method. Any
  1999. // pending HTTP request will be aborted if the provided context is
  2000. // canceled.
  2001. func (c *AppsRepairCall) Context(ctx context.Context) *AppsRepairCall {
  2002. c.ctx_ = ctx
  2003. return c
  2004. }
  2005. // Header returns an http.Header that can be modified by the caller to
  2006. // add HTTP headers to the request.
  2007. func (c *AppsRepairCall) Header() http.Header {
  2008. if c.header_ == nil {
  2009. c.header_ = make(http.Header)
  2010. }
  2011. return c.header_
  2012. }
  2013. func (c *AppsRepairCall) doRequest(alt string) (*http.Response, error) {
  2014. reqHeaders := make(http.Header)
  2015. for k, v := range c.header_ {
  2016. reqHeaders[k] = v
  2017. }
  2018. reqHeaders.Set("User-Agent", c.s.userAgent())
  2019. var body io.Reader = nil
  2020. body, err := googleapi.WithoutDataWrapper.JSONReader(c.repairapplicationrequest)
  2021. if err != nil {
  2022. return nil, err
  2023. }
  2024. reqHeaders.Set("Content-Type", "application/json")
  2025. c.urlParams_.Set("alt", alt)
  2026. c.urlParams_.Set("prettyPrint", "false")
  2027. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}:repair")
  2028. urls += "?" + c.urlParams_.Encode()
  2029. req, err := http.NewRequest("POST", urls, body)
  2030. if err != nil {
  2031. return nil, err
  2032. }
  2033. req.Header = reqHeaders
  2034. googleapi.Expand(req.URL, map[string]string{
  2035. "appsId": c.appsId,
  2036. })
  2037. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2038. }
  2039. // Do executes the "appengine.apps.repair" call.
  2040. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2041. // status code is an error. Response headers are in either
  2042. // *Operation.ServerResponse.Header or (if a response was returned at
  2043. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2044. // to check whether the returned error was because
  2045. // http.StatusNotModified was returned.
  2046. func (c *AppsRepairCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2047. gensupport.SetOptions(c.urlParams_, opts...)
  2048. res, err := c.doRequest("json")
  2049. if res != nil && res.StatusCode == http.StatusNotModified {
  2050. if res.Body != nil {
  2051. res.Body.Close()
  2052. }
  2053. return nil, &googleapi.Error{
  2054. Code: res.StatusCode,
  2055. Header: res.Header,
  2056. }
  2057. }
  2058. if err != nil {
  2059. return nil, err
  2060. }
  2061. defer googleapi.CloseBody(res)
  2062. if err := googleapi.CheckResponse(res); err != nil {
  2063. return nil, err
  2064. }
  2065. ret := &Operation{
  2066. ServerResponse: googleapi.ServerResponse{
  2067. Header: res.Header,
  2068. HTTPStatusCode: res.StatusCode,
  2069. },
  2070. }
  2071. target := &ret
  2072. if err := gensupport.DecodeResponse(target, res); err != nil {
  2073. return nil, err
  2074. }
  2075. return ret, nil
  2076. // {
  2077. // "description": "Recreates the required App Engine features for the application in your project, for example a Cloud Storage bucket or App Engine service account. Use this method if you receive an error message about a missing feature, for example \"*Error retrieving the App Engine service account*\".",
  2078. // "httpMethod": "POST",
  2079. // "id": "appengine.apps.repair",
  2080. // "parameterOrder": [
  2081. // "appsId"
  2082. // ],
  2083. // "parameters": {
  2084. // "appsId": {
  2085. // "description": "Part of `name`. Name of the application to repair. Example: `apps/myapp`",
  2086. // "location": "path",
  2087. // "required": true,
  2088. // "type": "string"
  2089. // }
  2090. // },
  2091. // "path": "v1/apps/{appsId}:repair",
  2092. // "request": {
  2093. // "$ref": "RepairApplicationRequest"
  2094. // },
  2095. // "response": {
  2096. // "$ref": "Operation"
  2097. // },
  2098. // "scopes": [
  2099. // "https://www.googleapis.com/auth/cloud-platform"
  2100. // ]
  2101. // }
  2102. }
  2103. // method id "appengine.apps.locations.get":
  2104. type AppsLocationsGetCall struct {
  2105. s *APIService
  2106. appsId string
  2107. locationsId string
  2108. urlParams_ gensupport.URLParams
  2109. ifNoneMatch_ string
  2110. ctx_ context.Context
  2111. header_ http.Header
  2112. }
  2113. // Get: Get information about a location.
  2114. func (r *AppsLocationsService) Get(appsId string, locationsId string) *AppsLocationsGetCall {
  2115. c := &AppsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2116. c.appsId = appsId
  2117. c.locationsId = locationsId
  2118. return c
  2119. }
  2120. // Fields allows partial responses to be retrieved. See
  2121. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2122. // for more information.
  2123. func (c *AppsLocationsGetCall) Fields(s ...googleapi.Field) *AppsLocationsGetCall {
  2124. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2125. return c
  2126. }
  2127. // IfNoneMatch sets the optional parameter which makes the operation
  2128. // fail if the object's ETag matches the given value. This is useful for
  2129. // getting updates only after the object has changed since the last
  2130. // request. Use googleapi.IsNotModified to check whether the response
  2131. // error from Do is the result of In-None-Match.
  2132. func (c *AppsLocationsGetCall) IfNoneMatch(entityTag string) *AppsLocationsGetCall {
  2133. c.ifNoneMatch_ = entityTag
  2134. return c
  2135. }
  2136. // Context sets the context to be used in this call's Do method. Any
  2137. // pending HTTP request will be aborted if the provided context is
  2138. // canceled.
  2139. func (c *AppsLocationsGetCall) Context(ctx context.Context) *AppsLocationsGetCall {
  2140. c.ctx_ = ctx
  2141. return c
  2142. }
  2143. // Header returns an http.Header that can be modified by the caller to
  2144. // add HTTP headers to the request.
  2145. func (c *AppsLocationsGetCall) Header() http.Header {
  2146. if c.header_ == nil {
  2147. c.header_ = make(http.Header)
  2148. }
  2149. return c.header_
  2150. }
  2151. func (c *AppsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  2152. reqHeaders := make(http.Header)
  2153. for k, v := range c.header_ {
  2154. reqHeaders[k] = v
  2155. }
  2156. reqHeaders.Set("User-Agent", c.s.userAgent())
  2157. if c.ifNoneMatch_ != "" {
  2158. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2159. }
  2160. var body io.Reader = nil
  2161. c.urlParams_.Set("alt", alt)
  2162. c.urlParams_.Set("prettyPrint", "false")
  2163. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/locations/{locationsId}")
  2164. urls += "?" + c.urlParams_.Encode()
  2165. req, err := http.NewRequest("GET", urls, body)
  2166. if err != nil {
  2167. return nil, err
  2168. }
  2169. req.Header = reqHeaders
  2170. googleapi.Expand(req.URL, map[string]string{
  2171. "appsId": c.appsId,
  2172. "locationsId": c.locationsId,
  2173. })
  2174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2175. }
  2176. // Do executes the "appengine.apps.locations.get" call.
  2177. // Exactly one of *Location or error will be non-nil. Any non-2xx status
  2178. // code is an error. Response headers are in either
  2179. // *Location.ServerResponse.Header or (if a response was returned at
  2180. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2181. // to check whether the returned error was because
  2182. // http.StatusNotModified was returned.
  2183. func (c *AppsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  2184. gensupport.SetOptions(c.urlParams_, opts...)
  2185. res, err := c.doRequest("json")
  2186. if res != nil && res.StatusCode == http.StatusNotModified {
  2187. if res.Body != nil {
  2188. res.Body.Close()
  2189. }
  2190. return nil, &googleapi.Error{
  2191. Code: res.StatusCode,
  2192. Header: res.Header,
  2193. }
  2194. }
  2195. if err != nil {
  2196. return nil, err
  2197. }
  2198. defer googleapi.CloseBody(res)
  2199. if err := googleapi.CheckResponse(res); err != nil {
  2200. return nil, err
  2201. }
  2202. ret := &Location{
  2203. ServerResponse: googleapi.ServerResponse{
  2204. Header: res.Header,
  2205. HTTPStatusCode: res.StatusCode,
  2206. },
  2207. }
  2208. target := &ret
  2209. if err := gensupport.DecodeResponse(target, res); err != nil {
  2210. return nil, err
  2211. }
  2212. return ret, nil
  2213. // {
  2214. // "description": "Get information about a location.",
  2215. // "httpMethod": "GET",
  2216. // "id": "appengine.apps.locations.get",
  2217. // "parameterOrder": [
  2218. // "appsId",
  2219. // "locationsId"
  2220. // ],
  2221. // "parameters": {
  2222. // "appsId": {
  2223. // "description": "Part of `name`. Resource name for the location.",
  2224. // "location": "path",
  2225. // "required": true,
  2226. // "type": "string"
  2227. // },
  2228. // "locationsId": {
  2229. // "description": "Part of `name`. See documentation of `appsId`.",
  2230. // "location": "path",
  2231. // "required": true,
  2232. // "type": "string"
  2233. // }
  2234. // },
  2235. // "path": "v1/apps/{appsId}/locations/{locationsId}",
  2236. // "response": {
  2237. // "$ref": "Location"
  2238. // },
  2239. // "scopes": [
  2240. // "https://www.googleapis.com/auth/cloud-platform"
  2241. // ]
  2242. // }
  2243. }
  2244. // method id "appengine.apps.locations.list":
  2245. type AppsLocationsListCall struct {
  2246. s *APIService
  2247. appsId string
  2248. urlParams_ gensupport.URLParams
  2249. ifNoneMatch_ string
  2250. ctx_ context.Context
  2251. header_ http.Header
  2252. }
  2253. // List: Lists information about the supported locations for this
  2254. // service.
  2255. func (r *AppsLocationsService) List(appsId string) *AppsLocationsListCall {
  2256. c := &AppsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2257. c.appsId = appsId
  2258. return c
  2259. }
  2260. // Filter sets the optional parameter "filter": The standard list
  2261. // filter.
  2262. func (c *AppsLocationsListCall) Filter(filter string) *AppsLocationsListCall {
  2263. c.urlParams_.Set("filter", filter)
  2264. return c
  2265. }
  2266. // PageSize sets the optional parameter "pageSize": The standard list
  2267. // page size.
  2268. func (c *AppsLocationsListCall) PageSize(pageSize int64) *AppsLocationsListCall {
  2269. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2270. return c
  2271. }
  2272. // PageToken sets the optional parameter "pageToken": The standard list
  2273. // page token.
  2274. func (c *AppsLocationsListCall) PageToken(pageToken string) *AppsLocationsListCall {
  2275. c.urlParams_.Set("pageToken", pageToken)
  2276. return c
  2277. }
  2278. // Fields allows partial responses to be retrieved. See
  2279. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2280. // for more information.
  2281. func (c *AppsLocationsListCall) Fields(s ...googleapi.Field) *AppsLocationsListCall {
  2282. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2283. return c
  2284. }
  2285. // IfNoneMatch sets the optional parameter which makes the operation
  2286. // fail if the object's ETag matches the given value. This is useful for
  2287. // getting updates only after the object has changed since the last
  2288. // request. Use googleapi.IsNotModified to check whether the response
  2289. // error from Do is the result of In-None-Match.
  2290. func (c *AppsLocationsListCall) IfNoneMatch(entityTag string) *AppsLocationsListCall {
  2291. c.ifNoneMatch_ = entityTag
  2292. return c
  2293. }
  2294. // Context sets the context to be used in this call's Do method. Any
  2295. // pending HTTP request will be aborted if the provided context is
  2296. // canceled.
  2297. func (c *AppsLocationsListCall) Context(ctx context.Context) *AppsLocationsListCall {
  2298. c.ctx_ = ctx
  2299. return c
  2300. }
  2301. // Header returns an http.Header that can be modified by the caller to
  2302. // add HTTP headers to the request.
  2303. func (c *AppsLocationsListCall) Header() http.Header {
  2304. if c.header_ == nil {
  2305. c.header_ = make(http.Header)
  2306. }
  2307. return c.header_
  2308. }
  2309. func (c *AppsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  2310. reqHeaders := make(http.Header)
  2311. for k, v := range c.header_ {
  2312. reqHeaders[k] = v
  2313. }
  2314. reqHeaders.Set("User-Agent", c.s.userAgent())
  2315. if c.ifNoneMatch_ != "" {
  2316. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2317. }
  2318. var body io.Reader = nil
  2319. c.urlParams_.Set("alt", alt)
  2320. c.urlParams_.Set("prettyPrint", "false")
  2321. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/locations")
  2322. urls += "?" + c.urlParams_.Encode()
  2323. req, err := http.NewRequest("GET", urls, body)
  2324. if err != nil {
  2325. return nil, err
  2326. }
  2327. req.Header = reqHeaders
  2328. googleapi.Expand(req.URL, map[string]string{
  2329. "appsId": c.appsId,
  2330. })
  2331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2332. }
  2333. // Do executes the "appengine.apps.locations.list" call.
  2334. // Exactly one of *ListLocationsResponse or error will be non-nil. Any
  2335. // non-2xx status code is an error. Response headers are in either
  2336. // *ListLocationsResponse.ServerResponse.Header or (if a response was
  2337. // returned at all) in error.(*googleapi.Error).Header. Use
  2338. // googleapi.IsNotModified to check whether the returned error was
  2339. // because http.StatusNotModified was returned.
  2340. func (c *AppsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  2341. gensupport.SetOptions(c.urlParams_, opts...)
  2342. res, err := c.doRequest("json")
  2343. if res != nil && res.StatusCode == http.StatusNotModified {
  2344. if res.Body != nil {
  2345. res.Body.Close()
  2346. }
  2347. return nil, &googleapi.Error{
  2348. Code: res.StatusCode,
  2349. Header: res.Header,
  2350. }
  2351. }
  2352. if err != nil {
  2353. return nil, err
  2354. }
  2355. defer googleapi.CloseBody(res)
  2356. if err := googleapi.CheckResponse(res); err != nil {
  2357. return nil, err
  2358. }
  2359. ret := &ListLocationsResponse{
  2360. ServerResponse: googleapi.ServerResponse{
  2361. Header: res.Header,
  2362. HTTPStatusCode: res.StatusCode,
  2363. },
  2364. }
  2365. target := &ret
  2366. if err := gensupport.DecodeResponse(target, res); err != nil {
  2367. return nil, err
  2368. }
  2369. return ret, nil
  2370. // {
  2371. // "description": "Lists information about the supported locations for this service.",
  2372. // "httpMethod": "GET",
  2373. // "id": "appengine.apps.locations.list",
  2374. // "parameterOrder": [
  2375. // "appsId"
  2376. // ],
  2377. // "parameters": {
  2378. // "appsId": {
  2379. // "description": "Part of `name`. The resource that owns the locations collection, if applicable.",
  2380. // "location": "path",
  2381. // "required": true,
  2382. // "type": "string"
  2383. // },
  2384. // "filter": {
  2385. // "description": "The standard list filter.",
  2386. // "location": "query",
  2387. // "type": "string"
  2388. // },
  2389. // "pageSize": {
  2390. // "description": "The standard list page size.",
  2391. // "format": "int32",
  2392. // "location": "query",
  2393. // "type": "integer"
  2394. // },
  2395. // "pageToken": {
  2396. // "description": "The standard list page token.",
  2397. // "location": "query",
  2398. // "type": "string"
  2399. // }
  2400. // },
  2401. // "path": "v1/apps/{appsId}/locations",
  2402. // "response": {
  2403. // "$ref": "ListLocationsResponse"
  2404. // },
  2405. // "scopes": [
  2406. // "https://www.googleapis.com/auth/cloud-platform"
  2407. // ]
  2408. // }
  2409. }
  2410. // Pages invokes f for each page of results.
  2411. // A non-nil error returned from f will halt the iteration.
  2412. // The provided context supersedes any context provided to the Context method.
  2413. func (c *AppsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  2414. c.ctx_ = ctx
  2415. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2416. for {
  2417. x, err := c.Do()
  2418. if err != nil {
  2419. return err
  2420. }
  2421. if err := f(x); err != nil {
  2422. return err
  2423. }
  2424. if x.NextPageToken == "" {
  2425. return nil
  2426. }
  2427. c.PageToken(x.NextPageToken)
  2428. }
  2429. }
  2430. // method id "appengine.apps.operations.get":
  2431. type AppsOperationsGetCall struct {
  2432. s *APIService
  2433. appsId string
  2434. operationsId string
  2435. urlParams_ gensupport.URLParams
  2436. ifNoneMatch_ string
  2437. ctx_ context.Context
  2438. header_ http.Header
  2439. }
  2440. // Get: Gets the latest state of a long-running operation. Clients can
  2441. // use this method to poll the operation result at intervals as
  2442. // recommended by the API service.
  2443. func (r *AppsOperationsService) Get(appsId string, operationsId string) *AppsOperationsGetCall {
  2444. c := &AppsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2445. c.appsId = appsId
  2446. c.operationsId = operationsId
  2447. return c
  2448. }
  2449. // Fields allows partial responses to be retrieved. See
  2450. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2451. // for more information.
  2452. func (c *AppsOperationsGetCall) Fields(s ...googleapi.Field) *AppsOperationsGetCall {
  2453. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2454. return c
  2455. }
  2456. // IfNoneMatch sets the optional parameter which makes the operation
  2457. // fail if the object's ETag matches the given value. This is useful for
  2458. // getting updates only after the object has changed since the last
  2459. // request. Use googleapi.IsNotModified to check whether the response
  2460. // error from Do is the result of In-None-Match.
  2461. func (c *AppsOperationsGetCall) IfNoneMatch(entityTag string) *AppsOperationsGetCall {
  2462. c.ifNoneMatch_ = entityTag
  2463. return c
  2464. }
  2465. // Context sets the context to be used in this call's Do method. Any
  2466. // pending HTTP request will be aborted if the provided context is
  2467. // canceled.
  2468. func (c *AppsOperationsGetCall) Context(ctx context.Context) *AppsOperationsGetCall {
  2469. c.ctx_ = ctx
  2470. return c
  2471. }
  2472. // Header returns an http.Header that can be modified by the caller to
  2473. // add HTTP headers to the request.
  2474. func (c *AppsOperationsGetCall) Header() http.Header {
  2475. if c.header_ == nil {
  2476. c.header_ = make(http.Header)
  2477. }
  2478. return c.header_
  2479. }
  2480. func (c *AppsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2481. reqHeaders := make(http.Header)
  2482. for k, v := range c.header_ {
  2483. reqHeaders[k] = v
  2484. }
  2485. reqHeaders.Set("User-Agent", c.s.userAgent())
  2486. if c.ifNoneMatch_ != "" {
  2487. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2488. }
  2489. var body io.Reader = nil
  2490. c.urlParams_.Set("alt", alt)
  2491. c.urlParams_.Set("prettyPrint", "false")
  2492. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/operations/{operationsId}")
  2493. urls += "?" + c.urlParams_.Encode()
  2494. req, err := http.NewRequest("GET", urls, body)
  2495. if err != nil {
  2496. return nil, err
  2497. }
  2498. req.Header = reqHeaders
  2499. googleapi.Expand(req.URL, map[string]string{
  2500. "appsId": c.appsId,
  2501. "operationsId": c.operationsId,
  2502. })
  2503. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2504. }
  2505. // Do executes the "appengine.apps.operations.get" call.
  2506. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2507. // status code is an error. Response headers are in either
  2508. // *Operation.ServerResponse.Header or (if a response was returned at
  2509. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2510. // to check whether the returned error was because
  2511. // http.StatusNotModified was returned.
  2512. func (c *AppsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2513. gensupport.SetOptions(c.urlParams_, opts...)
  2514. res, err := c.doRequest("json")
  2515. if res != nil && res.StatusCode == http.StatusNotModified {
  2516. if res.Body != nil {
  2517. res.Body.Close()
  2518. }
  2519. return nil, &googleapi.Error{
  2520. Code: res.StatusCode,
  2521. Header: res.Header,
  2522. }
  2523. }
  2524. if err != nil {
  2525. return nil, err
  2526. }
  2527. defer googleapi.CloseBody(res)
  2528. if err := googleapi.CheckResponse(res); err != nil {
  2529. return nil, err
  2530. }
  2531. ret := &Operation{
  2532. ServerResponse: googleapi.ServerResponse{
  2533. Header: res.Header,
  2534. HTTPStatusCode: res.StatusCode,
  2535. },
  2536. }
  2537. target := &ret
  2538. if err := gensupport.DecodeResponse(target, res); err != nil {
  2539. return nil, err
  2540. }
  2541. return ret, nil
  2542. // {
  2543. // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
  2544. // "httpMethod": "GET",
  2545. // "id": "appengine.apps.operations.get",
  2546. // "parameterOrder": [
  2547. // "appsId",
  2548. // "operationsId"
  2549. // ],
  2550. // "parameters": {
  2551. // "appsId": {
  2552. // "description": "Part of `name`. The name of the operation resource.",
  2553. // "location": "path",
  2554. // "required": true,
  2555. // "type": "string"
  2556. // },
  2557. // "operationsId": {
  2558. // "description": "Part of `name`. See documentation of `appsId`.",
  2559. // "location": "path",
  2560. // "required": true,
  2561. // "type": "string"
  2562. // }
  2563. // },
  2564. // "path": "v1/apps/{appsId}/operations/{operationsId}",
  2565. // "response": {
  2566. // "$ref": "Operation"
  2567. // },
  2568. // "scopes": [
  2569. // "https://www.googleapis.com/auth/cloud-platform"
  2570. // ]
  2571. // }
  2572. }
  2573. // method id "appengine.apps.operations.list":
  2574. type AppsOperationsListCall struct {
  2575. s *APIService
  2576. appsId string
  2577. urlParams_ gensupport.URLParams
  2578. ifNoneMatch_ string
  2579. ctx_ context.Context
  2580. header_ http.Header
  2581. }
  2582. // List: Lists operations that match the specified filter in the
  2583. // request. If the server doesn't support this method, it returns
  2584. // `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services
  2585. // to override the binding to use different resource name schemes, such
  2586. // as `users/*/operations`.
  2587. func (r *AppsOperationsService) List(appsId string) *AppsOperationsListCall {
  2588. c := &AppsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2589. c.appsId = appsId
  2590. return c
  2591. }
  2592. // Filter sets the optional parameter "filter": The standard list
  2593. // filter.
  2594. func (c *AppsOperationsListCall) Filter(filter string) *AppsOperationsListCall {
  2595. c.urlParams_.Set("filter", filter)
  2596. return c
  2597. }
  2598. // PageSize sets the optional parameter "pageSize": The standard list
  2599. // page size.
  2600. func (c *AppsOperationsListCall) PageSize(pageSize int64) *AppsOperationsListCall {
  2601. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2602. return c
  2603. }
  2604. // PageToken sets the optional parameter "pageToken": The standard list
  2605. // page token.
  2606. func (c *AppsOperationsListCall) PageToken(pageToken string) *AppsOperationsListCall {
  2607. c.urlParams_.Set("pageToken", pageToken)
  2608. return c
  2609. }
  2610. // Fields allows partial responses to be retrieved. See
  2611. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2612. // for more information.
  2613. func (c *AppsOperationsListCall) Fields(s ...googleapi.Field) *AppsOperationsListCall {
  2614. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2615. return c
  2616. }
  2617. // IfNoneMatch sets the optional parameter which makes the operation
  2618. // fail if the object's ETag matches the given value. This is useful for
  2619. // getting updates only after the object has changed since the last
  2620. // request. Use googleapi.IsNotModified to check whether the response
  2621. // error from Do is the result of In-None-Match.
  2622. func (c *AppsOperationsListCall) IfNoneMatch(entityTag string) *AppsOperationsListCall {
  2623. c.ifNoneMatch_ = entityTag
  2624. return c
  2625. }
  2626. // Context sets the context to be used in this call's Do method. Any
  2627. // pending HTTP request will be aborted if the provided context is
  2628. // canceled.
  2629. func (c *AppsOperationsListCall) Context(ctx context.Context) *AppsOperationsListCall {
  2630. c.ctx_ = ctx
  2631. return c
  2632. }
  2633. // Header returns an http.Header that can be modified by the caller to
  2634. // add HTTP headers to the request.
  2635. func (c *AppsOperationsListCall) Header() http.Header {
  2636. if c.header_ == nil {
  2637. c.header_ = make(http.Header)
  2638. }
  2639. return c.header_
  2640. }
  2641. func (c *AppsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  2642. reqHeaders := make(http.Header)
  2643. for k, v := range c.header_ {
  2644. reqHeaders[k] = v
  2645. }
  2646. reqHeaders.Set("User-Agent", c.s.userAgent())
  2647. if c.ifNoneMatch_ != "" {
  2648. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2649. }
  2650. var body io.Reader = nil
  2651. c.urlParams_.Set("alt", alt)
  2652. c.urlParams_.Set("prettyPrint", "false")
  2653. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/operations")
  2654. urls += "?" + c.urlParams_.Encode()
  2655. req, err := http.NewRequest("GET", urls, body)
  2656. if err != nil {
  2657. return nil, err
  2658. }
  2659. req.Header = reqHeaders
  2660. googleapi.Expand(req.URL, map[string]string{
  2661. "appsId": c.appsId,
  2662. })
  2663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2664. }
  2665. // Do executes the "appengine.apps.operations.list" call.
  2666. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  2667. // non-2xx status code is an error. Response headers are in either
  2668. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  2669. // returned at all) in error.(*googleapi.Error).Header. Use
  2670. // googleapi.IsNotModified to check whether the returned error was
  2671. // because http.StatusNotModified was returned.
  2672. func (c *AppsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  2673. gensupport.SetOptions(c.urlParams_, opts...)
  2674. res, err := c.doRequest("json")
  2675. if res != nil && res.StatusCode == http.StatusNotModified {
  2676. if res.Body != nil {
  2677. res.Body.Close()
  2678. }
  2679. return nil, &googleapi.Error{
  2680. Code: res.StatusCode,
  2681. Header: res.Header,
  2682. }
  2683. }
  2684. if err != nil {
  2685. return nil, err
  2686. }
  2687. defer googleapi.CloseBody(res)
  2688. if err := googleapi.CheckResponse(res); err != nil {
  2689. return nil, err
  2690. }
  2691. ret := &ListOperationsResponse{
  2692. ServerResponse: googleapi.ServerResponse{
  2693. Header: res.Header,
  2694. HTTPStatusCode: res.StatusCode,
  2695. },
  2696. }
  2697. target := &ret
  2698. if err := gensupport.DecodeResponse(target, res); err != nil {
  2699. return nil, err
  2700. }
  2701. return ret, nil
  2702. // {
  2703. // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`.",
  2704. // "httpMethod": "GET",
  2705. // "id": "appengine.apps.operations.list",
  2706. // "parameterOrder": [
  2707. // "appsId"
  2708. // ],
  2709. // "parameters": {
  2710. // "appsId": {
  2711. // "description": "Part of `name`. The name of the operation collection.",
  2712. // "location": "path",
  2713. // "required": true,
  2714. // "type": "string"
  2715. // },
  2716. // "filter": {
  2717. // "description": "The standard list filter.",
  2718. // "location": "query",
  2719. // "type": "string"
  2720. // },
  2721. // "pageSize": {
  2722. // "description": "The standard list page size.",
  2723. // "format": "int32",
  2724. // "location": "query",
  2725. // "type": "integer"
  2726. // },
  2727. // "pageToken": {
  2728. // "description": "The standard list page token.",
  2729. // "location": "query",
  2730. // "type": "string"
  2731. // }
  2732. // },
  2733. // "path": "v1/apps/{appsId}/operations",
  2734. // "response": {
  2735. // "$ref": "ListOperationsResponse"
  2736. // },
  2737. // "scopes": [
  2738. // "https://www.googleapis.com/auth/cloud-platform"
  2739. // ]
  2740. // }
  2741. }
  2742. // Pages invokes f for each page of results.
  2743. // A non-nil error returned from f will halt the iteration.
  2744. // The provided context supersedes any context provided to the Context method.
  2745. func (c *AppsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  2746. c.ctx_ = ctx
  2747. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2748. for {
  2749. x, err := c.Do()
  2750. if err != nil {
  2751. return err
  2752. }
  2753. if err := f(x); err != nil {
  2754. return err
  2755. }
  2756. if x.NextPageToken == "" {
  2757. return nil
  2758. }
  2759. c.PageToken(x.NextPageToken)
  2760. }
  2761. }
  2762. // method id "appengine.apps.services.delete":
  2763. type AppsServicesDeleteCall struct {
  2764. s *APIService
  2765. appsId string
  2766. servicesId string
  2767. urlParams_ gensupport.URLParams
  2768. ctx_ context.Context
  2769. header_ http.Header
  2770. }
  2771. // Delete: Deletes the specified service and all enclosed versions.
  2772. func (r *AppsServicesService) Delete(appsId string, servicesId string) *AppsServicesDeleteCall {
  2773. c := &AppsServicesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2774. c.appsId = appsId
  2775. c.servicesId = servicesId
  2776. return c
  2777. }
  2778. // Fields allows partial responses to be retrieved. See
  2779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2780. // for more information.
  2781. func (c *AppsServicesDeleteCall) Fields(s ...googleapi.Field) *AppsServicesDeleteCall {
  2782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2783. return c
  2784. }
  2785. // Context sets the context to be used in this call's Do method. Any
  2786. // pending HTTP request will be aborted if the provided context is
  2787. // canceled.
  2788. func (c *AppsServicesDeleteCall) Context(ctx context.Context) *AppsServicesDeleteCall {
  2789. c.ctx_ = ctx
  2790. return c
  2791. }
  2792. // Header returns an http.Header that can be modified by the caller to
  2793. // add HTTP headers to the request.
  2794. func (c *AppsServicesDeleteCall) Header() http.Header {
  2795. if c.header_ == nil {
  2796. c.header_ = make(http.Header)
  2797. }
  2798. return c.header_
  2799. }
  2800. func (c *AppsServicesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2801. reqHeaders := make(http.Header)
  2802. for k, v := range c.header_ {
  2803. reqHeaders[k] = v
  2804. }
  2805. reqHeaders.Set("User-Agent", c.s.userAgent())
  2806. var body io.Reader = nil
  2807. c.urlParams_.Set("alt", alt)
  2808. c.urlParams_.Set("prettyPrint", "false")
  2809. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}")
  2810. urls += "?" + c.urlParams_.Encode()
  2811. req, err := http.NewRequest("DELETE", urls, body)
  2812. if err != nil {
  2813. return nil, err
  2814. }
  2815. req.Header = reqHeaders
  2816. googleapi.Expand(req.URL, map[string]string{
  2817. "appsId": c.appsId,
  2818. "servicesId": c.servicesId,
  2819. })
  2820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2821. }
  2822. // Do executes the "appengine.apps.services.delete" call.
  2823. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  2824. // status code is an error. Response headers are in either
  2825. // *Operation.ServerResponse.Header or (if a response was returned at
  2826. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2827. // to check whether the returned error was because
  2828. // http.StatusNotModified was returned.
  2829. func (c *AppsServicesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  2830. gensupport.SetOptions(c.urlParams_, opts...)
  2831. res, err := c.doRequest("json")
  2832. if res != nil && res.StatusCode == http.StatusNotModified {
  2833. if res.Body != nil {
  2834. res.Body.Close()
  2835. }
  2836. return nil, &googleapi.Error{
  2837. Code: res.StatusCode,
  2838. Header: res.Header,
  2839. }
  2840. }
  2841. if err != nil {
  2842. return nil, err
  2843. }
  2844. defer googleapi.CloseBody(res)
  2845. if err := googleapi.CheckResponse(res); err != nil {
  2846. return nil, err
  2847. }
  2848. ret := &Operation{
  2849. ServerResponse: googleapi.ServerResponse{
  2850. Header: res.Header,
  2851. HTTPStatusCode: res.StatusCode,
  2852. },
  2853. }
  2854. target := &ret
  2855. if err := gensupport.DecodeResponse(target, res); err != nil {
  2856. return nil, err
  2857. }
  2858. return ret, nil
  2859. // {
  2860. // "description": "Deletes the specified service and all enclosed versions.",
  2861. // "httpMethod": "DELETE",
  2862. // "id": "appengine.apps.services.delete",
  2863. // "parameterOrder": [
  2864. // "appsId",
  2865. // "servicesId"
  2866. // ],
  2867. // "parameters": {
  2868. // "appsId": {
  2869. // "description": "Part of `name`. Name of the resource requested. Example: `apps/myapp/services/default`.",
  2870. // "location": "path",
  2871. // "required": true,
  2872. // "type": "string"
  2873. // },
  2874. // "servicesId": {
  2875. // "description": "Part of `name`. See documentation of `appsId`.",
  2876. // "location": "path",
  2877. // "required": true,
  2878. // "type": "string"
  2879. // }
  2880. // },
  2881. // "path": "v1/apps/{appsId}/services/{servicesId}",
  2882. // "response": {
  2883. // "$ref": "Operation"
  2884. // },
  2885. // "scopes": [
  2886. // "https://www.googleapis.com/auth/cloud-platform"
  2887. // ]
  2888. // }
  2889. }
  2890. // method id "appengine.apps.services.get":
  2891. type AppsServicesGetCall struct {
  2892. s *APIService
  2893. appsId string
  2894. servicesId string
  2895. urlParams_ gensupport.URLParams
  2896. ifNoneMatch_ string
  2897. ctx_ context.Context
  2898. header_ http.Header
  2899. }
  2900. // Get: Gets the current configuration of the specified service.
  2901. func (r *AppsServicesService) Get(appsId string, servicesId string) *AppsServicesGetCall {
  2902. c := &AppsServicesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2903. c.appsId = appsId
  2904. c.servicesId = servicesId
  2905. return c
  2906. }
  2907. // Fields allows partial responses to be retrieved. See
  2908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2909. // for more information.
  2910. func (c *AppsServicesGetCall) Fields(s ...googleapi.Field) *AppsServicesGetCall {
  2911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2912. return c
  2913. }
  2914. // IfNoneMatch sets the optional parameter which makes the operation
  2915. // fail if the object's ETag matches the given value. This is useful for
  2916. // getting updates only after the object has changed since the last
  2917. // request. Use googleapi.IsNotModified to check whether the response
  2918. // error from Do is the result of In-None-Match.
  2919. func (c *AppsServicesGetCall) IfNoneMatch(entityTag string) *AppsServicesGetCall {
  2920. c.ifNoneMatch_ = entityTag
  2921. return c
  2922. }
  2923. // Context sets the context to be used in this call's Do method. Any
  2924. // pending HTTP request will be aborted if the provided context is
  2925. // canceled.
  2926. func (c *AppsServicesGetCall) Context(ctx context.Context) *AppsServicesGetCall {
  2927. c.ctx_ = ctx
  2928. return c
  2929. }
  2930. // Header returns an http.Header that can be modified by the caller to
  2931. // add HTTP headers to the request.
  2932. func (c *AppsServicesGetCall) Header() http.Header {
  2933. if c.header_ == nil {
  2934. c.header_ = make(http.Header)
  2935. }
  2936. return c.header_
  2937. }
  2938. func (c *AppsServicesGetCall) doRequest(alt string) (*http.Response, error) {
  2939. reqHeaders := make(http.Header)
  2940. for k, v := range c.header_ {
  2941. reqHeaders[k] = v
  2942. }
  2943. reqHeaders.Set("User-Agent", c.s.userAgent())
  2944. if c.ifNoneMatch_ != "" {
  2945. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2946. }
  2947. var body io.Reader = nil
  2948. c.urlParams_.Set("alt", alt)
  2949. c.urlParams_.Set("prettyPrint", "false")
  2950. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}")
  2951. urls += "?" + c.urlParams_.Encode()
  2952. req, err := http.NewRequest("GET", urls, body)
  2953. if err != nil {
  2954. return nil, err
  2955. }
  2956. req.Header = reqHeaders
  2957. googleapi.Expand(req.URL, map[string]string{
  2958. "appsId": c.appsId,
  2959. "servicesId": c.servicesId,
  2960. })
  2961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2962. }
  2963. // Do executes the "appengine.apps.services.get" call.
  2964. // Exactly one of *Service or error will be non-nil. Any non-2xx status
  2965. // code is an error. Response headers are in either
  2966. // *Service.ServerResponse.Header or (if a response was returned at all)
  2967. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2968. // check whether the returned error was because http.StatusNotModified
  2969. // was returned.
  2970. func (c *AppsServicesGetCall) Do(opts ...googleapi.CallOption) (*Service, error) {
  2971. gensupport.SetOptions(c.urlParams_, opts...)
  2972. res, err := c.doRequest("json")
  2973. if res != nil && res.StatusCode == http.StatusNotModified {
  2974. if res.Body != nil {
  2975. res.Body.Close()
  2976. }
  2977. return nil, &googleapi.Error{
  2978. Code: res.StatusCode,
  2979. Header: res.Header,
  2980. }
  2981. }
  2982. if err != nil {
  2983. return nil, err
  2984. }
  2985. defer googleapi.CloseBody(res)
  2986. if err := googleapi.CheckResponse(res); err != nil {
  2987. return nil, err
  2988. }
  2989. ret := &Service{
  2990. ServerResponse: googleapi.ServerResponse{
  2991. Header: res.Header,
  2992. HTTPStatusCode: res.StatusCode,
  2993. },
  2994. }
  2995. target := &ret
  2996. if err := gensupport.DecodeResponse(target, res); err != nil {
  2997. return nil, err
  2998. }
  2999. return ret, nil
  3000. // {
  3001. // "description": "Gets the current configuration of the specified service.",
  3002. // "httpMethod": "GET",
  3003. // "id": "appengine.apps.services.get",
  3004. // "parameterOrder": [
  3005. // "appsId",
  3006. // "servicesId"
  3007. // ],
  3008. // "parameters": {
  3009. // "appsId": {
  3010. // "description": "Part of `name`. Name of the resource requested. Example: `apps/myapp/services/default`.",
  3011. // "location": "path",
  3012. // "required": true,
  3013. // "type": "string"
  3014. // },
  3015. // "servicesId": {
  3016. // "description": "Part of `name`. See documentation of `appsId`.",
  3017. // "location": "path",
  3018. // "required": true,
  3019. // "type": "string"
  3020. // }
  3021. // },
  3022. // "path": "v1/apps/{appsId}/services/{servicesId}",
  3023. // "response": {
  3024. // "$ref": "Service"
  3025. // },
  3026. // "scopes": [
  3027. // "https://www.googleapis.com/auth/cloud-platform"
  3028. // ]
  3029. // }
  3030. }
  3031. // method id "appengine.apps.services.list":
  3032. type AppsServicesListCall struct {
  3033. s *APIService
  3034. appsId string
  3035. urlParams_ gensupport.URLParams
  3036. ifNoneMatch_ string
  3037. ctx_ context.Context
  3038. header_ http.Header
  3039. }
  3040. // List: Lists all the services in the application.
  3041. func (r *AppsServicesService) List(appsId string) *AppsServicesListCall {
  3042. c := &AppsServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3043. c.appsId = appsId
  3044. return c
  3045. }
  3046. // PageSize sets the optional parameter "pageSize": Maximum results to
  3047. // return per page.
  3048. func (c *AppsServicesListCall) PageSize(pageSize int64) *AppsServicesListCall {
  3049. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3050. return c
  3051. }
  3052. // PageToken sets the optional parameter "pageToken": Continuation token
  3053. // for fetching the next page of results.
  3054. func (c *AppsServicesListCall) PageToken(pageToken string) *AppsServicesListCall {
  3055. c.urlParams_.Set("pageToken", pageToken)
  3056. return c
  3057. }
  3058. // Fields allows partial responses to be retrieved. See
  3059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3060. // for more information.
  3061. func (c *AppsServicesListCall) Fields(s ...googleapi.Field) *AppsServicesListCall {
  3062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3063. return c
  3064. }
  3065. // IfNoneMatch sets the optional parameter which makes the operation
  3066. // fail if the object's ETag matches the given value. This is useful for
  3067. // getting updates only after the object has changed since the last
  3068. // request. Use googleapi.IsNotModified to check whether the response
  3069. // error from Do is the result of In-None-Match.
  3070. func (c *AppsServicesListCall) IfNoneMatch(entityTag string) *AppsServicesListCall {
  3071. c.ifNoneMatch_ = entityTag
  3072. return c
  3073. }
  3074. // Context sets the context to be used in this call's Do method. Any
  3075. // pending HTTP request will be aborted if the provided context is
  3076. // canceled.
  3077. func (c *AppsServicesListCall) Context(ctx context.Context) *AppsServicesListCall {
  3078. c.ctx_ = ctx
  3079. return c
  3080. }
  3081. // Header returns an http.Header that can be modified by the caller to
  3082. // add HTTP headers to the request.
  3083. func (c *AppsServicesListCall) Header() http.Header {
  3084. if c.header_ == nil {
  3085. c.header_ = make(http.Header)
  3086. }
  3087. return c.header_
  3088. }
  3089. func (c *AppsServicesListCall) doRequest(alt string) (*http.Response, error) {
  3090. reqHeaders := make(http.Header)
  3091. for k, v := range c.header_ {
  3092. reqHeaders[k] = v
  3093. }
  3094. reqHeaders.Set("User-Agent", c.s.userAgent())
  3095. if c.ifNoneMatch_ != "" {
  3096. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3097. }
  3098. var body io.Reader = nil
  3099. c.urlParams_.Set("alt", alt)
  3100. c.urlParams_.Set("prettyPrint", "false")
  3101. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services")
  3102. urls += "?" + c.urlParams_.Encode()
  3103. req, err := http.NewRequest("GET", urls, body)
  3104. if err != nil {
  3105. return nil, err
  3106. }
  3107. req.Header = reqHeaders
  3108. googleapi.Expand(req.URL, map[string]string{
  3109. "appsId": c.appsId,
  3110. })
  3111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3112. }
  3113. // Do executes the "appengine.apps.services.list" call.
  3114. // Exactly one of *ListServicesResponse or error will be non-nil. Any
  3115. // non-2xx status code is an error. Response headers are in either
  3116. // *ListServicesResponse.ServerResponse.Header or (if a response was
  3117. // returned at all) in error.(*googleapi.Error).Header. Use
  3118. // googleapi.IsNotModified to check whether the returned error was
  3119. // because http.StatusNotModified was returned.
  3120. func (c *AppsServicesListCall) Do(opts ...googleapi.CallOption) (*ListServicesResponse, error) {
  3121. gensupport.SetOptions(c.urlParams_, opts...)
  3122. res, err := c.doRequest("json")
  3123. if res != nil && res.StatusCode == http.StatusNotModified {
  3124. if res.Body != nil {
  3125. res.Body.Close()
  3126. }
  3127. return nil, &googleapi.Error{
  3128. Code: res.StatusCode,
  3129. Header: res.Header,
  3130. }
  3131. }
  3132. if err != nil {
  3133. return nil, err
  3134. }
  3135. defer googleapi.CloseBody(res)
  3136. if err := googleapi.CheckResponse(res); err != nil {
  3137. return nil, err
  3138. }
  3139. ret := &ListServicesResponse{
  3140. ServerResponse: googleapi.ServerResponse{
  3141. Header: res.Header,
  3142. HTTPStatusCode: res.StatusCode,
  3143. },
  3144. }
  3145. target := &ret
  3146. if err := gensupport.DecodeResponse(target, res); err != nil {
  3147. return nil, err
  3148. }
  3149. return ret, nil
  3150. // {
  3151. // "description": "Lists all the services in the application.",
  3152. // "httpMethod": "GET",
  3153. // "id": "appengine.apps.services.list",
  3154. // "parameterOrder": [
  3155. // "appsId"
  3156. // ],
  3157. // "parameters": {
  3158. // "appsId": {
  3159. // "description": "Part of `parent`. Name of the parent Application resource. Example: `apps/myapp`.",
  3160. // "location": "path",
  3161. // "required": true,
  3162. // "type": "string"
  3163. // },
  3164. // "pageSize": {
  3165. // "description": "Maximum results to return per page.",
  3166. // "format": "int32",
  3167. // "location": "query",
  3168. // "type": "integer"
  3169. // },
  3170. // "pageToken": {
  3171. // "description": "Continuation token for fetching the next page of results.",
  3172. // "location": "query",
  3173. // "type": "string"
  3174. // }
  3175. // },
  3176. // "path": "v1/apps/{appsId}/services",
  3177. // "response": {
  3178. // "$ref": "ListServicesResponse"
  3179. // },
  3180. // "scopes": [
  3181. // "https://www.googleapis.com/auth/cloud-platform"
  3182. // ]
  3183. // }
  3184. }
  3185. // Pages invokes f for each page of results.
  3186. // A non-nil error returned from f will halt the iteration.
  3187. // The provided context supersedes any context provided to the Context method.
  3188. func (c *AppsServicesListCall) Pages(ctx context.Context, f func(*ListServicesResponse) error) error {
  3189. c.ctx_ = ctx
  3190. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3191. for {
  3192. x, err := c.Do()
  3193. if err != nil {
  3194. return err
  3195. }
  3196. if err := f(x); err != nil {
  3197. return err
  3198. }
  3199. if x.NextPageToken == "" {
  3200. return nil
  3201. }
  3202. c.PageToken(x.NextPageToken)
  3203. }
  3204. }
  3205. // method id "appengine.apps.services.patch":
  3206. type AppsServicesPatchCall struct {
  3207. s *APIService
  3208. appsId string
  3209. servicesId string
  3210. service *Service
  3211. urlParams_ gensupport.URLParams
  3212. ctx_ context.Context
  3213. header_ http.Header
  3214. }
  3215. // Patch: Updates the configuration of the specified service.
  3216. func (r *AppsServicesService) Patch(appsId string, servicesId string, service *Service) *AppsServicesPatchCall {
  3217. c := &AppsServicesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3218. c.appsId = appsId
  3219. c.servicesId = servicesId
  3220. c.service = service
  3221. return c
  3222. }
  3223. // MigrateTraffic sets the optional parameter "migrateTraffic": Set to
  3224. // `true` to gradually shift traffic from one version to another single
  3225. // version. By default, traffic is shifted immediately. For gradual
  3226. // traffic migration, the target version must be located within
  3227. // instances that are configured for both [warmup
  3228. // requests](https://cloud.google.com/appengine/docs/admin-api/reference/
  3229. // rest/v1/apps.services.versions#inboundservicetype) and [automatic
  3230. // scaling](https://cloud.google.com/appengine/docs/admin-api/reference/r
  3231. // est/v1/apps.services.versions#automaticscaling). You must specify the
  3232. // [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/referenc
  3233. // e/rest/v1/apps.services#shardby) field in the Service resource.
  3234. // Gradual traffic migration is not supported in the App Engine flexible
  3235. // environment. For examples, see [Migrating and Splitting
  3236. // Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-s
  3237. // plitting-traffic).
  3238. func (c *AppsServicesPatchCall) MigrateTraffic(migrateTraffic bool) *AppsServicesPatchCall {
  3239. c.urlParams_.Set("migrateTraffic", fmt.Sprint(migrateTraffic))
  3240. return c
  3241. }
  3242. // UpdateMask sets the optional parameter "updateMask": Standard field
  3243. // mask for the set of fields to be updated.
  3244. func (c *AppsServicesPatchCall) UpdateMask(updateMask string) *AppsServicesPatchCall {
  3245. c.urlParams_.Set("updateMask", updateMask)
  3246. return c
  3247. }
  3248. // Fields allows partial responses to be retrieved. See
  3249. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3250. // for more information.
  3251. func (c *AppsServicesPatchCall) Fields(s ...googleapi.Field) *AppsServicesPatchCall {
  3252. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3253. return c
  3254. }
  3255. // Context sets the context to be used in this call's Do method. Any
  3256. // pending HTTP request will be aborted if the provided context is
  3257. // canceled.
  3258. func (c *AppsServicesPatchCall) Context(ctx context.Context) *AppsServicesPatchCall {
  3259. c.ctx_ = ctx
  3260. return c
  3261. }
  3262. // Header returns an http.Header that can be modified by the caller to
  3263. // add HTTP headers to the request.
  3264. func (c *AppsServicesPatchCall) Header() http.Header {
  3265. if c.header_ == nil {
  3266. c.header_ = make(http.Header)
  3267. }
  3268. return c.header_
  3269. }
  3270. func (c *AppsServicesPatchCall) doRequest(alt string) (*http.Response, error) {
  3271. reqHeaders := make(http.Header)
  3272. for k, v := range c.header_ {
  3273. reqHeaders[k] = v
  3274. }
  3275. reqHeaders.Set("User-Agent", c.s.userAgent())
  3276. var body io.Reader = nil
  3277. body, err := googleapi.WithoutDataWrapper.JSONReader(c.service)
  3278. if err != nil {
  3279. return nil, err
  3280. }
  3281. reqHeaders.Set("Content-Type", "application/json")
  3282. c.urlParams_.Set("alt", alt)
  3283. c.urlParams_.Set("prettyPrint", "false")
  3284. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}")
  3285. urls += "?" + c.urlParams_.Encode()
  3286. req, err := http.NewRequest("PATCH", urls, body)
  3287. if err != nil {
  3288. return nil, err
  3289. }
  3290. req.Header = reqHeaders
  3291. googleapi.Expand(req.URL, map[string]string{
  3292. "appsId": c.appsId,
  3293. "servicesId": c.servicesId,
  3294. })
  3295. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3296. }
  3297. // Do executes the "appengine.apps.services.patch" call.
  3298. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3299. // status code is an error. Response headers are in either
  3300. // *Operation.ServerResponse.Header or (if a response was returned at
  3301. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3302. // to check whether the returned error was because
  3303. // http.StatusNotModified was returned.
  3304. func (c *AppsServicesPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3305. gensupport.SetOptions(c.urlParams_, opts...)
  3306. res, err := c.doRequest("json")
  3307. if res != nil && res.StatusCode == http.StatusNotModified {
  3308. if res.Body != nil {
  3309. res.Body.Close()
  3310. }
  3311. return nil, &googleapi.Error{
  3312. Code: res.StatusCode,
  3313. Header: res.Header,
  3314. }
  3315. }
  3316. if err != nil {
  3317. return nil, err
  3318. }
  3319. defer googleapi.CloseBody(res)
  3320. if err := googleapi.CheckResponse(res); err != nil {
  3321. return nil, err
  3322. }
  3323. ret := &Operation{
  3324. ServerResponse: googleapi.ServerResponse{
  3325. Header: res.Header,
  3326. HTTPStatusCode: res.StatusCode,
  3327. },
  3328. }
  3329. target := &ret
  3330. if err := gensupport.DecodeResponse(target, res); err != nil {
  3331. return nil, err
  3332. }
  3333. return ret, nil
  3334. // {
  3335. // "description": "Updates the configuration of the specified service.",
  3336. // "httpMethod": "PATCH",
  3337. // "id": "appengine.apps.services.patch",
  3338. // "parameterOrder": [
  3339. // "appsId",
  3340. // "servicesId"
  3341. // ],
  3342. // "parameters": {
  3343. // "appsId": {
  3344. // "description": "Part of `name`. Name of the resource to update. Example: `apps/myapp/services/default`.",
  3345. // "location": "path",
  3346. // "required": true,
  3347. // "type": "string"
  3348. // },
  3349. // "migrateTraffic": {
  3350. // "description": "Set to `true` to gradually shift traffic from one version to another single version. By default, traffic is shifted immediately. For gradual traffic migration, the target version must be located within instances that are configured for both [warmup requests](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#inboundservicetype) and [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#automaticscaling). You must specify the [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#shardby) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).",
  3351. // "location": "query",
  3352. // "type": "boolean"
  3353. // },
  3354. // "servicesId": {
  3355. // "description": "Part of `name`. See documentation of `appsId`.",
  3356. // "location": "path",
  3357. // "required": true,
  3358. // "type": "string"
  3359. // },
  3360. // "updateMask": {
  3361. // "description": "Standard field mask for the set of fields to be updated.",
  3362. // "location": "query",
  3363. // "type": "string"
  3364. // }
  3365. // },
  3366. // "path": "v1/apps/{appsId}/services/{servicesId}",
  3367. // "request": {
  3368. // "$ref": "Service"
  3369. // },
  3370. // "response": {
  3371. // "$ref": "Operation"
  3372. // },
  3373. // "scopes": [
  3374. // "https://www.googleapis.com/auth/cloud-platform"
  3375. // ]
  3376. // }
  3377. }
  3378. // method id "appengine.apps.services.versions.create":
  3379. type AppsServicesVersionsCreateCall struct {
  3380. s *APIService
  3381. appsId string
  3382. servicesId string
  3383. version *Version
  3384. urlParams_ gensupport.URLParams
  3385. ctx_ context.Context
  3386. header_ http.Header
  3387. }
  3388. // Create: Deploys code and resource files to a new version.
  3389. func (r *AppsServicesVersionsService) Create(appsId string, servicesId string, version *Version) *AppsServicesVersionsCreateCall {
  3390. c := &AppsServicesVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3391. c.appsId = appsId
  3392. c.servicesId = servicesId
  3393. c.version = version
  3394. return c
  3395. }
  3396. // Fields allows partial responses to be retrieved. See
  3397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3398. // for more information.
  3399. func (c *AppsServicesVersionsCreateCall) Fields(s ...googleapi.Field) *AppsServicesVersionsCreateCall {
  3400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3401. return c
  3402. }
  3403. // Context sets the context to be used in this call's Do method. Any
  3404. // pending HTTP request will be aborted if the provided context is
  3405. // canceled.
  3406. func (c *AppsServicesVersionsCreateCall) Context(ctx context.Context) *AppsServicesVersionsCreateCall {
  3407. c.ctx_ = ctx
  3408. return c
  3409. }
  3410. // Header returns an http.Header that can be modified by the caller to
  3411. // add HTTP headers to the request.
  3412. func (c *AppsServicesVersionsCreateCall) Header() http.Header {
  3413. if c.header_ == nil {
  3414. c.header_ = make(http.Header)
  3415. }
  3416. return c.header_
  3417. }
  3418. func (c *AppsServicesVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
  3419. reqHeaders := make(http.Header)
  3420. for k, v := range c.header_ {
  3421. reqHeaders[k] = v
  3422. }
  3423. reqHeaders.Set("User-Agent", c.s.userAgent())
  3424. var body io.Reader = nil
  3425. body, err := googleapi.WithoutDataWrapper.JSONReader(c.version)
  3426. if err != nil {
  3427. return nil, err
  3428. }
  3429. reqHeaders.Set("Content-Type", "application/json")
  3430. c.urlParams_.Set("alt", alt)
  3431. c.urlParams_.Set("prettyPrint", "false")
  3432. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions")
  3433. urls += "?" + c.urlParams_.Encode()
  3434. req, err := http.NewRequest("POST", urls, body)
  3435. if err != nil {
  3436. return nil, err
  3437. }
  3438. req.Header = reqHeaders
  3439. googleapi.Expand(req.URL, map[string]string{
  3440. "appsId": c.appsId,
  3441. "servicesId": c.servicesId,
  3442. })
  3443. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3444. }
  3445. // Do executes the "appengine.apps.services.versions.create" call.
  3446. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3447. // status code is an error. Response headers are in either
  3448. // *Operation.ServerResponse.Header or (if a response was returned at
  3449. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3450. // to check whether the returned error was because
  3451. // http.StatusNotModified was returned.
  3452. func (c *AppsServicesVersionsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3453. gensupport.SetOptions(c.urlParams_, opts...)
  3454. res, err := c.doRequest("json")
  3455. if res != nil && res.StatusCode == http.StatusNotModified {
  3456. if res.Body != nil {
  3457. res.Body.Close()
  3458. }
  3459. return nil, &googleapi.Error{
  3460. Code: res.StatusCode,
  3461. Header: res.Header,
  3462. }
  3463. }
  3464. if err != nil {
  3465. return nil, err
  3466. }
  3467. defer googleapi.CloseBody(res)
  3468. if err := googleapi.CheckResponse(res); err != nil {
  3469. return nil, err
  3470. }
  3471. ret := &Operation{
  3472. ServerResponse: googleapi.ServerResponse{
  3473. Header: res.Header,
  3474. HTTPStatusCode: res.StatusCode,
  3475. },
  3476. }
  3477. target := &ret
  3478. if err := gensupport.DecodeResponse(target, res); err != nil {
  3479. return nil, err
  3480. }
  3481. return ret, nil
  3482. // {
  3483. // "description": "Deploys code and resource files to a new version.",
  3484. // "httpMethod": "POST",
  3485. // "id": "appengine.apps.services.versions.create",
  3486. // "parameterOrder": [
  3487. // "appsId",
  3488. // "servicesId"
  3489. // ],
  3490. // "parameters": {
  3491. // "appsId": {
  3492. // "description": "Part of `parent`. Name of the parent resource to create this version under. Example: `apps/myapp/services/default`.",
  3493. // "location": "path",
  3494. // "required": true,
  3495. // "type": "string"
  3496. // },
  3497. // "servicesId": {
  3498. // "description": "Part of `parent`. See documentation of `appsId`.",
  3499. // "location": "path",
  3500. // "required": true,
  3501. // "type": "string"
  3502. // }
  3503. // },
  3504. // "path": "v1/apps/{appsId}/services/{servicesId}/versions",
  3505. // "request": {
  3506. // "$ref": "Version"
  3507. // },
  3508. // "response": {
  3509. // "$ref": "Operation"
  3510. // },
  3511. // "scopes": [
  3512. // "https://www.googleapis.com/auth/cloud-platform"
  3513. // ]
  3514. // }
  3515. }
  3516. // method id "appengine.apps.services.versions.delete":
  3517. type AppsServicesVersionsDeleteCall struct {
  3518. s *APIService
  3519. appsId string
  3520. servicesId string
  3521. versionsId string
  3522. urlParams_ gensupport.URLParams
  3523. ctx_ context.Context
  3524. header_ http.Header
  3525. }
  3526. // Delete: Deletes an existing Version resource.
  3527. func (r *AppsServicesVersionsService) Delete(appsId string, servicesId string, versionsId string) *AppsServicesVersionsDeleteCall {
  3528. c := &AppsServicesVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3529. c.appsId = appsId
  3530. c.servicesId = servicesId
  3531. c.versionsId = versionsId
  3532. return c
  3533. }
  3534. // Fields allows partial responses to be retrieved. See
  3535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3536. // for more information.
  3537. func (c *AppsServicesVersionsDeleteCall) Fields(s ...googleapi.Field) *AppsServicesVersionsDeleteCall {
  3538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3539. return c
  3540. }
  3541. // Context sets the context to be used in this call's Do method. Any
  3542. // pending HTTP request will be aborted if the provided context is
  3543. // canceled.
  3544. func (c *AppsServicesVersionsDeleteCall) Context(ctx context.Context) *AppsServicesVersionsDeleteCall {
  3545. c.ctx_ = ctx
  3546. return c
  3547. }
  3548. // Header returns an http.Header that can be modified by the caller to
  3549. // add HTTP headers to the request.
  3550. func (c *AppsServicesVersionsDeleteCall) Header() http.Header {
  3551. if c.header_ == nil {
  3552. c.header_ = make(http.Header)
  3553. }
  3554. return c.header_
  3555. }
  3556. func (c *AppsServicesVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3557. reqHeaders := make(http.Header)
  3558. for k, v := range c.header_ {
  3559. reqHeaders[k] = v
  3560. }
  3561. reqHeaders.Set("User-Agent", c.s.userAgent())
  3562. var body io.Reader = nil
  3563. c.urlParams_.Set("alt", alt)
  3564. c.urlParams_.Set("prettyPrint", "false")
  3565. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}")
  3566. urls += "?" + c.urlParams_.Encode()
  3567. req, err := http.NewRequest("DELETE", urls, body)
  3568. if err != nil {
  3569. return nil, err
  3570. }
  3571. req.Header = reqHeaders
  3572. googleapi.Expand(req.URL, map[string]string{
  3573. "appsId": c.appsId,
  3574. "servicesId": c.servicesId,
  3575. "versionsId": c.versionsId,
  3576. })
  3577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3578. }
  3579. // Do executes the "appengine.apps.services.versions.delete" call.
  3580. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3581. // status code is an error. Response headers are in either
  3582. // *Operation.ServerResponse.Header or (if a response was returned at
  3583. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3584. // to check whether the returned error was because
  3585. // http.StatusNotModified was returned.
  3586. func (c *AppsServicesVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3587. gensupport.SetOptions(c.urlParams_, opts...)
  3588. res, err := c.doRequest("json")
  3589. if res != nil && res.StatusCode == http.StatusNotModified {
  3590. if res.Body != nil {
  3591. res.Body.Close()
  3592. }
  3593. return nil, &googleapi.Error{
  3594. Code: res.StatusCode,
  3595. Header: res.Header,
  3596. }
  3597. }
  3598. if err != nil {
  3599. return nil, err
  3600. }
  3601. defer googleapi.CloseBody(res)
  3602. if err := googleapi.CheckResponse(res); err != nil {
  3603. return nil, err
  3604. }
  3605. ret := &Operation{
  3606. ServerResponse: googleapi.ServerResponse{
  3607. Header: res.Header,
  3608. HTTPStatusCode: res.StatusCode,
  3609. },
  3610. }
  3611. target := &ret
  3612. if err := gensupport.DecodeResponse(target, res); err != nil {
  3613. return nil, err
  3614. }
  3615. return ret, nil
  3616. // {
  3617. // "description": "Deletes an existing Version resource.",
  3618. // "httpMethod": "DELETE",
  3619. // "id": "appengine.apps.services.versions.delete",
  3620. // "parameterOrder": [
  3621. // "appsId",
  3622. // "servicesId",
  3623. // "versionsId"
  3624. // ],
  3625. // "parameters": {
  3626. // "appsId": {
  3627. // "description": "Part of `name`. Name of the resource requested. Example: `apps/myapp/services/default/versions/v1`.",
  3628. // "location": "path",
  3629. // "required": true,
  3630. // "type": "string"
  3631. // },
  3632. // "servicesId": {
  3633. // "description": "Part of `name`. See documentation of `appsId`.",
  3634. // "location": "path",
  3635. // "required": true,
  3636. // "type": "string"
  3637. // },
  3638. // "versionsId": {
  3639. // "description": "Part of `name`. See documentation of `appsId`.",
  3640. // "location": "path",
  3641. // "required": true,
  3642. // "type": "string"
  3643. // }
  3644. // },
  3645. // "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}",
  3646. // "response": {
  3647. // "$ref": "Operation"
  3648. // },
  3649. // "scopes": [
  3650. // "https://www.googleapis.com/auth/cloud-platform"
  3651. // ]
  3652. // }
  3653. }
  3654. // method id "appengine.apps.services.versions.get":
  3655. type AppsServicesVersionsGetCall struct {
  3656. s *APIService
  3657. appsId string
  3658. servicesId string
  3659. versionsId string
  3660. urlParams_ gensupport.URLParams
  3661. ifNoneMatch_ string
  3662. ctx_ context.Context
  3663. header_ http.Header
  3664. }
  3665. // Get: Gets the specified Version resource. By default, only a
  3666. // `BASIC_VIEW` will be returned. Specify the `FULL_VIEW` parameter to
  3667. // get the full resource.
  3668. func (r *AppsServicesVersionsService) Get(appsId string, servicesId string, versionsId string) *AppsServicesVersionsGetCall {
  3669. c := &AppsServicesVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3670. c.appsId = appsId
  3671. c.servicesId = servicesId
  3672. c.versionsId = versionsId
  3673. return c
  3674. }
  3675. // View sets the optional parameter "view": Controls the set of fields
  3676. // returned in the `Get` response.
  3677. //
  3678. // Possible values:
  3679. // "BASIC"
  3680. // "FULL"
  3681. func (c *AppsServicesVersionsGetCall) View(view string) *AppsServicesVersionsGetCall {
  3682. c.urlParams_.Set("view", view)
  3683. return c
  3684. }
  3685. // Fields allows partial responses to be retrieved. See
  3686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3687. // for more information.
  3688. func (c *AppsServicesVersionsGetCall) Fields(s ...googleapi.Field) *AppsServicesVersionsGetCall {
  3689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3690. return c
  3691. }
  3692. // IfNoneMatch sets the optional parameter which makes the operation
  3693. // fail if the object's ETag matches the given value. This is useful for
  3694. // getting updates only after the object has changed since the last
  3695. // request. Use googleapi.IsNotModified to check whether the response
  3696. // error from Do is the result of In-None-Match.
  3697. func (c *AppsServicesVersionsGetCall) IfNoneMatch(entityTag string) *AppsServicesVersionsGetCall {
  3698. c.ifNoneMatch_ = entityTag
  3699. return c
  3700. }
  3701. // Context sets the context to be used in this call's Do method. Any
  3702. // pending HTTP request will be aborted if the provided context is
  3703. // canceled.
  3704. func (c *AppsServicesVersionsGetCall) Context(ctx context.Context) *AppsServicesVersionsGetCall {
  3705. c.ctx_ = ctx
  3706. return c
  3707. }
  3708. // Header returns an http.Header that can be modified by the caller to
  3709. // add HTTP headers to the request.
  3710. func (c *AppsServicesVersionsGetCall) Header() http.Header {
  3711. if c.header_ == nil {
  3712. c.header_ = make(http.Header)
  3713. }
  3714. return c.header_
  3715. }
  3716. func (c *AppsServicesVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  3717. reqHeaders := make(http.Header)
  3718. for k, v := range c.header_ {
  3719. reqHeaders[k] = v
  3720. }
  3721. reqHeaders.Set("User-Agent", c.s.userAgent())
  3722. if c.ifNoneMatch_ != "" {
  3723. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3724. }
  3725. var body io.Reader = nil
  3726. c.urlParams_.Set("alt", alt)
  3727. c.urlParams_.Set("prettyPrint", "false")
  3728. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}")
  3729. urls += "?" + c.urlParams_.Encode()
  3730. req, err := http.NewRequest("GET", urls, body)
  3731. if err != nil {
  3732. return nil, err
  3733. }
  3734. req.Header = reqHeaders
  3735. googleapi.Expand(req.URL, map[string]string{
  3736. "appsId": c.appsId,
  3737. "servicesId": c.servicesId,
  3738. "versionsId": c.versionsId,
  3739. })
  3740. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3741. }
  3742. // Do executes the "appengine.apps.services.versions.get" call.
  3743. // Exactly one of *Version or error will be non-nil. Any non-2xx status
  3744. // code is an error. Response headers are in either
  3745. // *Version.ServerResponse.Header or (if a response was returned at all)
  3746. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3747. // check whether the returned error was because http.StatusNotModified
  3748. // was returned.
  3749. func (c *AppsServicesVersionsGetCall) Do(opts ...googleapi.CallOption) (*Version, error) {
  3750. gensupport.SetOptions(c.urlParams_, opts...)
  3751. res, err := c.doRequest("json")
  3752. if res != nil && res.StatusCode == http.StatusNotModified {
  3753. if res.Body != nil {
  3754. res.Body.Close()
  3755. }
  3756. return nil, &googleapi.Error{
  3757. Code: res.StatusCode,
  3758. Header: res.Header,
  3759. }
  3760. }
  3761. if err != nil {
  3762. return nil, err
  3763. }
  3764. defer googleapi.CloseBody(res)
  3765. if err := googleapi.CheckResponse(res); err != nil {
  3766. return nil, err
  3767. }
  3768. ret := &Version{
  3769. ServerResponse: googleapi.ServerResponse{
  3770. Header: res.Header,
  3771. HTTPStatusCode: res.StatusCode,
  3772. },
  3773. }
  3774. target := &ret
  3775. if err := gensupport.DecodeResponse(target, res); err != nil {
  3776. return nil, err
  3777. }
  3778. return ret, nil
  3779. // {
  3780. // "description": "Gets the specified Version resource. By default, only a `BASIC_VIEW` will be returned. Specify the `FULL_VIEW` parameter to get the full resource.",
  3781. // "httpMethod": "GET",
  3782. // "id": "appengine.apps.services.versions.get",
  3783. // "parameterOrder": [
  3784. // "appsId",
  3785. // "servicesId",
  3786. // "versionsId"
  3787. // ],
  3788. // "parameters": {
  3789. // "appsId": {
  3790. // "description": "Part of `name`. Name of the resource requested. Example: `apps/myapp/services/default/versions/v1`.",
  3791. // "location": "path",
  3792. // "required": true,
  3793. // "type": "string"
  3794. // },
  3795. // "servicesId": {
  3796. // "description": "Part of `name`. See documentation of `appsId`.",
  3797. // "location": "path",
  3798. // "required": true,
  3799. // "type": "string"
  3800. // },
  3801. // "versionsId": {
  3802. // "description": "Part of `name`. See documentation of `appsId`.",
  3803. // "location": "path",
  3804. // "required": true,
  3805. // "type": "string"
  3806. // },
  3807. // "view": {
  3808. // "description": "Controls the set of fields returned in the `Get` response.",
  3809. // "enum": [
  3810. // "BASIC",
  3811. // "FULL"
  3812. // ],
  3813. // "location": "query",
  3814. // "type": "string"
  3815. // }
  3816. // },
  3817. // "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}",
  3818. // "response": {
  3819. // "$ref": "Version"
  3820. // },
  3821. // "scopes": [
  3822. // "https://www.googleapis.com/auth/cloud-platform"
  3823. // ]
  3824. // }
  3825. }
  3826. // method id "appengine.apps.services.versions.list":
  3827. type AppsServicesVersionsListCall struct {
  3828. s *APIService
  3829. appsId string
  3830. servicesId string
  3831. urlParams_ gensupport.URLParams
  3832. ifNoneMatch_ string
  3833. ctx_ context.Context
  3834. header_ http.Header
  3835. }
  3836. // List: Lists the versions of a service.
  3837. func (r *AppsServicesVersionsService) List(appsId string, servicesId string) *AppsServicesVersionsListCall {
  3838. c := &AppsServicesVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3839. c.appsId = appsId
  3840. c.servicesId = servicesId
  3841. return c
  3842. }
  3843. // PageSize sets the optional parameter "pageSize": Maximum results to
  3844. // return per page.
  3845. func (c *AppsServicesVersionsListCall) PageSize(pageSize int64) *AppsServicesVersionsListCall {
  3846. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3847. return c
  3848. }
  3849. // PageToken sets the optional parameter "pageToken": Continuation token
  3850. // for fetching the next page of results.
  3851. func (c *AppsServicesVersionsListCall) PageToken(pageToken string) *AppsServicesVersionsListCall {
  3852. c.urlParams_.Set("pageToken", pageToken)
  3853. return c
  3854. }
  3855. // View sets the optional parameter "view": Controls the set of fields
  3856. // returned in the `List` response.
  3857. //
  3858. // Possible values:
  3859. // "BASIC"
  3860. // "FULL"
  3861. func (c *AppsServicesVersionsListCall) View(view string) *AppsServicesVersionsListCall {
  3862. c.urlParams_.Set("view", view)
  3863. return c
  3864. }
  3865. // Fields allows partial responses to be retrieved. See
  3866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3867. // for more information.
  3868. func (c *AppsServicesVersionsListCall) Fields(s ...googleapi.Field) *AppsServicesVersionsListCall {
  3869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3870. return c
  3871. }
  3872. // IfNoneMatch sets the optional parameter which makes the operation
  3873. // fail if the object's ETag matches the given value. This is useful for
  3874. // getting updates only after the object has changed since the last
  3875. // request. Use googleapi.IsNotModified to check whether the response
  3876. // error from Do is the result of In-None-Match.
  3877. func (c *AppsServicesVersionsListCall) IfNoneMatch(entityTag string) *AppsServicesVersionsListCall {
  3878. c.ifNoneMatch_ = entityTag
  3879. return c
  3880. }
  3881. // Context sets the context to be used in this call's Do method. Any
  3882. // pending HTTP request will be aborted if the provided context is
  3883. // canceled.
  3884. func (c *AppsServicesVersionsListCall) Context(ctx context.Context) *AppsServicesVersionsListCall {
  3885. c.ctx_ = ctx
  3886. return c
  3887. }
  3888. // Header returns an http.Header that can be modified by the caller to
  3889. // add HTTP headers to the request.
  3890. func (c *AppsServicesVersionsListCall) Header() http.Header {
  3891. if c.header_ == nil {
  3892. c.header_ = make(http.Header)
  3893. }
  3894. return c.header_
  3895. }
  3896. func (c *AppsServicesVersionsListCall) doRequest(alt string) (*http.Response, error) {
  3897. reqHeaders := make(http.Header)
  3898. for k, v := range c.header_ {
  3899. reqHeaders[k] = v
  3900. }
  3901. reqHeaders.Set("User-Agent", c.s.userAgent())
  3902. if c.ifNoneMatch_ != "" {
  3903. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3904. }
  3905. var body io.Reader = nil
  3906. c.urlParams_.Set("alt", alt)
  3907. c.urlParams_.Set("prettyPrint", "false")
  3908. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions")
  3909. urls += "?" + c.urlParams_.Encode()
  3910. req, err := http.NewRequest("GET", urls, body)
  3911. if err != nil {
  3912. return nil, err
  3913. }
  3914. req.Header = reqHeaders
  3915. googleapi.Expand(req.URL, map[string]string{
  3916. "appsId": c.appsId,
  3917. "servicesId": c.servicesId,
  3918. })
  3919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3920. }
  3921. // Do executes the "appengine.apps.services.versions.list" call.
  3922. // Exactly one of *ListVersionsResponse or error will be non-nil. Any
  3923. // non-2xx status code is an error. Response headers are in either
  3924. // *ListVersionsResponse.ServerResponse.Header or (if a response was
  3925. // returned at all) in error.(*googleapi.Error).Header. Use
  3926. // googleapi.IsNotModified to check whether the returned error was
  3927. // because http.StatusNotModified was returned.
  3928. func (c *AppsServicesVersionsListCall) Do(opts ...googleapi.CallOption) (*ListVersionsResponse, error) {
  3929. gensupport.SetOptions(c.urlParams_, opts...)
  3930. res, err := c.doRequest("json")
  3931. if res != nil && res.StatusCode == http.StatusNotModified {
  3932. if res.Body != nil {
  3933. res.Body.Close()
  3934. }
  3935. return nil, &googleapi.Error{
  3936. Code: res.StatusCode,
  3937. Header: res.Header,
  3938. }
  3939. }
  3940. if err != nil {
  3941. return nil, err
  3942. }
  3943. defer googleapi.CloseBody(res)
  3944. if err := googleapi.CheckResponse(res); err != nil {
  3945. return nil, err
  3946. }
  3947. ret := &ListVersionsResponse{
  3948. ServerResponse: googleapi.ServerResponse{
  3949. Header: res.Header,
  3950. HTTPStatusCode: res.StatusCode,
  3951. },
  3952. }
  3953. target := &ret
  3954. if err := gensupport.DecodeResponse(target, res); err != nil {
  3955. return nil, err
  3956. }
  3957. return ret, nil
  3958. // {
  3959. // "description": "Lists the versions of a service.",
  3960. // "httpMethod": "GET",
  3961. // "id": "appengine.apps.services.versions.list",
  3962. // "parameterOrder": [
  3963. // "appsId",
  3964. // "servicesId"
  3965. // ],
  3966. // "parameters": {
  3967. // "appsId": {
  3968. // "description": "Part of `parent`. Name of the parent Service resource. Example: `apps/myapp/services/default`.",
  3969. // "location": "path",
  3970. // "required": true,
  3971. // "type": "string"
  3972. // },
  3973. // "pageSize": {
  3974. // "description": "Maximum results to return per page.",
  3975. // "format": "int32",
  3976. // "location": "query",
  3977. // "type": "integer"
  3978. // },
  3979. // "pageToken": {
  3980. // "description": "Continuation token for fetching the next page of results.",
  3981. // "location": "query",
  3982. // "type": "string"
  3983. // },
  3984. // "servicesId": {
  3985. // "description": "Part of `parent`. See documentation of `appsId`.",
  3986. // "location": "path",
  3987. // "required": true,
  3988. // "type": "string"
  3989. // },
  3990. // "view": {
  3991. // "description": "Controls the set of fields returned in the `List` response.",
  3992. // "enum": [
  3993. // "BASIC",
  3994. // "FULL"
  3995. // ],
  3996. // "location": "query",
  3997. // "type": "string"
  3998. // }
  3999. // },
  4000. // "path": "v1/apps/{appsId}/services/{servicesId}/versions",
  4001. // "response": {
  4002. // "$ref": "ListVersionsResponse"
  4003. // },
  4004. // "scopes": [
  4005. // "https://www.googleapis.com/auth/cloud-platform"
  4006. // ]
  4007. // }
  4008. }
  4009. // Pages invokes f for each page of results.
  4010. // A non-nil error returned from f will halt the iteration.
  4011. // The provided context supersedes any context provided to the Context method.
  4012. func (c *AppsServicesVersionsListCall) Pages(ctx context.Context, f func(*ListVersionsResponse) error) error {
  4013. c.ctx_ = ctx
  4014. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4015. for {
  4016. x, err := c.Do()
  4017. if err != nil {
  4018. return err
  4019. }
  4020. if err := f(x); err != nil {
  4021. return err
  4022. }
  4023. if x.NextPageToken == "" {
  4024. return nil
  4025. }
  4026. c.PageToken(x.NextPageToken)
  4027. }
  4028. }
  4029. // method id "appengine.apps.services.versions.patch":
  4030. type AppsServicesVersionsPatchCall struct {
  4031. s *APIService
  4032. appsId string
  4033. servicesId string
  4034. versionsId string
  4035. version *Version
  4036. urlParams_ gensupport.URLParams
  4037. ctx_ context.Context
  4038. header_ http.Header
  4039. }
  4040. // Patch: Updates the specified Version resource. You can specify the
  4041. // following fields depending on the App Engine environment and type of
  4042. // scaling that the version resource uses: *
  4043. // [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/r
  4044. // eference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
  4045. // : For Version resources that use basic scaling, manual scaling, or
  4046. // run in the App Engine flexible environment. *
  4047. // [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/r
  4048. // eference/rest/v1/apps.services.versions#Version.FIELDS.instance_class)
  4049. // : For Version resources that run in the App Engine standard
  4050. // environment. *
  4051. // [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appe
  4052. // ngine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.
  4053. // FIELDS.automatic_scaling): For Version resources that use automatic
  4054. // scaling and run in the App Engine standard environment. *
  4055. // [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appe
  4056. // ngine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.
  4057. // FIELDS.automatic_scaling): For Version resources that use automatic
  4058. // scaling and run in the App Engine standard environment.
  4059. func (r *AppsServicesVersionsService) Patch(appsId string, servicesId string, versionsId string, version *Version) *AppsServicesVersionsPatchCall {
  4060. c := &AppsServicesVersionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4061. c.appsId = appsId
  4062. c.servicesId = servicesId
  4063. c.versionsId = versionsId
  4064. c.version = version
  4065. return c
  4066. }
  4067. // UpdateMask sets the optional parameter "updateMask": Standard field
  4068. // mask for the set of fields to be updated.
  4069. func (c *AppsServicesVersionsPatchCall) UpdateMask(updateMask string) *AppsServicesVersionsPatchCall {
  4070. c.urlParams_.Set("updateMask", updateMask)
  4071. return c
  4072. }
  4073. // Fields allows partial responses to be retrieved. See
  4074. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4075. // for more information.
  4076. func (c *AppsServicesVersionsPatchCall) Fields(s ...googleapi.Field) *AppsServicesVersionsPatchCall {
  4077. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4078. return c
  4079. }
  4080. // Context sets the context to be used in this call's Do method. Any
  4081. // pending HTTP request will be aborted if the provided context is
  4082. // canceled.
  4083. func (c *AppsServicesVersionsPatchCall) Context(ctx context.Context) *AppsServicesVersionsPatchCall {
  4084. c.ctx_ = ctx
  4085. return c
  4086. }
  4087. // Header returns an http.Header that can be modified by the caller to
  4088. // add HTTP headers to the request.
  4089. func (c *AppsServicesVersionsPatchCall) Header() http.Header {
  4090. if c.header_ == nil {
  4091. c.header_ = make(http.Header)
  4092. }
  4093. return c.header_
  4094. }
  4095. func (c *AppsServicesVersionsPatchCall) doRequest(alt string) (*http.Response, error) {
  4096. reqHeaders := make(http.Header)
  4097. for k, v := range c.header_ {
  4098. reqHeaders[k] = v
  4099. }
  4100. reqHeaders.Set("User-Agent", c.s.userAgent())
  4101. var body io.Reader = nil
  4102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.version)
  4103. if err != nil {
  4104. return nil, err
  4105. }
  4106. reqHeaders.Set("Content-Type", "application/json")
  4107. c.urlParams_.Set("alt", alt)
  4108. c.urlParams_.Set("prettyPrint", "false")
  4109. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}")
  4110. urls += "?" + c.urlParams_.Encode()
  4111. req, err := http.NewRequest("PATCH", urls, body)
  4112. if err != nil {
  4113. return nil, err
  4114. }
  4115. req.Header = reqHeaders
  4116. googleapi.Expand(req.URL, map[string]string{
  4117. "appsId": c.appsId,
  4118. "servicesId": c.servicesId,
  4119. "versionsId": c.versionsId,
  4120. })
  4121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4122. }
  4123. // Do executes the "appengine.apps.services.versions.patch" call.
  4124. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4125. // status code is an error. Response headers are in either
  4126. // *Operation.ServerResponse.Header or (if a response was returned at
  4127. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4128. // to check whether the returned error was because
  4129. // http.StatusNotModified was returned.
  4130. func (c *AppsServicesVersionsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4131. gensupport.SetOptions(c.urlParams_, opts...)
  4132. res, err := c.doRequest("json")
  4133. if res != nil && res.StatusCode == http.StatusNotModified {
  4134. if res.Body != nil {
  4135. res.Body.Close()
  4136. }
  4137. return nil, &googleapi.Error{
  4138. Code: res.StatusCode,
  4139. Header: res.Header,
  4140. }
  4141. }
  4142. if err != nil {
  4143. return nil, err
  4144. }
  4145. defer googleapi.CloseBody(res)
  4146. if err := googleapi.CheckResponse(res); err != nil {
  4147. return nil, err
  4148. }
  4149. ret := &Operation{
  4150. ServerResponse: googleapi.ServerResponse{
  4151. Header: res.Header,
  4152. HTTPStatusCode: res.StatusCode,
  4153. },
  4154. }
  4155. target := &ret
  4156. if err := gensupport.DecodeResponse(target, res); err != nil {
  4157. return nil, err
  4158. }
  4159. return ret, nil
  4160. // {
  4161. // "description": "Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment.",
  4162. // "httpMethod": "PATCH",
  4163. // "id": "appengine.apps.services.versions.patch",
  4164. // "parameterOrder": [
  4165. // "appsId",
  4166. // "servicesId",
  4167. // "versionsId"
  4168. // ],
  4169. // "parameters": {
  4170. // "appsId": {
  4171. // "description": "Part of `name`. Name of the resource to update. Example: `apps/myapp/services/default/versions/1`.",
  4172. // "location": "path",
  4173. // "required": true,
  4174. // "type": "string"
  4175. // },
  4176. // "servicesId": {
  4177. // "description": "Part of `name`. See documentation of `appsId`.",
  4178. // "location": "path",
  4179. // "required": true,
  4180. // "type": "string"
  4181. // },
  4182. // "updateMask": {
  4183. // "description": "Standard field mask for the set of fields to be updated.",
  4184. // "location": "query",
  4185. // "type": "string"
  4186. // },
  4187. // "versionsId": {
  4188. // "description": "Part of `name`. See documentation of `appsId`.",
  4189. // "location": "path",
  4190. // "required": true,
  4191. // "type": "string"
  4192. // }
  4193. // },
  4194. // "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}",
  4195. // "request": {
  4196. // "$ref": "Version"
  4197. // },
  4198. // "response": {
  4199. // "$ref": "Operation"
  4200. // },
  4201. // "scopes": [
  4202. // "https://www.googleapis.com/auth/cloud-platform"
  4203. // ]
  4204. // }
  4205. }
  4206. // method id "appengine.apps.services.versions.instances.debug":
  4207. type AppsServicesVersionsInstancesDebugCall struct {
  4208. s *APIService
  4209. appsId string
  4210. servicesId string
  4211. versionsId string
  4212. instancesId string
  4213. debuginstancerequest *DebugInstanceRequest
  4214. urlParams_ gensupport.URLParams
  4215. ctx_ context.Context
  4216. header_ http.Header
  4217. }
  4218. // Debug: Enables debugging on a VM instance. This allows you to use the
  4219. // SSH command to connect to the virtual machine where the instance
  4220. // lives. While in "debug mode", the instance continues to serve live
  4221. // traffic. You should delete the instance when you are done debugging
  4222. // and then allow the system to take over and determine if another
  4223. // instance should be started. Only applicable for instances in App
  4224. // Engine flexible environment.
  4225. func (r *AppsServicesVersionsInstancesService) Debug(appsId string, servicesId string, versionsId string, instancesId string, debuginstancerequest *DebugInstanceRequest) *AppsServicesVersionsInstancesDebugCall {
  4226. c := &AppsServicesVersionsInstancesDebugCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4227. c.appsId = appsId
  4228. c.servicesId = servicesId
  4229. c.versionsId = versionsId
  4230. c.instancesId = instancesId
  4231. c.debuginstancerequest = debuginstancerequest
  4232. return c
  4233. }
  4234. // Fields allows partial responses to be retrieved. See
  4235. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4236. // for more information.
  4237. func (c *AppsServicesVersionsInstancesDebugCall) Fields(s ...googleapi.Field) *AppsServicesVersionsInstancesDebugCall {
  4238. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4239. return c
  4240. }
  4241. // Context sets the context to be used in this call's Do method. Any
  4242. // pending HTTP request will be aborted if the provided context is
  4243. // canceled.
  4244. func (c *AppsServicesVersionsInstancesDebugCall) Context(ctx context.Context) *AppsServicesVersionsInstancesDebugCall {
  4245. c.ctx_ = ctx
  4246. return c
  4247. }
  4248. // Header returns an http.Header that can be modified by the caller to
  4249. // add HTTP headers to the request.
  4250. func (c *AppsServicesVersionsInstancesDebugCall) Header() http.Header {
  4251. if c.header_ == nil {
  4252. c.header_ = make(http.Header)
  4253. }
  4254. return c.header_
  4255. }
  4256. func (c *AppsServicesVersionsInstancesDebugCall) doRequest(alt string) (*http.Response, error) {
  4257. reqHeaders := make(http.Header)
  4258. for k, v := range c.header_ {
  4259. reqHeaders[k] = v
  4260. }
  4261. reqHeaders.Set("User-Agent", c.s.userAgent())
  4262. var body io.Reader = nil
  4263. body, err := googleapi.WithoutDataWrapper.JSONReader(c.debuginstancerequest)
  4264. if err != nil {
  4265. return nil, err
  4266. }
  4267. reqHeaders.Set("Content-Type", "application/json")
  4268. c.urlParams_.Set("alt", alt)
  4269. c.urlParams_.Set("prettyPrint", "false")
  4270. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug")
  4271. urls += "?" + c.urlParams_.Encode()
  4272. req, err := http.NewRequest("POST", urls, body)
  4273. if err != nil {
  4274. return nil, err
  4275. }
  4276. req.Header = reqHeaders
  4277. googleapi.Expand(req.URL, map[string]string{
  4278. "appsId": c.appsId,
  4279. "servicesId": c.servicesId,
  4280. "versionsId": c.versionsId,
  4281. "instancesId": c.instancesId,
  4282. })
  4283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4284. }
  4285. // Do executes the "appengine.apps.services.versions.instances.debug" call.
  4286. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4287. // status code is an error. Response headers are in either
  4288. // *Operation.ServerResponse.Header or (if a response was returned at
  4289. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4290. // to check whether the returned error was because
  4291. // http.StatusNotModified was returned.
  4292. func (c *AppsServicesVersionsInstancesDebugCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4293. gensupport.SetOptions(c.urlParams_, opts...)
  4294. res, err := c.doRequest("json")
  4295. if res != nil && res.StatusCode == http.StatusNotModified {
  4296. if res.Body != nil {
  4297. res.Body.Close()
  4298. }
  4299. return nil, &googleapi.Error{
  4300. Code: res.StatusCode,
  4301. Header: res.Header,
  4302. }
  4303. }
  4304. if err != nil {
  4305. return nil, err
  4306. }
  4307. defer googleapi.CloseBody(res)
  4308. if err := googleapi.CheckResponse(res); err != nil {
  4309. return nil, err
  4310. }
  4311. ret := &Operation{
  4312. ServerResponse: googleapi.ServerResponse{
  4313. Header: res.Header,
  4314. HTTPStatusCode: res.StatusCode,
  4315. },
  4316. }
  4317. target := &ret
  4318. if err := gensupport.DecodeResponse(target, res); err != nil {
  4319. return nil, err
  4320. }
  4321. return ret, nil
  4322. // {
  4323. // "description": "Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in \"debug mode\", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started. Only applicable for instances in App Engine flexible environment.",
  4324. // "httpMethod": "POST",
  4325. // "id": "appengine.apps.services.versions.instances.debug",
  4326. // "parameterOrder": [
  4327. // "appsId",
  4328. // "servicesId",
  4329. // "versionsId",
  4330. // "instancesId"
  4331. // ],
  4332. // "parameters": {
  4333. // "appsId": {
  4334. // "description": "Part of `name`. Name of the resource requested. Example: `apps/myapp/services/default/versions/v1/instances/instance-1`.",
  4335. // "location": "path",
  4336. // "required": true,
  4337. // "type": "string"
  4338. // },
  4339. // "instancesId": {
  4340. // "description": "Part of `name`. See documentation of `appsId`.",
  4341. // "location": "path",
  4342. // "required": true,
  4343. // "type": "string"
  4344. // },
  4345. // "servicesId": {
  4346. // "description": "Part of `name`. See documentation of `appsId`.",
  4347. // "location": "path",
  4348. // "required": true,
  4349. // "type": "string"
  4350. // },
  4351. // "versionsId": {
  4352. // "description": "Part of `name`. See documentation of `appsId`.",
  4353. // "location": "path",
  4354. // "required": true,
  4355. // "type": "string"
  4356. // }
  4357. // },
  4358. // "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}:debug",
  4359. // "request": {
  4360. // "$ref": "DebugInstanceRequest"
  4361. // },
  4362. // "response": {
  4363. // "$ref": "Operation"
  4364. // },
  4365. // "scopes": [
  4366. // "https://www.googleapis.com/auth/cloud-platform"
  4367. // ]
  4368. // }
  4369. }
  4370. // method id "appengine.apps.services.versions.instances.delete":
  4371. type AppsServicesVersionsInstancesDeleteCall struct {
  4372. s *APIService
  4373. appsId string
  4374. servicesId string
  4375. versionsId string
  4376. instancesId string
  4377. urlParams_ gensupport.URLParams
  4378. ctx_ context.Context
  4379. header_ http.Header
  4380. }
  4381. // Delete: Stops a running instance.
  4382. func (r *AppsServicesVersionsInstancesService) Delete(appsId string, servicesId string, versionsId string, instancesId string) *AppsServicesVersionsInstancesDeleteCall {
  4383. c := &AppsServicesVersionsInstancesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4384. c.appsId = appsId
  4385. c.servicesId = servicesId
  4386. c.versionsId = versionsId
  4387. c.instancesId = instancesId
  4388. return c
  4389. }
  4390. // Fields allows partial responses to be retrieved. See
  4391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4392. // for more information.
  4393. func (c *AppsServicesVersionsInstancesDeleteCall) Fields(s ...googleapi.Field) *AppsServicesVersionsInstancesDeleteCall {
  4394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4395. return c
  4396. }
  4397. // Context sets the context to be used in this call's Do method. Any
  4398. // pending HTTP request will be aborted if the provided context is
  4399. // canceled.
  4400. func (c *AppsServicesVersionsInstancesDeleteCall) Context(ctx context.Context) *AppsServicesVersionsInstancesDeleteCall {
  4401. c.ctx_ = ctx
  4402. return c
  4403. }
  4404. // Header returns an http.Header that can be modified by the caller to
  4405. // add HTTP headers to the request.
  4406. func (c *AppsServicesVersionsInstancesDeleteCall) Header() http.Header {
  4407. if c.header_ == nil {
  4408. c.header_ = make(http.Header)
  4409. }
  4410. return c.header_
  4411. }
  4412. func (c *AppsServicesVersionsInstancesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4413. reqHeaders := make(http.Header)
  4414. for k, v := range c.header_ {
  4415. reqHeaders[k] = v
  4416. }
  4417. reqHeaders.Set("User-Agent", c.s.userAgent())
  4418. var body io.Reader = nil
  4419. c.urlParams_.Set("alt", alt)
  4420. c.urlParams_.Set("prettyPrint", "false")
  4421. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}")
  4422. urls += "?" + c.urlParams_.Encode()
  4423. req, err := http.NewRequest("DELETE", urls, body)
  4424. if err != nil {
  4425. return nil, err
  4426. }
  4427. req.Header = reqHeaders
  4428. googleapi.Expand(req.URL, map[string]string{
  4429. "appsId": c.appsId,
  4430. "servicesId": c.servicesId,
  4431. "versionsId": c.versionsId,
  4432. "instancesId": c.instancesId,
  4433. })
  4434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4435. }
  4436. // Do executes the "appengine.apps.services.versions.instances.delete" call.
  4437. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4438. // status code is an error. Response headers are in either
  4439. // *Operation.ServerResponse.Header or (if a response was returned at
  4440. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4441. // to check whether the returned error was because
  4442. // http.StatusNotModified was returned.
  4443. func (c *AppsServicesVersionsInstancesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4444. gensupport.SetOptions(c.urlParams_, opts...)
  4445. res, err := c.doRequest("json")
  4446. if res != nil && res.StatusCode == http.StatusNotModified {
  4447. if res.Body != nil {
  4448. res.Body.Close()
  4449. }
  4450. return nil, &googleapi.Error{
  4451. Code: res.StatusCode,
  4452. Header: res.Header,
  4453. }
  4454. }
  4455. if err != nil {
  4456. return nil, err
  4457. }
  4458. defer googleapi.CloseBody(res)
  4459. if err := googleapi.CheckResponse(res); err != nil {
  4460. return nil, err
  4461. }
  4462. ret := &Operation{
  4463. ServerResponse: googleapi.ServerResponse{
  4464. Header: res.Header,
  4465. HTTPStatusCode: res.StatusCode,
  4466. },
  4467. }
  4468. target := &ret
  4469. if err := gensupport.DecodeResponse(target, res); err != nil {
  4470. return nil, err
  4471. }
  4472. return ret, nil
  4473. // {
  4474. // "description": "Stops a running instance.",
  4475. // "httpMethod": "DELETE",
  4476. // "id": "appengine.apps.services.versions.instances.delete",
  4477. // "parameterOrder": [
  4478. // "appsId",
  4479. // "servicesId",
  4480. // "versionsId",
  4481. // "instancesId"
  4482. // ],
  4483. // "parameters": {
  4484. // "appsId": {
  4485. // "description": "Part of `name`. Name of the resource requested. Example: `apps/myapp/services/default/versions/v1/instances/instance-1`.",
  4486. // "location": "path",
  4487. // "required": true,
  4488. // "type": "string"
  4489. // },
  4490. // "instancesId": {
  4491. // "description": "Part of `name`. See documentation of `appsId`.",
  4492. // "location": "path",
  4493. // "required": true,
  4494. // "type": "string"
  4495. // },
  4496. // "servicesId": {
  4497. // "description": "Part of `name`. See documentation of `appsId`.",
  4498. // "location": "path",
  4499. // "required": true,
  4500. // "type": "string"
  4501. // },
  4502. // "versionsId": {
  4503. // "description": "Part of `name`. See documentation of `appsId`.",
  4504. // "location": "path",
  4505. // "required": true,
  4506. // "type": "string"
  4507. // }
  4508. // },
  4509. // "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}",
  4510. // "response": {
  4511. // "$ref": "Operation"
  4512. // },
  4513. // "scopes": [
  4514. // "https://www.googleapis.com/auth/cloud-platform"
  4515. // ]
  4516. // }
  4517. }
  4518. // method id "appengine.apps.services.versions.instances.get":
  4519. type AppsServicesVersionsInstancesGetCall struct {
  4520. s *APIService
  4521. appsId string
  4522. servicesId string
  4523. versionsId string
  4524. instancesId string
  4525. urlParams_ gensupport.URLParams
  4526. ifNoneMatch_ string
  4527. ctx_ context.Context
  4528. header_ http.Header
  4529. }
  4530. // Get: Gets instance information.
  4531. func (r *AppsServicesVersionsInstancesService) Get(appsId string, servicesId string, versionsId string, instancesId string) *AppsServicesVersionsInstancesGetCall {
  4532. c := &AppsServicesVersionsInstancesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4533. c.appsId = appsId
  4534. c.servicesId = servicesId
  4535. c.versionsId = versionsId
  4536. c.instancesId = instancesId
  4537. return c
  4538. }
  4539. // Fields allows partial responses to be retrieved. See
  4540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4541. // for more information.
  4542. func (c *AppsServicesVersionsInstancesGetCall) Fields(s ...googleapi.Field) *AppsServicesVersionsInstancesGetCall {
  4543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4544. return c
  4545. }
  4546. // IfNoneMatch sets the optional parameter which makes the operation
  4547. // fail if the object's ETag matches the given value. This is useful for
  4548. // getting updates only after the object has changed since the last
  4549. // request. Use googleapi.IsNotModified to check whether the response
  4550. // error from Do is the result of In-None-Match.
  4551. func (c *AppsServicesVersionsInstancesGetCall) IfNoneMatch(entityTag string) *AppsServicesVersionsInstancesGetCall {
  4552. c.ifNoneMatch_ = entityTag
  4553. return c
  4554. }
  4555. // Context sets the context to be used in this call's Do method. Any
  4556. // pending HTTP request will be aborted if the provided context is
  4557. // canceled.
  4558. func (c *AppsServicesVersionsInstancesGetCall) Context(ctx context.Context) *AppsServicesVersionsInstancesGetCall {
  4559. c.ctx_ = ctx
  4560. return c
  4561. }
  4562. // Header returns an http.Header that can be modified by the caller to
  4563. // add HTTP headers to the request.
  4564. func (c *AppsServicesVersionsInstancesGetCall) Header() http.Header {
  4565. if c.header_ == nil {
  4566. c.header_ = make(http.Header)
  4567. }
  4568. return c.header_
  4569. }
  4570. func (c *AppsServicesVersionsInstancesGetCall) doRequest(alt string) (*http.Response, error) {
  4571. reqHeaders := make(http.Header)
  4572. for k, v := range c.header_ {
  4573. reqHeaders[k] = v
  4574. }
  4575. reqHeaders.Set("User-Agent", c.s.userAgent())
  4576. if c.ifNoneMatch_ != "" {
  4577. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4578. }
  4579. var body io.Reader = nil
  4580. c.urlParams_.Set("alt", alt)
  4581. c.urlParams_.Set("prettyPrint", "false")
  4582. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}")
  4583. urls += "?" + c.urlParams_.Encode()
  4584. req, err := http.NewRequest("GET", urls, body)
  4585. if err != nil {
  4586. return nil, err
  4587. }
  4588. req.Header = reqHeaders
  4589. googleapi.Expand(req.URL, map[string]string{
  4590. "appsId": c.appsId,
  4591. "servicesId": c.servicesId,
  4592. "versionsId": c.versionsId,
  4593. "instancesId": c.instancesId,
  4594. })
  4595. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4596. }
  4597. // Do executes the "appengine.apps.services.versions.instances.get" call.
  4598. // Exactly one of *Instance or error will be non-nil. Any non-2xx status
  4599. // code is an error. Response headers are in either
  4600. // *Instance.ServerResponse.Header or (if a response was returned at
  4601. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4602. // to check whether the returned error was because
  4603. // http.StatusNotModified was returned.
  4604. func (c *AppsServicesVersionsInstancesGetCall) Do(opts ...googleapi.CallOption) (*Instance, error) {
  4605. gensupport.SetOptions(c.urlParams_, opts...)
  4606. res, err := c.doRequest("json")
  4607. if res != nil && res.StatusCode == http.StatusNotModified {
  4608. if res.Body != nil {
  4609. res.Body.Close()
  4610. }
  4611. return nil, &googleapi.Error{
  4612. Code: res.StatusCode,
  4613. Header: res.Header,
  4614. }
  4615. }
  4616. if err != nil {
  4617. return nil, err
  4618. }
  4619. defer googleapi.CloseBody(res)
  4620. if err := googleapi.CheckResponse(res); err != nil {
  4621. return nil, err
  4622. }
  4623. ret := &Instance{
  4624. ServerResponse: googleapi.ServerResponse{
  4625. Header: res.Header,
  4626. HTTPStatusCode: res.StatusCode,
  4627. },
  4628. }
  4629. target := &ret
  4630. if err := gensupport.DecodeResponse(target, res); err != nil {
  4631. return nil, err
  4632. }
  4633. return ret, nil
  4634. // {
  4635. // "description": "Gets instance information.",
  4636. // "httpMethod": "GET",
  4637. // "id": "appengine.apps.services.versions.instances.get",
  4638. // "parameterOrder": [
  4639. // "appsId",
  4640. // "servicesId",
  4641. // "versionsId",
  4642. // "instancesId"
  4643. // ],
  4644. // "parameters": {
  4645. // "appsId": {
  4646. // "description": "Part of `name`. Name of the resource requested. Example: `apps/myapp/services/default/versions/v1/instances/instance-1`.",
  4647. // "location": "path",
  4648. // "required": true,
  4649. // "type": "string"
  4650. // },
  4651. // "instancesId": {
  4652. // "description": "Part of `name`. See documentation of `appsId`.",
  4653. // "location": "path",
  4654. // "required": true,
  4655. // "type": "string"
  4656. // },
  4657. // "servicesId": {
  4658. // "description": "Part of `name`. See documentation of `appsId`.",
  4659. // "location": "path",
  4660. // "required": true,
  4661. // "type": "string"
  4662. // },
  4663. // "versionsId": {
  4664. // "description": "Part of `name`. See documentation of `appsId`.",
  4665. // "location": "path",
  4666. // "required": true,
  4667. // "type": "string"
  4668. // }
  4669. // },
  4670. // "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}",
  4671. // "response": {
  4672. // "$ref": "Instance"
  4673. // },
  4674. // "scopes": [
  4675. // "https://www.googleapis.com/auth/cloud-platform"
  4676. // ]
  4677. // }
  4678. }
  4679. // method id "appengine.apps.services.versions.instances.list":
  4680. type AppsServicesVersionsInstancesListCall struct {
  4681. s *APIService
  4682. appsId string
  4683. servicesId string
  4684. versionsId string
  4685. urlParams_ gensupport.URLParams
  4686. ifNoneMatch_ string
  4687. ctx_ context.Context
  4688. header_ http.Header
  4689. }
  4690. // List: Lists the instances of a version.
  4691. func (r *AppsServicesVersionsInstancesService) List(appsId string, servicesId string, versionsId string) *AppsServicesVersionsInstancesListCall {
  4692. c := &AppsServicesVersionsInstancesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4693. c.appsId = appsId
  4694. c.servicesId = servicesId
  4695. c.versionsId = versionsId
  4696. return c
  4697. }
  4698. // PageSize sets the optional parameter "pageSize": Maximum results to
  4699. // return per page.
  4700. func (c *AppsServicesVersionsInstancesListCall) PageSize(pageSize int64) *AppsServicesVersionsInstancesListCall {
  4701. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4702. return c
  4703. }
  4704. // PageToken sets the optional parameter "pageToken": Continuation token
  4705. // for fetching the next page of results.
  4706. func (c *AppsServicesVersionsInstancesListCall) PageToken(pageToken string) *AppsServicesVersionsInstancesListCall {
  4707. c.urlParams_.Set("pageToken", pageToken)
  4708. return c
  4709. }
  4710. // Fields allows partial responses to be retrieved. See
  4711. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4712. // for more information.
  4713. func (c *AppsServicesVersionsInstancesListCall) Fields(s ...googleapi.Field) *AppsServicesVersionsInstancesListCall {
  4714. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4715. return c
  4716. }
  4717. // IfNoneMatch sets the optional parameter which makes the operation
  4718. // fail if the object's ETag matches the given value. This is useful for
  4719. // getting updates only after the object has changed since the last
  4720. // request. Use googleapi.IsNotModified to check whether the response
  4721. // error from Do is the result of In-None-Match.
  4722. func (c *AppsServicesVersionsInstancesListCall) IfNoneMatch(entityTag string) *AppsServicesVersionsInstancesListCall {
  4723. c.ifNoneMatch_ = entityTag
  4724. return c
  4725. }
  4726. // Context sets the context to be used in this call's Do method. Any
  4727. // pending HTTP request will be aborted if the provided context is
  4728. // canceled.
  4729. func (c *AppsServicesVersionsInstancesListCall) Context(ctx context.Context) *AppsServicesVersionsInstancesListCall {
  4730. c.ctx_ = ctx
  4731. return c
  4732. }
  4733. // Header returns an http.Header that can be modified by the caller to
  4734. // add HTTP headers to the request.
  4735. func (c *AppsServicesVersionsInstancesListCall) Header() http.Header {
  4736. if c.header_ == nil {
  4737. c.header_ = make(http.Header)
  4738. }
  4739. return c.header_
  4740. }
  4741. func (c *AppsServicesVersionsInstancesListCall) doRequest(alt string) (*http.Response, error) {
  4742. reqHeaders := make(http.Header)
  4743. for k, v := range c.header_ {
  4744. reqHeaders[k] = v
  4745. }
  4746. reqHeaders.Set("User-Agent", c.s.userAgent())
  4747. if c.ifNoneMatch_ != "" {
  4748. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4749. }
  4750. var body io.Reader = nil
  4751. c.urlParams_.Set("alt", alt)
  4752. c.urlParams_.Set("prettyPrint", "false")
  4753. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances")
  4754. urls += "?" + c.urlParams_.Encode()
  4755. req, err := http.NewRequest("GET", urls, body)
  4756. if err != nil {
  4757. return nil, err
  4758. }
  4759. req.Header = reqHeaders
  4760. googleapi.Expand(req.URL, map[string]string{
  4761. "appsId": c.appsId,
  4762. "servicesId": c.servicesId,
  4763. "versionsId": c.versionsId,
  4764. })
  4765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4766. }
  4767. // Do executes the "appengine.apps.services.versions.instances.list" call.
  4768. // Exactly one of *ListInstancesResponse or error will be non-nil. Any
  4769. // non-2xx status code is an error. Response headers are in either
  4770. // *ListInstancesResponse.ServerResponse.Header or (if a response was
  4771. // returned at all) in error.(*googleapi.Error).Header. Use
  4772. // googleapi.IsNotModified to check whether the returned error was
  4773. // because http.StatusNotModified was returned.
  4774. func (c *AppsServicesVersionsInstancesListCall) Do(opts ...googleapi.CallOption) (*ListInstancesResponse, error) {
  4775. gensupport.SetOptions(c.urlParams_, opts...)
  4776. res, err := c.doRequest("json")
  4777. if res != nil && res.StatusCode == http.StatusNotModified {
  4778. if res.Body != nil {
  4779. res.Body.Close()
  4780. }
  4781. return nil, &googleapi.Error{
  4782. Code: res.StatusCode,
  4783. Header: res.Header,
  4784. }
  4785. }
  4786. if err != nil {
  4787. return nil, err
  4788. }
  4789. defer googleapi.CloseBody(res)
  4790. if err := googleapi.CheckResponse(res); err != nil {
  4791. return nil, err
  4792. }
  4793. ret := &ListInstancesResponse{
  4794. ServerResponse: googleapi.ServerResponse{
  4795. Header: res.Header,
  4796. HTTPStatusCode: res.StatusCode,
  4797. },
  4798. }
  4799. target := &ret
  4800. if err := gensupport.DecodeResponse(target, res); err != nil {
  4801. return nil, err
  4802. }
  4803. return ret, nil
  4804. // {
  4805. // "description": "Lists the instances of a version.",
  4806. // "httpMethod": "GET",
  4807. // "id": "appengine.apps.services.versions.instances.list",
  4808. // "parameterOrder": [
  4809. // "appsId",
  4810. // "servicesId",
  4811. // "versionsId"
  4812. // ],
  4813. // "parameters": {
  4814. // "appsId": {
  4815. // "description": "Part of `parent`. Name of the parent Version resource. Example: `apps/myapp/services/default/versions/v1`.",
  4816. // "location": "path",
  4817. // "required": true,
  4818. // "type": "string"
  4819. // },
  4820. // "pageSize": {
  4821. // "description": "Maximum results to return per page.",
  4822. // "format": "int32",
  4823. // "location": "query",
  4824. // "type": "integer"
  4825. // },
  4826. // "pageToken": {
  4827. // "description": "Continuation token for fetching the next page of results.",
  4828. // "location": "query",
  4829. // "type": "string"
  4830. // },
  4831. // "servicesId": {
  4832. // "description": "Part of `parent`. See documentation of `appsId`.",
  4833. // "location": "path",
  4834. // "required": true,
  4835. // "type": "string"
  4836. // },
  4837. // "versionsId": {
  4838. // "description": "Part of `parent`. See documentation of `appsId`.",
  4839. // "location": "path",
  4840. // "required": true,
  4841. // "type": "string"
  4842. // }
  4843. // },
  4844. // "path": "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances",
  4845. // "response": {
  4846. // "$ref": "ListInstancesResponse"
  4847. // },
  4848. // "scopes": [
  4849. // "https://www.googleapis.com/auth/cloud-platform"
  4850. // ]
  4851. // }
  4852. }
  4853. // Pages invokes f for each page of results.
  4854. // A non-nil error returned from f will halt the iteration.
  4855. // The provided context supersedes any context provided to the Context method.
  4856. func (c *AppsServicesVersionsInstancesListCall) Pages(ctx context.Context, f func(*ListInstancesResponse) error) error {
  4857. c.ctx_ = ctx
  4858. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4859. for {
  4860. x, err := c.Do()
  4861. if err != nil {
  4862. return err
  4863. }
  4864. if err := f(x); err != nil {
  4865. return err
  4866. }
  4867. if x.NextPageToken == "" {
  4868. return nil
  4869. }
  4870. c.PageToken(x.NextPageToken)
  4871. }
  4872. }