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