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

5284 lines
190 KiB

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