No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

7640 líneas
267 KiB

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