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.
 
 
 

7881 lines
275 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package ml provides access to the Cloud Machine Learning Engine.
  6. //
  7. // For product documentation, see: https://cloud.google.com/ml/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/ml/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // mlService, err := ml.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // mlService, err := ml.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // mlService, err := ml.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package ml // import "google.golang.org/api/ml/v1"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "ml:v1"
  67. const apiName = "ml"
  68. const apiVersion = "v1"
  69. const basePath = "https://ml.googleapis.com/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your data across Google Cloud Platform services
  73. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/cloud-platform",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Operations = NewOperationsService(s)
  106. s.Projects = NewProjectsService(s)
  107. return s, nil
  108. }
  109. type Service struct {
  110. client *http.Client
  111. BasePath string // API endpoint base URL
  112. UserAgent string // optional additional User-Agent fragment
  113. Operations *OperationsService
  114. Projects *ProjectsService
  115. }
  116. func (s *Service) userAgent() string {
  117. if s.UserAgent == "" {
  118. return googleapi.UserAgent
  119. }
  120. return googleapi.UserAgent + " " + s.UserAgent
  121. }
  122. func NewOperationsService(s *Service) *OperationsService {
  123. rs := &OperationsService{s: s}
  124. return rs
  125. }
  126. type OperationsService struct {
  127. s *Service
  128. }
  129. func NewProjectsService(s *Service) *ProjectsService {
  130. rs := &ProjectsService{s: s}
  131. rs.Jobs = NewProjectsJobsService(s)
  132. rs.Locations = NewProjectsLocationsService(s)
  133. rs.Models = NewProjectsModelsService(s)
  134. rs.Operations = NewProjectsOperationsService(s)
  135. return rs
  136. }
  137. type ProjectsService struct {
  138. s *Service
  139. Jobs *ProjectsJobsService
  140. Locations *ProjectsLocationsService
  141. Models *ProjectsModelsService
  142. Operations *ProjectsOperationsService
  143. }
  144. func NewProjectsJobsService(s *Service) *ProjectsJobsService {
  145. rs := &ProjectsJobsService{s: s}
  146. return rs
  147. }
  148. type ProjectsJobsService struct {
  149. s *Service
  150. }
  151. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  152. rs := &ProjectsLocationsService{s: s}
  153. return rs
  154. }
  155. type ProjectsLocationsService struct {
  156. s *Service
  157. }
  158. func NewProjectsModelsService(s *Service) *ProjectsModelsService {
  159. rs := &ProjectsModelsService{s: s}
  160. rs.Versions = NewProjectsModelsVersionsService(s)
  161. return rs
  162. }
  163. type ProjectsModelsService struct {
  164. s *Service
  165. Versions *ProjectsModelsVersionsService
  166. }
  167. func NewProjectsModelsVersionsService(s *Service) *ProjectsModelsVersionsService {
  168. rs := &ProjectsModelsVersionsService{s: s}
  169. return rs
  170. }
  171. type ProjectsModelsVersionsService struct {
  172. s *Service
  173. }
  174. func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
  175. rs := &ProjectsOperationsService{s: s}
  176. return rs
  177. }
  178. type ProjectsOperationsService struct {
  179. s *Service
  180. }
  181. // GoogleApi__HttpBody: Message that represents an arbitrary HTTP body.
  182. // It should only be used for
  183. // payload formats that can't be represented as JSON, such as raw binary
  184. // or
  185. // an HTML page.
  186. //
  187. //
  188. // This message can be used both in streaming and non-streaming API
  189. // methods in
  190. // the request as well as the response.
  191. //
  192. // It can be used as a top-level request field, which is convenient if
  193. // one
  194. // wants to extract parameters from either the URL or HTTP template into
  195. // the
  196. // request fields and also want access to the raw HTTP body.
  197. //
  198. // Example:
  199. //
  200. // message GetResourceRequest {
  201. // // A unique request id.
  202. // string request_id = 1;
  203. //
  204. // // The raw HTTP body is bound to this field.
  205. // google.api.HttpBody http_body = 2;
  206. // }
  207. //
  208. // service ResourceService {
  209. // rpc GetResource(GetResourceRequest) returns
  210. // (google.api.HttpBody);
  211. // rpc UpdateResource(google.api.HttpBody) returns
  212. // (google.protobuf.Empty);
  213. // }
  214. //
  215. // Example with streaming methods:
  216. //
  217. // service CaldavService {
  218. // rpc GetCalendar(stream google.api.HttpBody)
  219. // returns (stream google.api.HttpBody);
  220. // rpc UpdateCalendar(stream google.api.HttpBody)
  221. // returns (stream google.api.HttpBody);
  222. // }
  223. //
  224. // Use of this type only changes how the request and response bodies
  225. // are
  226. // handled, all other features will continue to work unchanged.
  227. type GoogleApi__HttpBody struct {
  228. // ContentType: The HTTP Content-Type header value specifying the
  229. // content type of the body.
  230. ContentType string `json:"contentType,omitempty"`
  231. // Data: The HTTP request/response body as raw binary.
  232. Data string `json:"data,omitempty"`
  233. // Extensions: Application specific response metadata. Must be set in
  234. // the first response
  235. // for streaming APIs.
  236. Extensions []googleapi.RawMessage `json:"extensions,omitempty"`
  237. // ServerResponse contains the HTTP response code and headers from the
  238. // server.
  239. googleapi.ServerResponse `json:"-"`
  240. // ForceSendFields is a list of field names (e.g. "ContentType") to
  241. // unconditionally include in API requests. By default, fields with
  242. // empty values are omitted from API requests. However, any non-pointer,
  243. // non-interface field appearing in ForceSendFields will be sent to the
  244. // server regardless of whether the field is empty or not. This may be
  245. // used to include empty fields in Patch requests.
  246. ForceSendFields []string `json:"-"`
  247. // NullFields is a list of field names (e.g. "ContentType") to include
  248. // in API requests with the JSON null value. By default, fields with
  249. // empty values are omitted from API requests. However, any field with
  250. // an empty value appearing in NullFields will be sent to the server as
  251. // null. It is an error if a field in this list has a non-empty value.
  252. // This may be used to include null fields in Patch requests.
  253. NullFields []string `json:"-"`
  254. }
  255. func (s *GoogleApi__HttpBody) MarshalJSON() ([]byte, error) {
  256. type NoMethod GoogleApi__HttpBody
  257. raw := NoMethod(*s)
  258. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  259. }
  260. // GoogleCloudMlV1HyperparameterOutputHyperparameterMetric: An observed
  261. // value of a metric.
  262. type GoogleCloudMlV1HyperparameterOutputHyperparameterMetric struct {
  263. // ObjectiveValue: The objective value at this training step.
  264. ObjectiveValue float64 `json:"objectiveValue,omitempty"`
  265. // TrainingStep: The global training step for this metric.
  266. TrainingStep int64 `json:"trainingStep,omitempty,string"`
  267. // ForceSendFields is a list of field names (e.g. "ObjectiveValue") to
  268. // unconditionally include in API requests. By default, fields with
  269. // empty values are omitted from API requests. However, any non-pointer,
  270. // non-interface field appearing in ForceSendFields will be sent to the
  271. // server regardless of whether the field is empty or not. This may be
  272. // used to include empty fields in Patch requests.
  273. ForceSendFields []string `json:"-"`
  274. // NullFields is a list of field names (e.g. "ObjectiveValue") to
  275. // include in API requests with the JSON null value. By default, fields
  276. // with empty values are omitted from API requests. However, any field
  277. // with an empty value appearing in NullFields will be sent to the
  278. // server as null. It is an error if a field in this list has a
  279. // non-empty value. This may be used to include null fields in Patch
  280. // requests.
  281. NullFields []string `json:"-"`
  282. }
  283. func (s *GoogleCloudMlV1HyperparameterOutputHyperparameterMetric) MarshalJSON() ([]byte, error) {
  284. type NoMethod GoogleCloudMlV1HyperparameterOutputHyperparameterMetric
  285. raw := NoMethod(*s)
  286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  287. }
  288. func (s *GoogleCloudMlV1HyperparameterOutputHyperparameterMetric) UnmarshalJSON(data []byte) error {
  289. type NoMethod GoogleCloudMlV1HyperparameterOutputHyperparameterMetric
  290. var s1 struct {
  291. ObjectiveValue gensupport.JSONFloat64 `json:"objectiveValue"`
  292. *NoMethod
  293. }
  294. s1.NoMethod = (*NoMethod)(s)
  295. if err := json.Unmarshal(data, &s1); err != nil {
  296. return err
  297. }
  298. s.ObjectiveValue = float64(s1.ObjectiveValue)
  299. return nil
  300. }
  301. // GoogleCloudMlV1__AcceleratorConfig: Represents a hardware accelerator
  302. // request config.
  303. type GoogleCloudMlV1__AcceleratorConfig struct {
  304. // Count: The number of accelerators to attach to each machine running
  305. // the job.
  306. Count int64 `json:"count,omitempty,string"`
  307. // Type: The type of accelerator to use.
  308. //
  309. // Possible values:
  310. // "ACCELERATOR_TYPE_UNSPECIFIED" - Unspecified accelerator type.
  311. // Default to no GPU.
  312. // "NVIDIA_TESLA_K80" - Nvidia Tesla K80 GPU.
  313. // "NVIDIA_TESLA_P100" - Nvidia Tesla P100 GPU.
  314. // "NVIDIA_TESLA_V100" - Nvidia Tesla V100 GPU.
  315. // "NVIDIA_TESLA_P4" - Nvidia Tesla P4 GPU.
  316. // "TPU_V2" - TPU v2.
  317. Type string `json:"type,omitempty"`
  318. // ForceSendFields is a list of field names (e.g. "Count") to
  319. // unconditionally include in API requests. By default, fields with
  320. // empty values are omitted from API requests. However, any non-pointer,
  321. // non-interface field appearing in ForceSendFields will be sent to the
  322. // server regardless of whether the field is empty or not. This may be
  323. // used to include empty fields in Patch requests.
  324. ForceSendFields []string `json:"-"`
  325. // NullFields is a list of field names (e.g. "Count") to include in API
  326. // requests with the JSON null value. By default, fields with empty
  327. // values are omitted from API requests. However, any field with an
  328. // empty value appearing in NullFields will be sent to the server as
  329. // null. It is an error if a field in this list has a non-empty value.
  330. // This may be used to include null fields in Patch requests.
  331. NullFields []string `json:"-"`
  332. }
  333. func (s *GoogleCloudMlV1__AcceleratorConfig) MarshalJSON() ([]byte, error) {
  334. type NoMethod GoogleCloudMlV1__AcceleratorConfig
  335. raw := NoMethod(*s)
  336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  337. }
  338. // GoogleCloudMlV1__AutoScaling: Options for automatically scaling a
  339. // model.
  340. type GoogleCloudMlV1__AutoScaling struct {
  341. // MinNodes: Optional. The minimum number of nodes to allocate for this
  342. // model. These
  343. // nodes are always up, starting from the time the model is
  344. // deployed.
  345. // Therefore, the cost of operating this model will be at least
  346. // `rate` * `min_nodes` * number of hours since last billing
  347. // cycle,
  348. // where `rate` is the cost per node-hour as documented in the
  349. // [pricing guide](/ml-engine/docs/pricing),
  350. // even if no predictions are performed. There is additional cost for
  351. // each
  352. // prediction performed.
  353. //
  354. // Unlike manual scaling, if the load gets too heavy for the nodes
  355. // that are up, the service will automatically add nodes to handle
  356. // the
  357. // increased load as well as scale back as traffic drops, always
  358. // maintaining
  359. // at least `min_nodes`. You will be charged for the time in which
  360. // additional
  361. // nodes are used.
  362. //
  363. // If not specified, `min_nodes` defaults to 0, in which case, when
  364. // traffic
  365. // to a model stops (and after a cool-down period), nodes will be shut
  366. // down
  367. // and no charges will be incurred until traffic to the model
  368. // resumes.
  369. //
  370. // You can set `min_nodes` when creating the model version, and you can
  371. // also
  372. // update `min_nodes` for an existing
  373. // version:
  374. // <pre>
  375. // update_body.json:
  376. // {
  377. // 'autoScaling': {
  378. // 'minNodes': 5
  379. // }
  380. // }
  381. // </pre>
  382. // HTTP
  383. // request:
  384. // <pre>
  385. // PATCH
  386. // https://ml.googleapis.com/v1/{name=projects/*/mod
  387. // els/*/versions/*}?update_mask=autoScaling.minNodes
  388. // -d @./update_body.json
  389. // </pre>
  390. MinNodes int64 `json:"minNodes,omitempty"`
  391. // ForceSendFields is a list of field names (e.g. "MinNodes") to
  392. // unconditionally include in API requests. By default, fields with
  393. // empty values are omitted from API requests. However, any non-pointer,
  394. // non-interface field appearing in ForceSendFields will be sent to the
  395. // server regardless of whether the field is empty or not. This may be
  396. // used to include empty fields in Patch requests.
  397. ForceSendFields []string `json:"-"`
  398. // NullFields is a list of field names (e.g. "MinNodes") to include in
  399. // API requests with the JSON null value. By default, fields with empty
  400. // values are omitted from API requests. However, any field with an
  401. // empty value appearing in NullFields will be sent to the server as
  402. // null. It is an error if a field in this list has a non-empty value.
  403. // This may be used to include null fields in Patch requests.
  404. NullFields []string `json:"-"`
  405. }
  406. func (s *GoogleCloudMlV1__AutoScaling) MarshalJSON() ([]byte, error) {
  407. type NoMethod GoogleCloudMlV1__AutoScaling
  408. raw := NoMethod(*s)
  409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  410. }
  411. // GoogleCloudMlV1__BuiltInAlgorithmOutput: Represents output related to
  412. // a built-in algorithm Job.
  413. type GoogleCloudMlV1__BuiltInAlgorithmOutput struct {
  414. // Framework: Framework on which the built-in algorithm was trained on.
  415. Framework string `json:"framework,omitempty"`
  416. // ModelPath: Built-in algorithm's saved model path.
  417. // Only set for non-hptuning succeeded jobs.
  418. ModelPath string `json:"modelPath,omitempty"`
  419. // PythonVersion: Python version on which the built-in algorithm was
  420. // trained on.
  421. PythonVersion string `json:"pythonVersion,omitempty"`
  422. // RuntimeVersion: CMLE runtime version on which the built-in algorithm
  423. // was trained on.
  424. RuntimeVersion string `json:"runtimeVersion,omitempty"`
  425. // ForceSendFields is a list of field names (e.g. "Framework") to
  426. // unconditionally include in API requests. By default, fields with
  427. // empty values are omitted from API requests. However, any non-pointer,
  428. // non-interface field appearing in ForceSendFields will be sent to the
  429. // server regardless of whether the field is empty or not. This may be
  430. // used to include empty fields in Patch requests.
  431. ForceSendFields []string `json:"-"`
  432. // NullFields is a list of field names (e.g. "Framework") to include in
  433. // API requests with the JSON null value. By default, fields with empty
  434. // values are omitted from API requests. However, any field with an
  435. // empty value appearing in NullFields will be sent to the server as
  436. // null. It is an error if a field in this list has a non-empty value.
  437. // This may be used to include null fields in Patch requests.
  438. NullFields []string `json:"-"`
  439. }
  440. func (s *GoogleCloudMlV1__BuiltInAlgorithmOutput) MarshalJSON() ([]byte, error) {
  441. type NoMethod GoogleCloudMlV1__BuiltInAlgorithmOutput
  442. raw := NoMethod(*s)
  443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  444. }
  445. // GoogleCloudMlV1__CancelJobRequest: Request message for the CancelJob
  446. // method.
  447. type GoogleCloudMlV1__CancelJobRequest struct {
  448. }
  449. type GoogleCloudMlV1__Capability struct {
  450. // AvailableAccelerators: Available accelerators for the capability.
  451. //
  452. // Possible values:
  453. // "ACCELERATOR_TYPE_UNSPECIFIED" - Unspecified accelerator type.
  454. // Default to no GPU.
  455. // "NVIDIA_TESLA_K80" - Nvidia Tesla K80 GPU.
  456. // "NVIDIA_TESLA_P100" - Nvidia Tesla P100 GPU.
  457. // "NVIDIA_TESLA_V100" - Nvidia Tesla V100 GPU.
  458. // "NVIDIA_TESLA_P4" - Nvidia Tesla P4 GPU.
  459. // "TPU_V2" - TPU v2.
  460. AvailableAccelerators []string `json:"availableAccelerators,omitempty"`
  461. // Possible values:
  462. // "TYPE_UNSPECIFIED"
  463. // "TRAINING"
  464. // "BATCH_PREDICTION"
  465. // "ONLINE_PREDICTION"
  466. Type string `json:"type,omitempty"`
  467. // ForceSendFields is a list of field names (e.g.
  468. // "AvailableAccelerators") to unconditionally include in API requests.
  469. // By default, fields with empty values are omitted from API requests.
  470. // However, any non-pointer, non-interface field appearing in
  471. // ForceSendFields will be sent to the server regardless of whether the
  472. // field is empty or not. This may be used to include empty fields in
  473. // Patch requests.
  474. ForceSendFields []string `json:"-"`
  475. // NullFields is a list of field names (e.g. "AvailableAccelerators") to
  476. // include in API requests with the JSON null value. By default, fields
  477. // with empty values are omitted from API requests. However, any field
  478. // with an empty value appearing in NullFields will be sent to the
  479. // server as null. It is an error if a field in this list has a
  480. // non-empty value. This may be used to include null fields in Patch
  481. // requests.
  482. NullFields []string `json:"-"`
  483. }
  484. func (s *GoogleCloudMlV1__Capability) MarshalJSON() ([]byte, error) {
  485. type NoMethod GoogleCloudMlV1__Capability
  486. raw := NoMethod(*s)
  487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  488. }
  489. type GoogleCloudMlV1__Config struct {
  490. // TpuServiceAccount: The service account Cloud ML uses to run on TPU
  491. // node.
  492. TpuServiceAccount string `json:"tpuServiceAccount,omitempty"`
  493. // ForceSendFields is a list of field names (e.g. "TpuServiceAccount")
  494. // to unconditionally include in API requests. By default, fields with
  495. // empty values are omitted from API requests. However, any non-pointer,
  496. // non-interface field appearing in ForceSendFields will be sent to the
  497. // server regardless of whether the field is empty or not. This may be
  498. // used to include empty fields in Patch requests.
  499. ForceSendFields []string `json:"-"`
  500. // NullFields is a list of field names (e.g. "TpuServiceAccount") to
  501. // include in API requests with the JSON null value. By default, fields
  502. // with empty values are omitted from API requests. However, any field
  503. // with an empty value appearing in NullFields will be sent to the
  504. // server as null. It is an error if a field in this list has a
  505. // non-empty value. This may be used to include null fields in Patch
  506. // requests.
  507. NullFields []string `json:"-"`
  508. }
  509. func (s *GoogleCloudMlV1__Config) MarshalJSON() ([]byte, error) {
  510. type NoMethod GoogleCloudMlV1__Config
  511. raw := NoMethod(*s)
  512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  513. }
  514. // GoogleCloudMlV1__GetConfigResponse: Returns service account
  515. // information associated with a project.
  516. type GoogleCloudMlV1__GetConfigResponse struct {
  517. Config *GoogleCloudMlV1__Config `json:"config,omitempty"`
  518. // ServiceAccount: The service account Cloud ML uses to access resources
  519. // in the project.
  520. ServiceAccount string `json:"serviceAccount,omitempty"`
  521. // ServiceAccountProject: The project number for `service_account`.
  522. ServiceAccountProject int64 `json:"serviceAccountProject,omitempty,string"`
  523. // ServerResponse contains the HTTP response code and headers from the
  524. // server.
  525. googleapi.ServerResponse `json:"-"`
  526. // ForceSendFields is a list of field names (e.g. "Config") to
  527. // unconditionally include in API requests. By default, fields with
  528. // empty values are omitted from API requests. However, any non-pointer,
  529. // non-interface field appearing in ForceSendFields will be sent to the
  530. // server regardless of whether the field is empty or not. This may be
  531. // used to include empty fields in Patch requests.
  532. ForceSendFields []string `json:"-"`
  533. // NullFields is a list of field names (e.g. "Config") to include in API
  534. // requests with the JSON null value. By default, fields with empty
  535. // values are omitted from API requests. However, any field with an
  536. // empty value appearing in NullFields will be sent to the server as
  537. // null. It is an error if a field in this list has a non-empty value.
  538. // This may be used to include null fields in Patch requests.
  539. NullFields []string `json:"-"`
  540. }
  541. func (s *GoogleCloudMlV1__GetConfigResponse) MarshalJSON() ([]byte, error) {
  542. type NoMethod GoogleCloudMlV1__GetConfigResponse
  543. raw := NoMethod(*s)
  544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  545. }
  546. // GoogleCloudMlV1__HyperparameterOutput: Represents the result of a
  547. // single hyperparameter tuning trial from a
  548. // training job. The TrainingOutput object that is returned on
  549. // successful
  550. // completion of a training job with hyperparameter tuning includes a
  551. // list
  552. // of HyperparameterOutput objects, one for each successful trial.
  553. type GoogleCloudMlV1__HyperparameterOutput struct {
  554. // AllMetrics: All recorded object metrics for this trial. This field is
  555. // not currently
  556. // populated.
  557. AllMetrics []*GoogleCloudMlV1HyperparameterOutputHyperparameterMetric `json:"allMetrics,omitempty"`
  558. // BuiltInAlgorithmOutput: Details related to built-in algorithms
  559. // job.
  560. // Only set this for built-in algorithms jobs and for trials that
  561. // succeeded.
  562. BuiltInAlgorithmOutput *GoogleCloudMlV1__BuiltInAlgorithmOutput `json:"builtInAlgorithmOutput,omitempty"`
  563. // FinalMetric: The final objective metric seen for this trial.
  564. FinalMetric *GoogleCloudMlV1HyperparameterOutputHyperparameterMetric `json:"finalMetric,omitempty"`
  565. // Hyperparameters: The hyperparameters given to this trial.
  566. Hyperparameters map[string]string `json:"hyperparameters,omitempty"`
  567. // IsTrialStoppedEarly: True if the trial is stopped early.
  568. IsTrialStoppedEarly bool `json:"isTrialStoppedEarly,omitempty"`
  569. // TrialId: The trial id for these results.
  570. TrialId string `json:"trialId,omitempty"`
  571. // ForceSendFields is a list of field names (e.g. "AllMetrics") to
  572. // unconditionally include in API requests. By default, fields with
  573. // empty values are omitted from API requests. However, any non-pointer,
  574. // non-interface field appearing in ForceSendFields will be sent to the
  575. // server regardless of whether the field is empty or not. This may be
  576. // used to include empty fields in Patch requests.
  577. ForceSendFields []string `json:"-"`
  578. // NullFields is a list of field names (e.g. "AllMetrics") to include in
  579. // API requests with the JSON null value. By default, fields with empty
  580. // values are omitted from API requests. However, any field with an
  581. // empty value appearing in NullFields will be sent to the server as
  582. // null. It is an error if a field in this list has a non-empty value.
  583. // This may be used to include null fields in Patch requests.
  584. NullFields []string `json:"-"`
  585. }
  586. func (s *GoogleCloudMlV1__HyperparameterOutput) MarshalJSON() ([]byte, error) {
  587. type NoMethod GoogleCloudMlV1__HyperparameterOutput
  588. raw := NoMethod(*s)
  589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  590. }
  591. // GoogleCloudMlV1__HyperparameterSpec: Represents a set of
  592. // hyperparameters to optimize.
  593. type GoogleCloudMlV1__HyperparameterSpec struct {
  594. // Algorithm: Optional. The search algorithm specified for the
  595. // hyperparameter
  596. // tuning job.
  597. // Uses the default CloudML Engine hyperparameter tuning
  598. // algorithm if unspecified.
  599. //
  600. // Possible values:
  601. // "ALGORITHM_UNSPECIFIED" - The default algorithm used by the
  602. // hyperparameter tuning service. This is
  603. // a Bayesian optimization algorithm.
  604. // "GRID_SEARCH" - Simple grid search within the feasible space. To
  605. // use grid search,
  606. // all parameters must be `INTEGER`, `CATEGORICAL`, or `DISCRETE`.
  607. // "RANDOM_SEARCH" - Simple random search within the feasible space.
  608. Algorithm string `json:"algorithm,omitempty"`
  609. // EnableTrialEarlyStopping: Optional. Indicates if the hyperparameter
  610. // tuning job enables auto trial
  611. // early stopping.
  612. EnableTrialEarlyStopping bool `json:"enableTrialEarlyStopping,omitempty"`
  613. // Goal: Required. The type of goal to use for tuning. Available types
  614. // are
  615. // `MAXIMIZE` and `MINIMIZE`.
  616. //
  617. // Defaults to `MAXIMIZE`.
  618. //
  619. // Possible values:
  620. // "GOAL_TYPE_UNSPECIFIED" - Goal Type will default to maximize.
  621. // "MAXIMIZE" - Maximize the goal metric.
  622. // "MINIMIZE" - Minimize the goal metric.
  623. Goal string `json:"goal,omitempty"`
  624. // HyperparameterMetricTag: Optional. The Tensorflow summary tag name to
  625. // use for optimizing trials. For
  626. // current versions of Tensorflow, this tag name should exactly match
  627. // what is
  628. // shown in Tensorboard, including all scopes. For versions of
  629. // Tensorflow
  630. // prior to 0.12, this should be only the tag passed to tf.Summary.
  631. // By default, "training/hptuning/metric" will be used.
  632. HyperparameterMetricTag string `json:"hyperparameterMetricTag,omitempty"`
  633. // MaxFailedTrials: Optional. How many failed trials that need to be
  634. // seen before failing the
  635. // hyperparameter tuning job. User can specify this field to override
  636. // the
  637. // default failing criteria for CloudML Engine hyperparameter tuning
  638. // jobs.
  639. //
  640. // Defaults to zero, which means to let the service decide when
  641. // a
  642. // hyperparameter job should fail.
  643. MaxFailedTrials int64 `json:"maxFailedTrials,omitempty"`
  644. // MaxParallelTrials: Optional. The number of training trials to run
  645. // concurrently.
  646. // You can reduce the time it takes to perform hyperparameter tuning by
  647. // adding
  648. // trials in parallel. However, each trail only benefits from the
  649. // information
  650. // gained in completed trials. That means that a trial does not get
  651. // access to
  652. // the results of trials running at the same time, which could reduce
  653. // the
  654. // quality of the overall optimization.
  655. //
  656. // Each trial will use the same scale tier and machine types.
  657. //
  658. // Defaults to one.
  659. MaxParallelTrials int64 `json:"maxParallelTrials,omitempty"`
  660. // MaxTrials: Optional. How many training trials should be attempted to
  661. // optimize
  662. // the specified hyperparameters.
  663. //
  664. // Defaults to one.
  665. MaxTrials int64 `json:"maxTrials,omitempty"`
  666. // Params: Required. The set of parameters to tune.
  667. Params []*GoogleCloudMlV1__ParameterSpec `json:"params,omitempty"`
  668. // ResumePreviousJobId: Optional. The prior hyperparameter tuning job id
  669. // that users hope to
  670. // continue with. The job id will be used to find the corresponding
  671. // vizier
  672. // study guid and resume the study.
  673. ResumePreviousJobId string `json:"resumePreviousJobId,omitempty"`
  674. // ForceSendFields is a list of field names (e.g. "Algorithm") to
  675. // unconditionally include in API requests. By default, fields with
  676. // empty values are omitted from API requests. However, any non-pointer,
  677. // non-interface field appearing in ForceSendFields will be sent to the
  678. // server regardless of whether the field is empty or not. This may be
  679. // used to include empty fields in Patch requests.
  680. ForceSendFields []string `json:"-"`
  681. // NullFields is a list of field names (e.g. "Algorithm") to include in
  682. // API requests with the JSON null value. By default, fields with empty
  683. // values are omitted from API requests. However, any field with an
  684. // empty value appearing in NullFields will be sent to the server as
  685. // null. It is an error if a field in this list has a non-empty value.
  686. // This may be used to include null fields in Patch requests.
  687. NullFields []string `json:"-"`
  688. }
  689. func (s *GoogleCloudMlV1__HyperparameterSpec) MarshalJSON() ([]byte, error) {
  690. type NoMethod GoogleCloudMlV1__HyperparameterSpec
  691. raw := NoMethod(*s)
  692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  693. }
  694. // GoogleCloudMlV1__Job: Represents a training or prediction job.
  695. type GoogleCloudMlV1__Job struct {
  696. // CreateTime: Output only. When the job was created.
  697. CreateTime string `json:"createTime,omitempty"`
  698. // EndTime: Output only. When the job processing was completed.
  699. EndTime string `json:"endTime,omitempty"`
  700. // ErrorMessage: Output only. The details of a failure or a
  701. // cancellation.
  702. ErrorMessage string `json:"errorMessage,omitempty"`
  703. // Etag: `etag` is used for optimistic concurrency control as a way to
  704. // help
  705. // prevent simultaneous updates of a job from overwriting each other.
  706. // It is strongly suggested that systems make use of the `etag` in
  707. // the
  708. // read-modify-write cycle to perform job updates in order to avoid
  709. // race
  710. // conditions: An `etag` is returned in the response to `GetJob`,
  711. // and
  712. // systems are expected to put that etag in the request to `UpdateJob`
  713. // to
  714. // ensure that their change will be applied to the same version of the
  715. // job.
  716. Etag string `json:"etag,omitempty"`
  717. // JobId: Required. The user-specified id of the job.
  718. JobId string `json:"jobId,omitempty"`
  719. // Labels: Optional. One or more labels that you can add, to organize
  720. // your jobs.
  721. // Each label is a key-value pair, where both the key and the value
  722. // are
  723. // arbitrary strings that you supply.
  724. // For more information, see the documentation on
  725. // <a href="/ml-engine/docs/tensorflow/resource-labels">using
  726. // labels</a>.
  727. Labels map[string]string `json:"labels,omitempty"`
  728. // PredictionInput: Input parameters to create a prediction job.
  729. PredictionInput *GoogleCloudMlV1__PredictionInput `json:"predictionInput,omitempty"`
  730. // PredictionOutput: The current prediction job result.
  731. PredictionOutput *GoogleCloudMlV1__PredictionOutput `json:"predictionOutput,omitempty"`
  732. // StartTime: Output only. When the job processing was started.
  733. StartTime string `json:"startTime,omitempty"`
  734. // State: Output only. The detailed state of a job.
  735. //
  736. // Possible values:
  737. // "STATE_UNSPECIFIED" - The job state is unspecified.
  738. // "QUEUED" - The job has been just created and processing has not yet
  739. // begun.
  740. // "PREPARING" - The service is preparing to run the job.
  741. // "RUNNING" - The job is in progress.
  742. // "SUCCEEDED" - The job completed successfully.
  743. // "FAILED" - The job failed.
  744. // `error_message` should contain the details of the failure.
  745. // "CANCELLING" - The job is being cancelled.
  746. // `error_message` should describe the reason for the cancellation.
  747. // "CANCELLED" - The job has been cancelled.
  748. // `error_message` should describe the reason for the cancellation.
  749. State string `json:"state,omitempty"`
  750. // TrainingInput: Input parameters to create a training job.
  751. TrainingInput *GoogleCloudMlV1__TrainingInput `json:"trainingInput,omitempty"`
  752. // TrainingOutput: The current training job result.
  753. TrainingOutput *GoogleCloudMlV1__TrainingOutput `json:"trainingOutput,omitempty"`
  754. // ServerResponse contains the HTTP response code and headers from the
  755. // server.
  756. googleapi.ServerResponse `json:"-"`
  757. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  758. // unconditionally include in API requests. By default, fields with
  759. // empty values are omitted from API requests. However, any non-pointer,
  760. // non-interface field appearing in ForceSendFields will be sent to the
  761. // server regardless of whether the field is empty or not. This may be
  762. // used to include empty fields in Patch requests.
  763. ForceSendFields []string `json:"-"`
  764. // NullFields is a list of field names (e.g. "CreateTime") to include in
  765. // API requests with the JSON null value. By default, fields with empty
  766. // values are omitted from API requests. However, any field with an
  767. // empty value appearing in NullFields will be sent to the server as
  768. // null. It is an error if a field in this list has a non-empty value.
  769. // This may be used to include null fields in Patch requests.
  770. NullFields []string `json:"-"`
  771. }
  772. func (s *GoogleCloudMlV1__Job) MarshalJSON() ([]byte, error) {
  773. type NoMethod GoogleCloudMlV1__Job
  774. raw := NoMethod(*s)
  775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  776. }
  777. // GoogleCloudMlV1__ListJobsResponse: Response message for the ListJobs
  778. // method.
  779. type GoogleCloudMlV1__ListJobsResponse struct {
  780. // Jobs: The list of jobs.
  781. Jobs []*GoogleCloudMlV1__Job `json:"jobs,omitempty"`
  782. // NextPageToken: Optional. Pass this token as the `page_token` field of
  783. // the request for a
  784. // subsequent call.
  785. NextPageToken string `json:"nextPageToken,omitempty"`
  786. // ServerResponse contains the HTTP response code and headers from the
  787. // server.
  788. googleapi.ServerResponse `json:"-"`
  789. // ForceSendFields is a list of field names (e.g. "Jobs") to
  790. // unconditionally include in API requests. By default, fields with
  791. // empty values are omitted from API requests. However, any non-pointer,
  792. // non-interface field appearing in ForceSendFields will be sent to the
  793. // server regardless of whether the field is empty or not. This may be
  794. // used to include empty fields in Patch requests.
  795. ForceSendFields []string `json:"-"`
  796. // NullFields is a list of field names (e.g. "Jobs") to include in API
  797. // requests with the JSON null value. By default, fields with empty
  798. // values are omitted from API requests. However, any field with an
  799. // empty value appearing in NullFields will be sent to the server as
  800. // null. It is an error if a field in this list has a non-empty value.
  801. // This may be used to include null fields in Patch requests.
  802. NullFields []string `json:"-"`
  803. }
  804. func (s *GoogleCloudMlV1__ListJobsResponse) MarshalJSON() ([]byte, error) {
  805. type NoMethod GoogleCloudMlV1__ListJobsResponse
  806. raw := NoMethod(*s)
  807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  808. }
  809. type GoogleCloudMlV1__ListLocationsResponse struct {
  810. // Locations: Locations where at least one type of CMLE capability is
  811. // available.
  812. Locations []*GoogleCloudMlV1__Location `json:"locations,omitempty"`
  813. // NextPageToken: Optional. Pass this token as the `page_token` field of
  814. // the request for a
  815. // subsequent call.
  816. NextPageToken string `json:"nextPageToken,omitempty"`
  817. // ServerResponse contains the HTTP response code and headers from the
  818. // server.
  819. googleapi.ServerResponse `json:"-"`
  820. // ForceSendFields is a list of field names (e.g. "Locations") to
  821. // unconditionally include in API requests. By default, fields with
  822. // empty values are omitted from API requests. However, any non-pointer,
  823. // non-interface field appearing in ForceSendFields will be sent to the
  824. // server regardless of whether the field is empty or not. This may be
  825. // used to include empty fields in Patch requests.
  826. ForceSendFields []string `json:"-"`
  827. // NullFields is a list of field names (e.g. "Locations") to include in
  828. // API requests with the JSON null value. By default, fields with empty
  829. // values are omitted from API requests. However, any field with an
  830. // empty value appearing in NullFields will be sent to the server as
  831. // null. It is an error if a field in this list has a non-empty value.
  832. // This may be used to include null fields in Patch requests.
  833. NullFields []string `json:"-"`
  834. }
  835. func (s *GoogleCloudMlV1__ListLocationsResponse) MarshalJSON() ([]byte, error) {
  836. type NoMethod GoogleCloudMlV1__ListLocationsResponse
  837. raw := NoMethod(*s)
  838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  839. }
  840. // GoogleCloudMlV1__ListModelsResponse: Response message for the
  841. // ListModels method.
  842. type GoogleCloudMlV1__ListModelsResponse struct {
  843. // Models: The list of models.
  844. Models []*GoogleCloudMlV1__Model `json:"models,omitempty"`
  845. // NextPageToken: Optional. Pass this token as the `page_token` field of
  846. // the request for a
  847. // subsequent call.
  848. NextPageToken string `json:"nextPageToken,omitempty"`
  849. // ServerResponse contains the HTTP response code and headers from the
  850. // server.
  851. googleapi.ServerResponse `json:"-"`
  852. // ForceSendFields is a list of field names (e.g. "Models") to
  853. // unconditionally include in API requests. By default, fields with
  854. // empty values are omitted from API requests. However, any non-pointer,
  855. // non-interface field appearing in ForceSendFields will be sent to the
  856. // server regardless of whether the field is empty or not. This may be
  857. // used to include empty fields in Patch requests.
  858. ForceSendFields []string `json:"-"`
  859. // NullFields is a list of field names (e.g. "Models") to include in API
  860. // requests with the JSON null value. By default, fields with empty
  861. // values are omitted from API requests. However, any field with an
  862. // empty value appearing in NullFields will be sent to the server as
  863. // null. It is an error if a field in this list has a non-empty value.
  864. // This may be used to include null fields in Patch requests.
  865. NullFields []string `json:"-"`
  866. }
  867. func (s *GoogleCloudMlV1__ListModelsResponse) MarshalJSON() ([]byte, error) {
  868. type NoMethod GoogleCloudMlV1__ListModelsResponse
  869. raw := NoMethod(*s)
  870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  871. }
  872. // GoogleCloudMlV1__ListVersionsResponse: Response message for the
  873. // ListVersions method.
  874. type GoogleCloudMlV1__ListVersionsResponse struct {
  875. // NextPageToken: Optional. Pass this token as the `page_token` field of
  876. // the request for a
  877. // subsequent call.
  878. NextPageToken string `json:"nextPageToken,omitempty"`
  879. // Versions: The list of versions.
  880. Versions []*GoogleCloudMlV1__Version `json:"versions,omitempty"`
  881. // ServerResponse contains the HTTP response code and headers from the
  882. // server.
  883. googleapi.ServerResponse `json:"-"`
  884. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  885. // unconditionally include in API requests. By default, fields with
  886. // empty values are omitted from API requests. However, any non-pointer,
  887. // non-interface field appearing in ForceSendFields will be sent to the
  888. // server regardless of whether the field is empty or not. This may be
  889. // used to include empty fields in Patch requests.
  890. ForceSendFields []string `json:"-"`
  891. // NullFields is a list of field names (e.g. "NextPageToken") to include
  892. // in API requests with the JSON null value. By default, fields with
  893. // empty values are omitted from API requests. However, any field with
  894. // an empty value appearing in NullFields will be sent to the server as
  895. // null. It is an error if a field in this list has a non-empty value.
  896. // This may be used to include null fields in Patch requests.
  897. NullFields []string `json:"-"`
  898. }
  899. func (s *GoogleCloudMlV1__ListVersionsResponse) MarshalJSON() ([]byte, error) {
  900. type NoMethod GoogleCloudMlV1__ListVersionsResponse
  901. raw := NoMethod(*s)
  902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  903. }
  904. type GoogleCloudMlV1__Location struct {
  905. // Capabilities: Capabilities available in the location.
  906. Capabilities []*GoogleCloudMlV1__Capability `json:"capabilities,omitempty"`
  907. Name string `json:"name,omitempty"`
  908. // ServerResponse contains the HTTP response code and headers from the
  909. // server.
  910. googleapi.ServerResponse `json:"-"`
  911. // ForceSendFields is a list of field names (e.g. "Capabilities") to
  912. // unconditionally include in API requests. By default, fields with
  913. // empty values are omitted from API requests. However, any non-pointer,
  914. // non-interface field appearing in ForceSendFields will be sent to the
  915. // server regardless of whether the field is empty or not. This may be
  916. // used to include empty fields in Patch requests.
  917. ForceSendFields []string `json:"-"`
  918. // NullFields is a list of field names (e.g. "Capabilities") to include
  919. // in API requests with the JSON null value. By default, fields with
  920. // empty values are omitted from API requests. However, any field with
  921. // an empty value appearing in NullFields will be sent to the server as
  922. // null. It is an error if a field in this list has a non-empty value.
  923. // This may be used to include null fields in Patch requests.
  924. NullFields []string `json:"-"`
  925. }
  926. func (s *GoogleCloudMlV1__Location) MarshalJSON() ([]byte, error) {
  927. type NoMethod GoogleCloudMlV1__Location
  928. raw := NoMethod(*s)
  929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  930. }
  931. // GoogleCloudMlV1__ManualScaling: Options for manually scaling a model.
  932. type GoogleCloudMlV1__ManualScaling struct {
  933. // Nodes: The number of nodes to allocate for this model. These nodes
  934. // are always up,
  935. // starting from the time the model is deployed, so the cost of
  936. // operating
  937. // this model will be proportional to `nodes` * number of hours
  938. // since
  939. // last billing cycle plus the cost for each prediction performed.
  940. Nodes int64 `json:"nodes,omitempty"`
  941. // ForceSendFields is a list of field names (e.g. "Nodes") to
  942. // unconditionally include in API requests. By default, fields with
  943. // empty values are omitted from API requests. However, any non-pointer,
  944. // non-interface field appearing in ForceSendFields will be sent to the
  945. // server regardless of whether the field is empty or not. This may be
  946. // used to include empty fields in Patch requests.
  947. ForceSendFields []string `json:"-"`
  948. // NullFields is a list of field names (e.g. "Nodes") to include in API
  949. // requests with the JSON null value. By default, fields with empty
  950. // values are omitted from API requests. However, any field with an
  951. // empty value appearing in NullFields will be sent to the server as
  952. // null. It is an error if a field in this list has a non-empty value.
  953. // This may be used to include null fields in Patch requests.
  954. NullFields []string `json:"-"`
  955. }
  956. func (s *GoogleCloudMlV1__ManualScaling) MarshalJSON() ([]byte, error) {
  957. type NoMethod GoogleCloudMlV1__ManualScaling
  958. raw := NoMethod(*s)
  959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  960. }
  961. // GoogleCloudMlV1__Model: Represents a machine learning solution.
  962. //
  963. // A model can have multiple versions, each of which is a deployed,
  964. // trained
  965. // model ready to receive prediction requests. The model itself is just
  966. // a
  967. // container.
  968. type GoogleCloudMlV1__Model struct {
  969. // DefaultVersion: Output only. The default version of the model. This
  970. // version will be used to
  971. // handle prediction requests that do not specify a version.
  972. //
  973. // You can change the default version by
  974. // calling
  975. // [projects.methods.versions.setDefault](/ml-engine/reference/re
  976. // st/v1/projects.models.versions/setDefault).
  977. DefaultVersion *GoogleCloudMlV1__Version `json:"defaultVersion,omitempty"`
  978. // Description: Optional. The description specified for the model when
  979. // it was created.
  980. Description string `json:"description,omitempty"`
  981. // Etag: `etag` is used for optimistic concurrency control as a way to
  982. // help
  983. // prevent simultaneous updates of a model from overwriting each
  984. // other.
  985. // It is strongly suggested that systems make use of the `etag` in
  986. // the
  987. // read-modify-write cycle to perform model updates in order to avoid
  988. // race
  989. // conditions: An `etag` is returned in the response to `GetModel`,
  990. // and
  991. // systems are expected to put that etag in the request to `UpdateModel`
  992. // to
  993. // ensure that their change will be applied to the model as intended.
  994. Etag string `json:"etag,omitempty"`
  995. // Labels: Optional. One or more labels that you can add, to organize
  996. // your models.
  997. // Each label is a key-value pair, where both the key and the value
  998. // are
  999. // arbitrary strings that you supply.
  1000. // For more information, see the documentation on
  1001. // <a href="/ml-engine/docs/tensorflow/resource-labels">using
  1002. // labels</a>.
  1003. Labels map[string]string `json:"labels,omitempty"`
  1004. // Name: Required. The name specified for the model when it was
  1005. // created.
  1006. //
  1007. // The model name must be unique within the project it is created in.
  1008. Name string `json:"name,omitempty"`
  1009. // OnlinePredictionLogging: Optional. If true, enables StackDriver
  1010. // Logging for online prediction.
  1011. // Default is false.
  1012. OnlinePredictionLogging bool `json:"onlinePredictionLogging,omitempty"`
  1013. // Regions: Optional. The list of regions where the model is going to be
  1014. // deployed.
  1015. // Currently only one region per model is supported.
  1016. // Defaults to 'us-central1' if nothing is set.
  1017. // See the <a href="/ml-engine/docs/tensorflow/regions">available
  1018. // regions</a>
  1019. // for ML Engine services.
  1020. // Note:
  1021. // * No matter where a model is deployed, it can always be accessed
  1022. // by
  1023. // users from anywhere, both for online and batch prediction.
  1024. // * The region for a batch prediction job is set by the region field
  1025. // when
  1026. // submitting the batch prediction job and does not take its value
  1027. // from
  1028. // this field.
  1029. Regions []string `json:"regions,omitempty"`
  1030. // ServerResponse contains the HTTP response code and headers from the
  1031. // server.
  1032. googleapi.ServerResponse `json:"-"`
  1033. // ForceSendFields is a list of field names (e.g. "DefaultVersion") to
  1034. // unconditionally include in API requests. By default, fields with
  1035. // empty values are omitted from API requests. However, any non-pointer,
  1036. // non-interface field appearing in ForceSendFields will be sent to the
  1037. // server regardless of whether the field is empty or not. This may be
  1038. // used to include empty fields in Patch requests.
  1039. ForceSendFields []string `json:"-"`
  1040. // NullFields is a list of field names (e.g. "DefaultVersion") to
  1041. // include in API requests with the JSON null value. By default, fields
  1042. // with empty values are omitted from API requests. However, any field
  1043. // with an empty value appearing in NullFields will be sent to the
  1044. // server as null. It is an error if a field in this list has a
  1045. // non-empty value. This may be used to include null fields in Patch
  1046. // requests.
  1047. NullFields []string `json:"-"`
  1048. }
  1049. func (s *GoogleCloudMlV1__Model) MarshalJSON() ([]byte, error) {
  1050. type NoMethod GoogleCloudMlV1__Model
  1051. raw := NoMethod(*s)
  1052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1053. }
  1054. // GoogleCloudMlV1__OperationMetadata: Represents the metadata of the
  1055. // long-running operation.
  1056. type GoogleCloudMlV1__OperationMetadata struct {
  1057. // CreateTime: The time the operation was submitted.
  1058. CreateTime string `json:"createTime,omitempty"`
  1059. // EndTime: The time operation processing completed.
  1060. EndTime string `json:"endTime,omitempty"`
  1061. // IsCancellationRequested: Indicates whether a request to cancel this
  1062. // operation has been made.
  1063. IsCancellationRequested bool `json:"isCancellationRequested,omitempty"`
  1064. // Labels: The user labels, inherited from the model or the model
  1065. // version being
  1066. // operated on.
  1067. Labels map[string]string `json:"labels,omitempty"`
  1068. // ModelName: Contains the name of the model associated with the
  1069. // operation.
  1070. ModelName string `json:"modelName,omitempty"`
  1071. // OperationType: The operation type.
  1072. //
  1073. // Possible values:
  1074. // "OPERATION_TYPE_UNSPECIFIED" - Unspecified operation type.
  1075. // "CREATE_VERSION" - An operation to create a new version.
  1076. // "DELETE_VERSION" - An operation to delete an existing version.
  1077. // "DELETE_MODEL" - An operation to delete an existing model.
  1078. // "UPDATE_MODEL" - An operation to update an existing model.
  1079. // "UPDATE_VERSION" - An operation to update an existing version.
  1080. // "UPDATE_CONFIG" - An operation to update project configuration.
  1081. OperationType string `json:"operationType,omitempty"`
  1082. // ProjectNumber: Contains the project number associated with the
  1083. // operation.
  1084. ProjectNumber int64 `json:"projectNumber,omitempty,string"`
  1085. // StartTime: The time operation processing started.
  1086. StartTime string `json:"startTime,omitempty"`
  1087. // Version: Contains the version associated with the operation.
  1088. Version *GoogleCloudMlV1__Version `json:"version,omitempty"`
  1089. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  1090. // unconditionally include in API requests. By default, fields with
  1091. // empty values are omitted from API requests. However, any non-pointer,
  1092. // non-interface field appearing in ForceSendFields will be sent to the
  1093. // server regardless of whether the field is empty or not. This may be
  1094. // used to include empty fields in Patch requests.
  1095. ForceSendFields []string `json:"-"`
  1096. // NullFields is a list of field names (e.g. "CreateTime") to include in
  1097. // API requests with the JSON null value. By default, fields with empty
  1098. // values are omitted from API requests. However, any field with an
  1099. // empty value appearing in NullFields will be sent to the server as
  1100. // null. It is an error if a field in this list has a non-empty value.
  1101. // This may be used to include null fields in Patch requests.
  1102. NullFields []string `json:"-"`
  1103. }
  1104. func (s *GoogleCloudMlV1__OperationMetadata) MarshalJSON() ([]byte, error) {
  1105. type NoMethod GoogleCloudMlV1__OperationMetadata
  1106. raw := NoMethod(*s)
  1107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1108. }
  1109. // GoogleCloudMlV1__ParameterSpec: Represents a single hyperparameter to
  1110. // optimize.
  1111. type GoogleCloudMlV1__ParameterSpec struct {
  1112. // CategoricalValues: Required if type is `CATEGORICAL`. The list of
  1113. // possible categories.
  1114. CategoricalValues []string `json:"categoricalValues,omitempty"`
  1115. // DiscreteValues: Required if type is `DISCRETE`.
  1116. // A list of feasible points.
  1117. // The list should be in strictly increasing order. For instance,
  1118. // this
  1119. // parameter might have possible settings of 1.5, 2.5, and 4.0. This
  1120. // list
  1121. // should not contain more than 1,000 values.
  1122. DiscreteValues []float64 `json:"discreteValues,omitempty"`
  1123. // MaxValue: Required if type is `DOUBLE` or `INTEGER`. This
  1124. // field
  1125. // should be unset if type is `CATEGORICAL`. This value should be
  1126. // integers if
  1127. // type is `INTEGER`.
  1128. MaxValue float64 `json:"maxValue,omitempty"`
  1129. // MinValue: Required if type is `DOUBLE` or `INTEGER`. This
  1130. // field
  1131. // should be unset if type is `CATEGORICAL`. This value should be
  1132. // integers if
  1133. // type is INTEGER.
  1134. MinValue float64 `json:"minValue,omitempty"`
  1135. // ParameterName: Required. The parameter name must be unique amongst
  1136. // all ParameterConfigs in
  1137. // a HyperparameterSpec message. E.g., "learning_rate".
  1138. ParameterName string `json:"parameterName,omitempty"`
  1139. // ScaleType: Optional. How the parameter should be scaled to the
  1140. // hypercube.
  1141. // Leave unset for categorical parameters.
  1142. // Some kind of scaling is strongly recommended for real or
  1143. // integral
  1144. // parameters (e.g., `UNIT_LINEAR_SCALE`).
  1145. //
  1146. // Possible values:
  1147. // "NONE" - By default, no scaling is applied.
  1148. // "UNIT_LINEAR_SCALE" - Scales the feasible space to (0, 1) linearly.
  1149. // "UNIT_LOG_SCALE" - Scales the feasible space logarithmically to (0,
  1150. // 1). The entire feasible
  1151. // space must be strictly positive.
  1152. // "UNIT_REVERSE_LOG_SCALE" - Scales the feasible space "reverse"
  1153. // logarithmically to (0, 1). The result
  1154. // is that values close to the top of the feasible space are spread out
  1155. // more
  1156. // than points near the bottom. The entire feasible space must be
  1157. // strictly
  1158. // positive.
  1159. ScaleType string `json:"scaleType,omitempty"`
  1160. // Type: Required. The type of the parameter.
  1161. //
  1162. // Possible values:
  1163. // "PARAMETER_TYPE_UNSPECIFIED" - You must specify a valid type. Using
  1164. // this unspecified type will result in
  1165. // an error.
  1166. // "DOUBLE" - Type for real-valued parameters.
  1167. // "INTEGER" - Type for integral parameters.
  1168. // "CATEGORICAL" - The parameter is categorical, with a value chosen
  1169. // from the categories
  1170. // field.
  1171. // "DISCRETE" - The parameter is real valued, with a fixed set of
  1172. // feasible points. If
  1173. // `type==DISCRETE`, feasible_points must be provided, and
  1174. // {`min_value`, `max_value`} will be ignored.
  1175. Type string `json:"type,omitempty"`
  1176. // ForceSendFields is a list of field names (e.g. "CategoricalValues")
  1177. // to 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. "CategoricalValues") to
  1184. // include in API requests with the JSON null value. By default, fields
  1185. // with empty values are omitted from API requests. However, any field
  1186. // with an empty value appearing in NullFields will be sent to the
  1187. // server as null. It is an error if a field in this list has a
  1188. // non-empty value. This may be used to include null fields in Patch
  1189. // requests.
  1190. NullFields []string `json:"-"`
  1191. }
  1192. func (s *GoogleCloudMlV1__ParameterSpec) MarshalJSON() ([]byte, error) {
  1193. type NoMethod GoogleCloudMlV1__ParameterSpec
  1194. raw := NoMethod(*s)
  1195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1196. }
  1197. func (s *GoogleCloudMlV1__ParameterSpec) UnmarshalJSON(data []byte) error {
  1198. type NoMethod GoogleCloudMlV1__ParameterSpec
  1199. var s1 struct {
  1200. MaxValue gensupport.JSONFloat64 `json:"maxValue"`
  1201. MinValue gensupport.JSONFloat64 `json:"minValue"`
  1202. *NoMethod
  1203. }
  1204. s1.NoMethod = (*NoMethod)(s)
  1205. if err := json.Unmarshal(data, &s1); err != nil {
  1206. return err
  1207. }
  1208. s.MaxValue = float64(s1.MaxValue)
  1209. s.MinValue = float64(s1.MinValue)
  1210. return nil
  1211. }
  1212. // GoogleCloudMlV1__PredictRequest: Request for predictions to be issued
  1213. // against a trained model.
  1214. type GoogleCloudMlV1__PredictRequest struct {
  1215. // HttpBody:
  1216. // Required. The prediction request body.
  1217. HttpBody *GoogleApi__HttpBody `json:"httpBody,omitempty"`
  1218. // ForceSendFields is a list of field names (e.g. "HttpBody") to
  1219. // unconditionally include in API requests. By default, fields with
  1220. // empty values are omitted from API requests. However, any non-pointer,
  1221. // non-interface field appearing in ForceSendFields will be sent to the
  1222. // server regardless of whether the field is empty or not. This may be
  1223. // used to include empty fields in Patch requests.
  1224. ForceSendFields []string `json:"-"`
  1225. // NullFields is a list of field names (e.g. "HttpBody") to include in
  1226. // API requests with the JSON null value. By default, fields with empty
  1227. // values are omitted from API requests. However, any field with an
  1228. // empty value appearing in NullFields will be sent to the server as
  1229. // null. It is an error if a field in this list has a non-empty value.
  1230. // This may be used to include null fields in Patch requests.
  1231. NullFields []string `json:"-"`
  1232. }
  1233. func (s *GoogleCloudMlV1__PredictRequest) MarshalJSON() ([]byte, error) {
  1234. type NoMethod GoogleCloudMlV1__PredictRequest
  1235. raw := NoMethod(*s)
  1236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1237. }
  1238. // GoogleCloudMlV1__PredictionInput: Represents input parameters for a
  1239. // prediction job.
  1240. type GoogleCloudMlV1__PredictionInput struct {
  1241. // BatchSize: Optional. Number of records per batch, defaults to 64.
  1242. // The service will buffer batch_size number of records in memory
  1243. // before
  1244. // invoking one Tensorflow prediction call internally. So take the
  1245. // record
  1246. // size and memory available into consideration when setting this
  1247. // parameter.
  1248. BatchSize int64 `json:"batchSize,omitempty,string"`
  1249. // DataFormat: Required. The format of the input data files.
  1250. //
  1251. // Possible values:
  1252. // "DATA_FORMAT_UNSPECIFIED" - Unspecified format.
  1253. // "JSON" - Each line of the file is a JSON dictionary representing
  1254. // one record.
  1255. // "TEXT" - Deprecated. Use JSON instead.
  1256. // "TF_RECORD" - INPUT ONLY. The source file is a TFRecord file.
  1257. // "TF_RECORD_GZIP" - INPUT ONLY. The source file is a GZIP-compressed
  1258. // TFRecord file.
  1259. // "CSV" - OUTPUT ONLY. Output values will be in comma-separated rows,
  1260. // with keys
  1261. // in a separate file.
  1262. DataFormat string `json:"dataFormat,omitempty"`
  1263. // InputPaths: Required. The Google Cloud Storage location of the input
  1264. // data files.
  1265. // May contain wildcards.
  1266. InputPaths []string `json:"inputPaths,omitempty"`
  1267. // MaxWorkerCount: Optional. The maximum number of workers to be used
  1268. // for parallel processing.
  1269. // Defaults to 10 if not specified.
  1270. MaxWorkerCount int64 `json:"maxWorkerCount,omitempty,string"`
  1271. // ModelName: Use this field if you want to use the default version for
  1272. // the specified
  1273. // model. The string must use the following
  1274. // format:
  1275. //
  1276. // "projects/YOUR_PROJECT/models/YOUR_MODEL"
  1277. ModelName string `json:"modelName,omitempty"`
  1278. // OutputDataFormat: Optional. Format of the output data files, defaults
  1279. // to JSON.
  1280. //
  1281. // Possible values:
  1282. // "DATA_FORMAT_UNSPECIFIED" - Unspecified format.
  1283. // "JSON" - Each line of the file is a JSON dictionary representing
  1284. // one record.
  1285. // "TEXT" - Deprecated. Use JSON instead.
  1286. // "TF_RECORD" - INPUT ONLY. The source file is a TFRecord file.
  1287. // "TF_RECORD_GZIP" - INPUT ONLY. The source file is a GZIP-compressed
  1288. // TFRecord file.
  1289. // "CSV" - OUTPUT ONLY. Output values will be in comma-separated rows,
  1290. // with keys
  1291. // in a separate file.
  1292. OutputDataFormat string `json:"outputDataFormat,omitempty"`
  1293. // OutputPath: Required. The output Google Cloud Storage location.
  1294. OutputPath string `json:"outputPath,omitempty"`
  1295. // Region: Required. The Google Compute Engine region to run the
  1296. // prediction job in.
  1297. // See the <a href="/ml-engine/docs/tensorflow/regions">available
  1298. // regions</a>
  1299. // for ML Engine services.
  1300. Region string `json:"region,omitempty"`
  1301. // RuntimeVersion: Optional. The Cloud ML Engine runtime version to use
  1302. // for this batch
  1303. // prediction. If not set, Cloud ML Engine will pick the runtime version
  1304. // used
  1305. // during the CreateVersion request for this model version, or choose
  1306. // the
  1307. // latest stable version when model version information is not
  1308. // available
  1309. // such as when the model is specified by uri.
  1310. RuntimeVersion string `json:"runtimeVersion,omitempty"`
  1311. // SignatureName: Optional. The name of the signature defined in the
  1312. // SavedModel to use for
  1313. // this job. Please refer
  1314. // to
  1315. // [SavedModel](https://tensorflow.github.io/serving/serving_basic.htm
  1316. // l)
  1317. // for information about how to use signatures.
  1318. //
  1319. // Defaults
  1320. // to
  1321. // [DEFAULT_SERVING_SIGNATURE_DEF_KEY](https://www.tensorflow.org/api_
  1322. // docs/python/tf/saved_model/signature_constants)
  1323. // , which is "serving_default".
  1324. SignatureName string `json:"signatureName,omitempty"`
  1325. // Uri: Use this field if you want to specify a Google Cloud Storage
  1326. // path for
  1327. // the model to use.
  1328. Uri string `json:"uri,omitempty"`
  1329. // VersionName: Use this field if you want to specify a version of the
  1330. // model to use. The
  1331. // string is formatted the same way as `model_version`, with the
  1332. // addition
  1333. // of the version
  1334. // information:
  1335. //
  1336. // "projects/YOUR_PROJECT/models/YOUR_MODEL/versions/YOUR_
  1337. // VERSION"
  1338. VersionName string `json:"versionName,omitempty"`
  1339. // ForceSendFields is a list of field names (e.g. "BatchSize") to
  1340. // unconditionally include in API requests. By default, fields with
  1341. // empty values are omitted from API requests. However, any non-pointer,
  1342. // non-interface field appearing in ForceSendFields will be sent to the
  1343. // server regardless of whether the field is empty or not. This may be
  1344. // used to include empty fields in Patch requests.
  1345. ForceSendFields []string `json:"-"`
  1346. // NullFields is a list of field names (e.g. "BatchSize") to include in
  1347. // API requests with the JSON null value. By default, fields with empty
  1348. // values are omitted from API requests. However, any field with an
  1349. // empty value appearing in NullFields will be sent to the server as
  1350. // null. It is an error if a field in this list has a non-empty value.
  1351. // This may be used to include null fields in Patch requests.
  1352. NullFields []string `json:"-"`
  1353. }
  1354. func (s *GoogleCloudMlV1__PredictionInput) MarshalJSON() ([]byte, error) {
  1355. type NoMethod GoogleCloudMlV1__PredictionInput
  1356. raw := NoMethod(*s)
  1357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1358. }
  1359. // GoogleCloudMlV1__PredictionOutput: Represents results of a prediction
  1360. // job.
  1361. type GoogleCloudMlV1__PredictionOutput struct {
  1362. // ErrorCount: The number of data instances which resulted in errors.
  1363. ErrorCount int64 `json:"errorCount,omitempty,string"`
  1364. // NodeHours: Node hours used by the batch prediction job.
  1365. NodeHours float64 `json:"nodeHours,omitempty"`
  1366. // OutputPath: The output Google Cloud Storage location provided at the
  1367. // job creation time.
  1368. OutputPath string `json:"outputPath,omitempty"`
  1369. // PredictionCount: The number of generated predictions.
  1370. PredictionCount int64 `json:"predictionCount,omitempty,string"`
  1371. // ForceSendFields is a list of field names (e.g. "ErrorCount") to
  1372. // unconditionally include in API requests. By default, fields with
  1373. // empty values are omitted from API requests. However, any non-pointer,
  1374. // non-interface field appearing in ForceSendFields will be sent to the
  1375. // server regardless of whether the field is empty or not. This may be
  1376. // used to include empty fields in Patch requests.
  1377. ForceSendFields []string `json:"-"`
  1378. // NullFields is a list of field names (e.g. "ErrorCount") to include in
  1379. // API requests with the JSON null value. By default, fields with empty
  1380. // values are omitted from API requests. However, any field with an
  1381. // empty value appearing in NullFields will be sent to the server as
  1382. // null. It is an error if a field in this list has a non-empty value.
  1383. // This may be used to include null fields in Patch requests.
  1384. NullFields []string `json:"-"`
  1385. }
  1386. func (s *GoogleCloudMlV1__PredictionOutput) MarshalJSON() ([]byte, error) {
  1387. type NoMethod GoogleCloudMlV1__PredictionOutput
  1388. raw := NoMethod(*s)
  1389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1390. }
  1391. func (s *GoogleCloudMlV1__PredictionOutput) UnmarshalJSON(data []byte) error {
  1392. type NoMethod GoogleCloudMlV1__PredictionOutput
  1393. var s1 struct {
  1394. NodeHours gensupport.JSONFloat64 `json:"nodeHours"`
  1395. *NoMethod
  1396. }
  1397. s1.NoMethod = (*NoMethod)(s)
  1398. if err := json.Unmarshal(data, &s1); err != nil {
  1399. return err
  1400. }
  1401. s.NodeHours = float64(s1.NodeHours)
  1402. return nil
  1403. }
  1404. // GoogleCloudMlV1__ReplicaConfig: Represents the configuration for a
  1405. // replica in a cluster.
  1406. type GoogleCloudMlV1__ReplicaConfig struct {
  1407. // AcceleratorConfig: Represents the type and number of accelerators
  1408. // used by the replica.
  1409. // [Learn about restrictions on accelerator configurations
  1410. // for
  1411. // training.](/ml-engine/docs/tensorflow/using-gpus#compute-engine-ma
  1412. // chine-types-with-gpu)
  1413. AcceleratorConfig *GoogleCloudMlV1__AcceleratorConfig `json:"acceleratorConfig,omitempty"`
  1414. // ImageUri: The Docker image to run on the replica. This image must be
  1415. // in Container
  1416. // Registry. Learn more about [configuring
  1417. // custom
  1418. // containers](/ml-engine/docs/distributed-training-containers).
  1419. ImageUri string `json:"imageUri,omitempty"`
  1420. // ForceSendFields is a list of field names (e.g. "AcceleratorConfig")
  1421. // to unconditionally include in API requests. By default, fields with
  1422. // empty values are omitted from API requests. However, any non-pointer,
  1423. // non-interface field appearing in ForceSendFields will be sent to the
  1424. // server regardless of whether the field is empty or not. This may be
  1425. // used to include empty fields in Patch requests.
  1426. ForceSendFields []string `json:"-"`
  1427. // NullFields is a list of field names (e.g. "AcceleratorConfig") to
  1428. // include in API requests with the JSON null value. By default, fields
  1429. // with empty values are omitted from API requests. However, any field
  1430. // with an empty value appearing in NullFields will be sent to the
  1431. // server as null. It is an error if a field in this list has a
  1432. // non-empty value. This may be used to include null fields in Patch
  1433. // requests.
  1434. NullFields []string `json:"-"`
  1435. }
  1436. func (s *GoogleCloudMlV1__ReplicaConfig) MarshalJSON() ([]byte, error) {
  1437. type NoMethod GoogleCloudMlV1__ReplicaConfig
  1438. raw := NoMethod(*s)
  1439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1440. }
  1441. // GoogleCloudMlV1__SetDefaultVersionRequest: Request message for the
  1442. // SetDefaultVersion request.
  1443. type GoogleCloudMlV1__SetDefaultVersionRequest struct {
  1444. }
  1445. // GoogleCloudMlV1__TrainingInput: Represents input parameters for a
  1446. // training job. When using the
  1447. // gcloud command to submit your training job, you can specify
  1448. // the input parameters as command-line arguments and/or in a YAML
  1449. // configuration
  1450. // file referenced from the --config command-line argument. For
  1451. // details, see the guide to
  1452. // <a href="/ml-engine/docs/tensorflow/training-jobs">submitting a
  1453. // training
  1454. // job</a>.
  1455. type GoogleCloudMlV1__TrainingInput struct {
  1456. // Args: Optional. Command line arguments to pass to the program.
  1457. Args []string `json:"args,omitempty"`
  1458. // Hyperparameters: Optional. The set of Hyperparameters to tune.
  1459. Hyperparameters *GoogleCloudMlV1__HyperparameterSpec `json:"hyperparameters,omitempty"`
  1460. // JobDir: Optional. A Google Cloud Storage path in which to store
  1461. // training outputs
  1462. // and other data needed for training. This path is passed to your
  1463. // TensorFlow
  1464. // program as the '--job-dir' command-line argument. The benefit of
  1465. // specifying
  1466. // this field is that Cloud ML validates the path for use in training.
  1467. JobDir string `json:"jobDir,omitempty"`
  1468. // MasterConfig: Optional. The configuration for your master
  1469. // worker.
  1470. //
  1471. // You should only set `masterConfig.acceleratorConfig` if `masterType`
  1472. // is set
  1473. // to a Compute Engine machine type. Learn about [restrictions on
  1474. // accelerator
  1475. // configurations
  1476. // for
  1477. // training.](/ml-engine/docs/tensorflow/using-gpus#compute-engine-ma
  1478. // chine-types-with-gpu)
  1479. //
  1480. // Set `masterConfig.imageUri` only if you build a custom image. Only
  1481. // one of
  1482. // `masterConfig.imageUri` and `runtimeVersion` should be set. Learn
  1483. // more about
  1484. // [configuring custom
  1485. // containers](/ml-engine/docs/distributed-training-containers).
  1486. MasterConfig *GoogleCloudMlV1__ReplicaConfig `json:"masterConfig,omitempty"`
  1487. // MasterType: Optional. Specifies the type of virtual machine to use
  1488. // for your training
  1489. // job's master worker.
  1490. //
  1491. // The following types are supported:
  1492. //
  1493. // <dl>
  1494. // <dt>standard</dt>
  1495. // <dd>
  1496. // A basic machine configuration suitable for training simple models
  1497. // with
  1498. // small to moderate datasets.
  1499. // </dd>
  1500. // <dt>large_model</dt>
  1501. // <dd>
  1502. // A machine with a lot of memory, specially suited for parameter
  1503. // servers
  1504. // when your model is large (having many hidden layers or layers with
  1505. // very
  1506. // large numbers of nodes).
  1507. // </dd>
  1508. // <dt>complex_model_s</dt>
  1509. // <dd>
  1510. // A machine suitable for the master and workers of the cluster when
  1511. // your
  1512. // model requires more computation than the standard machine can
  1513. // handle
  1514. // satisfactorily.
  1515. // </dd>
  1516. // <dt>complex_model_m</dt>
  1517. // <dd>
  1518. // A machine with roughly twice the number of cores and roughly double
  1519. // the
  1520. // memory of <i>complex_model_s</i>.
  1521. // </dd>
  1522. // <dt>complex_model_l</dt>
  1523. // <dd>
  1524. // A machine with roughly twice the number of cores and roughly double
  1525. // the
  1526. // memory of <i>complex_model_m</i>.
  1527. // </dd>
  1528. // <dt>standard_gpu</dt>
  1529. // <dd>
  1530. // A machine equivalent to <i>standard</i> that
  1531. // also includes a single NVIDIA Tesla K80 GPU. See more about
  1532. // <a href="/ml-engine/docs/tensorflow/using-gpus">using GPUs to
  1533. // train your model</a>.
  1534. // </dd>
  1535. // <dt>complex_model_m_gpu</dt>
  1536. // <dd>
  1537. // A machine equivalent to <i>complex_model_m</i> that also includes
  1538. // four NVIDIA Tesla K80 GPUs.
  1539. // </dd>
  1540. // <dt>complex_model_l_gpu</dt>
  1541. // <dd>
  1542. // A machine equivalent to <i>complex_model_l</i> that also includes
  1543. // eight NVIDIA Tesla K80 GPUs.
  1544. // </dd>
  1545. // <dt>standard_p100</dt>
  1546. // <dd>
  1547. // A machine equivalent to <i>standard</i> that
  1548. // also includes a single NVIDIA Tesla P100 GPU.
  1549. // </dd>
  1550. // <dt>complex_model_m_p100</dt>
  1551. // <dd>
  1552. // A machine equivalent to <i>complex_model_m</i> that also includes
  1553. // four NVIDIA Tesla P100 GPUs.
  1554. // </dd>
  1555. // <dt>standard_v100</dt>
  1556. // <dd>
  1557. // A machine equivalent to <i>standard</i> that
  1558. // also includes a single NVIDIA Tesla V100 GPU.
  1559. // </dd>
  1560. // <dt>large_model_v100</dt>
  1561. // <dd>
  1562. // A machine equivalent to <i>large_model</i> that
  1563. // also includes a single NVIDIA Tesla V100 GPU.
  1564. // </dd>
  1565. // <dt>complex_model_m_v100</dt>
  1566. // <dd>
  1567. // A machine equivalent to <i>complex_model_m</i> that
  1568. // also includes four NVIDIA Tesla V100 GPUs.
  1569. // </dd>
  1570. // <dt>complex_model_l_v100</dt>
  1571. // <dd>
  1572. // A machine equivalent to <i>complex_model_l</i> that
  1573. // also includes eight NVIDIA Tesla V100 GPUs.
  1574. // </dd>
  1575. // <dt>cloud_tpu</dt>
  1576. // <dd>
  1577. // A TPU VM including one Cloud TPU. See more about
  1578. // <a href="/ml-engine/docs/tensorflow/using-tpus">using TPUs to
  1579. // train
  1580. // your model</a>.
  1581. // </dd>
  1582. // </dl>
  1583. //
  1584. // You may also use certain Compute Engine machine types directly in
  1585. // this
  1586. // field. The following types are supported:
  1587. //
  1588. // - `n1-standard-4`
  1589. // - `n1-standard-8`
  1590. // - `n1-standard-16`
  1591. // - `n1-standard-32`
  1592. // - `n1-standard-64`
  1593. // - `n1-standard-96`
  1594. // - `n1-highmem-2`
  1595. // - `n1-highmem-4`
  1596. // - `n1-highmem-8`
  1597. // - `n1-highmem-16`
  1598. // - `n1-highmem-32`
  1599. // - `n1-highmem-64`
  1600. // - `n1-highmem-96`
  1601. // - `n1-highcpu-16`
  1602. // - `n1-highcpu-32`
  1603. // - `n1-highcpu-64`
  1604. // - `n1-highcpu-96`
  1605. //
  1606. // See more about [using Compute Engine
  1607. // machine
  1608. // types](/ml-engine/docs/tensorflow/machine-types#compute-engine
  1609. // -machine-types).
  1610. //
  1611. // You must set this value when `scaleTier` is set to `CUSTOM`.
  1612. MasterType string `json:"masterType,omitempty"`
  1613. // PackageUris: Required. The Google Cloud Storage location of the
  1614. // packages with
  1615. // the training program and any additional dependencies.
  1616. // The maximum number of package URIs is 100.
  1617. PackageUris []string `json:"packageUris,omitempty"`
  1618. // ParameterServerConfig: Optional. The configuration for parameter
  1619. // servers.
  1620. //
  1621. // You should only set `parameterServerConfig.acceleratorConfig`
  1622. // if
  1623. // `parameterServerConfigType` is set to a Compute Engine machine type.
  1624. // [Learn
  1625. // about restrictions on accelerator configurations
  1626. // for
  1627. // training.](/ml-engine/docs/tensorflow/using-gpus#compute-engine-ma
  1628. // chine-types-with-gpu)
  1629. //
  1630. // Set `parameterServerConfig.imageUri` only if you build a custom image
  1631. // for
  1632. // your parameter server. If `parameterServerConfig.imageUri` has not
  1633. // been
  1634. // set, Cloud ML Engine uses the value of `masterConfig.imageUri`.
  1635. // Learn more about [configuring custom
  1636. // containers](/ml-engine/docs/distributed-training-containers).
  1637. ParameterServerConfig *GoogleCloudMlV1__ReplicaConfig `json:"parameterServerConfig,omitempty"`
  1638. // ParameterServerCount: Optional. The number of parameter server
  1639. // replicas to use for the training
  1640. // job. Each replica in the cluster will be of the type specified
  1641. // in
  1642. // `parameter_server_type`.
  1643. //
  1644. // This value can only be used when `scale_tier` is set to `CUSTOM`.If
  1645. // you
  1646. // set this value, you must also set `parameter_server_type`.
  1647. //
  1648. // The default value is zero.
  1649. ParameterServerCount int64 `json:"parameterServerCount,omitempty,string"`
  1650. // ParameterServerType: Optional. Specifies the type of virtual machine
  1651. // to use for your training
  1652. // job's parameter server.
  1653. //
  1654. // The supported values are the same as those described in the entry
  1655. // for
  1656. // `master_type`.
  1657. //
  1658. // This value must be consistent with the category of machine type
  1659. // that
  1660. // `masterType` uses. In other words, both must be Cloud ML Engine
  1661. // machine
  1662. // types or both must be Compute Engine machine types.
  1663. //
  1664. // This value must be present when `scaleTier` is set to `CUSTOM`
  1665. // and
  1666. // `parameter_server_count` is greater than zero.
  1667. ParameterServerType string `json:"parameterServerType,omitempty"`
  1668. // PythonModule: Required. The Python module name to run after
  1669. // installing the packages.
  1670. PythonModule string `json:"pythonModule,omitempty"`
  1671. // PythonVersion: Optional. The version of Python used in training. If
  1672. // not set, the default
  1673. // version is '2.7'. Python '3.5' is available when `runtime_version` is
  1674. // set
  1675. // to '1.4' and above. Python '2.7' works with all supported
  1676. // <a href="/ml-engine/docs/runtime-version-list">runtime versions</a>.
  1677. PythonVersion string `json:"pythonVersion,omitempty"`
  1678. // Region: Required. The Google Compute Engine region to run the
  1679. // training job in.
  1680. // See the <a href="/ml-engine/docs/tensorflow/regions">available
  1681. // regions</a>
  1682. // for ML Engine services.
  1683. Region string `json:"region,omitempty"`
  1684. // RuntimeVersion: Optional. The Cloud ML Engine runtime version to use
  1685. // for training. If not
  1686. // set, Cloud ML Engine uses the default stable version, 1.0. For
  1687. // more
  1688. // information, see the
  1689. // <a href="/ml-engine/docs/runtime-version-list">runtime version
  1690. // list</a>
  1691. // and
  1692. // <a href="/ml-engine/docs/versioning">how to manage runtime
  1693. // versions</a>.
  1694. RuntimeVersion string `json:"runtimeVersion,omitempty"`
  1695. // ScaleTier: Required. Specifies the machine types, the number of
  1696. // replicas for workers
  1697. // and parameter servers.
  1698. //
  1699. // Possible values:
  1700. // "BASIC" - A single worker instance. This tier is suitable for
  1701. // learning how to use
  1702. // Cloud ML, and for experimenting with new models using small datasets.
  1703. // "STANDARD_1" - Many workers and a few parameter servers.
  1704. // "PREMIUM_1" - A large number of workers with many parameter
  1705. // servers.
  1706. // "BASIC_GPU" - A single worker instance [with
  1707. // a
  1708. // GPU](/ml-engine/docs/tensorflow/using-gpus).
  1709. // "BASIC_TPU" - A single worker instance with a
  1710. // [Cloud TPU](/ml-engine/docs/tensorflow/using-tpus).
  1711. // "CUSTOM" - The CUSTOM tier is not a set tier, but rather enables
  1712. // you to use your
  1713. // own cluster specification. When you use this tier, set values
  1714. // to
  1715. // configure your processing cluster according to these guidelines:
  1716. //
  1717. // * You _must_ set `TrainingInput.masterType` to specify the type
  1718. // of machine to use for your master node. This is the only
  1719. // required
  1720. // setting.
  1721. //
  1722. // * You _may_ set `TrainingInput.workerCount` to specify the number
  1723. // of
  1724. // workers to use. If you specify one or more workers, you _must_
  1725. // also
  1726. // set `TrainingInput.workerType` to specify the type of machine to
  1727. // use
  1728. // for your worker nodes.
  1729. //
  1730. // * You _may_ set `TrainingInput.parameterServerCount` to specify
  1731. // the
  1732. // number of parameter servers to use. If you specify one or more
  1733. // parameter servers, you _must_ also set
  1734. // `TrainingInput.parameterServerType` to specify the type of
  1735. // machine to
  1736. // use for your parameter servers.
  1737. //
  1738. // Note that all of your workers must use the same machine type, which
  1739. // can
  1740. // be different from your parameter server type and master type.
  1741. // Your
  1742. // parameter servers must likewise use the same machine type, which can
  1743. // be
  1744. // different from your worker type and master type.
  1745. ScaleTier string `json:"scaleTier,omitempty"`
  1746. // WorkerConfig: Optional. The configuration for workers.
  1747. //
  1748. // You should only set `workerConfig.acceleratorConfig` if `workerType`
  1749. // is set
  1750. // to a Compute Engine machine type. [Learn about restrictions on
  1751. // accelerator
  1752. // configurations
  1753. // for
  1754. // training.](/ml-engine/docs/tensorflow/using-gpus#compute-engine-ma
  1755. // chine-types-with-gpu)
  1756. //
  1757. // Set `workerConfig.imageUri` only if you build a custom image for
  1758. // your
  1759. // worker. If `workerConfig.imageUri` has not been set, Cloud ML Engine
  1760. // uses
  1761. // the value of `masterConfig.imageUri`. Learn more about
  1762. // [configuring custom
  1763. // containers](/ml-engine/docs/distributed-training-containers).
  1764. WorkerConfig *GoogleCloudMlV1__ReplicaConfig `json:"workerConfig,omitempty"`
  1765. // WorkerCount: Optional. The number of worker replicas to use for the
  1766. // training job. Each
  1767. // replica in the cluster will be of the type specified in
  1768. // `worker_type`.
  1769. //
  1770. // This value can only be used when `scale_tier` is set to `CUSTOM`. If
  1771. // you
  1772. // set this value, you must also set `worker_type`.
  1773. //
  1774. // The default value is zero.
  1775. WorkerCount int64 `json:"workerCount,omitempty,string"`
  1776. // WorkerType: Optional. Specifies the type of virtual machine to use
  1777. // for your training
  1778. // job's worker nodes.
  1779. //
  1780. // The supported values are the same as those described in the entry
  1781. // for
  1782. // `masterType`.
  1783. //
  1784. // This value must be consistent with the category of machine type
  1785. // that
  1786. // `masterType` uses. In other words, both must be Cloud ML Engine
  1787. // machine
  1788. // types or both must be Compute Engine machine types.
  1789. //
  1790. // If you use `cloud_tpu` for this value, see special instructions
  1791. // for
  1792. // [configuring a custom
  1793. // TPU
  1794. // machine](/ml-engine/docs/tensorflow/using-tpus#configuring_a_custo
  1795. // m_tpu_machine).
  1796. //
  1797. // This value must be present when `scaleTier` is set to `CUSTOM`
  1798. // and
  1799. // `workerCount` is greater than zero.
  1800. WorkerType string `json:"workerType,omitempty"`
  1801. // ForceSendFields is a list of field names (e.g. "Args") to
  1802. // unconditionally include in API requests. By default, fields with
  1803. // empty values are omitted from API requests. However, any non-pointer,
  1804. // non-interface field appearing in ForceSendFields will be sent to the
  1805. // server regardless of whether the field is empty or not. This may be
  1806. // used to include empty fields in Patch requests.
  1807. ForceSendFields []string `json:"-"`
  1808. // NullFields is a list of field names (e.g. "Args") to include in API
  1809. // requests with the JSON null value. By default, fields with empty
  1810. // values are omitted from API requests. However, any field with an
  1811. // empty value appearing in NullFields will be sent to the server as
  1812. // null. It is an error if a field in this list has a non-empty value.
  1813. // This may be used to include null fields in Patch requests.
  1814. NullFields []string `json:"-"`
  1815. }
  1816. func (s *GoogleCloudMlV1__TrainingInput) MarshalJSON() ([]byte, error) {
  1817. type NoMethod GoogleCloudMlV1__TrainingInput
  1818. raw := NoMethod(*s)
  1819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1820. }
  1821. // GoogleCloudMlV1__TrainingOutput: Represents results of a training
  1822. // job. Output only.
  1823. type GoogleCloudMlV1__TrainingOutput struct {
  1824. // BuiltInAlgorithmOutput: Details related to built-in algorithms
  1825. // job.
  1826. // Only set for built-in algorithms jobs.
  1827. BuiltInAlgorithmOutput *GoogleCloudMlV1__BuiltInAlgorithmOutput `json:"builtInAlgorithmOutput,omitempty"`
  1828. // CompletedTrialCount: The number of hyperparameter tuning trials that
  1829. // completed successfully.
  1830. // Only set for hyperparameter tuning jobs.
  1831. CompletedTrialCount int64 `json:"completedTrialCount,omitempty,string"`
  1832. // ConsumedMLUnits: The amount of ML units consumed by the job.
  1833. ConsumedMLUnits float64 `json:"consumedMLUnits,omitempty"`
  1834. // IsBuiltInAlgorithmJob: Whether this job is a built-in Algorithm job.
  1835. IsBuiltInAlgorithmJob bool `json:"isBuiltInAlgorithmJob,omitempty"`
  1836. // IsHyperparameterTuningJob: Whether this job is a hyperparameter
  1837. // tuning job.
  1838. IsHyperparameterTuningJob bool `json:"isHyperparameterTuningJob,omitempty"`
  1839. // Trials: Results for individual Hyperparameter trials.
  1840. // Only set for hyperparameter tuning jobs.
  1841. Trials []*GoogleCloudMlV1__HyperparameterOutput `json:"trials,omitempty"`
  1842. // ForceSendFields is a list of field names (e.g.
  1843. // "BuiltInAlgorithmOutput") to unconditionally include in API requests.
  1844. // By default, fields with empty values are omitted from API requests.
  1845. // However, any non-pointer, non-interface field appearing in
  1846. // ForceSendFields will be sent to the server regardless of whether the
  1847. // field is empty or not. This may be used to include empty fields in
  1848. // Patch requests.
  1849. ForceSendFields []string `json:"-"`
  1850. // NullFields is a list of field names (e.g. "BuiltInAlgorithmOutput")
  1851. // to include in API requests with the JSON null value. By default,
  1852. // fields with empty values are omitted from API requests. However, any
  1853. // field with an empty value appearing in NullFields will be sent to the
  1854. // server as null. It is an error if a field in this list has a
  1855. // non-empty value. This may be used to include null fields in Patch
  1856. // requests.
  1857. NullFields []string `json:"-"`
  1858. }
  1859. func (s *GoogleCloudMlV1__TrainingOutput) MarshalJSON() ([]byte, error) {
  1860. type NoMethod GoogleCloudMlV1__TrainingOutput
  1861. raw := NoMethod(*s)
  1862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1863. }
  1864. func (s *GoogleCloudMlV1__TrainingOutput) UnmarshalJSON(data []byte) error {
  1865. type NoMethod GoogleCloudMlV1__TrainingOutput
  1866. var s1 struct {
  1867. ConsumedMLUnits gensupport.JSONFloat64 `json:"consumedMLUnits"`
  1868. *NoMethod
  1869. }
  1870. s1.NoMethod = (*NoMethod)(s)
  1871. if err := json.Unmarshal(data, &s1); err != nil {
  1872. return err
  1873. }
  1874. s.ConsumedMLUnits = float64(s1.ConsumedMLUnits)
  1875. return nil
  1876. }
  1877. // GoogleCloudMlV1__Version: Represents a version of the model.
  1878. //
  1879. // Each version is a trained model deployed in the cloud, ready to
  1880. // handle
  1881. // prediction requests. A model can have multiple versions. You can
  1882. // get
  1883. // information about all of the versions of a given model by
  1884. // calling
  1885. // [projects.models.versions.list](/ml-engine/reference/rest/v1/p
  1886. // rojects.models.versions/list).
  1887. // Next ID: 29
  1888. type GoogleCloudMlV1__Version struct {
  1889. // AutoScaling: Automatically scale the number of nodes used to serve
  1890. // the model in
  1891. // response to increases and decreases in traffic. Care should be
  1892. // taken to ramp up traffic according to the model's ability to scale
  1893. // or you will start seeing increases in latency and 429 response codes.
  1894. AutoScaling *GoogleCloudMlV1__AutoScaling `json:"autoScaling,omitempty"`
  1895. // CreateTime: Output only. The time the version was created.
  1896. CreateTime string `json:"createTime,omitempty"`
  1897. // DeploymentUri: Required. The Google Cloud Storage location of the
  1898. // trained model used to
  1899. // create the version. See the
  1900. // [guide to
  1901. // model
  1902. // deployment](/ml-engine/docs/tensorflow/deploying-models) for
  1903. // more
  1904. // information.
  1905. //
  1906. // When passing Version
  1907. // to
  1908. // [projects.models.versions.create](/ml-engine/reference/rest/v1/proj
  1909. // ects.models.versions/create)
  1910. // the model service uses the specified location as the source of the
  1911. // model.
  1912. // Once deployed, the model version is hosted by the prediction service,
  1913. // so
  1914. // this location is useful only as a historical record.
  1915. // The total number of model files can't exceed 1000.
  1916. DeploymentUri string `json:"deploymentUri,omitempty"`
  1917. // Description: Optional. The description specified for the version when
  1918. // it was created.
  1919. Description string `json:"description,omitempty"`
  1920. // ErrorMessage: Output only. The details of a failure or a
  1921. // cancellation.
  1922. ErrorMessage string `json:"errorMessage,omitempty"`
  1923. // Etag: `etag` is used for optimistic concurrency control as a way to
  1924. // help
  1925. // prevent simultaneous updates of a model from overwriting each
  1926. // other.
  1927. // It is strongly suggested that systems make use of the `etag` in
  1928. // the
  1929. // read-modify-write cycle to perform model updates in order to avoid
  1930. // race
  1931. // conditions: An `etag` is returned in the response to `GetVersion`,
  1932. // and
  1933. // systems are expected to put that etag in the request to
  1934. // `UpdateVersion` to
  1935. // ensure that their change will be applied to the model as intended.
  1936. Etag string `json:"etag,omitempty"`
  1937. // Framework: Optional. The machine learning framework Cloud ML Engine
  1938. // uses to train
  1939. // this version of the model. Valid values are `TENSORFLOW`,
  1940. // `SCIKIT_LEARN`,
  1941. // `XGBOOST`. If you do not specify a framework, Cloud ML Engine
  1942. // will analyze files in the deployment_uri to determine a framework. If
  1943. // you
  1944. // choose `SCIKIT_LEARN` or `XGBOOST`, you must also set the runtime
  1945. // version
  1946. // of the model to 1.4 or greater.
  1947. //
  1948. // Possible values:
  1949. // "FRAMEWORK_UNSPECIFIED" - Unspecified framework. Assigns a value
  1950. // based on the file suffix.
  1951. // "TENSORFLOW" - Tensorflow framework.
  1952. // "SCIKIT_LEARN" - Scikit-learn framework.
  1953. // "XGBOOST" - XGBoost framework.
  1954. Framework string `json:"framework,omitempty"`
  1955. // IsDefault: Output only. If true, this version will be used to handle
  1956. // prediction
  1957. // requests that do not specify a version.
  1958. //
  1959. // You can change the default version by
  1960. // calling
  1961. // [projects.methods.versions.setDefault](/ml-engine/reference/re
  1962. // st/v1/projects.models.versions/setDefault).
  1963. IsDefault bool `json:"isDefault,omitempty"`
  1964. // Labels: Optional. One or more labels that you can add, to organize
  1965. // your model
  1966. // versions. Each label is a key-value pair, where both the key and the
  1967. // value
  1968. // are arbitrary strings that you supply.
  1969. // For more information, see the documentation on
  1970. // <a href="/ml-engine/docs/tensorflow/resource-labels">using
  1971. // labels</a>.
  1972. Labels map[string]string `json:"labels,omitempty"`
  1973. // LastUseTime: Output only. The time the version was last used for
  1974. // prediction.
  1975. LastUseTime string `json:"lastUseTime,omitempty"`
  1976. // MachineType: Optional. The type of machine on which to serve the
  1977. // model. Currently only
  1978. // applies to online prediction service.
  1979. // <dl>
  1980. // <dt>mls1-c1-m2</dt>
  1981. // <dd>
  1982. // The <b>default</b> machine type, with 1 core and 2 GB RAM. The
  1983. // deprecated
  1984. // name for this machine type is "mls1-highmem-1".
  1985. // </dd>
  1986. // <dt>mls1-c4-m2</dt>
  1987. // <dd>
  1988. // In <b>Beta</b>. This machine type has 4 cores and 2 GB RAM. The
  1989. // deprecated name for this machine type is "mls1-highcpu-4".
  1990. // </dd>
  1991. // </dl>
  1992. MachineType string `json:"machineType,omitempty"`
  1993. // ManualScaling: Manually select the number of nodes to use for serving
  1994. // the
  1995. // model. You should generally use `auto_scaling` with an
  1996. // appropriate
  1997. // `min_nodes` instead, but this option is available if you want
  1998. // more
  1999. // predictable billing. Beware that latency and error rates will
  2000. // increase
  2001. // if the traffic exceeds that capability of the system to serve it
  2002. // based
  2003. // on the selected number of nodes.
  2004. ManualScaling *GoogleCloudMlV1__ManualScaling `json:"manualScaling,omitempty"`
  2005. // Name: Required.The name specified for the version when it was
  2006. // created.
  2007. //
  2008. // The version name must be unique within the model it is created in.
  2009. Name string `json:"name,omitempty"`
  2010. // PythonVersion: Optional. The version of Python used in prediction. If
  2011. // not set, the default
  2012. // version is '2.7'. Python '3.5' is available when `runtime_version` is
  2013. // set
  2014. // to '1.4' and above. Python '2.7' works with all supported runtime
  2015. // versions.
  2016. PythonVersion string `json:"pythonVersion,omitempty"`
  2017. // RuntimeVersion: Optional. The Cloud ML Engine runtime version to use
  2018. // for this deployment.
  2019. // If not set, Cloud ML Engine uses the default stable version, 1.0. For
  2020. // more
  2021. // information, see the
  2022. // [runtime version list](/ml-engine/docs/runtime-version-list) and
  2023. // [how to manage runtime versions](/ml-engine/docs/versioning).
  2024. RuntimeVersion string `json:"runtimeVersion,omitempty"`
  2025. // State: Output only. The state of a version.
  2026. //
  2027. // Possible values:
  2028. // "UNKNOWN" - The version state is unspecified.
  2029. // "READY" - The version is ready for prediction.
  2030. // "CREATING" - The version is being created. New UpdateVersion and
  2031. // DeleteVersion
  2032. // requests will fail if a version is in the CREATING state.
  2033. // "FAILED" - The version failed to be created, possibly
  2034. // cancelled.
  2035. // `error_message` should contain the details of the failure.
  2036. // "DELETING" - The version is being deleted. New UpdateVersion and
  2037. // DeleteVersion
  2038. // requests will fail if a version is in the DELETING state.
  2039. // "UPDATING" - The version is being updated. New UpdateVersion and
  2040. // DeleteVersion
  2041. // requests will fail if a version is in the UPDATING state.
  2042. State string `json:"state,omitempty"`
  2043. // ServerResponse contains the HTTP response code and headers from the
  2044. // server.
  2045. googleapi.ServerResponse `json:"-"`
  2046. // ForceSendFields is a list of field names (e.g. "AutoScaling") to
  2047. // unconditionally include in API requests. By default, fields with
  2048. // empty values are omitted from API requests. However, any non-pointer,
  2049. // non-interface field appearing in ForceSendFields will be sent to the
  2050. // server regardless of whether the field is empty or not. This may be
  2051. // used to include empty fields in Patch requests.
  2052. ForceSendFields []string `json:"-"`
  2053. // NullFields is a list of field names (e.g. "AutoScaling") to include
  2054. // in API requests with the JSON null value. By default, fields with
  2055. // empty values are omitted from API requests. However, any field with
  2056. // an empty value appearing in NullFields will be sent to the server as
  2057. // null. It is an error if a field in this list has a non-empty value.
  2058. // This may be used to include null fields in Patch requests.
  2059. NullFields []string `json:"-"`
  2060. }
  2061. func (s *GoogleCloudMlV1__Version) MarshalJSON() ([]byte, error) {
  2062. type NoMethod GoogleCloudMlV1__Version
  2063. raw := NoMethod(*s)
  2064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2065. }
  2066. // GoogleIamV1__AuditConfig: Specifies the audit configuration for a
  2067. // service.
  2068. // The configuration determines which permission types are logged, and
  2069. // what
  2070. // identities, if any, are exempted from logging.
  2071. // An AuditConfig must have one or more AuditLogConfigs.
  2072. //
  2073. // If there are AuditConfigs for both `allServices` and a specific
  2074. // service,
  2075. // the union of the two AuditConfigs is used for that service: the
  2076. // log_types
  2077. // specified in each AuditConfig are enabled, and the exempted_members
  2078. // in each
  2079. // AuditLogConfig are exempted.
  2080. //
  2081. // Example Policy with multiple AuditConfigs:
  2082. //
  2083. // {
  2084. // "audit_configs": [
  2085. // {
  2086. // "service": "allServices"
  2087. // "audit_log_configs": [
  2088. // {
  2089. // "log_type": "DATA_READ",
  2090. // "exempted_members": [
  2091. // "user:foo@gmail.com"
  2092. // ]
  2093. // },
  2094. // {
  2095. // "log_type": "DATA_WRITE",
  2096. // },
  2097. // {
  2098. // "log_type": "ADMIN_READ",
  2099. // }
  2100. // ]
  2101. // },
  2102. // {
  2103. // "service": "fooservice.googleapis.com"
  2104. // "audit_log_configs": [
  2105. // {
  2106. // "log_type": "DATA_READ",
  2107. // },
  2108. // {
  2109. // "log_type": "DATA_WRITE",
  2110. // "exempted_members": [
  2111. // "user:bar@gmail.com"
  2112. // ]
  2113. // }
  2114. // ]
  2115. // }
  2116. // ]
  2117. // }
  2118. //
  2119. // For fooservice, this policy enables DATA_READ, DATA_WRITE and
  2120. // ADMIN_READ
  2121. // logging. It also exempts foo@gmail.com from DATA_READ logging,
  2122. // and
  2123. // bar@gmail.com from DATA_WRITE logging.
  2124. type GoogleIamV1__AuditConfig struct {
  2125. // AuditLogConfigs: The configuration for logging of each type of
  2126. // permission.
  2127. AuditLogConfigs []*GoogleIamV1__AuditLogConfig `json:"auditLogConfigs,omitempty"`
  2128. // Service: Specifies a service that will be enabled for audit
  2129. // logging.
  2130. // For example, `storage.googleapis.com`,
  2131. // `cloudsql.googleapis.com`.
  2132. // `allServices` is a special value that covers all services.
  2133. Service string `json:"service,omitempty"`
  2134. // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
  2135. // unconditionally include in API requests. By default, fields with
  2136. // empty values are omitted from API requests. However, any non-pointer,
  2137. // non-interface field appearing in ForceSendFields will be sent to the
  2138. // server regardless of whether the field is empty or not. This may be
  2139. // used to include empty fields in Patch requests.
  2140. ForceSendFields []string `json:"-"`
  2141. // NullFields is a list of field names (e.g. "AuditLogConfigs") to
  2142. // include in API requests with the JSON null value. By default, fields
  2143. // with empty values are omitted from API requests. However, any field
  2144. // with an empty value appearing in NullFields will be sent to the
  2145. // server as null. It is an error if a field in this list has a
  2146. // non-empty value. This may be used to include null fields in Patch
  2147. // requests.
  2148. NullFields []string `json:"-"`
  2149. }
  2150. func (s *GoogleIamV1__AuditConfig) MarshalJSON() ([]byte, error) {
  2151. type NoMethod GoogleIamV1__AuditConfig
  2152. raw := NoMethod(*s)
  2153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2154. }
  2155. // GoogleIamV1__AuditLogConfig: Provides the configuration for logging a
  2156. // type of permissions.
  2157. // Example:
  2158. //
  2159. // {
  2160. // "audit_log_configs": [
  2161. // {
  2162. // "log_type": "DATA_READ",
  2163. // "exempted_members": [
  2164. // "user:foo@gmail.com"
  2165. // ]
  2166. // },
  2167. // {
  2168. // "log_type": "DATA_WRITE",
  2169. // }
  2170. // ]
  2171. // }
  2172. //
  2173. // This enables 'DATA_READ' and 'DATA_WRITE' logging, while
  2174. // exempting
  2175. // foo@gmail.com from DATA_READ logging.
  2176. type GoogleIamV1__AuditLogConfig struct {
  2177. // ExemptedMembers: Specifies the identities that do not cause logging
  2178. // for this type of
  2179. // permission.
  2180. // Follows the same format of Binding.members.
  2181. ExemptedMembers []string `json:"exemptedMembers,omitempty"`
  2182. // LogType: The log type that this config enables.
  2183. //
  2184. // Possible values:
  2185. // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
  2186. // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
  2187. // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
  2188. // "DATA_READ" - Data reads. Example: CloudSQL Users list
  2189. LogType string `json:"logType,omitempty"`
  2190. // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
  2191. // unconditionally include in API requests. By default, fields with
  2192. // empty values are omitted from API requests. However, any non-pointer,
  2193. // non-interface field appearing in ForceSendFields will be sent to the
  2194. // server regardless of whether the field is empty or not. This may be
  2195. // used to include empty fields in Patch requests.
  2196. ForceSendFields []string `json:"-"`
  2197. // NullFields is a list of field names (e.g. "ExemptedMembers") to
  2198. // include in API requests with the JSON null value. By default, fields
  2199. // with empty values are omitted from API requests. However, any field
  2200. // with an empty value appearing in NullFields will be sent to the
  2201. // server as null. It is an error if a field in this list has a
  2202. // non-empty value. This may be used to include null fields in Patch
  2203. // requests.
  2204. NullFields []string `json:"-"`
  2205. }
  2206. func (s *GoogleIamV1__AuditLogConfig) MarshalJSON() ([]byte, error) {
  2207. type NoMethod GoogleIamV1__AuditLogConfig
  2208. raw := NoMethod(*s)
  2209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2210. }
  2211. // GoogleIamV1__Binding: Associates `members` with a `role`.
  2212. type GoogleIamV1__Binding struct {
  2213. // Condition: Unimplemented. The condition that is associated with this
  2214. // binding.
  2215. // NOTE: an unsatisfied condition will not allow user access via
  2216. // current
  2217. // binding. Different bindings, including their conditions, are
  2218. // examined
  2219. // independently.
  2220. Condition *GoogleType__Expr `json:"condition,omitempty"`
  2221. // Members: Specifies the identities requesting access for a Cloud
  2222. // Platform resource.
  2223. // `members` can have the following values:
  2224. //
  2225. // * `allUsers`: A special identifier that represents anyone who is
  2226. // on the internet; with or without a Google account.
  2227. //
  2228. // * `allAuthenticatedUsers`: A special identifier that represents
  2229. // anyone
  2230. // who is authenticated with a Google account or a service
  2231. // account.
  2232. //
  2233. // * `user:{emailid}`: An email address that represents a specific
  2234. // Google
  2235. // account. For example, `alice@gmail.com` .
  2236. //
  2237. //
  2238. // * `serviceAccount:{emailid}`: An email address that represents a
  2239. // service
  2240. // account. For example,
  2241. // `my-other-app@appspot.gserviceaccount.com`.
  2242. //
  2243. // * `group:{emailid}`: An email address that represents a Google
  2244. // group.
  2245. // For example, `admins@example.com`.
  2246. //
  2247. //
  2248. // * `domain:{domain}`: The G Suite domain (primary) that represents all
  2249. // the
  2250. // users of that domain. For example, `google.com` or
  2251. // `example.com`.
  2252. //
  2253. //
  2254. Members []string `json:"members,omitempty"`
  2255. // Role: Role that is assigned to `members`.
  2256. // For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
  2257. Role string `json:"role,omitempty"`
  2258. // ForceSendFields is a list of field names (e.g. "Condition") to
  2259. // unconditionally include in API requests. By default, fields with
  2260. // empty values are omitted from API requests. However, any non-pointer,
  2261. // non-interface field appearing in ForceSendFields will be sent to the
  2262. // server regardless of whether the field is empty or not. This may be
  2263. // used to include empty fields in Patch requests.
  2264. ForceSendFields []string `json:"-"`
  2265. // NullFields is a list of field names (e.g. "Condition") to include in
  2266. // API requests with the JSON null value. By default, fields with empty
  2267. // values are omitted from API requests. However, any field with an
  2268. // empty value appearing in NullFields will be sent to the server as
  2269. // null. It is an error if a field in this list has a non-empty value.
  2270. // This may be used to include null fields in Patch requests.
  2271. NullFields []string `json:"-"`
  2272. }
  2273. func (s *GoogleIamV1__Binding) MarshalJSON() ([]byte, error) {
  2274. type NoMethod GoogleIamV1__Binding
  2275. raw := NoMethod(*s)
  2276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2277. }
  2278. // GoogleIamV1__Policy: Defines an Identity and Access Management (IAM)
  2279. // policy. It is used to
  2280. // specify access control policies for Cloud Platform resources.
  2281. //
  2282. //
  2283. // A `Policy` consists of a list of `bindings`. A `binding` binds a list
  2284. // of
  2285. // `members` to a `role`, where the members can be user accounts, Google
  2286. // groups,
  2287. // Google domains, and service accounts. A `role` is a named list of
  2288. // permissions
  2289. // defined by IAM.
  2290. //
  2291. // **JSON Example**
  2292. //
  2293. // {
  2294. // "bindings": [
  2295. // {
  2296. // "role": "roles/owner",
  2297. // "members": [
  2298. // "user:mike@example.com",
  2299. // "group:admins@example.com",
  2300. // "domain:google.com",
  2301. //
  2302. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  2303. // ]
  2304. // },
  2305. // {
  2306. // "role": "roles/viewer",
  2307. // "members": ["user:sean@example.com"]
  2308. // }
  2309. // ]
  2310. // }
  2311. //
  2312. // **YAML Example**
  2313. //
  2314. // bindings:
  2315. // - members:
  2316. // - user:mike@example.com
  2317. // - group:admins@example.com
  2318. // - domain:google.com
  2319. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  2320. // role: roles/owner
  2321. // - members:
  2322. // - user:sean@example.com
  2323. // role: roles/viewer
  2324. //
  2325. //
  2326. // For a description of IAM and its features, see the
  2327. // [IAM developer's guide](https://cloud.google.com/iam/docs).
  2328. type GoogleIamV1__Policy struct {
  2329. // AuditConfigs: Specifies cloud audit logging configuration for this
  2330. // policy.
  2331. AuditConfigs []*GoogleIamV1__AuditConfig `json:"auditConfigs,omitempty"`
  2332. // Bindings: Associates a list of `members` to a `role`.
  2333. // `bindings` with no members will result in an error.
  2334. Bindings []*GoogleIamV1__Binding `json:"bindings,omitempty"`
  2335. // Etag: `etag` is used for optimistic concurrency control as a way to
  2336. // help
  2337. // prevent simultaneous updates of a policy from overwriting each
  2338. // other.
  2339. // It is strongly suggested that systems make use of the `etag` in
  2340. // the
  2341. // read-modify-write cycle to perform policy updates in order to avoid
  2342. // race
  2343. // conditions: An `etag` is returned in the response to `getIamPolicy`,
  2344. // and
  2345. // systems are expected to put that etag in the request to
  2346. // `setIamPolicy` to
  2347. // ensure that their change will be applied to the same version of the
  2348. // policy.
  2349. //
  2350. // If no `etag` is provided in the call to `setIamPolicy`, then the
  2351. // existing
  2352. // policy is overwritten blindly.
  2353. Etag string `json:"etag,omitempty"`
  2354. // Version: Deprecated.
  2355. Version int64 `json:"version,omitempty"`
  2356. // ServerResponse contains the HTTP response code and headers from the
  2357. // server.
  2358. googleapi.ServerResponse `json:"-"`
  2359. // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
  2360. // unconditionally include in API requests. By default, fields with
  2361. // empty values are omitted from API requests. However, any non-pointer,
  2362. // non-interface field appearing in ForceSendFields will be sent to the
  2363. // server regardless of whether the field is empty or not. This may be
  2364. // used to include empty fields in Patch requests.
  2365. ForceSendFields []string `json:"-"`
  2366. // NullFields is a list of field names (e.g. "AuditConfigs") to include
  2367. // in API requests with the JSON null value. By default, fields with
  2368. // empty values are omitted from API requests. However, any field with
  2369. // an empty value appearing in NullFields will be sent to the server as
  2370. // null. It is an error if a field in this list has a non-empty value.
  2371. // This may be used to include null fields in Patch requests.
  2372. NullFields []string `json:"-"`
  2373. }
  2374. func (s *GoogleIamV1__Policy) MarshalJSON() ([]byte, error) {
  2375. type NoMethod GoogleIamV1__Policy
  2376. raw := NoMethod(*s)
  2377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2378. }
  2379. // GoogleIamV1__SetIamPolicyRequest: Request message for `SetIamPolicy`
  2380. // method.
  2381. type GoogleIamV1__SetIamPolicyRequest struct {
  2382. // Policy: REQUIRED: The complete policy to be applied to the
  2383. // `resource`. The size of
  2384. // the policy is limited to a few 10s of KB. An empty policy is a
  2385. // valid policy but certain Cloud Platform services (such as
  2386. // Projects)
  2387. // might reject them.
  2388. Policy *GoogleIamV1__Policy `json:"policy,omitempty"`
  2389. // UpdateMask: OPTIONAL: A FieldMask specifying which fields of the
  2390. // policy to modify. Only
  2391. // the fields in the mask will be modified. If no mask is provided,
  2392. // the
  2393. // following default mask is used:
  2394. // paths: "bindings, etag"
  2395. // This field is only used by Cloud IAM.
  2396. UpdateMask string `json:"updateMask,omitempty"`
  2397. // ForceSendFields is a list of field names (e.g. "Policy") to
  2398. // unconditionally include in API requests. By default, fields with
  2399. // empty values are omitted from API requests. However, any non-pointer,
  2400. // non-interface field appearing in ForceSendFields will be sent to the
  2401. // server regardless of whether the field is empty or not. This may be
  2402. // used to include empty fields in Patch requests.
  2403. ForceSendFields []string `json:"-"`
  2404. // NullFields is a list of field names (e.g. "Policy") to include in API
  2405. // requests with the JSON null value. By default, fields with empty
  2406. // values are omitted from API requests. However, any field with an
  2407. // empty value appearing in NullFields will be sent to the server as
  2408. // null. It is an error if a field in this list has a non-empty value.
  2409. // This may be used to include null fields in Patch requests.
  2410. NullFields []string `json:"-"`
  2411. }
  2412. func (s *GoogleIamV1__SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  2413. type NoMethod GoogleIamV1__SetIamPolicyRequest
  2414. raw := NoMethod(*s)
  2415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2416. }
  2417. // GoogleIamV1__TestIamPermissionsRequest: Request message for
  2418. // `TestIamPermissions` method.
  2419. type GoogleIamV1__TestIamPermissionsRequest struct {
  2420. // Permissions: The set of permissions to check for the `resource`.
  2421. // Permissions with
  2422. // wildcards (such as '*' or 'storage.*') are not allowed. For
  2423. // more
  2424. // information see
  2425. // [IAM
  2426. // Overview](https://cloud.google.com/iam/docs/overview#permissions).
  2427. Permissions []string `json:"permissions,omitempty"`
  2428. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2429. // unconditionally include in API requests. By default, fields with
  2430. // empty values are omitted from API requests. However, any non-pointer,
  2431. // non-interface field appearing in ForceSendFields will be sent to the
  2432. // server regardless of whether the field is empty or not. This may be
  2433. // used to include empty fields in Patch requests.
  2434. ForceSendFields []string `json:"-"`
  2435. // NullFields is a list of field names (e.g. "Permissions") to include
  2436. // in API requests with the JSON null value. By default, fields with
  2437. // empty values are omitted from API requests. However, any field with
  2438. // an empty value appearing in NullFields will be sent to the server as
  2439. // null. It is an error if a field in this list has a non-empty value.
  2440. // This may be used to include null fields in Patch requests.
  2441. NullFields []string `json:"-"`
  2442. }
  2443. func (s *GoogleIamV1__TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  2444. type NoMethod GoogleIamV1__TestIamPermissionsRequest
  2445. raw := NoMethod(*s)
  2446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2447. }
  2448. // GoogleIamV1__TestIamPermissionsResponse: Response message for
  2449. // `TestIamPermissions` method.
  2450. type GoogleIamV1__TestIamPermissionsResponse struct {
  2451. // Permissions: A subset of `TestPermissionsRequest.permissions` that
  2452. // the caller is
  2453. // allowed.
  2454. Permissions []string `json:"permissions,omitempty"`
  2455. // ServerResponse contains the HTTP response code and headers from the
  2456. // server.
  2457. googleapi.ServerResponse `json:"-"`
  2458. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2459. // unconditionally include in API requests. By default, fields with
  2460. // empty values are omitted from API requests. However, any non-pointer,
  2461. // non-interface field appearing in ForceSendFields will be sent to the
  2462. // server regardless of whether the field is empty or not. This may be
  2463. // used to include empty fields in Patch requests.
  2464. ForceSendFields []string `json:"-"`
  2465. // NullFields is a list of field names (e.g. "Permissions") to include
  2466. // in API requests with the JSON null value. By default, fields with
  2467. // empty values are omitted from API requests. However, any field with
  2468. // an empty value appearing in NullFields will be sent to the server as
  2469. // null. It is an error if a field in this list has a non-empty value.
  2470. // This may be used to include null fields in Patch requests.
  2471. NullFields []string `json:"-"`
  2472. }
  2473. func (s *GoogleIamV1__TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  2474. type NoMethod GoogleIamV1__TestIamPermissionsResponse
  2475. raw := NoMethod(*s)
  2476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2477. }
  2478. // GoogleLongrunning__ListOperationsResponse: The response message for
  2479. // Operations.ListOperations.
  2480. type GoogleLongrunning__ListOperationsResponse struct {
  2481. // NextPageToken: The standard List next-page token.
  2482. NextPageToken string `json:"nextPageToken,omitempty"`
  2483. // Operations: A list of operations that matches the specified filter in
  2484. // the request.
  2485. Operations []*GoogleLongrunning__Operation `json:"operations,omitempty"`
  2486. // ServerResponse contains the HTTP response code and headers from the
  2487. // server.
  2488. googleapi.ServerResponse `json:"-"`
  2489. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2490. // unconditionally include in API requests. By default, fields with
  2491. // empty values are omitted from API requests. However, any non-pointer,
  2492. // non-interface field appearing in ForceSendFields will be sent to the
  2493. // server regardless of whether the field is empty or not. This may be
  2494. // used to include empty fields in Patch requests.
  2495. ForceSendFields []string `json:"-"`
  2496. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2497. // in API requests with the JSON null value. By default, fields with
  2498. // empty values are omitted from API requests. However, any field with
  2499. // an empty value appearing in NullFields will be sent to the server as
  2500. // null. It is an error if a field in this list has a non-empty value.
  2501. // This may be used to include null fields in Patch requests.
  2502. NullFields []string `json:"-"`
  2503. }
  2504. func (s *GoogleLongrunning__ListOperationsResponse) MarshalJSON() ([]byte, error) {
  2505. type NoMethod GoogleLongrunning__ListOperationsResponse
  2506. raw := NoMethod(*s)
  2507. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2508. }
  2509. // GoogleLongrunning__Operation: This resource represents a long-running
  2510. // operation that is the result of a
  2511. // network API call.
  2512. type GoogleLongrunning__Operation struct {
  2513. // Done: If the value is `false`, it means the operation is still in
  2514. // progress.
  2515. // If `true`, the operation is completed, and either `error` or
  2516. // `response` is
  2517. // available.
  2518. Done bool `json:"done,omitempty"`
  2519. // Error: The error result of the operation in case of failure or
  2520. // cancellation.
  2521. Error *GoogleRpc__Status `json:"error,omitempty"`
  2522. // Metadata: Service-specific metadata associated with the operation.
  2523. // It typically
  2524. // contains progress information and common metadata such as create
  2525. // time.
  2526. // Some services might not provide such metadata. Any method that
  2527. // returns a
  2528. // long-running operation should document the metadata type, if any.
  2529. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  2530. // Name: The server-assigned name, which is only unique within the same
  2531. // service that
  2532. // originally returns it. If you use the default HTTP mapping,
  2533. // the
  2534. // `name` should have the format of `operations/some/unique/name`.
  2535. Name string `json:"name,omitempty"`
  2536. // Response: The normal response of the operation in case of success.
  2537. // If the original
  2538. // method returns no data on success, such as `Delete`, the response
  2539. // is
  2540. // `google.protobuf.Empty`. If the original method is
  2541. // standard
  2542. // `Get`/`Create`/`Update`, the response should be the resource. For
  2543. // other
  2544. // methods, the response should have the type `XxxResponse`, where
  2545. // `Xxx`
  2546. // is the original method name. For example, if the original method
  2547. // name
  2548. // is `TakeSnapshot()`, the inferred response type
  2549. // is
  2550. // `TakeSnapshotResponse`.
  2551. Response googleapi.RawMessage `json:"response,omitempty"`
  2552. // ServerResponse contains the HTTP response code and headers from the
  2553. // server.
  2554. googleapi.ServerResponse `json:"-"`
  2555. // ForceSendFields is a list of field names (e.g. "Done") to
  2556. // unconditionally include in API requests. By default, fields with
  2557. // empty values are omitted from API requests. However, any non-pointer,
  2558. // non-interface field appearing in ForceSendFields will be sent to the
  2559. // server regardless of whether the field is empty or not. This may be
  2560. // used to include empty fields in Patch requests.
  2561. ForceSendFields []string `json:"-"`
  2562. // NullFields is a list of field names (e.g. "Done") to include in API
  2563. // requests with the JSON null value. By default, fields with empty
  2564. // values are omitted from API requests. However, any field with an
  2565. // empty value appearing in NullFields will be sent to the server as
  2566. // null. It is an error if a field in this list has a non-empty value.
  2567. // This may be used to include null fields in Patch requests.
  2568. NullFields []string `json:"-"`
  2569. }
  2570. func (s *GoogleLongrunning__Operation) MarshalJSON() ([]byte, error) {
  2571. type NoMethod GoogleLongrunning__Operation
  2572. raw := NoMethod(*s)
  2573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2574. }
  2575. // GoogleProtobuf__Empty: A generic empty message that you can re-use to
  2576. // avoid defining duplicated
  2577. // empty messages in your APIs. A typical example is to use it as the
  2578. // request
  2579. // or the response type of an API method. For instance:
  2580. //
  2581. // service Foo {
  2582. // rpc Bar(google.protobuf.Empty) returns
  2583. // (google.protobuf.Empty);
  2584. // }
  2585. //
  2586. // The JSON representation for `Empty` is empty JSON object `{}`.
  2587. type GoogleProtobuf__Empty struct {
  2588. // ServerResponse contains the HTTP response code and headers from the
  2589. // server.
  2590. googleapi.ServerResponse `json:"-"`
  2591. }
  2592. // GoogleRpc__Status: The `Status` type defines a logical error model
  2593. // that is suitable for different
  2594. // programming environments, including REST APIs and RPC APIs. It is
  2595. // used by
  2596. // [gRPC](https://github.com/grpc). The error model is designed to
  2597. // be:
  2598. //
  2599. // - Simple to use and understand for most users
  2600. // - Flexible enough to meet unexpected needs
  2601. //
  2602. // # Overview
  2603. //
  2604. // The `Status` message contains three pieces of data: error code, error
  2605. // message,
  2606. // and error details. The error code should be an enum value
  2607. // of
  2608. // google.rpc.Code, but it may accept additional error codes if needed.
  2609. // The
  2610. // error message should be a developer-facing English message that
  2611. // helps
  2612. // developers *understand* and *resolve* the error. If a localized
  2613. // user-facing
  2614. // error message is needed, put the localized message in the error
  2615. // details or
  2616. // localize it in the client. The optional error details may contain
  2617. // arbitrary
  2618. // information about the error. There is a predefined set of error
  2619. // detail types
  2620. // in the package `google.rpc` that can be used for common error
  2621. // conditions.
  2622. //
  2623. // # Language mapping
  2624. //
  2625. // The `Status` message is the logical representation of the error
  2626. // model, but it
  2627. // is not necessarily the actual wire format. When the `Status` message
  2628. // is
  2629. // exposed in different client libraries and different wire protocols,
  2630. // it can be
  2631. // mapped differently. For example, it will likely be mapped to some
  2632. // exceptions
  2633. // in Java, but more likely mapped to some error codes in C.
  2634. //
  2635. // # Other uses
  2636. //
  2637. // The error model and the `Status` message can be used in a variety
  2638. // of
  2639. // environments, either with or without APIs, to provide a
  2640. // consistent developer experience across different
  2641. // environments.
  2642. //
  2643. // Example uses of this error model include:
  2644. //
  2645. // - Partial errors. If a service needs to return partial errors to the
  2646. // client,
  2647. // it may embed the `Status` in the normal response to indicate the
  2648. // partial
  2649. // errors.
  2650. //
  2651. // - Workflow errors. A typical workflow has multiple steps. Each step
  2652. // may
  2653. // have a `Status` message for error reporting.
  2654. //
  2655. // - Batch operations. If a client uses batch request and batch
  2656. // response, the
  2657. // `Status` message should be used directly inside batch response,
  2658. // one for
  2659. // each error sub-response.
  2660. //
  2661. // - Asynchronous operations. If an API call embeds asynchronous
  2662. // operation
  2663. // results in its response, the status of those operations should
  2664. // be
  2665. // represented directly using the `Status` message.
  2666. //
  2667. // - Logging. If some API errors are stored in logs, the message
  2668. // `Status` could
  2669. // be used directly after any stripping needed for security/privacy
  2670. // reasons.
  2671. type GoogleRpc__Status struct {
  2672. // Code: The status code, which should be an enum value of
  2673. // google.rpc.Code.
  2674. Code int64 `json:"code,omitempty"`
  2675. // Details: A list of messages that carry the error details. There is a
  2676. // common set of
  2677. // message types for APIs to use.
  2678. Details []googleapi.RawMessage `json:"details,omitempty"`
  2679. // Message: A developer-facing error message, which should be in
  2680. // English. Any
  2681. // user-facing error message should be localized and sent in
  2682. // the
  2683. // google.rpc.Status.details field, or localized by the client.
  2684. Message string `json:"message,omitempty"`
  2685. // ForceSendFields is a list of field names (e.g. "Code") to
  2686. // unconditionally include in API requests. By default, fields with
  2687. // empty values are omitted from API requests. However, any non-pointer,
  2688. // non-interface field appearing in ForceSendFields will be sent to the
  2689. // server regardless of whether the field is empty or not. This may be
  2690. // used to include empty fields in Patch requests.
  2691. ForceSendFields []string `json:"-"`
  2692. // NullFields is a list of field names (e.g. "Code") to include in API
  2693. // requests with the JSON null value. By default, fields with empty
  2694. // values are omitted from API requests. However, any field with an
  2695. // empty value appearing in NullFields will be sent to the server as
  2696. // null. It is an error if a field in this list has a non-empty value.
  2697. // This may be used to include null fields in Patch requests.
  2698. NullFields []string `json:"-"`
  2699. }
  2700. func (s *GoogleRpc__Status) MarshalJSON() ([]byte, error) {
  2701. type NoMethod GoogleRpc__Status
  2702. raw := NoMethod(*s)
  2703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2704. }
  2705. // GoogleType__Expr: Represents an expression text. Example:
  2706. //
  2707. // title: "User account presence"
  2708. // description: "Determines whether the request has a user account"
  2709. // expression: "size(request.user) > 0"
  2710. type GoogleType__Expr struct {
  2711. // Description: An optional description of the expression. This is a
  2712. // longer text which
  2713. // describes the expression, e.g. when hovered over it in a UI.
  2714. Description string `json:"description,omitempty"`
  2715. // Expression: Textual representation of an expression in
  2716. // Common Expression Language syntax.
  2717. //
  2718. // The application context of the containing message determines
  2719. // which
  2720. // well-known feature set of CEL is supported.
  2721. Expression string `json:"expression,omitempty"`
  2722. // Location: An optional string indicating the location of the
  2723. // expression for error
  2724. // reporting, e.g. a file name and a position in the file.
  2725. Location string `json:"location,omitempty"`
  2726. // Title: An optional title for the expression, i.e. a short string
  2727. // describing
  2728. // its purpose. This can be used e.g. in UIs which allow to enter
  2729. // the
  2730. // expression.
  2731. Title string `json:"title,omitempty"`
  2732. // ForceSendFields is a list of field names (e.g. "Description") to
  2733. // unconditionally include in API requests. By default, fields with
  2734. // empty values are omitted from API requests. However, any non-pointer,
  2735. // non-interface field appearing in ForceSendFields will be sent to the
  2736. // server regardless of whether the field is empty or not. This may be
  2737. // used to include empty fields in Patch requests.
  2738. ForceSendFields []string `json:"-"`
  2739. // NullFields is a list of field names (e.g. "Description") to include
  2740. // in API requests with the JSON null value. By default, fields with
  2741. // empty values are omitted from API requests. However, any field with
  2742. // an empty value appearing in NullFields will be sent to the server as
  2743. // null. It is an error if a field in this list has a non-empty value.
  2744. // This may be used to include null fields in Patch requests.
  2745. NullFields []string `json:"-"`
  2746. }
  2747. func (s *GoogleType__Expr) MarshalJSON() ([]byte, error) {
  2748. type NoMethod GoogleType__Expr
  2749. raw := NoMethod(*s)
  2750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2751. }
  2752. // method id "ml.operations.delete":
  2753. type OperationsDeleteCall struct {
  2754. s *Service
  2755. name string
  2756. urlParams_ gensupport.URLParams
  2757. ctx_ context.Context
  2758. header_ http.Header
  2759. }
  2760. // Delete: Deletes a long-running operation. This method indicates that
  2761. // the client is
  2762. // no longer interested in the operation result. It does not cancel
  2763. // the
  2764. // operation. If the server doesn't support this method, it
  2765. // returns
  2766. // `google.rpc.Code.UNIMPLEMENTED`.
  2767. func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
  2768. c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2769. c.name = name
  2770. return c
  2771. }
  2772. // Fields allows partial responses to be retrieved. See
  2773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2774. // for more information.
  2775. func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
  2776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2777. return c
  2778. }
  2779. // Context sets the context to be used in this call's Do method. Any
  2780. // pending HTTP request will be aborted if the provided context is
  2781. // canceled.
  2782. func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
  2783. c.ctx_ = ctx
  2784. return c
  2785. }
  2786. // Header returns an http.Header that can be modified by the caller to
  2787. // add HTTP headers to the request.
  2788. func (c *OperationsDeleteCall) Header() http.Header {
  2789. if c.header_ == nil {
  2790. c.header_ = make(http.Header)
  2791. }
  2792. return c.header_
  2793. }
  2794. func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2795. reqHeaders := make(http.Header)
  2796. for k, v := range c.header_ {
  2797. reqHeaders[k] = v
  2798. }
  2799. reqHeaders.Set("User-Agent", c.s.userAgent())
  2800. var body io.Reader = nil
  2801. c.urlParams_.Set("alt", alt)
  2802. c.urlParams_.Set("prettyPrint", "false")
  2803. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2804. urls += "?" + c.urlParams_.Encode()
  2805. req, err := http.NewRequest("DELETE", urls, body)
  2806. if err != nil {
  2807. return nil, err
  2808. }
  2809. req.Header = reqHeaders
  2810. googleapi.Expand(req.URL, map[string]string{
  2811. "name": c.name,
  2812. })
  2813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2814. }
  2815. // Do executes the "ml.operations.delete" call.
  2816. // Exactly one of *GoogleProtobuf__Empty or error will be non-nil. Any
  2817. // non-2xx status code is an error. Response headers are in either
  2818. // *GoogleProtobuf__Empty.ServerResponse.Header or (if a response was
  2819. // returned at all) in error.(*googleapi.Error).Header. Use
  2820. // googleapi.IsNotModified to check whether the returned error was
  2821. // because http.StatusNotModified was returned.
  2822. func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobuf__Empty, error) {
  2823. gensupport.SetOptions(c.urlParams_, opts...)
  2824. res, err := c.doRequest("json")
  2825. if res != nil && res.StatusCode == http.StatusNotModified {
  2826. if res.Body != nil {
  2827. res.Body.Close()
  2828. }
  2829. return nil, &googleapi.Error{
  2830. Code: res.StatusCode,
  2831. Header: res.Header,
  2832. }
  2833. }
  2834. if err != nil {
  2835. return nil, err
  2836. }
  2837. defer googleapi.CloseBody(res)
  2838. if err := googleapi.CheckResponse(res); err != nil {
  2839. return nil, err
  2840. }
  2841. ret := &GoogleProtobuf__Empty{
  2842. ServerResponse: googleapi.ServerResponse{
  2843. Header: res.Header,
  2844. HTTPStatusCode: res.StatusCode,
  2845. },
  2846. }
  2847. target := &ret
  2848. if err := gensupport.DecodeResponse(target, res); err != nil {
  2849. return nil, err
  2850. }
  2851. return ret, nil
  2852. // {
  2853. // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
  2854. // "flatPath": "v1/operations/{operationsId}",
  2855. // "httpMethod": "DELETE",
  2856. // "id": "ml.operations.delete",
  2857. // "parameterOrder": [
  2858. // "name"
  2859. // ],
  2860. // "parameters": {
  2861. // "name": {
  2862. // "description": "The name of the operation resource to be deleted.",
  2863. // "location": "path",
  2864. // "pattern": "^operations/.+$",
  2865. // "required": true,
  2866. // "type": "string"
  2867. // }
  2868. // },
  2869. // "path": "v1/{+name}",
  2870. // "response": {
  2871. // "$ref": "GoogleProtobuf__Empty"
  2872. // },
  2873. // "scopes": [
  2874. // "https://www.googleapis.com/auth/cloud-platform"
  2875. // ]
  2876. // }
  2877. }
  2878. // method id "ml.projects.getConfig":
  2879. type ProjectsGetConfigCall struct {
  2880. s *Service
  2881. name string
  2882. urlParams_ gensupport.URLParams
  2883. ifNoneMatch_ string
  2884. ctx_ context.Context
  2885. header_ http.Header
  2886. }
  2887. // GetConfig: Get the service account information associated with your
  2888. // project. You need
  2889. // this information in order to grant the service account permissions
  2890. // for
  2891. // the Google Cloud Storage location where you put your model training
  2892. // code
  2893. // for training the model with Google Cloud Machine Learning.
  2894. func (r *ProjectsService) GetConfig(name string) *ProjectsGetConfigCall {
  2895. c := &ProjectsGetConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2896. c.name = name
  2897. return c
  2898. }
  2899. // Fields allows partial responses to be retrieved. See
  2900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2901. // for more information.
  2902. func (c *ProjectsGetConfigCall) Fields(s ...googleapi.Field) *ProjectsGetConfigCall {
  2903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2904. return c
  2905. }
  2906. // IfNoneMatch sets the optional parameter which makes the operation
  2907. // fail if the object's ETag matches the given value. This is useful for
  2908. // getting updates only after the object has changed since the last
  2909. // request. Use googleapi.IsNotModified to check whether the response
  2910. // error from Do is the result of In-None-Match.
  2911. func (c *ProjectsGetConfigCall) IfNoneMatch(entityTag string) *ProjectsGetConfigCall {
  2912. c.ifNoneMatch_ = entityTag
  2913. return c
  2914. }
  2915. // Context sets the context to be used in this call's Do method. Any
  2916. // pending HTTP request will be aborted if the provided context is
  2917. // canceled.
  2918. func (c *ProjectsGetConfigCall) Context(ctx context.Context) *ProjectsGetConfigCall {
  2919. c.ctx_ = ctx
  2920. return c
  2921. }
  2922. // Header returns an http.Header that can be modified by the caller to
  2923. // add HTTP headers to the request.
  2924. func (c *ProjectsGetConfigCall) Header() http.Header {
  2925. if c.header_ == nil {
  2926. c.header_ = make(http.Header)
  2927. }
  2928. return c.header_
  2929. }
  2930. func (c *ProjectsGetConfigCall) doRequest(alt string) (*http.Response, error) {
  2931. reqHeaders := make(http.Header)
  2932. for k, v := range c.header_ {
  2933. reqHeaders[k] = v
  2934. }
  2935. reqHeaders.Set("User-Agent", c.s.userAgent())
  2936. if c.ifNoneMatch_ != "" {
  2937. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2938. }
  2939. var body io.Reader = nil
  2940. c.urlParams_.Set("alt", alt)
  2941. c.urlParams_.Set("prettyPrint", "false")
  2942. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getConfig")
  2943. urls += "?" + c.urlParams_.Encode()
  2944. req, err := http.NewRequest("GET", urls, body)
  2945. if err != nil {
  2946. return nil, err
  2947. }
  2948. req.Header = reqHeaders
  2949. googleapi.Expand(req.URL, map[string]string{
  2950. "name": c.name,
  2951. })
  2952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2953. }
  2954. // Do executes the "ml.projects.getConfig" call.
  2955. // Exactly one of *GoogleCloudMlV1__GetConfigResponse or error will be
  2956. // non-nil. Any non-2xx status code is an error. Response headers are in
  2957. // either *GoogleCloudMlV1__GetConfigResponse.ServerResponse.Header or
  2958. // (if a response was returned at all) in
  2959. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2960. // whether the returned error was because http.StatusNotModified was
  2961. // returned.
  2962. func (c *ProjectsGetConfigCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__GetConfigResponse, error) {
  2963. gensupport.SetOptions(c.urlParams_, opts...)
  2964. res, err := c.doRequest("json")
  2965. if res != nil && res.StatusCode == http.StatusNotModified {
  2966. if res.Body != nil {
  2967. res.Body.Close()
  2968. }
  2969. return nil, &googleapi.Error{
  2970. Code: res.StatusCode,
  2971. Header: res.Header,
  2972. }
  2973. }
  2974. if err != nil {
  2975. return nil, err
  2976. }
  2977. defer googleapi.CloseBody(res)
  2978. if err := googleapi.CheckResponse(res); err != nil {
  2979. return nil, err
  2980. }
  2981. ret := &GoogleCloudMlV1__GetConfigResponse{
  2982. ServerResponse: googleapi.ServerResponse{
  2983. Header: res.Header,
  2984. HTTPStatusCode: res.StatusCode,
  2985. },
  2986. }
  2987. target := &ret
  2988. if err := gensupport.DecodeResponse(target, res); err != nil {
  2989. return nil, err
  2990. }
  2991. return ret, nil
  2992. // {
  2993. // "description": "Get the service account information associated with your project. You need\nthis information in order to grant the service account permissions for\nthe Google Cloud Storage location where you put your model training code\nfor training the model with Google Cloud Machine Learning.",
  2994. // "flatPath": "v1/projects/{projectsId}:getConfig",
  2995. // "httpMethod": "GET",
  2996. // "id": "ml.projects.getConfig",
  2997. // "parameterOrder": [
  2998. // "name"
  2999. // ],
  3000. // "parameters": {
  3001. // "name": {
  3002. // "description": "Required. The project name.",
  3003. // "location": "path",
  3004. // "pattern": "^projects/[^/]+$",
  3005. // "required": true,
  3006. // "type": "string"
  3007. // }
  3008. // },
  3009. // "path": "v1/{+name}:getConfig",
  3010. // "response": {
  3011. // "$ref": "GoogleCloudMlV1__GetConfigResponse"
  3012. // },
  3013. // "scopes": [
  3014. // "https://www.googleapis.com/auth/cloud-platform"
  3015. // ]
  3016. // }
  3017. }
  3018. // method id "ml.projects.predict":
  3019. type ProjectsPredictCall struct {
  3020. s *Service
  3021. name string
  3022. googlecloudmlv1__predictrequest *GoogleCloudMlV1__PredictRequest
  3023. urlParams_ gensupport.URLParams
  3024. ctx_ context.Context
  3025. header_ http.Header
  3026. }
  3027. // Predict: Performs prediction on the data in the request.
  3028. // Cloud ML Engine implements a custom `predict` verb on top of an HTTP
  3029. // POST
  3030. // method. <p>For details of the request and response format, see the
  3031. // **guide
  3032. // to the [predict request
  3033. // format](/ml-engine/docs/v1/predict-request)**.
  3034. func (r *ProjectsService) Predict(name string, googlecloudmlv1__predictrequest *GoogleCloudMlV1__PredictRequest) *ProjectsPredictCall {
  3035. c := &ProjectsPredictCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3036. c.name = name
  3037. c.googlecloudmlv1__predictrequest = googlecloudmlv1__predictrequest
  3038. return c
  3039. }
  3040. // Fields allows partial responses to be retrieved. See
  3041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3042. // for more information.
  3043. func (c *ProjectsPredictCall) Fields(s ...googleapi.Field) *ProjectsPredictCall {
  3044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3045. return c
  3046. }
  3047. // Context sets the context to be used in this call's Do method. Any
  3048. // pending HTTP request will be aborted if the provided context is
  3049. // canceled.
  3050. func (c *ProjectsPredictCall) Context(ctx context.Context) *ProjectsPredictCall {
  3051. c.ctx_ = ctx
  3052. return c
  3053. }
  3054. // Header returns an http.Header that can be modified by the caller to
  3055. // add HTTP headers to the request.
  3056. func (c *ProjectsPredictCall) Header() http.Header {
  3057. if c.header_ == nil {
  3058. c.header_ = make(http.Header)
  3059. }
  3060. return c.header_
  3061. }
  3062. func (c *ProjectsPredictCall) doRequest(alt string) (*http.Response, error) {
  3063. reqHeaders := make(http.Header)
  3064. for k, v := range c.header_ {
  3065. reqHeaders[k] = v
  3066. }
  3067. reqHeaders.Set("User-Agent", c.s.userAgent())
  3068. var body io.Reader = nil
  3069. body = strings.NewReader(c.googlecloudmlv1__predictrequest.HttpBody.Data)
  3070. reqHeaders.Set("Content-Type", "application/json")
  3071. c.urlParams_.Set("alt", alt)
  3072. c.urlParams_.Set("prettyPrint", "false")
  3073. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:predict")
  3074. urls += "?" + c.urlParams_.Encode()
  3075. req, err := http.NewRequest("POST", urls, body)
  3076. if err != nil {
  3077. return nil, err
  3078. }
  3079. req.Header = reqHeaders
  3080. googleapi.Expand(req.URL, map[string]string{
  3081. "name": c.name,
  3082. })
  3083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3084. }
  3085. // Do executes the "ml.projects.predict" call.
  3086. // Exactly one of *GoogleApi__HttpBody or error will be non-nil. Any
  3087. // non-2xx status code is an error. Response headers are in either
  3088. // *GoogleApi__HttpBody.ServerResponse.Header or (if a response was
  3089. // returned at all) in error.(*googleapi.Error).Header. Use
  3090. // googleapi.IsNotModified to check whether the returned error was
  3091. // because http.StatusNotModified was returned.
  3092. func (c *ProjectsPredictCall) Do(opts ...googleapi.CallOption) (*GoogleApi__HttpBody, error) {
  3093. gensupport.SetOptions(c.urlParams_, opts...)
  3094. res, err := c.doRequest("json")
  3095. if res != nil && res.StatusCode == http.StatusNotModified {
  3096. if res.Body != nil {
  3097. res.Body.Close()
  3098. }
  3099. return nil, &googleapi.Error{
  3100. Code: res.StatusCode,
  3101. Header: res.Header,
  3102. }
  3103. }
  3104. if err != nil {
  3105. return nil, err
  3106. }
  3107. defer googleapi.CloseBody(res)
  3108. if err := googleapi.CheckResponse(res); err != nil {
  3109. return nil, err
  3110. }
  3111. ret := &GoogleApi__HttpBody{
  3112. ServerResponse: googleapi.ServerResponse{
  3113. Header: res.Header,
  3114. HTTPStatusCode: res.StatusCode,
  3115. },
  3116. }
  3117. target := &ret
  3118. var b bytes.Buffer
  3119. if _, err := io.Copy(&b, res.Body); err != nil {
  3120. return nil, err
  3121. }
  3122. if err := res.Body.Close(); err != nil {
  3123. return nil, err
  3124. }
  3125. if err := json.NewDecoder(bytes.NewReader(b.Bytes())).Decode(target); err != nil {
  3126. return nil, err
  3127. }
  3128. ret.Data = b.String()
  3129. return ret, nil
  3130. // {
  3131. // "description": "Performs prediction on the data in the request.\nCloud ML Engine implements a custom `predict` verb on top of an HTTP POST\nmethod. \u003cp\u003eFor details of the request and response format, see the **guide\nto the [predict request format](/ml-engine/docs/v1/predict-request)**.",
  3132. // "flatPath": "v1/projects/{projectsId}:predict",
  3133. // "httpMethod": "POST",
  3134. // "id": "ml.projects.predict",
  3135. // "parameterOrder": [
  3136. // "name"
  3137. // ],
  3138. // "parameters": {
  3139. // "name": {
  3140. // "description": "Required. The resource name of a model or a version.\n\nAuthorization: requires the `predict` permission on the specified resource.",
  3141. // "location": "path",
  3142. // "pattern": "^projects/.+$",
  3143. // "required": true,
  3144. // "type": "string"
  3145. // }
  3146. // },
  3147. // "path": "v1/{+name}:predict",
  3148. // "request": {
  3149. // "$ref": "GoogleCloudMlV1__PredictRequest"
  3150. // },
  3151. // "response": {
  3152. // "$ref": "GoogleApi__HttpBody"
  3153. // },
  3154. // "scopes": [
  3155. // "https://www.googleapis.com/auth/cloud-platform"
  3156. // ]
  3157. // }
  3158. }
  3159. // method id "ml.projects.jobs.cancel":
  3160. type ProjectsJobsCancelCall struct {
  3161. s *Service
  3162. name string
  3163. googlecloudmlv1__canceljobrequest *GoogleCloudMlV1__CancelJobRequest
  3164. urlParams_ gensupport.URLParams
  3165. ctx_ context.Context
  3166. header_ http.Header
  3167. }
  3168. // Cancel: Cancels a running job.
  3169. func (r *ProjectsJobsService) Cancel(name string, googlecloudmlv1__canceljobrequest *GoogleCloudMlV1__CancelJobRequest) *ProjectsJobsCancelCall {
  3170. c := &ProjectsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3171. c.name = name
  3172. c.googlecloudmlv1__canceljobrequest = googlecloudmlv1__canceljobrequest
  3173. return c
  3174. }
  3175. // Fields allows partial responses to be retrieved. See
  3176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3177. // for more information.
  3178. func (c *ProjectsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsJobsCancelCall {
  3179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3180. return c
  3181. }
  3182. // Context sets the context to be used in this call's Do method. Any
  3183. // pending HTTP request will be aborted if the provided context is
  3184. // canceled.
  3185. func (c *ProjectsJobsCancelCall) Context(ctx context.Context) *ProjectsJobsCancelCall {
  3186. c.ctx_ = ctx
  3187. return c
  3188. }
  3189. // Header returns an http.Header that can be modified by the caller to
  3190. // add HTTP headers to the request.
  3191. func (c *ProjectsJobsCancelCall) Header() http.Header {
  3192. if c.header_ == nil {
  3193. c.header_ = make(http.Header)
  3194. }
  3195. return c.header_
  3196. }
  3197. func (c *ProjectsJobsCancelCall) doRequest(alt string) (*http.Response, error) {
  3198. reqHeaders := make(http.Header)
  3199. for k, v := range c.header_ {
  3200. reqHeaders[k] = v
  3201. }
  3202. reqHeaders.Set("User-Agent", c.s.userAgent())
  3203. var body io.Reader = nil
  3204. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__canceljobrequest)
  3205. if err != nil {
  3206. return nil, err
  3207. }
  3208. reqHeaders.Set("Content-Type", "application/json")
  3209. c.urlParams_.Set("alt", alt)
  3210. c.urlParams_.Set("prettyPrint", "false")
  3211. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  3212. urls += "?" + c.urlParams_.Encode()
  3213. req, err := http.NewRequest("POST", urls, body)
  3214. if err != nil {
  3215. return nil, err
  3216. }
  3217. req.Header = reqHeaders
  3218. googleapi.Expand(req.URL, map[string]string{
  3219. "name": c.name,
  3220. })
  3221. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3222. }
  3223. // Do executes the "ml.projects.jobs.cancel" call.
  3224. // Exactly one of *GoogleProtobuf__Empty or error will be non-nil. Any
  3225. // non-2xx status code is an error. Response headers are in either
  3226. // *GoogleProtobuf__Empty.ServerResponse.Header or (if a response was
  3227. // returned at all) in error.(*googleapi.Error).Header. Use
  3228. // googleapi.IsNotModified to check whether the returned error was
  3229. // because http.StatusNotModified was returned.
  3230. func (c *ProjectsJobsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobuf__Empty, error) {
  3231. gensupport.SetOptions(c.urlParams_, opts...)
  3232. res, err := c.doRequest("json")
  3233. if res != nil && res.StatusCode == http.StatusNotModified {
  3234. if res.Body != nil {
  3235. res.Body.Close()
  3236. }
  3237. return nil, &googleapi.Error{
  3238. Code: res.StatusCode,
  3239. Header: res.Header,
  3240. }
  3241. }
  3242. if err != nil {
  3243. return nil, err
  3244. }
  3245. defer googleapi.CloseBody(res)
  3246. if err := googleapi.CheckResponse(res); err != nil {
  3247. return nil, err
  3248. }
  3249. ret := &GoogleProtobuf__Empty{
  3250. ServerResponse: googleapi.ServerResponse{
  3251. Header: res.Header,
  3252. HTTPStatusCode: res.StatusCode,
  3253. },
  3254. }
  3255. target := &ret
  3256. if err := gensupport.DecodeResponse(target, res); err != nil {
  3257. return nil, err
  3258. }
  3259. return ret, nil
  3260. // {
  3261. // "description": "Cancels a running job.",
  3262. // "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:cancel",
  3263. // "httpMethod": "POST",
  3264. // "id": "ml.projects.jobs.cancel",
  3265. // "parameterOrder": [
  3266. // "name"
  3267. // ],
  3268. // "parameters": {
  3269. // "name": {
  3270. // "description": "Required. The name of the job to cancel.",
  3271. // "location": "path",
  3272. // "pattern": "^projects/[^/]+/jobs/[^/]+$",
  3273. // "required": true,
  3274. // "type": "string"
  3275. // }
  3276. // },
  3277. // "path": "v1/{+name}:cancel",
  3278. // "request": {
  3279. // "$ref": "GoogleCloudMlV1__CancelJobRequest"
  3280. // },
  3281. // "response": {
  3282. // "$ref": "GoogleProtobuf__Empty"
  3283. // },
  3284. // "scopes": [
  3285. // "https://www.googleapis.com/auth/cloud-platform"
  3286. // ]
  3287. // }
  3288. }
  3289. // method id "ml.projects.jobs.create":
  3290. type ProjectsJobsCreateCall struct {
  3291. s *Service
  3292. parent string
  3293. googlecloudmlv1__job *GoogleCloudMlV1__Job
  3294. urlParams_ gensupport.URLParams
  3295. ctx_ context.Context
  3296. header_ http.Header
  3297. }
  3298. // Create: Creates a training or a batch prediction job.
  3299. func (r *ProjectsJobsService) Create(parent string, googlecloudmlv1__job *GoogleCloudMlV1__Job) *ProjectsJobsCreateCall {
  3300. c := &ProjectsJobsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3301. c.parent = parent
  3302. c.googlecloudmlv1__job = googlecloudmlv1__job
  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 *ProjectsJobsCreateCall) Fields(s ...googleapi.Field) *ProjectsJobsCreateCall {
  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 *ProjectsJobsCreateCall) Context(ctx context.Context) *ProjectsJobsCreateCall {
  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 *ProjectsJobsCreateCall) Header() http.Header {
  3322. if c.header_ == nil {
  3323. c.header_ = make(http.Header)
  3324. }
  3325. return c.header_
  3326. }
  3327. func (c *ProjectsJobsCreateCall) 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.googlecloudmlv1__job)
  3335. if err != nil {
  3336. return nil, err
  3337. }
  3338. reqHeaders.Set("Content-Type", "application/json")
  3339. c.urlParams_.Set("alt", alt)
  3340. c.urlParams_.Set("prettyPrint", "false")
  3341. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs")
  3342. urls += "?" + c.urlParams_.Encode()
  3343. req, err := http.NewRequest("POST", urls, body)
  3344. if err != nil {
  3345. return nil, err
  3346. }
  3347. req.Header = reqHeaders
  3348. googleapi.Expand(req.URL, map[string]string{
  3349. "parent": c.parent,
  3350. })
  3351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3352. }
  3353. // Do executes the "ml.projects.jobs.create" call.
  3354. // Exactly one of *GoogleCloudMlV1__Job or error will be non-nil. Any
  3355. // non-2xx status code is an error. Response headers are in either
  3356. // *GoogleCloudMlV1__Job.ServerResponse.Header or (if a response was
  3357. // returned at all) in error.(*googleapi.Error).Header. Use
  3358. // googleapi.IsNotModified to check whether the returned error was
  3359. // because http.StatusNotModified was returned.
  3360. func (c *ProjectsJobsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__Job, error) {
  3361. gensupport.SetOptions(c.urlParams_, opts...)
  3362. res, err := c.doRequest("json")
  3363. if res != nil && res.StatusCode == http.StatusNotModified {
  3364. if res.Body != nil {
  3365. res.Body.Close()
  3366. }
  3367. return nil, &googleapi.Error{
  3368. Code: res.StatusCode,
  3369. Header: res.Header,
  3370. }
  3371. }
  3372. if err != nil {
  3373. return nil, err
  3374. }
  3375. defer googleapi.CloseBody(res)
  3376. if err := googleapi.CheckResponse(res); err != nil {
  3377. return nil, err
  3378. }
  3379. ret := &GoogleCloudMlV1__Job{
  3380. ServerResponse: googleapi.ServerResponse{
  3381. Header: res.Header,
  3382. HTTPStatusCode: res.StatusCode,
  3383. },
  3384. }
  3385. target := &ret
  3386. if err := gensupport.DecodeResponse(target, res); err != nil {
  3387. return nil, err
  3388. }
  3389. return ret, nil
  3390. // {
  3391. // "description": "Creates a training or a batch prediction job.",
  3392. // "flatPath": "v1/projects/{projectsId}/jobs",
  3393. // "httpMethod": "POST",
  3394. // "id": "ml.projects.jobs.create",
  3395. // "parameterOrder": [
  3396. // "parent"
  3397. // ],
  3398. // "parameters": {
  3399. // "parent": {
  3400. // "description": "Required. The project name.",
  3401. // "location": "path",
  3402. // "pattern": "^projects/[^/]+$",
  3403. // "required": true,
  3404. // "type": "string"
  3405. // }
  3406. // },
  3407. // "path": "v1/{+parent}/jobs",
  3408. // "request": {
  3409. // "$ref": "GoogleCloudMlV1__Job"
  3410. // },
  3411. // "response": {
  3412. // "$ref": "GoogleCloudMlV1__Job"
  3413. // },
  3414. // "scopes": [
  3415. // "https://www.googleapis.com/auth/cloud-platform"
  3416. // ]
  3417. // }
  3418. }
  3419. // method id "ml.projects.jobs.get":
  3420. type ProjectsJobsGetCall struct {
  3421. s *Service
  3422. name string
  3423. urlParams_ gensupport.URLParams
  3424. ifNoneMatch_ string
  3425. ctx_ context.Context
  3426. header_ http.Header
  3427. }
  3428. // Get: Describes a job.
  3429. func (r *ProjectsJobsService) Get(name string) *ProjectsJobsGetCall {
  3430. c := &ProjectsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3431. c.name = name
  3432. return c
  3433. }
  3434. // Fields allows partial responses to be retrieved. See
  3435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3436. // for more information.
  3437. func (c *ProjectsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsJobsGetCall {
  3438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3439. return c
  3440. }
  3441. // IfNoneMatch sets the optional parameter which makes the operation
  3442. // fail if the object's ETag matches the given value. This is useful for
  3443. // getting updates only after the object has changed since the last
  3444. // request. Use googleapi.IsNotModified to check whether the response
  3445. // error from Do is the result of In-None-Match.
  3446. func (c *ProjectsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsJobsGetCall {
  3447. c.ifNoneMatch_ = entityTag
  3448. return c
  3449. }
  3450. // Context sets the context to be used in this call's Do method. Any
  3451. // pending HTTP request will be aborted if the provided context is
  3452. // canceled.
  3453. func (c *ProjectsJobsGetCall) Context(ctx context.Context) *ProjectsJobsGetCall {
  3454. c.ctx_ = ctx
  3455. return c
  3456. }
  3457. // Header returns an http.Header that can be modified by the caller to
  3458. // add HTTP headers to the request.
  3459. func (c *ProjectsJobsGetCall) Header() http.Header {
  3460. if c.header_ == nil {
  3461. c.header_ = make(http.Header)
  3462. }
  3463. return c.header_
  3464. }
  3465. func (c *ProjectsJobsGetCall) doRequest(alt string) (*http.Response, error) {
  3466. reqHeaders := make(http.Header)
  3467. for k, v := range c.header_ {
  3468. reqHeaders[k] = v
  3469. }
  3470. reqHeaders.Set("User-Agent", c.s.userAgent())
  3471. if c.ifNoneMatch_ != "" {
  3472. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3473. }
  3474. var body io.Reader = nil
  3475. c.urlParams_.Set("alt", alt)
  3476. c.urlParams_.Set("prettyPrint", "false")
  3477. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3478. urls += "?" + c.urlParams_.Encode()
  3479. req, err := http.NewRequest("GET", urls, body)
  3480. if err != nil {
  3481. return nil, err
  3482. }
  3483. req.Header = reqHeaders
  3484. googleapi.Expand(req.URL, map[string]string{
  3485. "name": c.name,
  3486. })
  3487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3488. }
  3489. // Do executes the "ml.projects.jobs.get" call.
  3490. // Exactly one of *GoogleCloudMlV1__Job or error will be non-nil. Any
  3491. // non-2xx status code is an error. Response headers are in either
  3492. // *GoogleCloudMlV1__Job.ServerResponse.Header or (if a response was
  3493. // returned at all) in error.(*googleapi.Error).Header. Use
  3494. // googleapi.IsNotModified to check whether the returned error was
  3495. // because http.StatusNotModified was returned.
  3496. func (c *ProjectsJobsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__Job, error) {
  3497. gensupport.SetOptions(c.urlParams_, opts...)
  3498. res, err := c.doRequest("json")
  3499. if res != nil && res.StatusCode == http.StatusNotModified {
  3500. if res.Body != nil {
  3501. res.Body.Close()
  3502. }
  3503. return nil, &googleapi.Error{
  3504. Code: res.StatusCode,
  3505. Header: res.Header,
  3506. }
  3507. }
  3508. if err != nil {
  3509. return nil, err
  3510. }
  3511. defer googleapi.CloseBody(res)
  3512. if err := googleapi.CheckResponse(res); err != nil {
  3513. return nil, err
  3514. }
  3515. ret := &GoogleCloudMlV1__Job{
  3516. ServerResponse: googleapi.ServerResponse{
  3517. Header: res.Header,
  3518. HTTPStatusCode: res.StatusCode,
  3519. },
  3520. }
  3521. target := &ret
  3522. if err := gensupport.DecodeResponse(target, res); err != nil {
  3523. return nil, err
  3524. }
  3525. return ret, nil
  3526. // {
  3527. // "description": "Describes a job.",
  3528. // "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}",
  3529. // "httpMethod": "GET",
  3530. // "id": "ml.projects.jobs.get",
  3531. // "parameterOrder": [
  3532. // "name"
  3533. // ],
  3534. // "parameters": {
  3535. // "name": {
  3536. // "description": "Required. The name of the job to get the description of.",
  3537. // "location": "path",
  3538. // "pattern": "^projects/[^/]+/jobs/[^/]+$",
  3539. // "required": true,
  3540. // "type": "string"
  3541. // }
  3542. // },
  3543. // "path": "v1/{+name}",
  3544. // "response": {
  3545. // "$ref": "GoogleCloudMlV1__Job"
  3546. // },
  3547. // "scopes": [
  3548. // "https://www.googleapis.com/auth/cloud-platform"
  3549. // ]
  3550. // }
  3551. }
  3552. // method id "ml.projects.jobs.getIamPolicy":
  3553. type ProjectsJobsGetIamPolicyCall struct {
  3554. s *Service
  3555. resource string
  3556. urlParams_ gensupport.URLParams
  3557. ifNoneMatch_ string
  3558. ctx_ context.Context
  3559. header_ http.Header
  3560. }
  3561. // GetIamPolicy: Gets the access control policy for a resource.
  3562. // Returns an empty policy if the resource exists and does not have a
  3563. // policy
  3564. // set.
  3565. func (r *ProjectsJobsService) GetIamPolicy(resource string) *ProjectsJobsGetIamPolicyCall {
  3566. c := &ProjectsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3567. c.resource = resource
  3568. return c
  3569. }
  3570. // Fields allows partial responses to be retrieved. See
  3571. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3572. // for more information.
  3573. func (c *ProjectsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsJobsGetIamPolicyCall {
  3574. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3575. return c
  3576. }
  3577. // IfNoneMatch sets the optional parameter which makes the operation
  3578. // fail if the object's ETag matches the given value. This is useful for
  3579. // getting updates only after the object has changed since the last
  3580. // request. Use googleapi.IsNotModified to check whether the response
  3581. // error from Do is the result of In-None-Match.
  3582. func (c *ProjectsJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsJobsGetIamPolicyCall {
  3583. c.ifNoneMatch_ = entityTag
  3584. return c
  3585. }
  3586. // Context sets the context to be used in this call's Do method. Any
  3587. // pending HTTP request will be aborted if the provided context is
  3588. // canceled.
  3589. func (c *ProjectsJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsJobsGetIamPolicyCall {
  3590. c.ctx_ = ctx
  3591. return c
  3592. }
  3593. // Header returns an http.Header that can be modified by the caller to
  3594. // add HTTP headers to the request.
  3595. func (c *ProjectsJobsGetIamPolicyCall) Header() http.Header {
  3596. if c.header_ == nil {
  3597. c.header_ = make(http.Header)
  3598. }
  3599. return c.header_
  3600. }
  3601. func (c *ProjectsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3602. reqHeaders := make(http.Header)
  3603. for k, v := range c.header_ {
  3604. reqHeaders[k] = v
  3605. }
  3606. reqHeaders.Set("User-Agent", c.s.userAgent())
  3607. if c.ifNoneMatch_ != "" {
  3608. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3609. }
  3610. var body io.Reader = nil
  3611. c.urlParams_.Set("alt", alt)
  3612. c.urlParams_.Set("prettyPrint", "false")
  3613. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  3614. urls += "?" + c.urlParams_.Encode()
  3615. req, err := http.NewRequest("GET", urls, body)
  3616. if err != nil {
  3617. return nil, err
  3618. }
  3619. req.Header = reqHeaders
  3620. googleapi.Expand(req.URL, map[string]string{
  3621. "resource": c.resource,
  3622. })
  3623. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3624. }
  3625. // Do executes the "ml.projects.jobs.getIamPolicy" call.
  3626. // Exactly one of *GoogleIamV1__Policy or error will be non-nil. Any
  3627. // non-2xx status code is an error. Response headers are in either
  3628. // *GoogleIamV1__Policy.ServerResponse.Header or (if a response was
  3629. // returned at all) in error.(*googleapi.Error).Header. Use
  3630. // googleapi.IsNotModified to check whether the returned error was
  3631. // because http.StatusNotModified was returned.
  3632. func (c *ProjectsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__Policy, error) {
  3633. gensupport.SetOptions(c.urlParams_, opts...)
  3634. res, err := c.doRequest("json")
  3635. if res != nil && res.StatusCode == http.StatusNotModified {
  3636. if res.Body != nil {
  3637. res.Body.Close()
  3638. }
  3639. return nil, &googleapi.Error{
  3640. Code: res.StatusCode,
  3641. Header: res.Header,
  3642. }
  3643. }
  3644. if err != nil {
  3645. return nil, err
  3646. }
  3647. defer googleapi.CloseBody(res)
  3648. if err := googleapi.CheckResponse(res); err != nil {
  3649. return nil, err
  3650. }
  3651. ret := &GoogleIamV1__Policy{
  3652. ServerResponse: googleapi.ServerResponse{
  3653. Header: res.Header,
  3654. HTTPStatusCode: res.StatusCode,
  3655. },
  3656. }
  3657. target := &ret
  3658. if err := gensupport.DecodeResponse(target, res); err != nil {
  3659. return nil, err
  3660. }
  3661. return ret, nil
  3662. // {
  3663. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  3664. // "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:getIamPolicy",
  3665. // "httpMethod": "GET",
  3666. // "id": "ml.projects.jobs.getIamPolicy",
  3667. // "parameterOrder": [
  3668. // "resource"
  3669. // ],
  3670. // "parameters": {
  3671. // "resource": {
  3672. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  3673. // "location": "path",
  3674. // "pattern": "^projects/[^/]+/jobs/[^/]+$",
  3675. // "required": true,
  3676. // "type": "string"
  3677. // }
  3678. // },
  3679. // "path": "v1/{+resource}:getIamPolicy",
  3680. // "response": {
  3681. // "$ref": "GoogleIamV1__Policy"
  3682. // },
  3683. // "scopes": [
  3684. // "https://www.googleapis.com/auth/cloud-platform"
  3685. // ]
  3686. // }
  3687. }
  3688. // method id "ml.projects.jobs.list":
  3689. type ProjectsJobsListCall struct {
  3690. s *Service
  3691. parent string
  3692. urlParams_ gensupport.URLParams
  3693. ifNoneMatch_ string
  3694. ctx_ context.Context
  3695. header_ http.Header
  3696. }
  3697. // List: Lists the jobs in the project.
  3698. //
  3699. // If there are no jobs that match the request parameters, the
  3700. // list
  3701. // request returns an empty response body: {}.
  3702. func (r *ProjectsJobsService) List(parent string) *ProjectsJobsListCall {
  3703. c := &ProjectsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3704. c.parent = parent
  3705. return c
  3706. }
  3707. // Filter sets the optional parameter "filter": Specifies the subset of
  3708. // jobs to retrieve.
  3709. // You can filter on the value of one or more attributes of the job
  3710. // object.
  3711. // For example, retrieve jobs with a job identifier that starts with
  3712. // 'census':
  3713. // <p><code>gcloud ml-engine jobs list
  3714. // --filter='jobId:census*'</code>
  3715. // <p>List all failed jobs with names that start with
  3716. // 'rnn':
  3717. // <p><code>gcloud ml-engine jobs list --filter='jobId:rnn*
  3718. // AND state:FAILED'</code>
  3719. // <p>For more examples, see the guide to
  3720. // <a href="/ml-engine/docs/tensorflow/monitor-training">monitoring
  3721. // jobs</a>.
  3722. func (c *ProjectsJobsListCall) Filter(filter string) *ProjectsJobsListCall {
  3723. c.urlParams_.Set("filter", filter)
  3724. return c
  3725. }
  3726. // PageSize sets the optional parameter "pageSize": The number of jobs
  3727. // to retrieve per "page" of results. If there
  3728. // are more remaining results than this number, the response message
  3729. // will
  3730. // contain a valid value in the `next_page_token` field.
  3731. //
  3732. // The default value is 20, and the maximum page size is 100.
  3733. func (c *ProjectsJobsListCall) PageSize(pageSize int64) *ProjectsJobsListCall {
  3734. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3735. return c
  3736. }
  3737. // PageToken sets the optional parameter "pageToken": A page token to
  3738. // request the next page of results.
  3739. //
  3740. // You get the token from the `next_page_token` field of the response
  3741. // from
  3742. // the previous call.
  3743. func (c *ProjectsJobsListCall) PageToken(pageToken string) *ProjectsJobsListCall {
  3744. c.urlParams_.Set("pageToken", pageToken)
  3745. return c
  3746. }
  3747. // Fields allows partial responses to be retrieved. See
  3748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3749. // for more information.
  3750. func (c *ProjectsJobsListCall) Fields(s ...googleapi.Field) *ProjectsJobsListCall {
  3751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3752. return c
  3753. }
  3754. // IfNoneMatch sets the optional parameter which makes the operation
  3755. // fail if the object's ETag matches the given value. This is useful for
  3756. // getting updates only after the object has changed since the last
  3757. // request. Use googleapi.IsNotModified to check whether the response
  3758. // error from Do is the result of In-None-Match.
  3759. func (c *ProjectsJobsListCall) IfNoneMatch(entityTag string) *ProjectsJobsListCall {
  3760. c.ifNoneMatch_ = entityTag
  3761. return c
  3762. }
  3763. // Context sets the context to be used in this call's Do method. Any
  3764. // pending HTTP request will be aborted if the provided context is
  3765. // canceled.
  3766. func (c *ProjectsJobsListCall) Context(ctx context.Context) *ProjectsJobsListCall {
  3767. c.ctx_ = ctx
  3768. return c
  3769. }
  3770. // Header returns an http.Header that can be modified by the caller to
  3771. // add HTTP headers to the request.
  3772. func (c *ProjectsJobsListCall) Header() http.Header {
  3773. if c.header_ == nil {
  3774. c.header_ = make(http.Header)
  3775. }
  3776. return c.header_
  3777. }
  3778. func (c *ProjectsJobsListCall) doRequest(alt string) (*http.Response, error) {
  3779. reqHeaders := make(http.Header)
  3780. for k, v := range c.header_ {
  3781. reqHeaders[k] = v
  3782. }
  3783. reqHeaders.Set("User-Agent", c.s.userAgent())
  3784. if c.ifNoneMatch_ != "" {
  3785. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3786. }
  3787. var body io.Reader = nil
  3788. c.urlParams_.Set("alt", alt)
  3789. c.urlParams_.Set("prettyPrint", "false")
  3790. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/jobs")
  3791. urls += "?" + c.urlParams_.Encode()
  3792. req, err := http.NewRequest("GET", urls, body)
  3793. if err != nil {
  3794. return nil, err
  3795. }
  3796. req.Header = reqHeaders
  3797. googleapi.Expand(req.URL, map[string]string{
  3798. "parent": c.parent,
  3799. })
  3800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3801. }
  3802. // Do executes the "ml.projects.jobs.list" call.
  3803. // Exactly one of *GoogleCloudMlV1__ListJobsResponse or error will be
  3804. // non-nil. Any non-2xx status code is an error. Response headers are in
  3805. // either *GoogleCloudMlV1__ListJobsResponse.ServerResponse.Header or
  3806. // (if a response was returned at all) in
  3807. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3808. // whether the returned error was because http.StatusNotModified was
  3809. // returned.
  3810. func (c *ProjectsJobsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__ListJobsResponse, error) {
  3811. gensupport.SetOptions(c.urlParams_, opts...)
  3812. res, err := c.doRequest("json")
  3813. if res != nil && res.StatusCode == http.StatusNotModified {
  3814. if res.Body != nil {
  3815. res.Body.Close()
  3816. }
  3817. return nil, &googleapi.Error{
  3818. Code: res.StatusCode,
  3819. Header: res.Header,
  3820. }
  3821. }
  3822. if err != nil {
  3823. return nil, err
  3824. }
  3825. defer googleapi.CloseBody(res)
  3826. if err := googleapi.CheckResponse(res); err != nil {
  3827. return nil, err
  3828. }
  3829. ret := &GoogleCloudMlV1__ListJobsResponse{
  3830. ServerResponse: googleapi.ServerResponse{
  3831. Header: res.Header,
  3832. HTTPStatusCode: res.StatusCode,
  3833. },
  3834. }
  3835. target := &ret
  3836. if err := gensupport.DecodeResponse(target, res); err != nil {
  3837. return nil, err
  3838. }
  3839. return ret, nil
  3840. // {
  3841. // "description": "Lists the jobs in the project.\n\nIf there are no jobs that match the request parameters, the list\nrequest returns an empty response body: {}.",
  3842. // "flatPath": "v1/projects/{projectsId}/jobs",
  3843. // "httpMethod": "GET",
  3844. // "id": "ml.projects.jobs.list",
  3845. // "parameterOrder": [
  3846. // "parent"
  3847. // ],
  3848. // "parameters": {
  3849. // "filter": {
  3850. // "description": "Optional. Specifies the subset of jobs to retrieve.\nYou can filter on the value of one or more attributes of the job object.\nFor example, retrieve jobs with a job identifier that starts with 'census':\n\u003cp\u003e\u003ccode\u003egcloud ml-engine jobs list --filter='jobId:census*'\u003c/code\u003e\n\u003cp\u003eList all failed jobs with names that start with 'rnn':\n\u003cp\u003e\u003ccode\u003egcloud ml-engine jobs list --filter='jobId:rnn*\nAND state:FAILED'\u003c/code\u003e\n\u003cp\u003eFor more examples, see the guide to\n\u003ca href=\"/ml-engine/docs/tensorflow/monitor-training\"\u003emonitoring jobs\u003c/a\u003e.",
  3851. // "location": "query",
  3852. // "type": "string"
  3853. // },
  3854. // "pageSize": {
  3855. // "description": "Optional. The number of jobs to retrieve per \"page\" of results. If there\nare more remaining results than this number, the response message will\ncontain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.",
  3856. // "format": "int32",
  3857. // "location": "query",
  3858. // "type": "integer"
  3859. // },
  3860. // "pageToken": {
  3861. // "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call.",
  3862. // "location": "query",
  3863. // "type": "string"
  3864. // },
  3865. // "parent": {
  3866. // "description": "Required. The name of the project for which to list jobs.",
  3867. // "location": "path",
  3868. // "pattern": "^projects/[^/]+$",
  3869. // "required": true,
  3870. // "type": "string"
  3871. // }
  3872. // },
  3873. // "path": "v1/{+parent}/jobs",
  3874. // "response": {
  3875. // "$ref": "GoogleCloudMlV1__ListJobsResponse"
  3876. // },
  3877. // "scopes": [
  3878. // "https://www.googleapis.com/auth/cloud-platform"
  3879. // ]
  3880. // }
  3881. }
  3882. // Pages invokes f for each page of results.
  3883. // A non-nil error returned from f will halt the iteration.
  3884. // The provided context supersedes any context provided to the Context method.
  3885. func (c *ProjectsJobsListCall) Pages(ctx context.Context, f func(*GoogleCloudMlV1__ListJobsResponse) error) error {
  3886. c.ctx_ = ctx
  3887. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3888. for {
  3889. x, err := c.Do()
  3890. if err != nil {
  3891. return err
  3892. }
  3893. if err := f(x); err != nil {
  3894. return err
  3895. }
  3896. if x.NextPageToken == "" {
  3897. return nil
  3898. }
  3899. c.PageToken(x.NextPageToken)
  3900. }
  3901. }
  3902. // method id "ml.projects.jobs.patch":
  3903. type ProjectsJobsPatchCall struct {
  3904. s *Service
  3905. name string
  3906. googlecloudmlv1__job *GoogleCloudMlV1__Job
  3907. urlParams_ gensupport.URLParams
  3908. ctx_ context.Context
  3909. header_ http.Header
  3910. }
  3911. // Patch: Updates a specific job resource.
  3912. //
  3913. // Currently the only supported fields to update are `labels`.
  3914. func (r *ProjectsJobsService) Patch(name string, googlecloudmlv1__job *GoogleCloudMlV1__Job) *ProjectsJobsPatchCall {
  3915. c := &ProjectsJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3916. c.name = name
  3917. c.googlecloudmlv1__job = googlecloudmlv1__job
  3918. return c
  3919. }
  3920. // UpdateMask sets the optional parameter "updateMask": Required.
  3921. // Specifies the path, relative to `Job`, of the field to update.
  3922. // To adopt etag mechanism, include `etag` field in the mask, and
  3923. // include the
  3924. // `etag` value in your job resource.
  3925. //
  3926. // For example, to change the labels of a job, the `update_mask`
  3927. // parameter
  3928. // would be specified as `labels`, `etag`, and the
  3929. // `PATCH` request body would specify the new value, as follows:
  3930. // {
  3931. // "labels": {
  3932. // "owner": "Google",
  3933. // "color": "Blue"
  3934. // }
  3935. // "etag": "33a64df551425fcc55e4d42a148795d9f25f89d4"
  3936. // }
  3937. // If `etag` matches the one on the server, the labels of the job will
  3938. // be
  3939. // replaced with the given ones, and the server end `etag` will
  3940. // be
  3941. // recalculated.
  3942. //
  3943. // Currently the only supported update masks are `labels` and `etag`.
  3944. func (c *ProjectsJobsPatchCall) UpdateMask(updateMask string) *ProjectsJobsPatchCall {
  3945. c.urlParams_.Set("updateMask", updateMask)
  3946. return c
  3947. }
  3948. // Fields allows partial responses to be retrieved. See
  3949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3950. // for more information.
  3951. func (c *ProjectsJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsJobsPatchCall {
  3952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3953. return c
  3954. }
  3955. // Context sets the context to be used in this call's Do method. Any
  3956. // pending HTTP request will be aborted if the provided context is
  3957. // canceled.
  3958. func (c *ProjectsJobsPatchCall) Context(ctx context.Context) *ProjectsJobsPatchCall {
  3959. c.ctx_ = ctx
  3960. return c
  3961. }
  3962. // Header returns an http.Header that can be modified by the caller to
  3963. // add HTTP headers to the request.
  3964. func (c *ProjectsJobsPatchCall) Header() http.Header {
  3965. if c.header_ == nil {
  3966. c.header_ = make(http.Header)
  3967. }
  3968. return c.header_
  3969. }
  3970. func (c *ProjectsJobsPatchCall) doRequest(alt string) (*http.Response, error) {
  3971. reqHeaders := make(http.Header)
  3972. for k, v := range c.header_ {
  3973. reqHeaders[k] = v
  3974. }
  3975. reqHeaders.Set("User-Agent", c.s.userAgent())
  3976. var body io.Reader = nil
  3977. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__job)
  3978. if err != nil {
  3979. return nil, err
  3980. }
  3981. reqHeaders.Set("Content-Type", "application/json")
  3982. c.urlParams_.Set("alt", alt)
  3983. c.urlParams_.Set("prettyPrint", "false")
  3984. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3985. urls += "?" + c.urlParams_.Encode()
  3986. req, err := http.NewRequest("PATCH", urls, body)
  3987. if err != nil {
  3988. return nil, err
  3989. }
  3990. req.Header = reqHeaders
  3991. googleapi.Expand(req.URL, map[string]string{
  3992. "name": c.name,
  3993. })
  3994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3995. }
  3996. // Do executes the "ml.projects.jobs.patch" call.
  3997. // Exactly one of *GoogleCloudMlV1__Job or error will be non-nil. Any
  3998. // non-2xx status code is an error. Response headers are in either
  3999. // *GoogleCloudMlV1__Job.ServerResponse.Header or (if a response was
  4000. // returned at all) in error.(*googleapi.Error).Header. Use
  4001. // googleapi.IsNotModified to check whether the returned error was
  4002. // because http.StatusNotModified was returned.
  4003. func (c *ProjectsJobsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__Job, error) {
  4004. gensupport.SetOptions(c.urlParams_, opts...)
  4005. res, err := c.doRequest("json")
  4006. if res != nil && res.StatusCode == http.StatusNotModified {
  4007. if res.Body != nil {
  4008. res.Body.Close()
  4009. }
  4010. return nil, &googleapi.Error{
  4011. Code: res.StatusCode,
  4012. Header: res.Header,
  4013. }
  4014. }
  4015. if err != nil {
  4016. return nil, err
  4017. }
  4018. defer googleapi.CloseBody(res)
  4019. if err := googleapi.CheckResponse(res); err != nil {
  4020. return nil, err
  4021. }
  4022. ret := &GoogleCloudMlV1__Job{
  4023. ServerResponse: googleapi.ServerResponse{
  4024. Header: res.Header,
  4025. HTTPStatusCode: res.StatusCode,
  4026. },
  4027. }
  4028. target := &ret
  4029. if err := gensupport.DecodeResponse(target, res); err != nil {
  4030. return nil, err
  4031. }
  4032. return ret, nil
  4033. // {
  4034. // "description": "Updates a specific job resource.\n\nCurrently the only supported fields to update are `labels`.",
  4035. // "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}",
  4036. // "httpMethod": "PATCH",
  4037. // "id": "ml.projects.jobs.patch",
  4038. // "parameterOrder": [
  4039. // "name"
  4040. // ],
  4041. // "parameters": {
  4042. // "name": {
  4043. // "description": "Required. The job name.",
  4044. // "location": "path",
  4045. // "pattern": "^projects/[^/]+/jobs/[^/]+$",
  4046. // "required": true,
  4047. // "type": "string"
  4048. // },
  4049. // "updateMask": {
  4050. // "description": "Required. Specifies the path, relative to `Job`, of the field to update.\nTo adopt etag mechanism, include `etag` field in the mask, and include the\n`etag` value in your job resource.\n\nFor example, to change the labels of a job, the `update_mask` parameter\nwould be specified as `labels`, `etag`, and the\n`PATCH` request body would specify the new value, as follows:\n {\n \"labels\": {\n \"owner\": \"Google\",\n \"color\": \"Blue\"\n }\n \"etag\": \"33a64df551425fcc55e4d42a148795d9f25f89d4\"\n }\nIf `etag` matches the one on the server, the labels of the job will be\nreplaced with the given ones, and the server end `etag` will be\nrecalculated.\n\nCurrently the only supported update masks are `labels` and `etag`.",
  4051. // "format": "google-fieldmask",
  4052. // "location": "query",
  4053. // "type": "string"
  4054. // }
  4055. // },
  4056. // "path": "v1/{+name}",
  4057. // "request": {
  4058. // "$ref": "GoogleCloudMlV1__Job"
  4059. // },
  4060. // "response": {
  4061. // "$ref": "GoogleCloudMlV1__Job"
  4062. // },
  4063. // "scopes": [
  4064. // "https://www.googleapis.com/auth/cloud-platform"
  4065. // ]
  4066. // }
  4067. }
  4068. // method id "ml.projects.jobs.setIamPolicy":
  4069. type ProjectsJobsSetIamPolicyCall struct {
  4070. s *Service
  4071. resource string
  4072. googleiamv1__setiampolicyrequest *GoogleIamV1__SetIamPolicyRequest
  4073. urlParams_ gensupport.URLParams
  4074. ctx_ context.Context
  4075. header_ http.Header
  4076. }
  4077. // SetIamPolicy: Sets the access control policy on the specified
  4078. // resource. Replaces any
  4079. // existing policy.
  4080. func (r *ProjectsJobsService) SetIamPolicy(resource string, googleiamv1__setiampolicyrequest *GoogleIamV1__SetIamPolicyRequest) *ProjectsJobsSetIamPolicyCall {
  4081. c := &ProjectsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4082. c.resource = resource
  4083. c.googleiamv1__setiampolicyrequest = googleiamv1__setiampolicyrequest
  4084. return c
  4085. }
  4086. // Fields allows partial responses to be retrieved. See
  4087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4088. // for more information.
  4089. func (c *ProjectsJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsJobsSetIamPolicyCall {
  4090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4091. return c
  4092. }
  4093. // Context sets the context to be used in this call's Do method. Any
  4094. // pending HTTP request will be aborted if the provided context is
  4095. // canceled.
  4096. func (c *ProjectsJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsJobsSetIamPolicyCall {
  4097. c.ctx_ = ctx
  4098. return c
  4099. }
  4100. // Header returns an http.Header that can be modified by the caller to
  4101. // add HTTP headers to the request.
  4102. func (c *ProjectsJobsSetIamPolicyCall) Header() http.Header {
  4103. if c.header_ == nil {
  4104. c.header_ = make(http.Header)
  4105. }
  4106. return c.header_
  4107. }
  4108. func (c *ProjectsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4109. reqHeaders := make(http.Header)
  4110. for k, v := range c.header_ {
  4111. reqHeaders[k] = v
  4112. }
  4113. reqHeaders.Set("User-Agent", c.s.userAgent())
  4114. var body io.Reader = nil
  4115. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__setiampolicyrequest)
  4116. if err != nil {
  4117. return nil, err
  4118. }
  4119. reqHeaders.Set("Content-Type", "application/json")
  4120. c.urlParams_.Set("alt", alt)
  4121. c.urlParams_.Set("prettyPrint", "false")
  4122. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  4123. urls += "?" + c.urlParams_.Encode()
  4124. req, err := http.NewRequest("POST", urls, body)
  4125. if err != nil {
  4126. return nil, err
  4127. }
  4128. req.Header = reqHeaders
  4129. googleapi.Expand(req.URL, map[string]string{
  4130. "resource": c.resource,
  4131. })
  4132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4133. }
  4134. // Do executes the "ml.projects.jobs.setIamPolicy" call.
  4135. // Exactly one of *GoogleIamV1__Policy or error will be non-nil. Any
  4136. // non-2xx status code is an error. Response headers are in either
  4137. // *GoogleIamV1__Policy.ServerResponse.Header or (if a response was
  4138. // returned at all) in error.(*googleapi.Error).Header. Use
  4139. // googleapi.IsNotModified to check whether the returned error was
  4140. // because http.StatusNotModified was returned.
  4141. func (c *ProjectsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__Policy, error) {
  4142. gensupport.SetOptions(c.urlParams_, opts...)
  4143. res, err := c.doRequest("json")
  4144. if res != nil && res.StatusCode == http.StatusNotModified {
  4145. if res.Body != nil {
  4146. res.Body.Close()
  4147. }
  4148. return nil, &googleapi.Error{
  4149. Code: res.StatusCode,
  4150. Header: res.Header,
  4151. }
  4152. }
  4153. if err != nil {
  4154. return nil, err
  4155. }
  4156. defer googleapi.CloseBody(res)
  4157. if err := googleapi.CheckResponse(res); err != nil {
  4158. return nil, err
  4159. }
  4160. ret := &GoogleIamV1__Policy{
  4161. ServerResponse: googleapi.ServerResponse{
  4162. Header: res.Header,
  4163. HTTPStatusCode: res.StatusCode,
  4164. },
  4165. }
  4166. target := &ret
  4167. if err := gensupport.DecodeResponse(target, res); err != nil {
  4168. return nil, err
  4169. }
  4170. return ret, nil
  4171. // {
  4172. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  4173. // "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:setIamPolicy",
  4174. // "httpMethod": "POST",
  4175. // "id": "ml.projects.jobs.setIamPolicy",
  4176. // "parameterOrder": [
  4177. // "resource"
  4178. // ],
  4179. // "parameters": {
  4180. // "resource": {
  4181. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  4182. // "location": "path",
  4183. // "pattern": "^projects/[^/]+/jobs/[^/]+$",
  4184. // "required": true,
  4185. // "type": "string"
  4186. // }
  4187. // },
  4188. // "path": "v1/{+resource}:setIamPolicy",
  4189. // "request": {
  4190. // "$ref": "GoogleIamV1__SetIamPolicyRequest"
  4191. // },
  4192. // "response": {
  4193. // "$ref": "GoogleIamV1__Policy"
  4194. // },
  4195. // "scopes": [
  4196. // "https://www.googleapis.com/auth/cloud-platform"
  4197. // ]
  4198. // }
  4199. }
  4200. // method id "ml.projects.jobs.testIamPermissions":
  4201. type ProjectsJobsTestIamPermissionsCall struct {
  4202. s *Service
  4203. resource string
  4204. googleiamv1__testiampermissionsrequest *GoogleIamV1__TestIamPermissionsRequest
  4205. urlParams_ gensupport.URLParams
  4206. ctx_ context.Context
  4207. header_ http.Header
  4208. }
  4209. // TestIamPermissions: Returns permissions that a caller has on the
  4210. // specified resource.
  4211. // If the resource does not exist, this will return an empty set
  4212. // of
  4213. // permissions, not a NOT_FOUND error.
  4214. //
  4215. // Note: This operation is designed to be used for building
  4216. // permission-aware
  4217. // UIs and command-line tools, not for authorization checking. This
  4218. // operation
  4219. // may "fail open" without warning.
  4220. func (r *ProjectsJobsService) TestIamPermissions(resource string, googleiamv1__testiampermissionsrequest *GoogleIamV1__TestIamPermissionsRequest) *ProjectsJobsTestIamPermissionsCall {
  4221. c := &ProjectsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4222. c.resource = resource
  4223. c.googleiamv1__testiampermissionsrequest = googleiamv1__testiampermissionsrequest
  4224. return c
  4225. }
  4226. // Fields allows partial responses to be retrieved. See
  4227. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4228. // for more information.
  4229. func (c *ProjectsJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsJobsTestIamPermissionsCall {
  4230. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4231. return c
  4232. }
  4233. // Context sets the context to be used in this call's Do method. Any
  4234. // pending HTTP request will be aborted if the provided context is
  4235. // canceled.
  4236. func (c *ProjectsJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsJobsTestIamPermissionsCall {
  4237. c.ctx_ = ctx
  4238. return c
  4239. }
  4240. // Header returns an http.Header that can be modified by the caller to
  4241. // add HTTP headers to the request.
  4242. func (c *ProjectsJobsTestIamPermissionsCall) Header() http.Header {
  4243. if c.header_ == nil {
  4244. c.header_ = make(http.Header)
  4245. }
  4246. return c.header_
  4247. }
  4248. func (c *ProjectsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4249. reqHeaders := make(http.Header)
  4250. for k, v := range c.header_ {
  4251. reqHeaders[k] = v
  4252. }
  4253. reqHeaders.Set("User-Agent", c.s.userAgent())
  4254. var body io.Reader = nil
  4255. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__testiampermissionsrequest)
  4256. if err != nil {
  4257. return nil, err
  4258. }
  4259. reqHeaders.Set("Content-Type", "application/json")
  4260. c.urlParams_.Set("alt", alt)
  4261. c.urlParams_.Set("prettyPrint", "false")
  4262. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  4263. urls += "?" + c.urlParams_.Encode()
  4264. req, err := http.NewRequest("POST", urls, body)
  4265. if err != nil {
  4266. return nil, err
  4267. }
  4268. req.Header = reqHeaders
  4269. googleapi.Expand(req.URL, map[string]string{
  4270. "resource": c.resource,
  4271. })
  4272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4273. }
  4274. // Do executes the "ml.projects.jobs.testIamPermissions" call.
  4275. // Exactly one of *GoogleIamV1__TestIamPermissionsResponse or error will
  4276. // be non-nil. Any non-2xx status code is an error. Response headers are
  4277. // in either
  4278. // *GoogleIamV1__TestIamPermissionsResponse.ServerResponse.Header or (if
  4279. // a response was returned at all) in error.(*googleapi.Error).Header.
  4280. // Use googleapi.IsNotModified to check whether the returned error was
  4281. // because http.StatusNotModified was returned.
  4282. func (c *ProjectsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__TestIamPermissionsResponse, error) {
  4283. gensupport.SetOptions(c.urlParams_, opts...)
  4284. res, err := c.doRequest("json")
  4285. if res != nil && res.StatusCode == http.StatusNotModified {
  4286. if res.Body != nil {
  4287. res.Body.Close()
  4288. }
  4289. return nil, &googleapi.Error{
  4290. Code: res.StatusCode,
  4291. Header: res.Header,
  4292. }
  4293. }
  4294. if err != nil {
  4295. return nil, err
  4296. }
  4297. defer googleapi.CloseBody(res)
  4298. if err := googleapi.CheckResponse(res); err != nil {
  4299. return nil, err
  4300. }
  4301. ret := &GoogleIamV1__TestIamPermissionsResponse{
  4302. ServerResponse: googleapi.ServerResponse{
  4303. Header: res.Header,
  4304. HTTPStatusCode: res.StatusCode,
  4305. },
  4306. }
  4307. target := &ret
  4308. if err := gensupport.DecodeResponse(target, res); err != nil {
  4309. return nil, err
  4310. }
  4311. return ret, nil
  4312. // {
  4313. // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
  4314. // "flatPath": "v1/projects/{projectsId}/jobs/{jobsId}:testIamPermissions",
  4315. // "httpMethod": "POST",
  4316. // "id": "ml.projects.jobs.testIamPermissions",
  4317. // "parameterOrder": [
  4318. // "resource"
  4319. // ],
  4320. // "parameters": {
  4321. // "resource": {
  4322. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  4323. // "location": "path",
  4324. // "pattern": "^projects/[^/]+/jobs/[^/]+$",
  4325. // "required": true,
  4326. // "type": "string"
  4327. // }
  4328. // },
  4329. // "path": "v1/{+resource}:testIamPermissions",
  4330. // "request": {
  4331. // "$ref": "GoogleIamV1__TestIamPermissionsRequest"
  4332. // },
  4333. // "response": {
  4334. // "$ref": "GoogleIamV1__TestIamPermissionsResponse"
  4335. // },
  4336. // "scopes": [
  4337. // "https://www.googleapis.com/auth/cloud-platform"
  4338. // ]
  4339. // }
  4340. }
  4341. // method id "ml.projects.locations.get":
  4342. type ProjectsLocationsGetCall struct {
  4343. s *Service
  4344. name string
  4345. urlParams_ gensupport.URLParams
  4346. ifNoneMatch_ string
  4347. ctx_ context.Context
  4348. header_ http.Header
  4349. }
  4350. // Get: Get the complete list of CMLE capabilities in a location, along
  4351. // with their
  4352. // location-specific properties.
  4353. func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  4354. c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4355. c.name = name
  4356. return c
  4357. }
  4358. // Fields allows partial responses to be retrieved. See
  4359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4360. // for more information.
  4361. func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  4362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4363. return c
  4364. }
  4365. // IfNoneMatch sets the optional parameter which makes the operation
  4366. // fail if the object's ETag matches the given value. This is useful for
  4367. // getting updates only after the object has changed since the last
  4368. // request. Use googleapi.IsNotModified to check whether the response
  4369. // error from Do is the result of In-None-Match.
  4370. func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  4371. c.ifNoneMatch_ = entityTag
  4372. return c
  4373. }
  4374. // Context sets the context to be used in this call's Do method. Any
  4375. // pending HTTP request will be aborted if the provided context is
  4376. // canceled.
  4377. func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  4378. c.ctx_ = ctx
  4379. return c
  4380. }
  4381. // Header returns an http.Header that can be modified by the caller to
  4382. // add HTTP headers to the request.
  4383. func (c *ProjectsLocationsGetCall) Header() http.Header {
  4384. if c.header_ == nil {
  4385. c.header_ = make(http.Header)
  4386. }
  4387. return c.header_
  4388. }
  4389. func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  4390. reqHeaders := make(http.Header)
  4391. for k, v := range c.header_ {
  4392. reqHeaders[k] = v
  4393. }
  4394. reqHeaders.Set("User-Agent", c.s.userAgent())
  4395. if c.ifNoneMatch_ != "" {
  4396. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4397. }
  4398. var body io.Reader = nil
  4399. c.urlParams_.Set("alt", alt)
  4400. c.urlParams_.Set("prettyPrint", "false")
  4401. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4402. urls += "?" + c.urlParams_.Encode()
  4403. req, err := http.NewRequest("GET", urls, body)
  4404. if err != nil {
  4405. return nil, err
  4406. }
  4407. req.Header = reqHeaders
  4408. googleapi.Expand(req.URL, map[string]string{
  4409. "name": c.name,
  4410. })
  4411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4412. }
  4413. // Do executes the "ml.projects.locations.get" call.
  4414. // Exactly one of *GoogleCloudMlV1__Location or error will be non-nil.
  4415. // Any non-2xx status code is an error. Response headers are in either
  4416. // *GoogleCloudMlV1__Location.ServerResponse.Header or (if a response
  4417. // was returned at all) in error.(*googleapi.Error).Header. Use
  4418. // googleapi.IsNotModified to check whether the returned error was
  4419. // because http.StatusNotModified was returned.
  4420. func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__Location, error) {
  4421. gensupport.SetOptions(c.urlParams_, opts...)
  4422. res, err := c.doRequest("json")
  4423. if res != nil && res.StatusCode == http.StatusNotModified {
  4424. if res.Body != nil {
  4425. res.Body.Close()
  4426. }
  4427. return nil, &googleapi.Error{
  4428. Code: res.StatusCode,
  4429. Header: res.Header,
  4430. }
  4431. }
  4432. if err != nil {
  4433. return nil, err
  4434. }
  4435. defer googleapi.CloseBody(res)
  4436. if err := googleapi.CheckResponse(res); err != nil {
  4437. return nil, err
  4438. }
  4439. ret := &GoogleCloudMlV1__Location{
  4440. ServerResponse: googleapi.ServerResponse{
  4441. Header: res.Header,
  4442. HTTPStatusCode: res.StatusCode,
  4443. },
  4444. }
  4445. target := &ret
  4446. if err := gensupport.DecodeResponse(target, res); err != nil {
  4447. return nil, err
  4448. }
  4449. return ret, nil
  4450. // {
  4451. // "description": "Get the complete list of CMLE capabilities in a location, along with their\nlocation-specific properties.",
  4452. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}",
  4453. // "httpMethod": "GET",
  4454. // "id": "ml.projects.locations.get",
  4455. // "parameterOrder": [
  4456. // "name"
  4457. // ],
  4458. // "parameters": {
  4459. // "name": {
  4460. // "description": "Required. The name of the location.",
  4461. // "location": "path",
  4462. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  4463. // "required": true,
  4464. // "type": "string"
  4465. // }
  4466. // },
  4467. // "path": "v1/{+name}",
  4468. // "response": {
  4469. // "$ref": "GoogleCloudMlV1__Location"
  4470. // },
  4471. // "scopes": [
  4472. // "https://www.googleapis.com/auth/cloud-platform"
  4473. // ]
  4474. // }
  4475. }
  4476. // method id "ml.projects.locations.list":
  4477. type ProjectsLocationsListCall struct {
  4478. s *Service
  4479. parent string
  4480. urlParams_ gensupport.URLParams
  4481. ifNoneMatch_ string
  4482. ctx_ context.Context
  4483. header_ http.Header
  4484. }
  4485. // List: List all locations that provides at least one type of CMLE
  4486. // capability.
  4487. func (r *ProjectsLocationsService) List(parent string) *ProjectsLocationsListCall {
  4488. c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4489. c.parent = parent
  4490. return c
  4491. }
  4492. // PageSize sets the optional parameter "pageSize": The number of
  4493. // locations to retrieve per "page" of results. If there
  4494. // are more remaining results than this number, the response message
  4495. // will
  4496. // contain a valid value in the `next_page_token` field.
  4497. //
  4498. // The default value is 20, and the maximum page size is 100.
  4499. func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  4500. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4501. return c
  4502. }
  4503. // PageToken sets the optional parameter "pageToken": A page token to
  4504. // request the next page of results.
  4505. //
  4506. // You get the token from the `next_page_token` field of the response
  4507. // from
  4508. // the previous call.
  4509. func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  4510. c.urlParams_.Set("pageToken", pageToken)
  4511. return c
  4512. }
  4513. // Fields allows partial responses to be retrieved. See
  4514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4515. // for more information.
  4516. func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  4517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4518. return c
  4519. }
  4520. // IfNoneMatch sets the optional parameter which makes the operation
  4521. // fail if the object's ETag matches the given value. This is useful for
  4522. // getting updates only after the object has changed since the last
  4523. // request. Use googleapi.IsNotModified to check whether the response
  4524. // error from Do is the result of In-None-Match.
  4525. func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  4526. c.ifNoneMatch_ = entityTag
  4527. return c
  4528. }
  4529. // Context sets the context to be used in this call's Do method. Any
  4530. // pending HTTP request will be aborted if the provided context is
  4531. // canceled.
  4532. func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  4533. c.ctx_ = ctx
  4534. return c
  4535. }
  4536. // Header returns an http.Header that can be modified by the caller to
  4537. // add HTTP headers to the request.
  4538. func (c *ProjectsLocationsListCall) Header() http.Header {
  4539. if c.header_ == nil {
  4540. c.header_ = make(http.Header)
  4541. }
  4542. return c.header_
  4543. }
  4544. func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  4545. reqHeaders := make(http.Header)
  4546. for k, v := range c.header_ {
  4547. reqHeaders[k] = v
  4548. }
  4549. reqHeaders.Set("User-Agent", c.s.userAgent())
  4550. if c.ifNoneMatch_ != "" {
  4551. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4552. }
  4553. var body io.Reader = nil
  4554. c.urlParams_.Set("alt", alt)
  4555. c.urlParams_.Set("prettyPrint", "false")
  4556. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/locations")
  4557. urls += "?" + c.urlParams_.Encode()
  4558. req, err := http.NewRequest("GET", urls, body)
  4559. if err != nil {
  4560. return nil, err
  4561. }
  4562. req.Header = reqHeaders
  4563. googleapi.Expand(req.URL, map[string]string{
  4564. "parent": c.parent,
  4565. })
  4566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4567. }
  4568. // Do executes the "ml.projects.locations.list" call.
  4569. // Exactly one of *GoogleCloudMlV1__ListLocationsResponse or error will
  4570. // be non-nil. Any non-2xx status code is an error. Response headers are
  4571. // in either
  4572. // *GoogleCloudMlV1__ListLocationsResponse.ServerResponse.Header or (if
  4573. // a response was returned at all) in error.(*googleapi.Error).Header.
  4574. // Use googleapi.IsNotModified to check whether the returned error was
  4575. // because http.StatusNotModified was returned.
  4576. func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__ListLocationsResponse, error) {
  4577. gensupport.SetOptions(c.urlParams_, opts...)
  4578. res, err := c.doRequest("json")
  4579. if res != nil && res.StatusCode == http.StatusNotModified {
  4580. if res.Body != nil {
  4581. res.Body.Close()
  4582. }
  4583. return nil, &googleapi.Error{
  4584. Code: res.StatusCode,
  4585. Header: res.Header,
  4586. }
  4587. }
  4588. if err != nil {
  4589. return nil, err
  4590. }
  4591. defer googleapi.CloseBody(res)
  4592. if err := googleapi.CheckResponse(res); err != nil {
  4593. return nil, err
  4594. }
  4595. ret := &GoogleCloudMlV1__ListLocationsResponse{
  4596. ServerResponse: googleapi.ServerResponse{
  4597. Header: res.Header,
  4598. HTTPStatusCode: res.StatusCode,
  4599. },
  4600. }
  4601. target := &ret
  4602. if err := gensupport.DecodeResponse(target, res); err != nil {
  4603. return nil, err
  4604. }
  4605. return ret, nil
  4606. // {
  4607. // "description": "List all locations that provides at least one type of CMLE capability.",
  4608. // "flatPath": "v1/projects/{projectsId}/locations",
  4609. // "httpMethod": "GET",
  4610. // "id": "ml.projects.locations.list",
  4611. // "parameterOrder": [
  4612. // "parent"
  4613. // ],
  4614. // "parameters": {
  4615. // "pageSize": {
  4616. // "description": "Optional. The number of locations to retrieve per \"page\" of results. If there\nare more remaining results than this number, the response message will\ncontain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.",
  4617. // "format": "int32",
  4618. // "location": "query",
  4619. // "type": "integer"
  4620. // },
  4621. // "pageToken": {
  4622. // "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call.",
  4623. // "location": "query",
  4624. // "type": "string"
  4625. // },
  4626. // "parent": {
  4627. // "description": "Required. The name of the project for which available locations are to be\nlisted (since some locations might be whitelisted for specific projects).",
  4628. // "location": "path",
  4629. // "pattern": "^projects/[^/]+$",
  4630. // "required": true,
  4631. // "type": "string"
  4632. // }
  4633. // },
  4634. // "path": "v1/{+parent}/locations",
  4635. // "response": {
  4636. // "$ref": "GoogleCloudMlV1__ListLocationsResponse"
  4637. // },
  4638. // "scopes": [
  4639. // "https://www.googleapis.com/auth/cloud-platform"
  4640. // ]
  4641. // }
  4642. }
  4643. // Pages invokes f for each page of results.
  4644. // A non-nil error returned from f will halt the iteration.
  4645. // The provided context supersedes any context provided to the Context method.
  4646. func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*GoogleCloudMlV1__ListLocationsResponse) error) error {
  4647. c.ctx_ = ctx
  4648. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4649. for {
  4650. x, err := c.Do()
  4651. if err != nil {
  4652. return err
  4653. }
  4654. if err := f(x); err != nil {
  4655. return err
  4656. }
  4657. if x.NextPageToken == "" {
  4658. return nil
  4659. }
  4660. c.PageToken(x.NextPageToken)
  4661. }
  4662. }
  4663. // method id "ml.projects.models.create":
  4664. type ProjectsModelsCreateCall struct {
  4665. s *Service
  4666. parent string
  4667. googlecloudmlv1__model *GoogleCloudMlV1__Model
  4668. urlParams_ gensupport.URLParams
  4669. ctx_ context.Context
  4670. header_ http.Header
  4671. }
  4672. // Create: Creates a model which will later contain one or more
  4673. // versions.
  4674. //
  4675. // You must add at least one version before you can request predictions
  4676. // from
  4677. // the model. Add versions by
  4678. // calling
  4679. // [projects.models.versions.create](/ml-engine/reference/rest/v1
  4680. // /projects.models.versions/create).
  4681. func (r *ProjectsModelsService) Create(parent string, googlecloudmlv1__model *GoogleCloudMlV1__Model) *ProjectsModelsCreateCall {
  4682. c := &ProjectsModelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4683. c.parent = parent
  4684. c.googlecloudmlv1__model = googlecloudmlv1__model
  4685. return c
  4686. }
  4687. // Fields allows partial responses to be retrieved. See
  4688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4689. // for more information.
  4690. func (c *ProjectsModelsCreateCall) Fields(s ...googleapi.Field) *ProjectsModelsCreateCall {
  4691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4692. return c
  4693. }
  4694. // Context sets the context to be used in this call's Do method. Any
  4695. // pending HTTP request will be aborted if the provided context is
  4696. // canceled.
  4697. func (c *ProjectsModelsCreateCall) Context(ctx context.Context) *ProjectsModelsCreateCall {
  4698. c.ctx_ = ctx
  4699. return c
  4700. }
  4701. // Header returns an http.Header that can be modified by the caller to
  4702. // add HTTP headers to the request.
  4703. func (c *ProjectsModelsCreateCall) Header() http.Header {
  4704. if c.header_ == nil {
  4705. c.header_ = make(http.Header)
  4706. }
  4707. return c.header_
  4708. }
  4709. func (c *ProjectsModelsCreateCall) doRequest(alt string) (*http.Response, error) {
  4710. reqHeaders := make(http.Header)
  4711. for k, v := range c.header_ {
  4712. reqHeaders[k] = v
  4713. }
  4714. reqHeaders.Set("User-Agent", c.s.userAgent())
  4715. var body io.Reader = nil
  4716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__model)
  4717. if err != nil {
  4718. return nil, err
  4719. }
  4720. reqHeaders.Set("Content-Type", "application/json")
  4721. c.urlParams_.Set("alt", alt)
  4722. c.urlParams_.Set("prettyPrint", "false")
  4723. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/models")
  4724. urls += "?" + c.urlParams_.Encode()
  4725. req, err := http.NewRequest("POST", urls, body)
  4726. if err != nil {
  4727. return nil, err
  4728. }
  4729. req.Header = reqHeaders
  4730. googleapi.Expand(req.URL, map[string]string{
  4731. "parent": c.parent,
  4732. })
  4733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4734. }
  4735. // Do executes the "ml.projects.models.create" call.
  4736. // Exactly one of *GoogleCloudMlV1__Model or error will be non-nil. Any
  4737. // non-2xx status code is an error. Response headers are in either
  4738. // *GoogleCloudMlV1__Model.ServerResponse.Header or (if a response was
  4739. // returned at all) in error.(*googleapi.Error).Header. Use
  4740. // googleapi.IsNotModified to check whether the returned error was
  4741. // because http.StatusNotModified was returned.
  4742. func (c *ProjectsModelsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__Model, error) {
  4743. gensupport.SetOptions(c.urlParams_, opts...)
  4744. res, err := c.doRequest("json")
  4745. if res != nil && res.StatusCode == http.StatusNotModified {
  4746. if res.Body != nil {
  4747. res.Body.Close()
  4748. }
  4749. return nil, &googleapi.Error{
  4750. Code: res.StatusCode,
  4751. Header: res.Header,
  4752. }
  4753. }
  4754. if err != nil {
  4755. return nil, err
  4756. }
  4757. defer googleapi.CloseBody(res)
  4758. if err := googleapi.CheckResponse(res); err != nil {
  4759. return nil, err
  4760. }
  4761. ret := &GoogleCloudMlV1__Model{
  4762. ServerResponse: googleapi.ServerResponse{
  4763. Header: res.Header,
  4764. HTTPStatusCode: res.StatusCode,
  4765. },
  4766. }
  4767. target := &ret
  4768. if err := gensupport.DecodeResponse(target, res); err != nil {
  4769. return nil, err
  4770. }
  4771. return ret, nil
  4772. // {
  4773. // "description": "Creates a model which will later contain one or more versions.\n\nYou must add at least one version before you can request predictions from\nthe model. Add versions by calling\n[projects.models.versions.create](/ml-engine/reference/rest/v1/projects.models.versions/create).",
  4774. // "flatPath": "v1/projects/{projectsId}/models",
  4775. // "httpMethod": "POST",
  4776. // "id": "ml.projects.models.create",
  4777. // "parameterOrder": [
  4778. // "parent"
  4779. // ],
  4780. // "parameters": {
  4781. // "parent": {
  4782. // "description": "Required. The project name.",
  4783. // "location": "path",
  4784. // "pattern": "^projects/[^/]+$",
  4785. // "required": true,
  4786. // "type": "string"
  4787. // }
  4788. // },
  4789. // "path": "v1/{+parent}/models",
  4790. // "request": {
  4791. // "$ref": "GoogleCloudMlV1__Model"
  4792. // },
  4793. // "response": {
  4794. // "$ref": "GoogleCloudMlV1__Model"
  4795. // },
  4796. // "scopes": [
  4797. // "https://www.googleapis.com/auth/cloud-platform"
  4798. // ]
  4799. // }
  4800. }
  4801. // method id "ml.projects.models.delete":
  4802. type ProjectsModelsDeleteCall struct {
  4803. s *Service
  4804. name string
  4805. urlParams_ gensupport.URLParams
  4806. ctx_ context.Context
  4807. header_ http.Header
  4808. }
  4809. // Delete: Deletes a model.
  4810. //
  4811. // You can only delete a model if there are no versions in it. You can
  4812. // delete
  4813. // versions by
  4814. // calling
  4815. // [projects.models.versions.delete](/ml-engine/reference/rest/v1
  4816. // /projects.models.versions/delete).
  4817. func (r *ProjectsModelsService) Delete(name string) *ProjectsModelsDeleteCall {
  4818. c := &ProjectsModelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4819. c.name = name
  4820. return c
  4821. }
  4822. // Fields allows partial responses to be retrieved. See
  4823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4824. // for more information.
  4825. func (c *ProjectsModelsDeleteCall) Fields(s ...googleapi.Field) *ProjectsModelsDeleteCall {
  4826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4827. return c
  4828. }
  4829. // Context sets the context to be used in this call's Do method. Any
  4830. // pending HTTP request will be aborted if the provided context is
  4831. // canceled.
  4832. func (c *ProjectsModelsDeleteCall) Context(ctx context.Context) *ProjectsModelsDeleteCall {
  4833. c.ctx_ = ctx
  4834. return c
  4835. }
  4836. // Header returns an http.Header that can be modified by the caller to
  4837. // add HTTP headers to the request.
  4838. func (c *ProjectsModelsDeleteCall) Header() http.Header {
  4839. if c.header_ == nil {
  4840. c.header_ = make(http.Header)
  4841. }
  4842. return c.header_
  4843. }
  4844. func (c *ProjectsModelsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4845. reqHeaders := make(http.Header)
  4846. for k, v := range c.header_ {
  4847. reqHeaders[k] = v
  4848. }
  4849. reqHeaders.Set("User-Agent", c.s.userAgent())
  4850. var body io.Reader = nil
  4851. c.urlParams_.Set("alt", alt)
  4852. c.urlParams_.Set("prettyPrint", "false")
  4853. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4854. urls += "?" + c.urlParams_.Encode()
  4855. req, err := http.NewRequest("DELETE", urls, body)
  4856. if err != nil {
  4857. return nil, err
  4858. }
  4859. req.Header = reqHeaders
  4860. googleapi.Expand(req.URL, map[string]string{
  4861. "name": c.name,
  4862. })
  4863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4864. }
  4865. // Do executes the "ml.projects.models.delete" call.
  4866. // Exactly one of *GoogleLongrunning__Operation or error will be
  4867. // non-nil. Any non-2xx status code is an error. Response headers are in
  4868. // either *GoogleLongrunning__Operation.ServerResponse.Header or (if a
  4869. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4870. // googleapi.IsNotModified to check whether the returned error was
  4871. // because http.StatusNotModified was returned.
  4872. func (c *ProjectsModelsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunning__Operation, error) {
  4873. gensupport.SetOptions(c.urlParams_, opts...)
  4874. res, err := c.doRequest("json")
  4875. if res != nil && res.StatusCode == http.StatusNotModified {
  4876. if res.Body != nil {
  4877. res.Body.Close()
  4878. }
  4879. return nil, &googleapi.Error{
  4880. Code: res.StatusCode,
  4881. Header: res.Header,
  4882. }
  4883. }
  4884. if err != nil {
  4885. return nil, err
  4886. }
  4887. defer googleapi.CloseBody(res)
  4888. if err := googleapi.CheckResponse(res); err != nil {
  4889. return nil, err
  4890. }
  4891. ret := &GoogleLongrunning__Operation{
  4892. ServerResponse: googleapi.ServerResponse{
  4893. Header: res.Header,
  4894. HTTPStatusCode: res.StatusCode,
  4895. },
  4896. }
  4897. target := &ret
  4898. if err := gensupport.DecodeResponse(target, res); err != nil {
  4899. return nil, err
  4900. }
  4901. return ret, nil
  4902. // {
  4903. // "description": "Deletes a model.\n\nYou can only delete a model if there are no versions in it. You can delete\nversions by calling\n[projects.models.versions.delete](/ml-engine/reference/rest/v1/projects.models.versions/delete).",
  4904. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}",
  4905. // "httpMethod": "DELETE",
  4906. // "id": "ml.projects.models.delete",
  4907. // "parameterOrder": [
  4908. // "name"
  4909. // ],
  4910. // "parameters": {
  4911. // "name": {
  4912. // "description": "Required. The name of the model.",
  4913. // "location": "path",
  4914. // "pattern": "^projects/[^/]+/models/[^/]+$",
  4915. // "required": true,
  4916. // "type": "string"
  4917. // }
  4918. // },
  4919. // "path": "v1/{+name}",
  4920. // "response": {
  4921. // "$ref": "GoogleLongrunning__Operation"
  4922. // },
  4923. // "scopes": [
  4924. // "https://www.googleapis.com/auth/cloud-platform"
  4925. // ]
  4926. // }
  4927. }
  4928. // method id "ml.projects.models.get":
  4929. type ProjectsModelsGetCall struct {
  4930. s *Service
  4931. name string
  4932. urlParams_ gensupport.URLParams
  4933. ifNoneMatch_ string
  4934. ctx_ context.Context
  4935. header_ http.Header
  4936. }
  4937. // Get: Gets information about a model, including its name, the
  4938. // description (if
  4939. // set), and the default version (if at least one version of the model
  4940. // has
  4941. // been deployed).
  4942. func (r *ProjectsModelsService) Get(name string) *ProjectsModelsGetCall {
  4943. c := &ProjectsModelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4944. c.name = name
  4945. return c
  4946. }
  4947. // Fields allows partial responses to be retrieved. See
  4948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4949. // for more information.
  4950. func (c *ProjectsModelsGetCall) Fields(s ...googleapi.Field) *ProjectsModelsGetCall {
  4951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4952. return c
  4953. }
  4954. // IfNoneMatch sets the optional parameter which makes the operation
  4955. // fail if the object's ETag matches the given value. This is useful for
  4956. // getting updates only after the object has changed since the last
  4957. // request. Use googleapi.IsNotModified to check whether the response
  4958. // error from Do is the result of In-None-Match.
  4959. func (c *ProjectsModelsGetCall) IfNoneMatch(entityTag string) *ProjectsModelsGetCall {
  4960. c.ifNoneMatch_ = entityTag
  4961. return c
  4962. }
  4963. // Context sets the context to be used in this call's Do method. Any
  4964. // pending HTTP request will be aborted if the provided context is
  4965. // canceled.
  4966. func (c *ProjectsModelsGetCall) Context(ctx context.Context) *ProjectsModelsGetCall {
  4967. c.ctx_ = ctx
  4968. return c
  4969. }
  4970. // Header returns an http.Header that can be modified by the caller to
  4971. // add HTTP headers to the request.
  4972. func (c *ProjectsModelsGetCall) Header() http.Header {
  4973. if c.header_ == nil {
  4974. c.header_ = make(http.Header)
  4975. }
  4976. return c.header_
  4977. }
  4978. func (c *ProjectsModelsGetCall) doRequest(alt string) (*http.Response, error) {
  4979. reqHeaders := make(http.Header)
  4980. for k, v := range c.header_ {
  4981. reqHeaders[k] = v
  4982. }
  4983. reqHeaders.Set("User-Agent", c.s.userAgent())
  4984. if c.ifNoneMatch_ != "" {
  4985. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4986. }
  4987. var body io.Reader = nil
  4988. c.urlParams_.Set("alt", alt)
  4989. c.urlParams_.Set("prettyPrint", "false")
  4990. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4991. urls += "?" + c.urlParams_.Encode()
  4992. req, err := http.NewRequest("GET", urls, body)
  4993. if err != nil {
  4994. return nil, err
  4995. }
  4996. req.Header = reqHeaders
  4997. googleapi.Expand(req.URL, map[string]string{
  4998. "name": c.name,
  4999. })
  5000. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5001. }
  5002. // Do executes the "ml.projects.models.get" call.
  5003. // Exactly one of *GoogleCloudMlV1__Model or error will be non-nil. Any
  5004. // non-2xx status code is an error. Response headers are in either
  5005. // *GoogleCloudMlV1__Model.ServerResponse.Header or (if a response was
  5006. // returned at all) in error.(*googleapi.Error).Header. Use
  5007. // googleapi.IsNotModified to check whether the returned error was
  5008. // because http.StatusNotModified was returned.
  5009. func (c *ProjectsModelsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__Model, error) {
  5010. gensupport.SetOptions(c.urlParams_, opts...)
  5011. res, err := c.doRequest("json")
  5012. if res != nil && res.StatusCode == http.StatusNotModified {
  5013. if res.Body != nil {
  5014. res.Body.Close()
  5015. }
  5016. return nil, &googleapi.Error{
  5017. Code: res.StatusCode,
  5018. Header: res.Header,
  5019. }
  5020. }
  5021. if err != nil {
  5022. return nil, err
  5023. }
  5024. defer googleapi.CloseBody(res)
  5025. if err := googleapi.CheckResponse(res); err != nil {
  5026. return nil, err
  5027. }
  5028. ret := &GoogleCloudMlV1__Model{
  5029. ServerResponse: googleapi.ServerResponse{
  5030. Header: res.Header,
  5031. HTTPStatusCode: res.StatusCode,
  5032. },
  5033. }
  5034. target := &ret
  5035. if err := gensupport.DecodeResponse(target, res); err != nil {
  5036. return nil, err
  5037. }
  5038. return ret, nil
  5039. // {
  5040. // "description": "Gets information about a model, including its name, the description (if\nset), and the default version (if at least one version of the model has\nbeen deployed).",
  5041. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}",
  5042. // "httpMethod": "GET",
  5043. // "id": "ml.projects.models.get",
  5044. // "parameterOrder": [
  5045. // "name"
  5046. // ],
  5047. // "parameters": {
  5048. // "name": {
  5049. // "description": "Required. The name of the model.",
  5050. // "location": "path",
  5051. // "pattern": "^projects/[^/]+/models/[^/]+$",
  5052. // "required": true,
  5053. // "type": "string"
  5054. // }
  5055. // },
  5056. // "path": "v1/{+name}",
  5057. // "response": {
  5058. // "$ref": "GoogleCloudMlV1__Model"
  5059. // },
  5060. // "scopes": [
  5061. // "https://www.googleapis.com/auth/cloud-platform"
  5062. // ]
  5063. // }
  5064. }
  5065. // method id "ml.projects.models.getIamPolicy":
  5066. type ProjectsModelsGetIamPolicyCall struct {
  5067. s *Service
  5068. resource string
  5069. urlParams_ gensupport.URLParams
  5070. ifNoneMatch_ string
  5071. ctx_ context.Context
  5072. header_ http.Header
  5073. }
  5074. // GetIamPolicy: Gets the access control policy for a resource.
  5075. // Returns an empty policy if the resource exists and does not have a
  5076. // policy
  5077. // set.
  5078. func (r *ProjectsModelsService) GetIamPolicy(resource string) *ProjectsModelsGetIamPolicyCall {
  5079. c := &ProjectsModelsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5080. c.resource = resource
  5081. return c
  5082. }
  5083. // Fields allows partial responses to be retrieved. See
  5084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5085. // for more information.
  5086. func (c *ProjectsModelsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsModelsGetIamPolicyCall {
  5087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5088. return c
  5089. }
  5090. // IfNoneMatch sets the optional parameter which makes the operation
  5091. // fail if the object's ETag matches the given value. This is useful for
  5092. // getting updates only after the object has changed since the last
  5093. // request. Use googleapi.IsNotModified to check whether the response
  5094. // error from Do is the result of In-None-Match.
  5095. func (c *ProjectsModelsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsModelsGetIamPolicyCall {
  5096. c.ifNoneMatch_ = entityTag
  5097. return c
  5098. }
  5099. // Context sets the context to be used in this call's Do method. Any
  5100. // pending HTTP request will be aborted if the provided context is
  5101. // canceled.
  5102. func (c *ProjectsModelsGetIamPolicyCall) Context(ctx context.Context) *ProjectsModelsGetIamPolicyCall {
  5103. c.ctx_ = ctx
  5104. return c
  5105. }
  5106. // Header returns an http.Header that can be modified by the caller to
  5107. // add HTTP headers to the request.
  5108. func (c *ProjectsModelsGetIamPolicyCall) Header() http.Header {
  5109. if c.header_ == nil {
  5110. c.header_ = make(http.Header)
  5111. }
  5112. return c.header_
  5113. }
  5114. func (c *ProjectsModelsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5115. reqHeaders := make(http.Header)
  5116. for k, v := range c.header_ {
  5117. reqHeaders[k] = v
  5118. }
  5119. reqHeaders.Set("User-Agent", c.s.userAgent())
  5120. if c.ifNoneMatch_ != "" {
  5121. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5122. }
  5123. var body io.Reader = nil
  5124. c.urlParams_.Set("alt", alt)
  5125. c.urlParams_.Set("prettyPrint", "false")
  5126. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  5127. urls += "?" + c.urlParams_.Encode()
  5128. req, err := http.NewRequest("GET", urls, body)
  5129. if err != nil {
  5130. return nil, err
  5131. }
  5132. req.Header = reqHeaders
  5133. googleapi.Expand(req.URL, map[string]string{
  5134. "resource": c.resource,
  5135. })
  5136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5137. }
  5138. // Do executes the "ml.projects.models.getIamPolicy" call.
  5139. // Exactly one of *GoogleIamV1__Policy or error will be non-nil. Any
  5140. // non-2xx status code is an error. Response headers are in either
  5141. // *GoogleIamV1__Policy.ServerResponse.Header or (if a response was
  5142. // returned at all) in error.(*googleapi.Error).Header. Use
  5143. // googleapi.IsNotModified to check whether the returned error was
  5144. // because http.StatusNotModified was returned.
  5145. func (c *ProjectsModelsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__Policy, error) {
  5146. gensupport.SetOptions(c.urlParams_, opts...)
  5147. res, err := c.doRequest("json")
  5148. if res != nil && res.StatusCode == http.StatusNotModified {
  5149. if res.Body != nil {
  5150. res.Body.Close()
  5151. }
  5152. return nil, &googleapi.Error{
  5153. Code: res.StatusCode,
  5154. Header: res.Header,
  5155. }
  5156. }
  5157. if err != nil {
  5158. return nil, err
  5159. }
  5160. defer googleapi.CloseBody(res)
  5161. if err := googleapi.CheckResponse(res); err != nil {
  5162. return nil, err
  5163. }
  5164. ret := &GoogleIamV1__Policy{
  5165. ServerResponse: googleapi.ServerResponse{
  5166. Header: res.Header,
  5167. HTTPStatusCode: res.StatusCode,
  5168. },
  5169. }
  5170. target := &ret
  5171. if err := gensupport.DecodeResponse(target, res); err != nil {
  5172. return nil, err
  5173. }
  5174. return ret, nil
  5175. // {
  5176. // "description": "Gets the access control policy for a resource.\nReturns an empty policy if the resource exists and does not have a policy\nset.",
  5177. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}:getIamPolicy",
  5178. // "httpMethod": "GET",
  5179. // "id": "ml.projects.models.getIamPolicy",
  5180. // "parameterOrder": [
  5181. // "resource"
  5182. // ],
  5183. // "parameters": {
  5184. // "resource": {
  5185. // "description": "REQUIRED: The resource for which the policy is being requested.\nSee the operation documentation for the appropriate value for this field.",
  5186. // "location": "path",
  5187. // "pattern": "^projects/[^/]+/models/[^/]+$",
  5188. // "required": true,
  5189. // "type": "string"
  5190. // }
  5191. // },
  5192. // "path": "v1/{+resource}:getIamPolicy",
  5193. // "response": {
  5194. // "$ref": "GoogleIamV1__Policy"
  5195. // },
  5196. // "scopes": [
  5197. // "https://www.googleapis.com/auth/cloud-platform"
  5198. // ]
  5199. // }
  5200. }
  5201. // method id "ml.projects.models.list":
  5202. type ProjectsModelsListCall struct {
  5203. s *Service
  5204. parent string
  5205. urlParams_ gensupport.URLParams
  5206. ifNoneMatch_ string
  5207. ctx_ context.Context
  5208. header_ http.Header
  5209. }
  5210. // List: Lists the models in a project.
  5211. //
  5212. // Each project can contain multiple models, and each model can have
  5213. // multiple
  5214. // versions.
  5215. //
  5216. // If there are no models that match the request parameters, the list
  5217. // request
  5218. // returns an empty response body: {}.
  5219. func (r *ProjectsModelsService) List(parent string) *ProjectsModelsListCall {
  5220. c := &ProjectsModelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5221. c.parent = parent
  5222. return c
  5223. }
  5224. // Filter sets the optional parameter "filter": Specifies the subset of
  5225. // models to retrieve.
  5226. func (c *ProjectsModelsListCall) Filter(filter string) *ProjectsModelsListCall {
  5227. c.urlParams_.Set("filter", filter)
  5228. return c
  5229. }
  5230. // PageSize sets the optional parameter "pageSize": The number of models
  5231. // to retrieve per "page" of results. If there
  5232. // are more remaining results than this number, the response message
  5233. // will
  5234. // contain a valid value in the `next_page_token` field.
  5235. //
  5236. // The default value is 20, and the maximum page size is 100.
  5237. func (c *ProjectsModelsListCall) PageSize(pageSize int64) *ProjectsModelsListCall {
  5238. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5239. return c
  5240. }
  5241. // PageToken sets the optional parameter "pageToken": A page token to
  5242. // request the next page of results.
  5243. //
  5244. // You get the token from the `next_page_token` field of the response
  5245. // from
  5246. // the previous call.
  5247. func (c *ProjectsModelsListCall) PageToken(pageToken string) *ProjectsModelsListCall {
  5248. c.urlParams_.Set("pageToken", pageToken)
  5249. return c
  5250. }
  5251. // Fields allows partial responses to be retrieved. See
  5252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5253. // for more information.
  5254. func (c *ProjectsModelsListCall) Fields(s ...googleapi.Field) *ProjectsModelsListCall {
  5255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5256. return c
  5257. }
  5258. // IfNoneMatch sets the optional parameter which makes the operation
  5259. // fail if the object's ETag matches the given value. This is useful for
  5260. // getting updates only after the object has changed since the last
  5261. // request. Use googleapi.IsNotModified to check whether the response
  5262. // error from Do is the result of In-None-Match.
  5263. func (c *ProjectsModelsListCall) IfNoneMatch(entityTag string) *ProjectsModelsListCall {
  5264. c.ifNoneMatch_ = entityTag
  5265. return c
  5266. }
  5267. // Context sets the context to be used in this call's Do method. Any
  5268. // pending HTTP request will be aborted if the provided context is
  5269. // canceled.
  5270. func (c *ProjectsModelsListCall) Context(ctx context.Context) *ProjectsModelsListCall {
  5271. c.ctx_ = ctx
  5272. return c
  5273. }
  5274. // Header returns an http.Header that can be modified by the caller to
  5275. // add HTTP headers to the request.
  5276. func (c *ProjectsModelsListCall) Header() http.Header {
  5277. if c.header_ == nil {
  5278. c.header_ = make(http.Header)
  5279. }
  5280. return c.header_
  5281. }
  5282. func (c *ProjectsModelsListCall) doRequest(alt string) (*http.Response, error) {
  5283. reqHeaders := make(http.Header)
  5284. for k, v := range c.header_ {
  5285. reqHeaders[k] = v
  5286. }
  5287. reqHeaders.Set("User-Agent", c.s.userAgent())
  5288. if c.ifNoneMatch_ != "" {
  5289. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5290. }
  5291. var body io.Reader = nil
  5292. c.urlParams_.Set("alt", alt)
  5293. c.urlParams_.Set("prettyPrint", "false")
  5294. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/models")
  5295. urls += "?" + c.urlParams_.Encode()
  5296. req, err := http.NewRequest("GET", urls, body)
  5297. if err != nil {
  5298. return nil, err
  5299. }
  5300. req.Header = reqHeaders
  5301. googleapi.Expand(req.URL, map[string]string{
  5302. "parent": c.parent,
  5303. })
  5304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5305. }
  5306. // Do executes the "ml.projects.models.list" call.
  5307. // Exactly one of *GoogleCloudMlV1__ListModelsResponse or error will be
  5308. // non-nil. Any non-2xx status code is an error. Response headers are in
  5309. // either *GoogleCloudMlV1__ListModelsResponse.ServerResponse.Header or
  5310. // (if a response was returned at all) in
  5311. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5312. // whether the returned error was because http.StatusNotModified was
  5313. // returned.
  5314. func (c *ProjectsModelsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__ListModelsResponse, error) {
  5315. gensupport.SetOptions(c.urlParams_, opts...)
  5316. res, err := c.doRequest("json")
  5317. if res != nil && res.StatusCode == http.StatusNotModified {
  5318. if res.Body != nil {
  5319. res.Body.Close()
  5320. }
  5321. return nil, &googleapi.Error{
  5322. Code: res.StatusCode,
  5323. Header: res.Header,
  5324. }
  5325. }
  5326. if err != nil {
  5327. return nil, err
  5328. }
  5329. defer googleapi.CloseBody(res)
  5330. if err := googleapi.CheckResponse(res); err != nil {
  5331. return nil, err
  5332. }
  5333. ret := &GoogleCloudMlV1__ListModelsResponse{
  5334. ServerResponse: googleapi.ServerResponse{
  5335. Header: res.Header,
  5336. HTTPStatusCode: res.StatusCode,
  5337. },
  5338. }
  5339. target := &ret
  5340. if err := gensupport.DecodeResponse(target, res); err != nil {
  5341. return nil, err
  5342. }
  5343. return ret, nil
  5344. // {
  5345. // "description": "Lists the models in a project.\n\nEach project can contain multiple models, and each model can have multiple\nversions.\n\nIf there are no models that match the request parameters, the list request\nreturns an empty response body: {}.",
  5346. // "flatPath": "v1/projects/{projectsId}/models",
  5347. // "httpMethod": "GET",
  5348. // "id": "ml.projects.models.list",
  5349. // "parameterOrder": [
  5350. // "parent"
  5351. // ],
  5352. // "parameters": {
  5353. // "filter": {
  5354. // "description": "Optional. Specifies the subset of models to retrieve.",
  5355. // "location": "query",
  5356. // "type": "string"
  5357. // },
  5358. // "pageSize": {
  5359. // "description": "Optional. The number of models to retrieve per \"page\" of results. If there\nare more remaining results than this number, the response message will\ncontain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.",
  5360. // "format": "int32",
  5361. // "location": "query",
  5362. // "type": "integer"
  5363. // },
  5364. // "pageToken": {
  5365. // "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call.",
  5366. // "location": "query",
  5367. // "type": "string"
  5368. // },
  5369. // "parent": {
  5370. // "description": "Required. The name of the project whose models are to be listed.",
  5371. // "location": "path",
  5372. // "pattern": "^projects/[^/]+$",
  5373. // "required": true,
  5374. // "type": "string"
  5375. // }
  5376. // },
  5377. // "path": "v1/{+parent}/models",
  5378. // "response": {
  5379. // "$ref": "GoogleCloudMlV1__ListModelsResponse"
  5380. // },
  5381. // "scopes": [
  5382. // "https://www.googleapis.com/auth/cloud-platform"
  5383. // ]
  5384. // }
  5385. }
  5386. // Pages invokes f for each page of results.
  5387. // A non-nil error returned from f will halt the iteration.
  5388. // The provided context supersedes any context provided to the Context method.
  5389. func (c *ProjectsModelsListCall) Pages(ctx context.Context, f func(*GoogleCloudMlV1__ListModelsResponse) error) error {
  5390. c.ctx_ = ctx
  5391. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5392. for {
  5393. x, err := c.Do()
  5394. if err != nil {
  5395. return err
  5396. }
  5397. if err := f(x); err != nil {
  5398. return err
  5399. }
  5400. if x.NextPageToken == "" {
  5401. return nil
  5402. }
  5403. c.PageToken(x.NextPageToken)
  5404. }
  5405. }
  5406. // method id "ml.projects.models.patch":
  5407. type ProjectsModelsPatchCall struct {
  5408. s *Service
  5409. name string
  5410. googlecloudmlv1__model *GoogleCloudMlV1__Model
  5411. urlParams_ gensupport.URLParams
  5412. ctx_ context.Context
  5413. header_ http.Header
  5414. }
  5415. // Patch: Updates a specific model resource.
  5416. //
  5417. // Currently the only supported fields to update are `description`
  5418. // and
  5419. // `default_version.name`.
  5420. func (r *ProjectsModelsService) Patch(name string, googlecloudmlv1__model *GoogleCloudMlV1__Model) *ProjectsModelsPatchCall {
  5421. c := &ProjectsModelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5422. c.name = name
  5423. c.googlecloudmlv1__model = googlecloudmlv1__model
  5424. return c
  5425. }
  5426. // UpdateMask sets the optional parameter "updateMask": Required.
  5427. // Specifies the path, relative to `Model`, of the field to update.
  5428. //
  5429. // For example, to change the description of a model to "foo" and set
  5430. // its
  5431. // default version to "version_1", the `update_mask` parameter would
  5432. // be
  5433. // specified as `description`, `default_version.name`, and the
  5434. // `PATCH`
  5435. // request body would specify the new value, as follows:
  5436. // {
  5437. // "description": "foo",
  5438. // "defaultVersion": {
  5439. // "name":"version_1"
  5440. // }
  5441. // }
  5442. //
  5443. // Currently the supported update masks are `description`
  5444. // and
  5445. // `default_version.name`.
  5446. func (c *ProjectsModelsPatchCall) UpdateMask(updateMask string) *ProjectsModelsPatchCall {
  5447. c.urlParams_.Set("updateMask", updateMask)
  5448. return c
  5449. }
  5450. // Fields allows partial responses to be retrieved. See
  5451. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5452. // for more information.
  5453. func (c *ProjectsModelsPatchCall) Fields(s ...googleapi.Field) *ProjectsModelsPatchCall {
  5454. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5455. return c
  5456. }
  5457. // Context sets the context to be used in this call's Do method. Any
  5458. // pending HTTP request will be aborted if the provided context is
  5459. // canceled.
  5460. func (c *ProjectsModelsPatchCall) Context(ctx context.Context) *ProjectsModelsPatchCall {
  5461. c.ctx_ = ctx
  5462. return c
  5463. }
  5464. // Header returns an http.Header that can be modified by the caller to
  5465. // add HTTP headers to the request.
  5466. func (c *ProjectsModelsPatchCall) Header() http.Header {
  5467. if c.header_ == nil {
  5468. c.header_ = make(http.Header)
  5469. }
  5470. return c.header_
  5471. }
  5472. func (c *ProjectsModelsPatchCall) doRequest(alt string) (*http.Response, error) {
  5473. reqHeaders := make(http.Header)
  5474. for k, v := range c.header_ {
  5475. reqHeaders[k] = v
  5476. }
  5477. reqHeaders.Set("User-Agent", c.s.userAgent())
  5478. var body io.Reader = nil
  5479. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__model)
  5480. if err != nil {
  5481. return nil, err
  5482. }
  5483. reqHeaders.Set("Content-Type", "application/json")
  5484. c.urlParams_.Set("alt", alt)
  5485. c.urlParams_.Set("prettyPrint", "false")
  5486. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5487. urls += "?" + c.urlParams_.Encode()
  5488. req, err := http.NewRequest("PATCH", urls, body)
  5489. if err != nil {
  5490. return nil, err
  5491. }
  5492. req.Header = reqHeaders
  5493. googleapi.Expand(req.URL, map[string]string{
  5494. "name": c.name,
  5495. })
  5496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5497. }
  5498. // Do executes the "ml.projects.models.patch" call.
  5499. // Exactly one of *GoogleLongrunning__Operation or error will be
  5500. // non-nil. Any non-2xx status code is an error. Response headers are in
  5501. // either *GoogleLongrunning__Operation.ServerResponse.Header or (if a
  5502. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5503. // googleapi.IsNotModified to check whether the returned error was
  5504. // because http.StatusNotModified was returned.
  5505. func (c *ProjectsModelsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunning__Operation, error) {
  5506. gensupport.SetOptions(c.urlParams_, opts...)
  5507. res, err := c.doRequest("json")
  5508. if res != nil && res.StatusCode == http.StatusNotModified {
  5509. if res.Body != nil {
  5510. res.Body.Close()
  5511. }
  5512. return nil, &googleapi.Error{
  5513. Code: res.StatusCode,
  5514. Header: res.Header,
  5515. }
  5516. }
  5517. if err != nil {
  5518. return nil, err
  5519. }
  5520. defer googleapi.CloseBody(res)
  5521. if err := googleapi.CheckResponse(res); err != nil {
  5522. return nil, err
  5523. }
  5524. ret := &GoogleLongrunning__Operation{
  5525. ServerResponse: googleapi.ServerResponse{
  5526. Header: res.Header,
  5527. HTTPStatusCode: res.StatusCode,
  5528. },
  5529. }
  5530. target := &ret
  5531. if err := gensupport.DecodeResponse(target, res); err != nil {
  5532. return nil, err
  5533. }
  5534. return ret, nil
  5535. // {
  5536. // "description": "Updates a specific model resource.\n\nCurrently the only supported fields to update are `description` and\n`default_version.name`.",
  5537. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}",
  5538. // "httpMethod": "PATCH",
  5539. // "id": "ml.projects.models.patch",
  5540. // "parameterOrder": [
  5541. // "name"
  5542. // ],
  5543. // "parameters": {
  5544. // "name": {
  5545. // "description": "Required. The project name.",
  5546. // "location": "path",
  5547. // "pattern": "^projects/[^/]+/models/[^/]+$",
  5548. // "required": true,
  5549. // "type": "string"
  5550. // },
  5551. // "updateMask": {
  5552. // "description": "Required. Specifies the path, relative to `Model`, of the field to update.\n\nFor example, to change the description of a model to \"foo\" and set its\ndefault version to \"version_1\", the `update_mask` parameter would be\nspecified as `description`, `default_version.name`, and the `PATCH`\nrequest body would specify the new value, as follows:\n {\n \"description\": \"foo\",\n \"defaultVersion\": {\n \"name\":\"version_1\"\n }\n }\n\nCurrently the supported update masks are `description` and\n`default_version.name`.",
  5553. // "format": "google-fieldmask",
  5554. // "location": "query",
  5555. // "type": "string"
  5556. // }
  5557. // },
  5558. // "path": "v1/{+name}",
  5559. // "request": {
  5560. // "$ref": "GoogleCloudMlV1__Model"
  5561. // },
  5562. // "response": {
  5563. // "$ref": "GoogleLongrunning__Operation"
  5564. // },
  5565. // "scopes": [
  5566. // "https://www.googleapis.com/auth/cloud-platform"
  5567. // ]
  5568. // }
  5569. }
  5570. // method id "ml.projects.models.setIamPolicy":
  5571. type ProjectsModelsSetIamPolicyCall struct {
  5572. s *Service
  5573. resource string
  5574. googleiamv1__setiampolicyrequest *GoogleIamV1__SetIamPolicyRequest
  5575. urlParams_ gensupport.URLParams
  5576. ctx_ context.Context
  5577. header_ http.Header
  5578. }
  5579. // SetIamPolicy: Sets the access control policy on the specified
  5580. // resource. Replaces any
  5581. // existing policy.
  5582. func (r *ProjectsModelsService) SetIamPolicy(resource string, googleiamv1__setiampolicyrequest *GoogleIamV1__SetIamPolicyRequest) *ProjectsModelsSetIamPolicyCall {
  5583. c := &ProjectsModelsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5584. c.resource = resource
  5585. c.googleiamv1__setiampolicyrequest = googleiamv1__setiampolicyrequest
  5586. return c
  5587. }
  5588. // Fields allows partial responses to be retrieved. See
  5589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5590. // for more information.
  5591. func (c *ProjectsModelsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsModelsSetIamPolicyCall {
  5592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5593. return c
  5594. }
  5595. // Context sets the context to be used in this call's Do method. Any
  5596. // pending HTTP request will be aborted if the provided context is
  5597. // canceled.
  5598. func (c *ProjectsModelsSetIamPolicyCall) Context(ctx context.Context) *ProjectsModelsSetIamPolicyCall {
  5599. c.ctx_ = ctx
  5600. return c
  5601. }
  5602. // Header returns an http.Header that can be modified by the caller to
  5603. // add HTTP headers to the request.
  5604. func (c *ProjectsModelsSetIamPolicyCall) Header() http.Header {
  5605. if c.header_ == nil {
  5606. c.header_ = make(http.Header)
  5607. }
  5608. return c.header_
  5609. }
  5610. func (c *ProjectsModelsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5611. reqHeaders := make(http.Header)
  5612. for k, v := range c.header_ {
  5613. reqHeaders[k] = v
  5614. }
  5615. reqHeaders.Set("User-Agent", c.s.userAgent())
  5616. var body io.Reader = nil
  5617. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__setiampolicyrequest)
  5618. if err != nil {
  5619. return nil, err
  5620. }
  5621. reqHeaders.Set("Content-Type", "application/json")
  5622. c.urlParams_.Set("alt", alt)
  5623. c.urlParams_.Set("prettyPrint", "false")
  5624. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  5625. urls += "?" + c.urlParams_.Encode()
  5626. req, err := http.NewRequest("POST", urls, body)
  5627. if err != nil {
  5628. return nil, err
  5629. }
  5630. req.Header = reqHeaders
  5631. googleapi.Expand(req.URL, map[string]string{
  5632. "resource": c.resource,
  5633. })
  5634. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5635. }
  5636. // Do executes the "ml.projects.models.setIamPolicy" call.
  5637. // Exactly one of *GoogleIamV1__Policy or error will be non-nil. Any
  5638. // non-2xx status code is an error. Response headers are in either
  5639. // *GoogleIamV1__Policy.ServerResponse.Header or (if a response was
  5640. // returned at all) in error.(*googleapi.Error).Header. Use
  5641. // googleapi.IsNotModified to check whether the returned error was
  5642. // because http.StatusNotModified was returned.
  5643. func (c *ProjectsModelsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__Policy, error) {
  5644. gensupport.SetOptions(c.urlParams_, opts...)
  5645. res, err := c.doRequest("json")
  5646. if res != nil && res.StatusCode == http.StatusNotModified {
  5647. if res.Body != nil {
  5648. res.Body.Close()
  5649. }
  5650. return nil, &googleapi.Error{
  5651. Code: res.StatusCode,
  5652. Header: res.Header,
  5653. }
  5654. }
  5655. if err != nil {
  5656. return nil, err
  5657. }
  5658. defer googleapi.CloseBody(res)
  5659. if err := googleapi.CheckResponse(res); err != nil {
  5660. return nil, err
  5661. }
  5662. ret := &GoogleIamV1__Policy{
  5663. ServerResponse: googleapi.ServerResponse{
  5664. Header: res.Header,
  5665. HTTPStatusCode: res.StatusCode,
  5666. },
  5667. }
  5668. target := &ret
  5669. if err := gensupport.DecodeResponse(target, res); err != nil {
  5670. return nil, err
  5671. }
  5672. return ret, nil
  5673. // {
  5674. // "description": "Sets the access control policy on the specified resource. Replaces any\nexisting policy.",
  5675. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}:setIamPolicy",
  5676. // "httpMethod": "POST",
  5677. // "id": "ml.projects.models.setIamPolicy",
  5678. // "parameterOrder": [
  5679. // "resource"
  5680. // ],
  5681. // "parameters": {
  5682. // "resource": {
  5683. // "description": "REQUIRED: The resource for which the policy is being specified.\nSee the operation documentation for the appropriate value for this field.",
  5684. // "location": "path",
  5685. // "pattern": "^projects/[^/]+/models/[^/]+$",
  5686. // "required": true,
  5687. // "type": "string"
  5688. // }
  5689. // },
  5690. // "path": "v1/{+resource}:setIamPolicy",
  5691. // "request": {
  5692. // "$ref": "GoogleIamV1__SetIamPolicyRequest"
  5693. // },
  5694. // "response": {
  5695. // "$ref": "GoogleIamV1__Policy"
  5696. // },
  5697. // "scopes": [
  5698. // "https://www.googleapis.com/auth/cloud-platform"
  5699. // ]
  5700. // }
  5701. }
  5702. // method id "ml.projects.models.testIamPermissions":
  5703. type ProjectsModelsTestIamPermissionsCall struct {
  5704. s *Service
  5705. resource string
  5706. googleiamv1__testiampermissionsrequest *GoogleIamV1__TestIamPermissionsRequest
  5707. urlParams_ gensupport.URLParams
  5708. ctx_ context.Context
  5709. header_ http.Header
  5710. }
  5711. // TestIamPermissions: Returns permissions that a caller has on the
  5712. // specified resource.
  5713. // If the resource does not exist, this will return an empty set
  5714. // of
  5715. // permissions, not a NOT_FOUND error.
  5716. //
  5717. // Note: This operation is designed to be used for building
  5718. // permission-aware
  5719. // UIs and command-line tools, not for authorization checking. This
  5720. // operation
  5721. // may "fail open" without warning.
  5722. func (r *ProjectsModelsService) TestIamPermissions(resource string, googleiamv1__testiampermissionsrequest *GoogleIamV1__TestIamPermissionsRequest) *ProjectsModelsTestIamPermissionsCall {
  5723. c := &ProjectsModelsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5724. c.resource = resource
  5725. c.googleiamv1__testiampermissionsrequest = googleiamv1__testiampermissionsrequest
  5726. return c
  5727. }
  5728. // Fields allows partial responses to be retrieved. See
  5729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5730. // for more information.
  5731. func (c *ProjectsModelsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsModelsTestIamPermissionsCall {
  5732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5733. return c
  5734. }
  5735. // Context sets the context to be used in this call's Do method. Any
  5736. // pending HTTP request will be aborted if the provided context is
  5737. // canceled.
  5738. func (c *ProjectsModelsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsModelsTestIamPermissionsCall {
  5739. c.ctx_ = ctx
  5740. return c
  5741. }
  5742. // Header returns an http.Header that can be modified by the caller to
  5743. // add HTTP headers to the request.
  5744. func (c *ProjectsModelsTestIamPermissionsCall) Header() http.Header {
  5745. if c.header_ == nil {
  5746. c.header_ = make(http.Header)
  5747. }
  5748. return c.header_
  5749. }
  5750. func (c *ProjectsModelsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  5751. reqHeaders := make(http.Header)
  5752. for k, v := range c.header_ {
  5753. reqHeaders[k] = v
  5754. }
  5755. reqHeaders.Set("User-Agent", c.s.userAgent())
  5756. var body io.Reader = nil
  5757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googleiamv1__testiampermissionsrequest)
  5758. if err != nil {
  5759. return nil, err
  5760. }
  5761. reqHeaders.Set("Content-Type", "application/json")
  5762. c.urlParams_.Set("alt", alt)
  5763. c.urlParams_.Set("prettyPrint", "false")
  5764. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  5765. urls += "?" + c.urlParams_.Encode()
  5766. req, err := http.NewRequest("POST", urls, body)
  5767. if err != nil {
  5768. return nil, err
  5769. }
  5770. req.Header = reqHeaders
  5771. googleapi.Expand(req.URL, map[string]string{
  5772. "resource": c.resource,
  5773. })
  5774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5775. }
  5776. // Do executes the "ml.projects.models.testIamPermissions" call.
  5777. // Exactly one of *GoogleIamV1__TestIamPermissionsResponse or error will
  5778. // be non-nil. Any non-2xx status code is an error. Response headers are
  5779. // in either
  5780. // *GoogleIamV1__TestIamPermissionsResponse.ServerResponse.Header or (if
  5781. // a response was returned at all) in error.(*googleapi.Error).Header.
  5782. // Use googleapi.IsNotModified to check whether the returned error was
  5783. // because http.StatusNotModified was returned.
  5784. func (c *ProjectsModelsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*GoogleIamV1__TestIamPermissionsResponse, error) {
  5785. gensupport.SetOptions(c.urlParams_, opts...)
  5786. res, err := c.doRequest("json")
  5787. if res != nil && res.StatusCode == http.StatusNotModified {
  5788. if res.Body != nil {
  5789. res.Body.Close()
  5790. }
  5791. return nil, &googleapi.Error{
  5792. Code: res.StatusCode,
  5793. Header: res.Header,
  5794. }
  5795. }
  5796. if err != nil {
  5797. return nil, err
  5798. }
  5799. defer googleapi.CloseBody(res)
  5800. if err := googleapi.CheckResponse(res); err != nil {
  5801. return nil, err
  5802. }
  5803. ret := &GoogleIamV1__TestIamPermissionsResponse{
  5804. ServerResponse: googleapi.ServerResponse{
  5805. Header: res.Header,
  5806. HTTPStatusCode: res.StatusCode,
  5807. },
  5808. }
  5809. target := &ret
  5810. if err := gensupport.DecodeResponse(target, res); err != nil {
  5811. return nil, err
  5812. }
  5813. return ret, nil
  5814. // {
  5815. // "description": "Returns permissions that a caller has on the specified resource.\nIf the resource does not exist, this will return an empty set of\npermissions, not a NOT_FOUND error.\n\nNote: This operation is designed to be used for building permission-aware\nUIs and command-line tools, not for authorization checking. This operation\nmay \"fail open\" without warning.",
  5816. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}:testIamPermissions",
  5817. // "httpMethod": "POST",
  5818. // "id": "ml.projects.models.testIamPermissions",
  5819. // "parameterOrder": [
  5820. // "resource"
  5821. // ],
  5822. // "parameters": {
  5823. // "resource": {
  5824. // "description": "REQUIRED: The resource for which the policy detail is being requested.\nSee the operation documentation for the appropriate value for this field.",
  5825. // "location": "path",
  5826. // "pattern": "^projects/[^/]+/models/[^/]+$",
  5827. // "required": true,
  5828. // "type": "string"
  5829. // }
  5830. // },
  5831. // "path": "v1/{+resource}:testIamPermissions",
  5832. // "request": {
  5833. // "$ref": "GoogleIamV1__TestIamPermissionsRequest"
  5834. // },
  5835. // "response": {
  5836. // "$ref": "GoogleIamV1__TestIamPermissionsResponse"
  5837. // },
  5838. // "scopes": [
  5839. // "https://www.googleapis.com/auth/cloud-platform"
  5840. // ]
  5841. // }
  5842. }
  5843. // method id "ml.projects.models.versions.create":
  5844. type ProjectsModelsVersionsCreateCall struct {
  5845. s *Service
  5846. parent string
  5847. googlecloudmlv1__version *GoogleCloudMlV1__Version
  5848. urlParams_ gensupport.URLParams
  5849. ctx_ context.Context
  5850. header_ http.Header
  5851. }
  5852. // Create: Creates a new version of a model from a trained TensorFlow
  5853. // model.
  5854. //
  5855. // If the version created in the cloud by this call is the first
  5856. // deployed
  5857. // version of the specified model, it will be made the default version
  5858. // of the
  5859. // model. When you add a version to a model that already has one or
  5860. // more
  5861. // versions, the default version does not automatically change. If you
  5862. // want a
  5863. // new version to be the default, you must
  5864. // call
  5865. // [projects.models.versions.setDefault](/ml-engine/reference/rest/v
  5866. // 1/projects.models.versions/setDefault).
  5867. func (r *ProjectsModelsVersionsService) Create(parent string, googlecloudmlv1__version *GoogleCloudMlV1__Version) *ProjectsModelsVersionsCreateCall {
  5868. c := &ProjectsModelsVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5869. c.parent = parent
  5870. c.googlecloudmlv1__version = googlecloudmlv1__version
  5871. return c
  5872. }
  5873. // Fields allows partial responses to be retrieved. See
  5874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5875. // for more information.
  5876. func (c *ProjectsModelsVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsModelsVersionsCreateCall {
  5877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5878. return c
  5879. }
  5880. // Context sets the context to be used in this call's Do method. Any
  5881. // pending HTTP request will be aborted if the provided context is
  5882. // canceled.
  5883. func (c *ProjectsModelsVersionsCreateCall) Context(ctx context.Context) *ProjectsModelsVersionsCreateCall {
  5884. c.ctx_ = ctx
  5885. return c
  5886. }
  5887. // Header returns an http.Header that can be modified by the caller to
  5888. // add HTTP headers to the request.
  5889. func (c *ProjectsModelsVersionsCreateCall) Header() http.Header {
  5890. if c.header_ == nil {
  5891. c.header_ = make(http.Header)
  5892. }
  5893. return c.header_
  5894. }
  5895. func (c *ProjectsModelsVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
  5896. reqHeaders := make(http.Header)
  5897. for k, v := range c.header_ {
  5898. reqHeaders[k] = v
  5899. }
  5900. reqHeaders.Set("User-Agent", c.s.userAgent())
  5901. var body io.Reader = nil
  5902. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__version)
  5903. if err != nil {
  5904. return nil, err
  5905. }
  5906. reqHeaders.Set("Content-Type", "application/json")
  5907. c.urlParams_.Set("alt", alt)
  5908. c.urlParams_.Set("prettyPrint", "false")
  5909. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
  5910. urls += "?" + c.urlParams_.Encode()
  5911. req, err := http.NewRequest("POST", urls, body)
  5912. if err != nil {
  5913. return nil, err
  5914. }
  5915. req.Header = reqHeaders
  5916. googleapi.Expand(req.URL, map[string]string{
  5917. "parent": c.parent,
  5918. })
  5919. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5920. }
  5921. // Do executes the "ml.projects.models.versions.create" call.
  5922. // Exactly one of *GoogleLongrunning__Operation or error will be
  5923. // non-nil. Any non-2xx status code is an error. Response headers are in
  5924. // either *GoogleLongrunning__Operation.ServerResponse.Header or (if a
  5925. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5926. // googleapi.IsNotModified to check whether the returned error was
  5927. // because http.StatusNotModified was returned.
  5928. func (c *ProjectsModelsVersionsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunning__Operation, error) {
  5929. gensupport.SetOptions(c.urlParams_, opts...)
  5930. res, err := c.doRequest("json")
  5931. if res != nil && res.StatusCode == http.StatusNotModified {
  5932. if res.Body != nil {
  5933. res.Body.Close()
  5934. }
  5935. return nil, &googleapi.Error{
  5936. Code: res.StatusCode,
  5937. Header: res.Header,
  5938. }
  5939. }
  5940. if err != nil {
  5941. return nil, err
  5942. }
  5943. defer googleapi.CloseBody(res)
  5944. if err := googleapi.CheckResponse(res); err != nil {
  5945. return nil, err
  5946. }
  5947. ret := &GoogleLongrunning__Operation{
  5948. ServerResponse: googleapi.ServerResponse{
  5949. Header: res.Header,
  5950. HTTPStatusCode: res.StatusCode,
  5951. },
  5952. }
  5953. target := &ret
  5954. if err := gensupport.DecodeResponse(target, res); err != nil {
  5955. return nil, err
  5956. }
  5957. return ret, nil
  5958. // {
  5959. // "description": "Creates a new version of a model from a trained TensorFlow model.\n\nIf the version created in the cloud by this call is the first deployed\nversion of the specified model, it will be made the default version of the\nmodel. When you add a version to a model that already has one or more\nversions, the default version does not automatically change. If you want a\nnew version to be the default, you must call\n[projects.models.versions.setDefault](/ml-engine/reference/rest/v1/projects.models.versions/setDefault).",
  5960. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions",
  5961. // "httpMethod": "POST",
  5962. // "id": "ml.projects.models.versions.create",
  5963. // "parameterOrder": [
  5964. // "parent"
  5965. // ],
  5966. // "parameters": {
  5967. // "parent": {
  5968. // "description": "Required. The name of the model.",
  5969. // "location": "path",
  5970. // "pattern": "^projects/[^/]+/models/[^/]+$",
  5971. // "required": true,
  5972. // "type": "string"
  5973. // }
  5974. // },
  5975. // "path": "v1/{+parent}/versions",
  5976. // "request": {
  5977. // "$ref": "GoogleCloudMlV1__Version"
  5978. // },
  5979. // "response": {
  5980. // "$ref": "GoogleLongrunning__Operation"
  5981. // },
  5982. // "scopes": [
  5983. // "https://www.googleapis.com/auth/cloud-platform"
  5984. // ]
  5985. // }
  5986. }
  5987. // method id "ml.projects.models.versions.delete":
  5988. type ProjectsModelsVersionsDeleteCall struct {
  5989. s *Service
  5990. name string
  5991. urlParams_ gensupport.URLParams
  5992. ctx_ context.Context
  5993. header_ http.Header
  5994. }
  5995. // Delete: Deletes a model version.
  5996. //
  5997. // Each model can have multiple versions deployed and in use at any
  5998. // given
  5999. // time. Use this method to remove a single version.
  6000. //
  6001. // Note: You cannot delete the version that is set as the default
  6002. // version
  6003. // of the model unless it is the only remaining version.
  6004. func (r *ProjectsModelsVersionsService) Delete(name string) *ProjectsModelsVersionsDeleteCall {
  6005. c := &ProjectsModelsVersionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6006. c.name = name
  6007. return c
  6008. }
  6009. // Fields allows partial responses to be retrieved. See
  6010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6011. // for more information.
  6012. func (c *ProjectsModelsVersionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsModelsVersionsDeleteCall {
  6013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6014. return c
  6015. }
  6016. // Context sets the context to be used in this call's Do method. Any
  6017. // pending HTTP request will be aborted if the provided context is
  6018. // canceled.
  6019. func (c *ProjectsModelsVersionsDeleteCall) Context(ctx context.Context) *ProjectsModelsVersionsDeleteCall {
  6020. c.ctx_ = ctx
  6021. return c
  6022. }
  6023. // Header returns an http.Header that can be modified by the caller to
  6024. // add HTTP headers to the request.
  6025. func (c *ProjectsModelsVersionsDeleteCall) Header() http.Header {
  6026. if c.header_ == nil {
  6027. c.header_ = make(http.Header)
  6028. }
  6029. return c.header_
  6030. }
  6031. func (c *ProjectsModelsVersionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6032. reqHeaders := make(http.Header)
  6033. for k, v := range c.header_ {
  6034. reqHeaders[k] = v
  6035. }
  6036. reqHeaders.Set("User-Agent", c.s.userAgent())
  6037. var body io.Reader = nil
  6038. c.urlParams_.Set("alt", alt)
  6039. c.urlParams_.Set("prettyPrint", "false")
  6040. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6041. urls += "?" + c.urlParams_.Encode()
  6042. req, err := http.NewRequest("DELETE", urls, body)
  6043. if err != nil {
  6044. return nil, err
  6045. }
  6046. req.Header = reqHeaders
  6047. googleapi.Expand(req.URL, map[string]string{
  6048. "name": c.name,
  6049. })
  6050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6051. }
  6052. // Do executes the "ml.projects.models.versions.delete" call.
  6053. // Exactly one of *GoogleLongrunning__Operation or error will be
  6054. // non-nil. Any non-2xx status code is an error. Response headers are in
  6055. // either *GoogleLongrunning__Operation.ServerResponse.Header or (if a
  6056. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6057. // googleapi.IsNotModified to check whether the returned error was
  6058. // because http.StatusNotModified was returned.
  6059. func (c *ProjectsModelsVersionsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunning__Operation, error) {
  6060. gensupport.SetOptions(c.urlParams_, opts...)
  6061. res, err := c.doRequest("json")
  6062. if res != nil && res.StatusCode == http.StatusNotModified {
  6063. if res.Body != nil {
  6064. res.Body.Close()
  6065. }
  6066. return nil, &googleapi.Error{
  6067. Code: res.StatusCode,
  6068. Header: res.Header,
  6069. }
  6070. }
  6071. if err != nil {
  6072. return nil, err
  6073. }
  6074. defer googleapi.CloseBody(res)
  6075. if err := googleapi.CheckResponse(res); err != nil {
  6076. return nil, err
  6077. }
  6078. ret := &GoogleLongrunning__Operation{
  6079. ServerResponse: googleapi.ServerResponse{
  6080. Header: res.Header,
  6081. HTTPStatusCode: res.StatusCode,
  6082. },
  6083. }
  6084. target := &ret
  6085. if err := gensupport.DecodeResponse(target, res); err != nil {
  6086. return nil, err
  6087. }
  6088. return ret, nil
  6089. // {
  6090. // "description": "Deletes a model version.\n\nEach model can have multiple versions deployed and in use at any given\ntime. Use this method to remove a single version.\n\nNote: You cannot delete the version that is set as the default version\nof the model unless it is the only remaining version.",
  6091. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}",
  6092. // "httpMethod": "DELETE",
  6093. // "id": "ml.projects.models.versions.delete",
  6094. // "parameterOrder": [
  6095. // "name"
  6096. // ],
  6097. // "parameters": {
  6098. // "name": {
  6099. // "description": "Required. The name of the version. You can get the names of all the\nversions of a model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list).",
  6100. // "location": "path",
  6101. // "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$",
  6102. // "required": true,
  6103. // "type": "string"
  6104. // }
  6105. // },
  6106. // "path": "v1/{+name}",
  6107. // "response": {
  6108. // "$ref": "GoogleLongrunning__Operation"
  6109. // },
  6110. // "scopes": [
  6111. // "https://www.googleapis.com/auth/cloud-platform"
  6112. // ]
  6113. // }
  6114. }
  6115. // method id "ml.projects.models.versions.get":
  6116. type ProjectsModelsVersionsGetCall struct {
  6117. s *Service
  6118. name string
  6119. urlParams_ gensupport.URLParams
  6120. ifNoneMatch_ string
  6121. ctx_ context.Context
  6122. header_ http.Header
  6123. }
  6124. // Get: Gets information about a model version.
  6125. //
  6126. // Models can have multiple versions. You can
  6127. // call
  6128. // [projects.models.versions.list](/ml-engine/reference/rest/v1/proj
  6129. // ects.models.versions/list)
  6130. // to get the same information that this method returns for all of
  6131. // the
  6132. // versions of a model.
  6133. func (r *ProjectsModelsVersionsService) Get(name string) *ProjectsModelsVersionsGetCall {
  6134. c := &ProjectsModelsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6135. c.name = name
  6136. return c
  6137. }
  6138. // Fields allows partial responses to be retrieved. See
  6139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6140. // for more information.
  6141. func (c *ProjectsModelsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsModelsVersionsGetCall {
  6142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6143. return c
  6144. }
  6145. // IfNoneMatch sets the optional parameter which makes the operation
  6146. // fail if the object's ETag matches the given value. This is useful for
  6147. // getting updates only after the object has changed since the last
  6148. // request. Use googleapi.IsNotModified to check whether the response
  6149. // error from Do is the result of In-None-Match.
  6150. func (c *ProjectsModelsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsModelsVersionsGetCall {
  6151. c.ifNoneMatch_ = entityTag
  6152. return c
  6153. }
  6154. // Context sets the context to be used in this call's Do method. Any
  6155. // pending HTTP request will be aborted if the provided context is
  6156. // canceled.
  6157. func (c *ProjectsModelsVersionsGetCall) Context(ctx context.Context) *ProjectsModelsVersionsGetCall {
  6158. c.ctx_ = ctx
  6159. return c
  6160. }
  6161. // Header returns an http.Header that can be modified by the caller to
  6162. // add HTTP headers to the request.
  6163. func (c *ProjectsModelsVersionsGetCall) Header() http.Header {
  6164. if c.header_ == nil {
  6165. c.header_ = make(http.Header)
  6166. }
  6167. return c.header_
  6168. }
  6169. func (c *ProjectsModelsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  6170. reqHeaders := make(http.Header)
  6171. for k, v := range c.header_ {
  6172. reqHeaders[k] = v
  6173. }
  6174. reqHeaders.Set("User-Agent", c.s.userAgent())
  6175. if c.ifNoneMatch_ != "" {
  6176. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6177. }
  6178. var body io.Reader = nil
  6179. c.urlParams_.Set("alt", alt)
  6180. c.urlParams_.Set("prettyPrint", "false")
  6181. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6182. urls += "?" + c.urlParams_.Encode()
  6183. req, err := http.NewRequest("GET", urls, body)
  6184. if err != nil {
  6185. return nil, err
  6186. }
  6187. req.Header = reqHeaders
  6188. googleapi.Expand(req.URL, map[string]string{
  6189. "name": c.name,
  6190. })
  6191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6192. }
  6193. // Do executes the "ml.projects.models.versions.get" call.
  6194. // Exactly one of *GoogleCloudMlV1__Version or error will be non-nil.
  6195. // Any non-2xx status code is an error. Response headers are in either
  6196. // *GoogleCloudMlV1__Version.ServerResponse.Header or (if a response was
  6197. // returned at all) in error.(*googleapi.Error).Header. Use
  6198. // googleapi.IsNotModified to check whether the returned error was
  6199. // because http.StatusNotModified was returned.
  6200. func (c *ProjectsModelsVersionsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__Version, error) {
  6201. gensupport.SetOptions(c.urlParams_, opts...)
  6202. res, err := c.doRequest("json")
  6203. if res != nil && res.StatusCode == http.StatusNotModified {
  6204. if res.Body != nil {
  6205. res.Body.Close()
  6206. }
  6207. return nil, &googleapi.Error{
  6208. Code: res.StatusCode,
  6209. Header: res.Header,
  6210. }
  6211. }
  6212. if err != nil {
  6213. return nil, err
  6214. }
  6215. defer googleapi.CloseBody(res)
  6216. if err := googleapi.CheckResponse(res); err != nil {
  6217. return nil, err
  6218. }
  6219. ret := &GoogleCloudMlV1__Version{
  6220. ServerResponse: googleapi.ServerResponse{
  6221. Header: res.Header,
  6222. HTTPStatusCode: res.StatusCode,
  6223. },
  6224. }
  6225. target := &ret
  6226. if err := gensupport.DecodeResponse(target, res); err != nil {
  6227. return nil, err
  6228. }
  6229. return ret, nil
  6230. // {
  6231. // "description": "Gets information about a model version.\n\nModels can have multiple versions. You can call\n[projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list)\nto get the same information that this method returns for all of the\nversions of a model.",
  6232. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}",
  6233. // "httpMethod": "GET",
  6234. // "id": "ml.projects.models.versions.get",
  6235. // "parameterOrder": [
  6236. // "name"
  6237. // ],
  6238. // "parameters": {
  6239. // "name": {
  6240. // "description": "Required. The name of the version.",
  6241. // "location": "path",
  6242. // "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$",
  6243. // "required": true,
  6244. // "type": "string"
  6245. // }
  6246. // },
  6247. // "path": "v1/{+name}",
  6248. // "response": {
  6249. // "$ref": "GoogleCloudMlV1__Version"
  6250. // },
  6251. // "scopes": [
  6252. // "https://www.googleapis.com/auth/cloud-platform"
  6253. // ]
  6254. // }
  6255. }
  6256. // method id "ml.projects.models.versions.list":
  6257. type ProjectsModelsVersionsListCall struct {
  6258. s *Service
  6259. parent string
  6260. urlParams_ gensupport.URLParams
  6261. ifNoneMatch_ string
  6262. ctx_ context.Context
  6263. header_ http.Header
  6264. }
  6265. // List: Gets basic information about all the versions of a model.
  6266. //
  6267. // If you expect that a model has many versions, or if you need to
  6268. // handle
  6269. // only a limited number of results at a time, you can request that the
  6270. // list
  6271. // be retrieved in batches (called pages).
  6272. //
  6273. // If there are no versions that match the request parameters, the
  6274. // list
  6275. // request returns an empty response body: {}.
  6276. func (r *ProjectsModelsVersionsService) List(parent string) *ProjectsModelsVersionsListCall {
  6277. c := &ProjectsModelsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6278. c.parent = parent
  6279. return c
  6280. }
  6281. // Filter sets the optional parameter "filter": Specifies the subset of
  6282. // versions to retrieve.
  6283. func (c *ProjectsModelsVersionsListCall) Filter(filter string) *ProjectsModelsVersionsListCall {
  6284. c.urlParams_.Set("filter", filter)
  6285. return c
  6286. }
  6287. // PageSize sets the optional parameter "pageSize": The number of
  6288. // versions to retrieve per "page" of results. If
  6289. // there are more remaining results than this number, the response
  6290. // message
  6291. // will contain a valid value in the `next_page_token` field.
  6292. //
  6293. // The default value is 20, and the maximum page size is 100.
  6294. func (c *ProjectsModelsVersionsListCall) PageSize(pageSize int64) *ProjectsModelsVersionsListCall {
  6295. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6296. return c
  6297. }
  6298. // PageToken sets the optional parameter "pageToken": A page token to
  6299. // request the next page of results.
  6300. //
  6301. // You get the token from the `next_page_token` field of the response
  6302. // from
  6303. // the previous call.
  6304. func (c *ProjectsModelsVersionsListCall) PageToken(pageToken string) *ProjectsModelsVersionsListCall {
  6305. c.urlParams_.Set("pageToken", pageToken)
  6306. return c
  6307. }
  6308. // Fields allows partial responses to be retrieved. See
  6309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6310. // for more information.
  6311. func (c *ProjectsModelsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsModelsVersionsListCall {
  6312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6313. return c
  6314. }
  6315. // IfNoneMatch sets the optional parameter which makes the operation
  6316. // fail if the object's ETag matches the given value. This is useful for
  6317. // getting updates only after the object has changed since the last
  6318. // request. Use googleapi.IsNotModified to check whether the response
  6319. // error from Do is the result of In-None-Match.
  6320. func (c *ProjectsModelsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsModelsVersionsListCall {
  6321. c.ifNoneMatch_ = entityTag
  6322. return c
  6323. }
  6324. // Context sets the context to be used in this call's Do method. Any
  6325. // pending HTTP request will be aborted if the provided context is
  6326. // canceled.
  6327. func (c *ProjectsModelsVersionsListCall) Context(ctx context.Context) *ProjectsModelsVersionsListCall {
  6328. c.ctx_ = ctx
  6329. return c
  6330. }
  6331. // Header returns an http.Header that can be modified by the caller to
  6332. // add HTTP headers to the request.
  6333. func (c *ProjectsModelsVersionsListCall) Header() http.Header {
  6334. if c.header_ == nil {
  6335. c.header_ = make(http.Header)
  6336. }
  6337. return c.header_
  6338. }
  6339. func (c *ProjectsModelsVersionsListCall) doRequest(alt string) (*http.Response, error) {
  6340. reqHeaders := make(http.Header)
  6341. for k, v := range c.header_ {
  6342. reqHeaders[k] = v
  6343. }
  6344. reqHeaders.Set("User-Agent", c.s.userAgent())
  6345. if c.ifNoneMatch_ != "" {
  6346. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6347. }
  6348. var body io.Reader = nil
  6349. c.urlParams_.Set("alt", alt)
  6350. c.urlParams_.Set("prettyPrint", "false")
  6351. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
  6352. urls += "?" + c.urlParams_.Encode()
  6353. req, err := http.NewRequest("GET", urls, body)
  6354. if err != nil {
  6355. return nil, err
  6356. }
  6357. req.Header = reqHeaders
  6358. googleapi.Expand(req.URL, map[string]string{
  6359. "parent": c.parent,
  6360. })
  6361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6362. }
  6363. // Do executes the "ml.projects.models.versions.list" call.
  6364. // Exactly one of *GoogleCloudMlV1__ListVersionsResponse or error will
  6365. // be non-nil. Any non-2xx status code is an error. Response headers are
  6366. // in either
  6367. // *GoogleCloudMlV1__ListVersionsResponse.ServerResponse.Header or (if a
  6368. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6369. // googleapi.IsNotModified to check whether the returned error was
  6370. // because http.StatusNotModified was returned.
  6371. func (c *ProjectsModelsVersionsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__ListVersionsResponse, error) {
  6372. gensupport.SetOptions(c.urlParams_, opts...)
  6373. res, err := c.doRequest("json")
  6374. if res != nil && res.StatusCode == http.StatusNotModified {
  6375. if res.Body != nil {
  6376. res.Body.Close()
  6377. }
  6378. return nil, &googleapi.Error{
  6379. Code: res.StatusCode,
  6380. Header: res.Header,
  6381. }
  6382. }
  6383. if err != nil {
  6384. return nil, err
  6385. }
  6386. defer googleapi.CloseBody(res)
  6387. if err := googleapi.CheckResponse(res); err != nil {
  6388. return nil, err
  6389. }
  6390. ret := &GoogleCloudMlV1__ListVersionsResponse{
  6391. ServerResponse: googleapi.ServerResponse{
  6392. Header: res.Header,
  6393. HTTPStatusCode: res.StatusCode,
  6394. },
  6395. }
  6396. target := &ret
  6397. if err := gensupport.DecodeResponse(target, res); err != nil {
  6398. return nil, err
  6399. }
  6400. return ret, nil
  6401. // {
  6402. // "description": "Gets basic information about all the versions of a model.\n\nIf you expect that a model has many versions, or if you need to handle\nonly a limited number of results at a time, you can request that the list\nbe retrieved in batches (called pages).\n\nIf there are no versions that match the request parameters, the list\nrequest returns an empty response body: {}.",
  6403. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions",
  6404. // "httpMethod": "GET",
  6405. // "id": "ml.projects.models.versions.list",
  6406. // "parameterOrder": [
  6407. // "parent"
  6408. // ],
  6409. // "parameters": {
  6410. // "filter": {
  6411. // "description": "Optional. Specifies the subset of versions to retrieve.",
  6412. // "location": "query",
  6413. // "type": "string"
  6414. // },
  6415. // "pageSize": {
  6416. // "description": "Optional. The number of versions to retrieve per \"page\" of results. If\nthere are more remaining results than this number, the response message\nwill contain a valid value in the `next_page_token` field.\n\nThe default value is 20, and the maximum page size is 100.",
  6417. // "format": "int32",
  6418. // "location": "query",
  6419. // "type": "integer"
  6420. // },
  6421. // "pageToken": {
  6422. // "description": "Optional. A page token to request the next page of results.\n\nYou get the token from the `next_page_token` field of the response from\nthe previous call.",
  6423. // "location": "query",
  6424. // "type": "string"
  6425. // },
  6426. // "parent": {
  6427. // "description": "Required. The name of the model for which to list the version.",
  6428. // "location": "path",
  6429. // "pattern": "^projects/[^/]+/models/[^/]+$",
  6430. // "required": true,
  6431. // "type": "string"
  6432. // }
  6433. // },
  6434. // "path": "v1/{+parent}/versions",
  6435. // "response": {
  6436. // "$ref": "GoogleCloudMlV1__ListVersionsResponse"
  6437. // },
  6438. // "scopes": [
  6439. // "https://www.googleapis.com/auth/cloud-platform"
  6440. // ]
  6441. // }
  6442. }
  6443. // Pages invokes f for each page of results.
  6444. // A non-nil error returned from f will halt the iteration.
  6445. // The provided context supersedes any context provided to the Context method.
  6446. func (c *ProjectsModelsVersionsListCall) Pages(ctx context.Context, f func(*GoogleCloudMlV1__ListVersionsResponse) error) error {
  6447. c.ctx_ = ctx
  6448. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6449. for {
  6450. x, err := c.Do()
  6451. if err != nil {
  6452. return err
  6453. }
  6454. if err := f(x); err != nil {
  6455. return err
  6456. }
  6457. if x.NextPageToken == "" {
  6458. return nil
  6459. }
  6460. c.PageToken(x.NextPageToken)
  6461. }
  6462. }
  6463. // method id "ml.projects.models.versions.patch":
  6464. type ProjectsModelsVersionsPatchCall struct {
  6465. s *Service
  6466. name string
  6467. googlecloudmlv1__version *GoogleCloudMlV1__Version
  6468. urlParams_ gensupport.URLParams
  6469. ctx_ context.Context
  6470. header_ http.Header
  6471. }
  6472. // Patch: Updates the specified Version resource.
  6473. //
  6474. // Currently the only update-able fields are `description`
  6475. // and
  6476. // `autoScaling.minNodes`.
  6477. func (r *ProjectsModelsVersionsService) Patch(name string, googlecloudmlv1__version *GoogleCloudMlV1__Version) *ProjectsModelsVersionsPatchCall {
  6478. c := &ProjectsModelsVersionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6479. c.name = name
  6480. c.googlecloudmlv1__version = googlecloudmlv1__version
  6481. return c
  6482. }
  6483. // UpdateMask sets the optional parameter "updateMask": Required.
  6484. // Specifies the path, relative to `Version`, of the field to
  6485. // update. Must be present and non-empty.
  6486. //
  6487. // For example, to change the description of a version to "foo",
  6488. // the
  6489. // `update_mask` parameter would be specified as `description`, and
  6490. // the
  6491. // `PATCH` request body would specify the new value, as follows:
  6492. // {
  6493. // "description": "foo"
  6494. // }
  6495. //
  6496. // Currently the only supported update mask fields are `description`
  6497. // and
  6498. // `autoScaling.minNodes`.
  6499. func (c *ProjectsModelsVersionsPatchCall) UpdateMask(updateMask string) *ProjectsModelsVersionsPatchCall {
  6500. c.urlParams_.Set("updateMask", updateMask)
  6501. return c
  6502. }
  6503. // Fields allows partial responses to be retrieved. See
  6504. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6505. // for more information.
  6506. func (c *ProjectsModelsVersionsPatchCall) Fields(s ...googleapi.Field) *ProjectsModelsVersionsPatchCall {
  6507. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6508. return c
  6509. }
  6510. // Context sets the context to be used in this call's Do method. Any
  6511. // pending HTTP request will be aborted if the provided context is
  6512. // canceled.
  6513. func (c *ProjectsModelsVersionsPatchCall) Context(ctx context.Context) *ProjectsModelsVersionsPatchCall {
  6514. c.ctx_ = ctx
  6515. return c
  6516. }
  6517. // Header returns an http.Header that can be modified by the caller to
  6518. // add HTTP headers to the request.
  6519. func (c *ProjectsModelsVersionsPatchCall) Header() http.Header {
  6520. if c.header_ == nil {
  6521. c.header_ = make(http.Header)
  6522. }
  6523. return c.header_
  6524. }
  6525. func (c *ProjectsModelsVersionsPatchCall) doRequest(alt string) (*http.Response, error) {
  6526. reqHeaders := make(http.Header)
  6527. for k, v := range c.header_ {
  6528. reqHeaders[k] = v
  6529. }
  6530. reqHeaders.Set("User-Agent", c.s.userAgent())
  6531. var body io.Reader = nil
  6532. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__version)
  6533. if err != nil {
  6534. return nil, err
  6535. }
  6536. reqHeaders.Set("Content-Type", "application/json")
  6537. c.urlParams_.Set("alt", alt)
  6538. c.urlParams_.Set("prettyPrint", "false")
  6539. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6540. urls += "?" + c.urlParams_.Encode()
  6541. req, err := http.NewRequest("PATCH", urls, body)
  6542. if err != nil {
  6543. return nil, err
  6544. }
  6545. req.Header = reqHeaders
  6546. googleapi.Expand(req.URL, map[string]string{
  6547. "name": c.name,
  6548. })
  6549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6550. }
  6551. // Do executes the "ml.projects.models.versions.patch" call.
  6552. // Exactly one of *GoogleLongrunning__Operation or error will be
  6553. // non-nil. Any non-2xx status code is an error. Response headers are in
  6554. // either *GoogleLongrunning__Operation.ServerResponse.Header or (if a
  6555. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6556. // googleapi.IsNotModified to check whether the returned error was
  6557. // because http.StatusNotModified was returned.
  6558. func (c *ProjectsModelsVersionsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunning__Operation, error) {
  6559. gensupport.SetOptions(c.urlParams_, opts...)
  6560. res, err := c.doRequest("json")
  6561. if res != nil && res.StatusCode == http.StatusNotModified {
  6562. if res.Body != nil {
  6563. res.Body.Close()
  6564. }
  6565. return nil, &googleapi.Error{
  6566. Code: res.StatusCode,
  6567. Header: res.Header,
  6568. }
  6569. }
  6570. if err != nil {
  6571. return nil, err
  6572. }
  6573. defer googleapi.CloseBody(res)
  6574. if err := googleapi.CheckResponse(res); err != nil {
  6575. return nil, err
  6576. }
  6577. ret := &GoogleLongrunning__Operation{
  6578. ServerResponse: googleapi.ServerResponse{
  6579. Header: res.Header,
  6580. HTTPStatusCode: res.StatusCode,
  6581. },
  6582. }
  6583. target := &ret
  6584. if err := gensupport.DecodeResponse(target, res); err != nil {
  6585. return nil, err
  6586. }
  6587. return ret, nil
  6588. // {
  6589. // "description": "Updates the specified Version resource.\n\nCurrently the only update-able fields are `description` and\n`autoScaling.minNodes`.",
  6590. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}",
  6591. // "httpMethod": "PATCH",
  6592. // "id": "ml.projects.models.versions.patch",
  6593. // "parameterOrder": [
  6594. // "name"
  6595. // ],
  6596. // "parameters": {
  6597. // "name": {
  6598. // "description": "Required. The name of the model.",
  6599. // "location": "path",
  6600. // "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$",
  6601. // "required": true,
  6602. // "type": "string"
  6603. // },
  6604. // "updateMask": {
  6605. // "description": "Required. Specifies the path, relative to `Version`, of the field to\nupdate. Must be present and non-empty.\n\nFor example, to change the description of a version to \"foo\", the\n`update_mask` parameter would be specified as `description`, and the\n`PATCH` request body would specify the new value, as follows:\n {\n \"description\": \"foo\"\n }\n\nCurrently the only supported update mask fields are `description` and\n`autoScaling.minNodes`.",
  6606. // "format": "google-fieldmask",
  6607. // "location": "query",
  6608. // "type": "string"
  6609. // }
  6610. // },
  6611. // "path": "v1/{+name}",
  6612. // "request": {
  6613. // "$ref": "GoogleCloudMlV1__Version"
  6614. // },
  6615. // "response": {
  6616. // "$ref": "GoogleLongrunning__Operation"
  6617. // },
  6618. // "scopes": [
  6619. // "https://www.googleapis.com/auth/cloud-platform"
  6620. // ]
  6621. // }
  6622. }
  6623. // method id "ml.projects.models.versions.setDefault":
  6624. type ProjectsModelsVersionsSetDefaultCall struct {
  6625. s *Service
  6626. name string
  6627. googlecloudmlv1__setdefaultversionrequest *GoogleCloudMlV1__SetDefaultVersionRequest
  6628. urlParams_ gensupport.URLParams
  6629. ctx_ context.Context
  6630. header_ http.Header
  6631. }
  6632. // SetDefault: Designates a version to be the default for the
  6633. // model.
  6634. //
  6635. // The default version is used for prediction requests made against the
  6636. // model
  6637. // that don't specify a version.
  6638. //
  6639. // The first version to be created for a model is automatically set as
  6640. // the
  6641. // default. You must make any subsequent changes to the default
  6642. // version
  6643. // setting manually using this method.
  6644. func (r *ProjectsModelsVersionsService) SetDefault(name string, googlecloudmlv1__setdefaultversionrequest *GoogleCloudMlV1__SetDefaultVersionRequest) *ProjectsModelsVersionsSetDefaultCall {
  6645. c := &ProjectsModelsVersionsSetDefaultCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6646. c.name = name
  6647. c.googlecloudmlv1__setdefaultversionrequest = googlecloudmlv1__setdefaultversionrequest
  6648. return c
  6649. }
  6650. // Fields allows partial responses to be retrieved. See
  6651. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6652. // for more information.
  6653. func (c *ProjectsModelsVersionsSetDefaultCall) Fields(s ...googleapi.Field) *ProjectsModelsVersionsSetDefaultCall {
  6654. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6655. return c
  6656. }
  6657. // Context sets the context to be used in this call's Do method. Any
  6658. // pending HTTP request will be aborted if the provided context is
  6659. // canceled.
  6660. func (c *ProjectsModelsVersionsSetDefaultCall) Context(ctx context.Context) *ProjectsModelsVersionsSetDefaultCall {
  6661. c.ctx_ = ctx
  6662. return c
  6663. }
  6664. // Header returns an http.Header that can be modified by the caller to
  6665. // add HTTP headers to the request.
  6666. func (c *ProjectsModelsVersionsSetDefaultCall) Header() http.Header {
  6667. if c.header_ == nil {
  6668. c.header_ = make(http.Header)
  6669. }
  6670. return c.header_
  6671. }
  6672. func (c *ProjectsModelsVersionsSetDefaultCall) doRequest(alt string) (*http.Response, error) {
  6673. reqHeaders := make(http.Header)
  6674. for k, v := range c.header_ {
  6675. reqHeaders[k] = v
  6676. }
  6677. reqHeaders.Set("User-Agent", c.s.userAgent())
  6678. var body io.Reader = nil
  6679. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudmlv1__setdefaultversionrequest)
  6680. if err != nil {
  6681. return nil, err
  6682. }
  6683. reqHeaders.Set("Content-Type", "application/json")
  6684. c.urlParams_.Set("alt", alt)
  6685. c.urlParams_.Set("prettyPrint", "false")
  6686. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:setDefault")
  6687. urls += "?" + c.urlParams_.Encode()
  6688. req, err := http.NewRequest("POST", urls, body)
  6689. if err != nil {
  6690. return nil, err
  6691. }
  6692. req.Header = reqHeaders
  6693. googleapi.Expand(req.URL, map[string]string{
  6694. "name": c.name,
  6695. })
  6696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6697. }
  6698. // Do executes the "ml.projects.models.versions.setDefault" call.
  6699. // Exactly one of *GoogleCloudMlV1__Version or error will be non-nil.
  6700. // Any non-2xx status code is an error. Response headers are in either
  6701. // *GoogleCloudMlV1__Version.ServerResponse.Header or (if a response was
  6702. // returned at all) in error.(*googleapi.Error).Header. Use
  6703. // googleapi.IsNotModified to check whether the returned error was
  6704. // because http.StatusNotModified was returned.
  6705. func (c *ProjectsModelsVersionsSetDefaultCall) Do(opts ...googleapi.CallOption) (*GoogleCloudMlV1__Version, error) {
  6706. gensupport.SetOptions(c.urlParams_, opts...)
  6707. res, err := c.doRequest("json")
  6708. if res != nil && res.StatusCode == http.StatusNotModified {
  6709. if res.Body != nil {
  6710. res.Body.Close()
  6711. }
  6712. return nil, &googleapi.Error{
  6713. Code: res.StatusCode,
  6714. Header: res.Header,
  6715. }
  6716. }
  6717. if err != nil {
  6718. return nil, err
  6719. }
  6720. defer googleapi.CloseBody(res)
  6721. if err := googleapi.CheckResponse(res); err != nil {
  6722. return nil, err
  6723. }
  6724. ret := &GoogleCloudMlV1__Version{
  6725. ServerResponse: googleapi.ServerResponse{
  6726. Header: res.Header,
  6727. HTTPStatusCode: res.StatusCode,
  6728. },
  6729. }
  6730. target := &ret
  6731. if err := gensupport.DecodeResponse(target, res); err != nil {
  6732. return nil, err
  6733. }
  6734. return ret, nil
  6735. // {
  6736. // "description": "Designates a version to be the default for the model.\n\nThe default version is used for prediction requests made against the model\nthat don't specify a version.\n\nThe first version to be created for a model is automatically set as the\ndefault. You must make any subsequent changes to the default version\nsetting manually using this method.",
  6737. // "flatPath": "v1/projects/{projectsId}/models/{modelsId}/versions/{versionsId}:setDefault",
  6738. // "httpMethod": "POST",
  6739. // "id": "ml.projects.models.versions.setDefault",
  6740. // "parameterOrder": [
  6741. // "name"
  6742. // ],
  6743. // "parameters": {
  6744. // "name": {
  6745. // "description": "Required. The name of the version to make the default for the model. You\ncan get the names of all the versions of a model by calling\n[projects.models.versions.list](/ml-engine/reference/rest/v1/projects.models.versions/list).",
  6746. // "location": "path",
  6747. // "pattern": "^projects/[^/]+/models/[^/]+/versions/[^/]+$",
  6748. // "required": true,
  6749. // "type": "string"
  6750. // }
  6751. // },
  6752. // "path": "v1/{+name}:setDefault",
  6753. // "request": {
  6754. // "$ref": "GoogleCloudMlV1__SetDefaultVersionRequest"
  6755. // },
  6756. // "response": {
  6757. // "$ref": "GoogleCloudMlV1__Version"
  6758. // },
  6759. // "scopes": [
  6760. // "https://www.googleapis.com/auth/cloud-platform"
  6761. // ]
  6762. // }
  6763. }
  6764. // method id "ml.projects.operations.cancel":
  6765. type ProjectsOperationsCancelCall struct {
  6766. s *Service
  6767. name string
  6768. urlParams_ gensupport.URLParams
  6769. ctx_ context.Context
  6770. header_ http.Header
  6771. }
  6772. // Cancel: Starts asynchronous cancellation on a long-running operation.
  6773. // The server
  6774. // makes a best effort to cancel the operation, but success is
  6775. // not
  6776. // guaranteed. If the server doesn't support this method, it
  6777. // returns
  6778. // `google.rpc.Code.UNIMPLEMENTED`. Clients can
  6779. // use
  6780. // Operations.GetOperation or
  6781. // other methods to check whether the cancellation succeeded or whether
  6782. // the
  6783. // operation completed despite cancellation. On successful
  6784. // cancellation,
  6785. // the operation is not deleted; instead, it becomes an operation
  6786. // with
  6787. // an Operation.error value with a google.rpc.Status.code of
  6788. // 1,
  6789. // corresponding to `Code.CANCELLED`.
  6790. func (r *ProjectsOperationsService) Cancel(name string) *ProjectsOperationsCancelCall {
  6791. c := &ProjectsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6792. c.name = name
  6793. return c
  6794. }
  6795. // Fields allows partial responses to be retrieved. See
  6796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6797. // for more information.
  6798. func (c *ProjectsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsOperationsCancelCall {
  6799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6800. return c
  6801. }
  6802. // Context sets the context to be used in this call's Do method. Any
  6803. // pending HTTP request will be aborted if the provided context is
  6804. // canceled.
  6805. func (c *ProjectsOperationsCancelCall) Context(ctx context.Context) *ProjectsOperationsCancelCall {
  6806. c.ctx_ = ctx
  6807. return c
  6808. }
  6809. // Header returns an http.Header that can be modified by the caller to
  6810. // add HTTP headers to the request.
  6811. func (c *ProjectsOperationsCancelCall) Header() http.Header {
  6812. if c.header_ == nil {
  6813. c.header_ = make(http.Header)
  6814. }
  6815. return c.header_
  6816. }
  6817. func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  6818. reqHeaders := make(http.Header)
  6819. for k, v := range c.header_ {
  6820. reqHeaders[k] = v
  6821. }
  6822. reqHeaders.Set("User-Agent", c.s.userAgent())
  6823. var body io.Reader = nil
  6824. c.urlParams_.Set("alt", alt)
  6825. c.urlParams_.Set("prettyPrint", "false")
  6826. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  6827. urls += "?" + c.urlParams_.Encode()
  6828. req, err := http.NewRequest("POST", urls, body)
  6829. if err != nil {
  6830. return nil, err
  6831. }
  6832. req.Header = reqHeaders
  6833. googleapi.Expand(req.URL, map[string]string{
  6834. "name": c.name,
  6835. })
  6836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6837. }
  6838. // Do executes the "ml.projects.operations.cancel" call.
  6839. // Exactly one of *GoogleProtobuf__Empty or error will be non-nil. Any
  6840. // non-2xx status code is an error. Response headers are in either
  6841. // *GoogleProtobuf__Empty.ServerResponse.Header or (if a response was
  6842. // returned at all) in error.(*googleapi.Error).Header. Use
  6843. // googleapi.IsNotModified to check whether the returned error was
  6844. // because http.StatusNotModified was returned.
  6845. func (c *ProjectsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobuf__Empty, error) {
  6846. gensupport.SetOptions(c.urlParams_, opts...)
  6847. res, err := c.doRequest("json")
  6848. if res != nil && res.StatusCode == http.StatusNotModified {
  6849. if res.Body != nil {
  6850. res.Body.Close()
  6851. }
  6852. return nil, &googleapi.Error{
  6853. Code: res.StatusCode,
  6854. Header: res.Header,
  6855. }
  6856. }
  6857. if err != nil {
  6858. return nil, err
  6859. }
  6860. defer googleapi.CloseBody(res)
  6861. if err := googleapi.CheckResponse(res); err != nil {
  6862. return nil, err
  6863. }
  6864. ret := &GoogleProtobuf__Empty{
  6865. ServerResponse: googleapi.ServerResponse{
  6866. Header: res.Header,
  6867. HTTPStatusCode: res.StatusCode,
  6868. },
  6869. }
  6870. target := &ret
  6871. if err := gensupport.DecodeResponse(target, res); err != nil {
  6872. return nil, err
  6873. }
  6874. return ret, nil
  6875. // {
  6876. // "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.",
  6877. // "flatPath": "v1/projects/{projectsId}/operations/{operationsId}:cancel",
  6878. // "httpMethod": "POST",
  6879. // "id": "ml.projects.operations.cancel",
  6880. // "parameterOrder": [
  6881. // "name"
  6882. // ],
  6883. // "parameters": {
  6884. // "name": {
  6885. // "description": "The name of the operation resource to be cancelled.",
  6886. // "location": "path",
  6887. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  6888. // "required": true,
  6889. // "type": "string"
  6890. // }
  6891. // },
  6892. // "path": "v1/{+name}:cancel",
  6893. // "response": {
  6894. // "$ref": "GoogleProtobuf__Empty"
  6895. // },
  6896. // "scopes": [
  6897. // "https://www.googleapis.com/auth/cloud-platform"
  6898. // ]
  6899. // }
  6900. }
  6901. // method id "ml.projects.operations.get":
  6902. type ProjectsOperationsGetCall struct {
  6903. s *Service
  6904. name string
  6905. urlParams_ gensupport.URLParams
  6906. ifNoneMatch_ string
  6907. ctx_ context.Context
  6908. header_ http.Header
  6909. }
  6910. // Get: Gets the latest state of a long-running operation. Clients can
  6911. // use this
  6912. // method to poll the operation result at intervals as recommended by
  6913. // the API
  6914. // service.
  6915. func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall {
  6916. c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6917. c.name = name
  6918. return c
  6919. }
  6920. // Fields allows partial responses to be retrieved. See
  6921. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6922. // for more information.
  6923. func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall {
  6924. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6925. return c
  6926. }
  6927. // IfNoneMatch sets the optional parameter which makes the operation
  6928. // fail if the object's ETag matches the given value. This is useful for
  6929. // getting updates only after the object has changed since the last
  6930. // request. Use googleapi.IsNotModified to check whether the response
  6931. // error from Do is the result of In-None-Match.
  6932. func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall {
  6933. c.ifNoneMatch_ = entityTag
  6934. return c
  6935. }
  6936. // Context sets the context to be used in this call's Do method. Any
  6937. // pending HTTP request will be aborted if the provided context is
  6938. // canceled.
  6939. func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall {
  6940. c.ctx_ = ctx
  6941. return c
  6942. }
  6943. // Header returns an http.Header that can be modified by the caller to
  6944. // add HTTP headers to the request.
  6945. func (c *ProjectsOperationsGetCall) Header() http.Header {
  6946. if c.header_ == nil {
  6947. c.header_ = make(http.Header)
  6948. }
  6949. return c.header_
  6950. }
  6951. func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  6952. reqHeaders := make(http.Header)
  6953. for k, v := range c.header_ {
  6954. reqHeaders[k] = v
  6955. }
  6956. reqHeaders.Set("User-Agent", c.s.userAgent())
  6957. if c.ifNoneMatch_ != "" {
  6958. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6959. }
  6960. var body io.Reader = nil
  6961. c.urlParams_.Set("alt", alt)
  6962. c.urlParams_.Set("prettyPrint", "false")
  6963. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6964. urls += "?" + c.urlParams_.Encode()
  6965. req, err := http.NewRequest("GET", urls, body)
  6966. if err != nil {
  6967. return nil, err
  6968. }
  6969. req.Header = reqHeaders
  6970. googleapi.Expand(req.URL, map[string]string{
  6971. "name": c.name,
  6972. })
  6973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6974. }
  6975. // Do executes the "ml.projects.operations.get" call.
  6976. // Exactly one of *GoogleLongrunning__Operation or error will be
  6977. // non-nil. Any non-2xx status code is an error. Response headers are in
  6978. // either *GoogleLongrunning__Operation.ServerResponse.Header or (if a
  6979. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6980. // googleapi.IsNotModified to check whether the returned error was
  6981. // because http.StatusNotModified was returned.
  6982. func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunning__Operation, error) {
  6983. gensupport.SetOptions(c.urlParams_, opts...)
  6984. res, err := c.doRequest("json")
  6985. if res != nil && res.StatusCode == http.StatusNotModified {
  6986. if res.Body != nil {
  6987. res.Body.Close()
  6988. }
  6989. return nil, &googleapi.Error{
  6990. Code: res.StatusCode,
  6991. Header: res.Header,
  6992. }
  6993. }
  6994. if err != nil {
  6995. return nil, err
  6996. }
  6997. defer googleapi.CloseBody(res)
  6998. if err := googleapi.CheckResponse(res); err != nil {
  6999. return nil, err
  7000. }
  7001. ret := &GoogleLongrunning__Operation{
  7002. ServerResponse: googleapi.ServerResponse{
  7003. Header: res.Header,
  7004. HTTPStatusCode: res.StatusCode,
  7005. },
  7006. }
  7007. target := &ret
  7008. if err := gensupport.DecodeResponse(target, res); err != nil {
  7009. return nil, err
  7010. }
  7011. return ret, nil
  7012. // {
  7013. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  7014. // "flatPath": "v1/projects/{projectsId}/operations/{operationsId}",
  7015. // "httpMethod": "GET",
  7016. // "id": "ml.projects.operations.get",
  7017. // "parameterOrder": [
  7018. // "name"
  7019. // ],
  7020. // "parameters": {
  7021. // "name": {
  7022. // "description": "The name of the operation resource.",
  7023. // "location": "path",
  7024. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  7025. // "required": true,
  7026. // "type": "string"
  7027. // }
  7028. // },
  7029. // "path": "v1/{+name}",
  7030. // "response": {
  7031. // "$ref": "GoogleLongrunning__Operation"
  7032. // },
  7033. // "scopes": [
  7034. // "https://www.googleapis.com/auth/cloud-platform"
  7035. // ]
  7036. // }
  7037. }
  7038. // method id "ml.projects.operations.list":
  7039. type ProjectsOperationsListCall struct {
  7040. s *Service
  7041. name string
  7042. urlParams_ gensupport.URLParams
  7043. ifNoneMatch_ string
  7044. ctx_ context.Context
  7045. header_ http.Header
  7046. }
  7047. // List: Lists operations that match the specified filter in the
  7048. // request. If the
  7049. // server doesn't support this method, it returns
  7050. // `UNIMPLEMENTED`.
  7051. //
  7052. // NOTE: the `name` binding allows API services to override the
  7053. // binding
  7054. // to use different resource name schemes, such as `users/*/operations`.
  7055. // To
  7056. // override the binding, API services can add a binding such
  7057. // as
  7058. // "/v1/{name=users/*}/operations" to their service configuration.
  7059. // For backwards compatibility, the default name includes the
  7060. // operations
  7061. // collection id, however overriding users must ensure the name
  7062. // binding
  7063. // is the parent resource, without the operations collection id.
  7064. func (r *ProjectsOperationsService) List(name string) *ProjectsOperationsListCall {
  7065. c := &ProjectsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7066. c.name = name
  7067. return c
  7068. }
  7069. // Filter sets the optional parameter "filter": The standard list
  7070. // filter.
  7071. func (c *ProjectsOperationsListCall) Filter(filter string) *ProjectsOperationsListCall {
  7072. c.urlParams_.Set("filter", filter)
  7073. return c
  7074. }
  7075. // PageSize sets the optional parameter "pageSize": The standard list
  7076. // page size.
  7077. func (c *ProjectsOperationsListCall) PageSize(pageSize int64) *ProjectsOperationsListCall {
  7078. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7079. return c
  7080. }
  7081. // PageToken sets the optional parameter "pageToken": The standard list
  7082. // page token.
  7083. func (c *ProjectsOperationsListCall) PageToken(pageToken string) *ProjectsOperationsListCall {
  7084. c.urlParams_.Set("pageToken", pageToken)
  7085. return c
  7086. }
  7087. // Fields allows partial responses to be retrieved. See
  7088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7089. // for more information.
  7090. func (c *ProjectsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsOperationsListCall {
  7091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7092. return c
  7093. }
  7094. // IfNoneMatch sets the optional parameter which makes the operation
  7095. // fail if the object's ETag matches the given value. This is useful for
  7096. // getting updates only after the object has changed since the last
  7097. // request. Use googleapi.IsNotModified to check whether the response
  7098. // error from Do is the result of In-None-Match.
  7099. func (c *ProjectsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsOperationsListCall {
  7100. c.ifNoneMatch_ = entityTag
  7101. return c
  7102. }
  7103. // Context sets the context to be used in this call's Do method. Any
  7104. // pending HTTP request will be aborted if the provided context is
  7105. // canceled.
  7106. func (c *ProjectsOperationsListCall) Context(ctx context.Context) *ProjectsOperationsListCall {
  7107. c.ctx_ = ctx
  7108. return c
  7109. }
  7110. // Header returns an http.Header that can be modified by the caller to
  7111. // add HTTP headers to the request.
  7112. func (c *ProjectsOperationsListCall) Header() http.Header {
  7113. if c.header_ == nil {
  7114. c.header_ = make(http.Header)
  7115. }
  7116. return c.header_
  7117. }
  7118. func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  7119. reqHeaders := make(http.Header)
  7120. for k, v := range c.header_ {
  7121. reqHeaders[k] = v
  7122. }
  7123. reqHeaders.Set("User-Agent", c.s.userAgent())
  7124. if c.ifNoneMatch_ != "" {
  7125. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7126. }
  7127. var body io.Reader = nil
  7128. c.urlParams_.Set("alt", alt)
  7129. c.urlParams_.Set("prettyPrint", "false")
  7130. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  7131. urls += "?" + c.urlParams_.Encode()
  7132. req, err := http.NewRequest("GET", urls, body)
  7133. if err != nil {
  7134. return nil, err
  7135. }
  7136. req.Header = reqHeaders
  7137. googleapi.Expand(req.URL, map[string]string{
  7138. "name": c.name,
  7139. })
  7140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7141. }
  7142. // Do executes the "ml.projects.operations.list" call.
  7143. // Exactly one of *GoogleLongrunning__ListOperationsResponse or error
  7144. // will be non-nil. Any non-2xx status code is an error. Response
  7145. // headers are in either
  7146. // *GoogleLongrunning__ListOperationsResponse.ServerResponse.Header or
  7147. // (if a response was returned at all) in
  7148. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7149. // whether the returned error was because http.StatusNotModified was
  7150. // returned.
  7151. func (c *ProjectsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunning__ListOperationsResponse, error) {
  7152. gensupport.SetOptions(c.urlParams_, opts...)
  7153. res, err := c.doRequest("json")
  7154. if res != nil && res.StatusCode == http.StatusNotModified {
  7155. if res.Body != nil {
  7156. res.Body.Close()
  7157. }
  7158. return nil, &googleapi.Error{
  7159. Code: res.StatusCode,
  7160. Header: res.Header,
  7161. }
  7162. }
  7163. if err != nil {
  7164. return nil, err
  7165. }
  7166. defer googleapi.CloseBody(res)
  7167. if err := googleapi.CheckResponse(res); err != nil {
  7168. return nil, err
  7169. }
  7170. ret := &GoogleLongrunning__ListOperationsResponse{
  7171. ServerResponse: googleapi.ServerResponse{
  7172. Header: res.Header,
  7173. HTTPStatusCode: res.StatusCode,
  7174. },
  7175. }
  7176. target := &ret
  7177. if err := gensupport.DecodeResponse(target, res); err != nil {
  7178. return nil, err
  7179. }
  7180. return ret, nil
  7181. // {
  7182. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  7183. // "flatPath": "v1/projects/{projectsId}/operations",
  7184. // "httpMethod": "GET",
  7185. // "id": "ml.projects.operations.list",
  7186. // "parameterOrder": [
  7187. // "name"
  7188. // ],
  7189. // "parameters": {
  7190. // "filter": {
  7191. // "description": "The standard list filter.",
  7192. // "location": "query",
  7193. // "type": "string"
  7194. // },
  7195. // "name": {
  7196. // "description": "The name of the operation's parent resource.",
  7197. // "location": "path",
  7198. // "pattern": "^projects/[^/]+$",
  7199. // "required": true,
  7200. // "type": "string"
  7201. // },
  7202. // "pageSize": {
  7203. // "description": "The standard list page size.",
  7204. // "format": "int32",
  7205. // "location": "query",
  7206. // "type": "integer"
  7207. // },
  7208. // "pageToken": {
  7209. // "description": "The standard list page token.",
  7210. // "location": "query",
  7211. // "type": "string"
  7212. // }
  7213. // },
  7214. // "path": "v1/{+name}/operations",
  7215. // "response": {
  7216. // "$ref": "GoogleLongrunning__ListOperationsResponse"
  7217. // },
  7218. // "scopes": [
  7219. // "https://www.googleapis.com/auth/cloud-platform"
  7220. // ]
  7221. // }
  7222. }
  7223. // Pages invokes f for each page of results.
  7224. // A non-nil error returned from f will halt the iteration.
  7225. // The provided context supersedes any context provided to the Context method.
  7226. func (c *ProjectsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunning__ListOperationsResponse) error) error {
  7227. c.ctx_ = ctx
  7228. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7229. for {
  7230. x, err := c.Do()
  7231. if err != nil {
  7232. return err
  7233. }
  7234. if err := f(x); err != nil {
  7235. return err
  7236. }
  7237. if x.NextPageToken == "" {
  7238. return nil
  7239. }
  7240. c.PageToken(x.NextPageToken)
  7241. }
  7242. }