Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

7042 wiersze
247 KiB

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