Debian Codegraph @

saasservicemgmt/v1/saasservicemgmt-gen.go

raw
1 // Copyright 2026 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 saasservicemgmt provides access to the App Lifecycle Manager API.
8 //
9 // For product documentation, see: https://cloud.google.com/saas-runtime/docs
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/saasservicemgmt/v1"
27 // ...
28 // ctx := context.Background()
29 // saasservicemgmtService, err := saasservicemgmt.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 // saasservicemgmtService, err := saasservicemgmt.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 // saasservicemgmtService, err := saasservicemgmt.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package saasservicemgmt // import "google.golang.org/api/saasservicemgmt/v1"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "saasservicemgmt:v1"
93 const apiName = "saasservicemgmt"
94 const apiVersion = "v1"
95 const basePath = "https://saasservicemgmt.googleapis.com/"
96 const basePathTemplate = "https://saasservicemgmt.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://saasservicemgmt.mtls.googleapis.com/"
98
99 // OAuth2 scopes used by this API.
100 const (
101 // See, edit, configure, and delete your Google Cloud data and see the email
102 // address for your Google Account.
103 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
104 )
105
106 // NewService creates a new Service.
107 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
108 scopesOption := internaloption.WithDefaultScopes(
109 "https://www.googleapis.com/auth/cloud-platform",
110 )
111 // NOTE: prepend, so we don't override user-specified scopes.
112 opts = append([]option.ClientOption{scopesOption}, opts...)
113 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
114 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
115 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
116 opts = append(opts, internaloption.EnableNewAuthLibrary())
117 client, endpoint, err := htransport.NewClient(ctx, opts...)
118 if err != nil {
119 return nil, err
120 }
121 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
122 s.Projects = NewProjectsService(s)
123 if endpoint != "" {
124 s.BasePath = endpoint
125 }
126 return s, nil
127 }
128
129 // New creates a new Service. It uses the provided http.Client for requests.
130 //
131 // Deprecated: please use NewService instead.
132 // To provide a custom HTTP client, use option.WithHTTPClient.
133 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
134 func New(client *http.Client) (*Service, error) {
135 if client == nil {
136 return nil, errors.New("client is nil")
137 }
138 return NewService(context.TODO(), option.WithHTTPClient(client))
139 }
140
141 type Service struct {
142 client *http.Client
143 logger *slog.Logger
144 BasePath string // API endpoint base URL
145 UserAgent string // optional additional User-Agent fragment
146
147 Projects *ProjectsService
148 }
149
150 func (s *Service) userAgent() string {
151 if s.UserAgent == "" {
152 return googleapi.UserAgent
153 }
154 return googleapi.UserAgent + " " + s.UserAgent
155 }
156
157 func NewProjectsService(s *Service) *ProjectsService {
158 rs := &ProjectsService{s: s}
159 rs.Locations = NewProjectsLocationsService(s)
160 return rs
161 }
162
163 type ProjectsService struct {
164 s *Service
165
166 Locations *ProjectsLocationsService
167 }
168
169 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
170 rs := &ProjectsLocationsService{s: s}
171 rs.Releases = NewProjectsLocationsReleasesService(s)
172 rs.RolloutKinds = NewProjectsLocationsRolloutKindsService(s)
173 rs.Rollouts = NewProjectsLocationsRolloutsService(s)
174 rs.Saas = NewProjectsLocationsSaasService(s)
175 rs.Tenants = NewProjectsLocationsTenantsService(s)
176 rs.UnitKinds = NewProjectsLocationsUnitKindsService(s)
177 rs.UnitOperations = NewProjectsLocationsUnitOperationsService(s)
178 rs.Units = NewProjectsLocationsUnitsService(s)
179 return rs
180 }
181
182 type ProjectsLocationsService struct {
183 s *Service
184
185 Releases *ProjectsLocationsReleasesService
186
187 RolloutKinds *ProjectsLocationsRolloutKindsService
188
189 Rollouts *ProjectsLocationsRolloutsService
190
191 Saas *ProjectsLocationsSaasService
192
193 Tenants *ProjectsLocationsTenantsService
194
195 UnitKinds *ProjectsLocationsUnitKindsService
196
197 UnitOperations *ProjectsLocationsUnitOperationsService
198
199 Units *ProjectsLocationsUnitsService
200 }
201
202 func NewProjectsLocationsReleasesService(s *Service) *ProjectsLocationsReleasesService {
203 rs := &ProjectsLocationsReleasesService{s: s}
204 return rs
205 }
206
207 type ProjectsLocationsReleasesService struct {
208 s *Service
209 }
210
211 func NewProjectsLocationsRolloutKindsService(s *Service) *ProjectsLocationsRolloutKindsService {
212 rs := &ProjectsLocationsRolloutKindsService{s: s}
213 return rs
214 }
215
216 type ProjectsLocationsRolloutKindsService struct {
217 s *Service
218 }
219
220 func NewProjectsLocationsRolloutsService(s *Service) *ProjectsLocationsRolloutsService {
221 rs := &ProjectsLocationsRolloutsService{s: s}
222 return rs
223 }
224
225 type ProjectsLocationsRolloutsService struct {
226 s *Service
227 }
228
229 func NewProjectsLocationsSaasService(s *Service) *ProjectsLocationsSaasService {
230 rs := &ProjectsLocationsSaasService{s: s}
231 return rs
232 }
233
234 type ProjectsLocationsSaasService struct {
235 s *Service
236 }
237
238 func NewProjectsLocationsTenantsService(s *Service) *ProjectsLocationsTenantsService {
239 rs := &ProjectsLocationsTenantsService{s: s}
240 return rs
241 }
242
243 type ProjectsLocationsTenantsService struct {
244 s *Service
245 }
246
247 func NewProjectsLocationsUnitKindsService(s *Service) *ProjectsLocationsUnitKindsService {
248 rs := &ProjectsLocationsUnitKindsService{s: s}
249 return rs
250 }
251
252 type ProjectsLocationsUnitKindsService struct {
253 s *Service
254 }
255
256 func NewProjectsLocationsUnitOperationsService(s *Service) *ProjectsLocationsUnitOperationsService {
257 rs := &ProjectsLocationsUnitOperationsService{s: s}
258 return rs
259 }
260
261 type ProjectsLocationsUnitOperationsService struct {
262 s *Service
263 }
264
265 func NewProjectsLocationsUnitsService(s *Service) *ProjectsLocationsUnitsService {
266 rs := &ProjectsLocationsUnitsService{s: s}
267 return rs
268 }
269
270 type ProjectsLocationsUnitsService struct {
271 s *Service
272 }
273
274 // Aggregate: Represents the aggregation of a set of population of like records
275 // by a certain group. For example, a collection of unit counts can be
276 // aggregated and grouped by their state.
277 type Aggregate struct {
278 // Count: Required. Number of records in the group.
279 Count int64 `json:"count,omitempty"`
280 // Group: Required. Group by which to aggregate.
281 Group string `json:"group,omitempty"`
282 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally
283 // include in API requests. By default, fields with empty or default values are
284 // omitted from API requests. See
285 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
286 // details.
287 ForceSendFields []string `json:"-"`
288 // NullFields is a list of field names (e.g. "Count") to include in API
289 // requests with the JSON null value. By default, fields with empty values are
290 // omitted from API requests. See
291 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
292 NullFields []string `json:"-"`
293 }
294
295 func (s Aggregate) MarshalJSON() ([]byte, error) {
296 type NoMethod Aggregate
297 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
298 }
299
300 // Blueprint: Blueprints are OCI Images that contain all of the artifacts
301 // needed to provision a unit. Metadata such as, type of the engine used to
302 // actuate the blueprint (e.g. terraform, helm etc) and version will come from
303 // the image manifest. If the hostname is omitted, it will be assumed to be the
304 // regional path to Artifact Registry (eg. us-east1-docker.pkg.dev).
305 type Blueprint struct {
306 // Engine: Output only. Type of the engine used to actuate the blueprint. e.g.
307 // terraform, helm etc.
308 Engine string `json:"engine,omitempty"`
309 // Package: Optional. Immutable. URI to a blueprint used by the Unit (required
310 // unless unitKind or release is set).
311 Package string `json:"package,omitempty"`
312 // Version: Output only. Version metadata if present on the blueprint.
313 Version string `json:"version,omitempty"`
314 // ForceSendFields is a list of field names (e.g. "Engine") to unconditionally
315 // include in API requests. By default, fields with empty or default values are
316 // omitted from API requests. See
317 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
318 // details.
319 ForceSendFields []string `json:"-"`
320 // NullFields is a list of field names (e.g. "Engine") to include in API
321 // requests with the JSON null value. By default, fields with empty values are
322 // omitted from API requests. See
323 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
324 NullFields []string `json:"-"`
325 }
326
327 func (s Blueprint) MarshalJSON() ([]byte, error) {
328 type NoMethod Blueprint
329 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
330 }
331
332 // Dependency: Dependency represent a single dependency with another unit kind
333 // by alias.
334 type Dependency struct {
335 // Alias: Required. An alias for the dependency. Used for input variable
336 // mapping.
337 Alias string `json:"alias,omitempty"`
338 // UnitKind: Required. Immutable. The unit kind of the dependency.
339 UnitKind string `json:"unitKind,omitempty"`
340 // ForceSendFields is a list of field names (e.g. "Alias") to unconditionally
341 // include in API requests. By default, fields with empty or default values are
342 // omitted from API requests. See
343 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
344 // details.
345 ForceSendFields []string `json:"-"`
346 // NullFields is a list of field names (e.g. "Alias") to include in API
347 // requests with the JSON null value. By default, fields with empty values are
348 // omitted from API requests. See
349 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
350 NullFields []string `json:"-"`
351 }
352
353 func (s Dependency) MarshalJSON() ([]byte, error) {
354 type NoMethod Dependency
355 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
356 }
357
358 // Deprovision: Deprovision is the unit operation that deprovision the
359 // underlying resources represented by a Unit. Can only execute if the Unit is
360 // currently provisioned.
361 type Deprovision struct {
362 }
363
364 // Empty: A generic empty message that you can re-use to avoid defining
365 // duplicated empty messages in your APIs. A typical example is to use it as
366 // the request or the response type of an API method. For instance: service Foo
367 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
368 type Empty struct {
369 // ServerResponse contains the HTTP response code and headers from the server.
370 googleapi.ServerResponse `json:"-"`
371 }
372
373 // ErrorBudget: The configuration for error budget. If the number of failed
374 // units exceeds max(allowed_count, allowed_ratio * total_units), the rollout
375 // will be paused.
376 type ErrorBudget struct {
377 // AllowedCount: Optional. The maximum number of failed units allowed in a
378 // location without pausing the rollout.
379 AllowedCount int64 `json:"allowedCount,omitempty"`
380 // AllowedPercentage: Optional. The maximum percentage of units allowed to fail
381 // (0, 100] within a location without pausing the rollout.
382 AllowedPercentage int64 `json:"allowedPercentage,omitempty"`
383 // ForceSendFields is a list of field names (e.g. "AllowedCount") to
384 // unconditionally include in API requests. By default, fields with empty or
385 // default values are omitted from API requests. See
386 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
387 // details.
388 ForceSendFields []string `json:"-"`
389 // NullFields is a list of field names (e.g. "AllowedCount") to include in API
390 // requests with the JSON null value. By default, fields with empty values are
391 // omitted from API requests. See
392 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
393 NullFields []string `json:"-"`
394 }
395
396 func (s ErrorBudget) MarshalJSON() ([]byte, error) {
397 type NoMethod ErrorBudget
398 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
399 }
400
401 // FlagUpdate: FlagUpdate is a UnitOperation that pushes new flag values to
402 // Units.
403 type FlagUpdate struct {
404 // FlagRelease: Required. Flag release being applied by UnitOperation.
405 FlagRelease string `json:"flagRelease,omitempty"`
406 // ForceSendFields is a list of field names (e.g. "FlagRelease") to
407 // unconditionally include in API requests. By default, fields with empty or
408 // default values are omitted from API requests. See
409 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
410 // details.
411 ForceSendFields []string `json:"-"`
412 // NullFields is a list of field names (e.g. "FlagRelease") to include in API
413 // requests with the JSON null value. By default, fields with empty values are
414 // omitted from API requests. See
415 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
416 NullFields []string `json:"-"`
417 }
418
419 func (s FlagUpdate) MarshalJSON() ([]byte, error) {
420 type NoMethod FlagUpdate
421 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
422 }
423
424 // FromMapping: Output variables whose values will be passed on to dependencies
425 type FromMapping struct {
426 // Dependency: Required. Alias of the dependency that the outputVariable will
427 // pass its value to
428 Dependency string `json:"dependency,omitempty"`
429 // OutputVariable: Required. Name of the outputVariable on the dependency
430 OutputVariable string `json:"outputVariable,omitempty"`
431 // ForceSendFields is a list of field names (e.g. "Dependency") to
432 // unconditionally include in API requests. By default, fields with empty or
433 // default values are omitted from API requests. See
434 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
435 // details.
436 ForceSendFields []string `json:"-"`
437 // NullFields is a list of field names (e.g. "Dependency") to include in API
438 // requests with the JSON null value. By default, fields with empty values are
439 // omitted from API requests. See
440 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
441 NullFields []string `json:"-"`
442 }
443
444 func (s FromMapping) MarshalJSON() ([]byte, error) {
445 type NoMethod FromMapping
446 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
447 }
448
449 // GoogleCloudLocationLocation: A resource that represents a Google Cloud
450 // location.
451 type GoogleCloudLocationLocation struct {
452 // DisplayName: The friendly name for this location, typically a nearby city
453 // name. For example, "Tokyo".
454 DisplayName string `json:"displayName,omitempty"`
455 // Labels: Cross-service attributes for the location. For example
456 // {"cloud.googleapis.com/region": "us-east1"}
457 Labels map[string]string `json:"labels,omitempty"`
458 // LocationId: The canonical id for this location. For example: "us-east1".
459 LocationId string `json:"locationId,omitempty"`
460 // Metadata: Service-specific metadata. For example the available capacity at
461 // the given location.
462 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
463 // Name: Resource name for the location, which may vary between
464 // implementations. For example:
465 // "projects/example-project/locations/us-east1"
466 Name string `json:"name,omitempty"`
467
468 // ServerResponse contains the HTTP response code and headers from the server.
469 googleapi.ServerResponse `json:"-"`
470 // ForceSendFields is a list of field names (e.g. "DisplayName") to
471 // unconditionally include in API requests. By default, fields with empty or
472 // default values are omitted from API requests. See
473 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
474 // details.
475 ForceSendFields []string `json:"-"`
476 // NullFields is a list of field names (e.g. "DisplayName") to include in API
477 // requests with the JSON null value. By default, fields with empty values are
478 // omitted from API requests. See
479 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
480 NullFields []string `json:"-"`
481 }
482
483 func (s GoogleCloudLocationLocation) MarshalJSON() ([]byte, error) {
484 type NoMethod GoogleCloudLocationLocation
485 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
486 }
487
488 // ListLocationsResponse: The response message for Locations.ListLocations.
489 type ListLocationsResponse struct {
490 // Locations: A list of locations that matches the specified filter in the
491 // request.
492 Locations []*GoogleCloudLocationLocation `json:"locations,omitempty"`
493 // NextPageToken: The standard List next-page token.
494 NextPageToken string `json:"nextPageToken,omitempty"`
495
496 // ServerResponse contains the HTTP response code and headers from the server.
497 googleapi.ServerResponse `json:"-"`
498 // ForceSendFields is a list of field names (e.g. "Locations") to
499 // unconditionally include in API requests. By default, fields with empty or
500 // default values are omitted from API requests. See
501 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
502 // details.
503 ForceSendFields []string `json:"-"`
504 // NullFields is a list of field names (e.g. "Locations") to include in API
505 // requests with the JSON null value. By default, fields with empty values are
506 // omitted from API requests. See
507 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
508 NullFields []string `json:"-"`
509 }
510
511 func (s ListLocationsResponse) MarshalJSON() ([]byte, error) {
512 type NoMethod ListLocationsResponse
513 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
514 }
515
516 // ListReleasesResponse: The response structure for the ListReleases method.
517 type ListReleasesResponse struct {
518 // NextPageToken: If present, the next page token can be provided to a
519 // subsequent ListReleases call to list the next page. If empty, there are no
520 // more pages.
521 NextPageToken string `json:"nextPageToken,omitempty"`
522 // Releases: The resulting releases.
523 Releases []*Release `json:"releases,omitempty"`
524 // Unreachable: Locations that could not be reached.
525 Unreachable []string `json:"unreachable,omitempty"`
526
527 // ServerResponse contains the HTTP response code and headers from the server.
528 googleapi.ServerResponse `json:"-"`
529 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
530 // unconditionally include in API requests. By default, fields with empty or
531 // default values are omitted from API requests. See
532 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
533 // details.
534 ForceSendFields []string `json:"-"`
535 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
536 // requests with the JSON null value. By default, fields with empty values are
537 // omitted from API requests. See
538 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
539 NullFields []string `json:"-"`
540 }
541
542 func (s ListReleasesResponse) MarshalJSON() ([]byte, error) {
543 type NoMethod ListReleasesResponse
544 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
545 }
546
547 // ListRolloutKindsResponse: The response structure for the ListRolloutKinds
548 // method.
549 type ListRolloutKindsResponse struct {
550 // NextPageToken: If present, the next page token can be provided to a
551 // subsequent ListRolloutKinds call to list the next page. If empty, there are
552 // no more pages.
553 NextPageToken string `json:"nextPageToken,omitempty"`
554 // RolloutKinds: The resulting rollout kinds.
555 RolloutKinds []*RolloutKind `json:"rolloutKinds,omitempty"`
556 // Unreachable: Locations that could not be reached.
557 Unreachable []string `json:"unreachable,omitempty"`
558
559 // ServerResponse contains the HTTP response code and headers from the server.
560 googleapi.ServerResponse `json:"-"`
561 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
562 // unconditionally include in API requests. By default, fields with empty or
563 // default values are omitted from API requests. See
564 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
565 // details.
566 ForceSendFields []string `json:"-"`
567 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
568 // requests with the JSON null value. By default, fields with empty values are
569 // omitted from API requests. See
570 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
571 NullFields []string `json:"-"`
572 }
573
574 func (s ListRolloutKindsResponse) MarshalJSON() ([]byte, error) {
575 type NoMethod ListRolloutKindsResponse
576 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
577 }
578
579 // ListRolloutsResponse: The response structure for the ListRollouts method.
580 type ListRolloutsResponse struct {
581 // NextPageToken: If present, the next page token can be provided to a
582 // subsequent ListRollouts call to list the next page. If empty, there are no
583 // more pages.
584 NextPageToken string `json:"nextPageToken,omitempty"`
585 // Rollouts: The resulting rollouts.
586 Rollouts []*Rollout `json:"rollouts,omitempty"`
587 // Unreachable: Locations that could not be reached.
588 Unreachable []string `json:"unreachable,omitempty"`
589
590 // ServerResponse contains the HTTP response code and headers from the server.
591 googleapi.ServerResponse `json:"-"`
592 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
593 // unconditionally include in API requests. By default, fields with empty or
594 // default values are omitted from API requests. See
595 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
596 // details.
597 ForceSendFields []string `json:"-"`
598 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
599 // requests with the JSON null value. By default, fields with empty values are
600 // omitted from API requests. See
601 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
602 NullFields []string `json:"-"`
603 }
604
605 func (s ListRolloutsResponse) MarshalJSON() ([]byte, error) {
606 type NoMethod ListRolloutsResponse
607 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
608 }
609
610 // ListSaasResponse: The response structure for the ListSaas method.
611 type ListSaasResponse struct {
612 // NextPageToken: If present, the next page token can be provided to a
613 // subsequent ListSaas call to list the next page. If empty, there are no more
614 // pages.
615 NextPageToken string `json:"nextPageToken,omitempty"`
616 // Saas: The resulting saas.
617 Saas []*Saas `json:"saas,omitempty"`
618 // Unreachable: Locations that could not be reached.
619 Unreachable []string `json:"unreachable,omitempty"`
620
621 // ServerResponse contains the HTTP response code and headers from the server.
622 googleapi.ServerResponse `json:"-"`
623 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
624 // unconditionally include in API requests. By default, fields with empty or
625 // default values are omitted from API requests. See
626 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
627 // details.
628 ForceSendFields []string `json:"-"`
629 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
630 // requests with the JSON null value. By default, fields with empty values are
631 // omitted from API requests. See
632 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
633 NullFields []string `json:"-"`
634 }
635
636 func (s ListSaasResponse) MarshalJSON() ([]byte, error) {
637 type NoMethod ListSaasResponse
638 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
639 }
640
641 // ListTenantsResponse: The response structure for the ListTenants method.
642 type ListTenantsResponse struct {
643 // NextPageToken: If present, the next page token can be provided to a
644 // subsequent ListTenants call to list the next page. If empty, there are no
645 // more pages.
646 NextPageToken string `json:"nextPageToken,omitempty"`
647 // Tenants: The resulting tenants.
648 Tenants []*Tenant `json:"tenants,omitempty"`
649 // Unreachable: Locations that could not be reached.
650 Unreachable []string `json:"unreachable,omitempty"`
651
652 // ServerResponse contains the HTTP response code and headers from the server.
653 googleapi.ServerResponse `json:"-"`
654 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
655 // unconditionally include in API requests. By default, fields with empty or
656 // default values are omitted from API requests. See
657 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
658 // details.
659 ForceSendFields []string `json:"-"`
660 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
661 // requests with the JSON null value. By default, fields with empty values are
662 // omitted from API requests. See
663 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
664 NullFields []string `json:"-"`
665 }
666
667 func (s ListTenantsResponse) MarshalJSON() ([]byte, error) {
668 type NoMethod ListTenantsResponse
669 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
670 }
671
672 // ListUnitKindsResponse: The response structure for the ListUnitKinds method.
673 type ListUnitKindsResponse struct {
674 // NextPageToken: If present, the next page token can be provided to a
675 // subsequent ListUnitKinds call to list the next page. If empty, there are no
676 // more pages.
677 NextPageToken string `json:"nextPageToken,omitempty"`
678 // UnitKinds: The resulting unit kinds.
679 UnitKinds []*UnitKind `json:"unitKinds,omitempty"`
680 // Unreachable: Locations that could not be reached.
681 Unreachable []string `json:"unreachable,omitempty"`
682
683 // ServerResponse contains the HTTP response code and headers from the server.
684 googleapi.ServerResponse `json:"-"`
685 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
686 // unconditionally include in API requests. By default, fields with empty or
687 // default values are omitted from API requests. See
688 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
689 // details.
690 ForceSendFields []string `json:"-"`
691 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
692 // requests with the JSON null value. By default, fields with empty values are
693 // omitted from API requests. See
694 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
695 NullFields []string `json:"-"`
696 }
697
698 func (s ListUnitKindsResponse) MarshalJSON() ([]byte, error) {
699 type NoMethod ListUnitKindsResponse
700 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
701 }
702
703 // ListUnitOperationsResponse: The response structure for the
704 // ListUnitOperations method.
705 type ListUnitOperationsResponse struct {
706 // NextPageToken: If present, the next page token can be provided to a
707 // subsequent ListUnitOperations call to list the next page. If empty, there
708 // are no more pages.
709 NextPageToken string `json:"nextPageToken,omitempty"`
710 // UnitOperations: The resulting unit operations.
711 UnitOperations []*UnitOperation `json:"unitOperations,omitempty"`
712 // Unreachable: Locations that could not be reached.
713 Unreachable []string `json:"unreachable,omitempty"`
714
715 // ServerResponse contains the HTTP response code and headers from the server.
716 googleapi.ServerResponse `json:"-"`
717 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
718 // unconditionally include in API requests. By default, fields with empty or
719 // default values are omitted from API requests. See
720 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
721 // details.
722 ForceSendFields []string `json:"-"`
723 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
724 // requests with the JSON null value. By default, fields with empty values are
725 // omitted from API requests. See
726 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
727 NullFields []string `json:"-"`
728 }
729
730 func (s ListUnitOperationsResponse) MarshalJSON() ([]byte, error) {
731 type NoMethod ListUnitOperationsResponse
732 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
733 }
734
735 // ListUnitsResponse: The response structure for the ListUnits method.
736 type ListUnitsResponse struct {
737 // NextPageToken: If present, the next page token can be provided to a
738 // subsequent ListUnits call to list the next page. If empty, there are no more
739 // pages.
740 NextPageToken string `json:"nextPageToken,omitempty"`
741 // Units: The resulting units.
742 Units []*Unit `json:"units,omitempty"`
743 // Unreachable: Locations that could not be reached.
744 Unreachable []string `json:"unreachable,omitempty"`
745
746 // ServerResponse contains the HTTP response code and headers from the server.
747 googleapi.ServerResponse `json:"-"`
748 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
749 // unconditionally include in API requests. By default, fields with empty or
750 // default values are omitted from API requests. See
751 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
752 // details.
753 ForceSendFields []string `json:"-"`
754 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
755 // requests with the JSON null value. By default, fields with empty values are
756 // omitted from API requests. See
757 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
758 NullFields []string `json:"-"`
759 }
760
761 func (s ListUnitsResponse) MarshalJSON() ([]byte, error) {
762 type NoMethod ListUnitsResponse
763 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
764 }
765
766 // Location: Location information that the service is available in.
767 type Location struct {
768 // Name: Optional. Name of location.
769 Name string `json:"name,omitempty"`
770 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
771 // include in API requests. By default, fields with empty or default values are
772 // omitted from API requests. See
773 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
774 // details.
775 ForceSendFields []string `json:"-"`
776 // NullFields is a list of field names (e.g. "Name") to include in API requests
777 // with the JSON null value. By default, fields with empty values are omitted
778 // from API requests. See
779 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
780 NullFields []string `json:"-"`
781 }
782
783 func (s Location) MarshalJSON() ([]byte, error) {
784 type NoMethod Location
785 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
786 }
787
788 // MaintenanceSettings: Captures requested directives for performing future
789 // maintenance on the unit. This includes a request for the unit to skip
790 // maintenance for a period of time and remain pinned to its current release as
791 // well as controls for postponing maintenance scheduled in future.
792 type MaintenanceSettings struct {
793 // PinnedUntilTime: Optional. If present, it fixes the release on the unit
794 // until the given time; i.e. changes to the release field will be rejected.
795 // Rollouts should and will also respect this by not requesting an upgrade in
796 // the first place.
797 PinnedUntilTime string `json:"pinnedUntilTime,omitempty"`
798 // ForceSendFields is a list of field names (e.g. "PinnedUntilTime") to
799 // unconditionally include in API requests. By default, fields with empty or
800 // default values are omitted from API requests. See
801 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
802 // details.
803 ForceSendFields []string `json:"-"`
804 // NullFields is a list of field names (e.g. "PinnedUntilTime") to include in
805 // API requests with the JSON null value. By default, fields with empty values
806 // are omitted from API requests. See
807 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
808 NullFields []string `json:"-"`
809 }
810
811 func (s MaintenanceSettings) MarshalJSON() ([]byte, error) {
812 type NoMethod MaintenanceSettings
813 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
814 }
815
816 // Provision: Provision is the unit operation that provision the underlying
817 // resources represented by a Unit. Can only execute if the Unit is not
818 // currently provisioned.
819 type Provision struct {
820 // InputVariables: Optional. Set of input variables. Maximum 100. (optional)
821 InputVariables []*UnitVariable `json:"inputVariables,omitempty"`
822 // Release: Optional. Reference to the Release object to use for the Unit.
823 // (optional).
824 Release string `json:"release,omitempty"`
825 // ForceSendFields is a list of field names (e.g. "InputVariables") to
826 // unconditionally include in API requests. By default, fields with empty or
827 // default values are omitted from API requests. See
828 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
829 // details.
830 ForceSendFields []string `json:"-"`
831 // NullFields is a list of field names (e.g. "InputVariables") to include in
832 // API requests with the JSON null value. By default, fields with empty values
833 // are omitted from API requests. See
834 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
835 NullFields []string `json:"-"`
836 }
837
838 func (s Provision) MarshalJSON() ([]byte, error) {
839 type NoMethod Provision
840 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
841 }
842
843 // Release: A new version to be propagated and deployed to units. This includes
844 // pointers to packaged blueprints for actuation (e.g Helm or Terraform
845 // configuration packages) via artifact registry.
846 type Release struct {
847 // Annotations: Optional. Annotations is an unstructured key-value map stored
848 // with a resource that may be set by external tools to store and retrieve
849 // arbitrary metadata. They are not queryable and should be preserved when
850 // modifying objects. More info:
851 // https://kubernetes.io/docs/user-guide/annotations
852 Annotations map[string]string `json:"annotations,omitempty"`
853 // Blueprint: Optional. Blueprints are OCI Images that contain all of the
854 // artifacts needed to provision a unit.
855 Blueprint *Blueprint `json:"blueprint,omitempty"`
856 // CreateTime: Output only. The timestamp when the resource was created.
857 CreateTime string `json:"createTime,omitempty"`
858 // Etag: Output only. An opaque value that uniquely identifies a version or
859 // generation of a resource. It can be used to confirm that the client and
860 // server agree on the ordering of a resource being written.
861 Etag string `json:"etag,omitempty"`
862 // InputVariableDefaults: Optional. Mapping of input variables to default
863 // values. Maximum 100
864 InputVariableDefaults []*UnitVariable `json:"inputVariableDefaults,omitempty"`
865 // InputVariables: Optional. Output only. List of input variables declared on
866 // the blueprint and can be present with their values on the unit spec
867 InputVariables []*UnitVariable `json:"inputVariables,omitempty"`
868 // Labels: Optional. The labels on the resource, which can be used for
869 // categorization. similar to Kubernetes resource labels.
870 Labels map[string]string `json:"labels,omitempty"`
871 // Name: Identifier. The resource name (full URI of the resource) following the
872 // standard naming scheme:
873 // "projects/{project}/locations/{location}/releases/{release}"
874 Name string `json:"name,omitempty"`
875 // OutputVariables: Optional. Output only. List of output variables declared on
876 // the blueprint and can be present with their values on the unit status
877 OutputVariables []*UnitVariable `json:"outputVariables,omitempty"`
878 // ReleaseRequirements: Optional. Set of requirements to be fulfilled on the
879 // Unit when using this Release.
880 ReleaseRequirements *ReleaseRequirements `json:"releaseRequirements,omitempty"`
881 // Uid: Output only. The unique identifier of the resource. UID is unique in
882 // the time and space for this resource within the scope of the service. It is
883 // typically generated by the server on successful creation of a resource and
884 // must not be changed. UID is used to uniquely identify resources with
885 // resource name reuses. This should be a UUID4.
886 Uid string `json:"uid,omitempty"`
887 // UnitKind: Required. Immutable. Reference to the UnitKind this Release
888 // corresponds to (required and immutable once created).
889 UnitKind string `json:"unitKind,omitempty"`
890 // UpdateTime: Output only. The timestamp when the resource was last updated.
891 // Any change to the resource made by users must refresh this value. Changes to
892 // a resource made by the service should refresh this value.
893 UpdateTime string `json:"updateTime,omitempty"`
894
895 // ServerResponse contains the HTTP response code and headers from the server.
896 googleapi.ServerResponse `json:"-"`
897 // ForceSendFields is a list of field names (e.g. "Annotations") to
898 // unconditionally include in API requests. By default, fields with empty or
899 // default values are omitted from API requests. See
900 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
901 // details.
902 ForceSendFields []string `json:"-"`
903 // NullFields is a list of field names (e.g. "Annotations") to include in API
904 // requests with the JSON null value. By default, fields with empty values are
905 // omitted from API requests. See
906 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
907 NullFields []string `json:"-"`
908 }
909
910 func (s Release) MarshalJSON() ([]byte, error) {
911 type NoMethod Release
912 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
913 }
914
915 // ReleaseRequirements: Set of requirements to be fulfilled on the Unit when
916 // using this Release.
917 type ReleaseRequirements struct {
918 // UpgradeableFromReleases: Optional. A list of releases from which a unit can
919 // be upgraded to this one (optional). If left empty no constraints will be
920 // applied. When provided, unit upgrade requests to this release will check and
921 // enforce this constraint.
922 UpgradeableFromReleases []string `json:"upgradeableFromReleases,omitempty"`
923 // ForceSendFields is a list of field names (e.g. "UpgradeableFromReleases") to
924 // unconditionally include in API requests. By default, fields with empty or
925 // default values are omitted from API requests. See
926 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
927 // details.
928 ForceSendFields []string `json:"-"`
929 // NullFields is a list of field names (e.g. "UpgradeableFromReleases") to
930 // include in API requests with the JSON null value. By default, fields with
931 // empty values are omitted from API requests. See
932 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
933 NullFields []string `json:"-"`
934 }
935
936 func (s ReleaseRequirements) MarshalJSON() ([]byte, error) {
937 type NoMethod ReleaseRequirements
938 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
939 }
940
941 // Rollout: Represents a single rollout execution and its results
942 type Rollout struct {
943 // Annotations: Optional. Annotations is an unstructured key-value map stored
944 // with a resource that may be set by external tools to store and retrieve
945 // arbitrary metadata. They are not queryable and should be preserved when
946 // modifying objects. More info:
947 // https://kubernetes.io/docs/user-guide/annotations
948 Annotations map[string]string `json:"annotations,omitempty"`
949 // Control: Optional. Requested change to the execution of this rollout.
950 // Default RolloutControl.action is ROLLOUT_ACTION_RUN meaning the rollout will
951 // be executed to completion while progressing through all natural Rollout
952 // States (such as RUNNING -> SUCCEEDED or RUNNING -> FAILED). Requests can
953 // only be made when the Rollout is in a non-terminal state.
954 Control *RolloutControl `json:"control,omitempty"`
955 // CreateTime: Output only. The timestamp when the resource was created.
956 CreateTime string `json:"createTime,omitempty"`
957 // DeleteTime: Output only. The timestamp when the resource was marked for
958 // deletion (deletion is an asynchronous operation).
959 DeleteTime string `json:"deleteTime,omitempty"`
960 // EffectiveUnitFilter: Optional. Output only. Output only snapshot of the
961 // effective unit filter at Rollout start time. Contains a
962 // CEL(https://github.com/google/cel-spec) expression consisting of a
963 // conjunction of Rollout.unit_filter and RolloutKind.unit_filter. This field
964 // captures the filter applied by the Rollout to determine the Unit population.
965 // If the associated RolloutKind's unit_filter is modified after the rollout is
966 // started, it will not be updated here.
967 EffectiveUnitFilter string `json:"effectiveUnitFilter,omitempty"`
968 // EndTime: Optional. Output only. The time when the rollout finished execution
969 // (regardless of success, failure, or cancellation). Will be empty if the
970 // rollout hasn't finished yet. Once set, the rollout is in terminal state and
971 // all the results are final.
972 EndTime string `json:"endTime,omitempty"`
973 // Etag: Output only. An opaque value that uniquely identifies a version or
974 // generation of a resource. It can be used to confirm that the client and
975 // server agree on the ordering of a resource being written.
976 Etag string `json:"etag,omitempty"`
977 // FlagRelease: Optional. Immutable. Name of the FlagRelease to be rolled out
978 // to the target Units. Release and FlagRelease are mutually exclusive. Note:
979 // `release` comment needs to be adjusted to mention that "Release and
980 // FlagRelease are mutually exclusive" when visibility restriction will be
981 // lifted.
982 FlagRelease string `json:"flagRelease,omitempty"`
983 // Labels: Optional. The labels on the resource, which can be used for
984 // categorization. similar to Kubernetes resource labels.
985 Labels map[string]string `json:"labels,omitempty"`
986 // Name: Identifier. The resource name (full URI of the resource) following the
987 // standard naming scheme:
988 // "projects/{project}/locations/{location}/rollout/{rollout_id}"
989 Name string `json:"name,omitempty"`
990 // ParentRollout: Optional. Output only. The direct parent rollout that this
991 // rollout is stemming from. The resource name (full URI of the resource)
992 // following the standard naming scheme:
993 // "projects/{project}/locations/{location}/rollouts/{rollout_id}"
994 ParentRollout string `json:"parentRollout,omitempty"`
995 // Release: Optional. Immutable. Name of the Release that gets rolled out to
996 // target Units. Required if no other type of release is specified.
997 Release string `json:"release,omitempty"`
998 // RolloutKind: Required. Immutable. Name of the RolloutKind this rollout is
999 // stemming from and adhering to.
1000 RolloutKind string `json:"rolloutKind,omitempty"`
1001 // RolloutOrchestrationStrategy: Optional. The strategy used for executing this
1002 // Rollout. This strategy will override whatever strategy is specified in the
1003 // RolloutKind. If not specified on creation, the strategy from RolloutKind
1004 // will be used. There are two supported values strategies which are used to
1005 // control - "Google.Cloud.Simple.AllAtOnce" -
1006 // "Google.Cloud.Simple.OneLocationAtATime" A rollout with one of these simple
1007 // strategies will rollout across all locations defined in the targeted
1008 // UnitKind's Saas Locations.
1009 RolloutOrchestrationStrategy string `json:"rolloutOrchestrationStrategy,omitempty"`
1010 // RootRollout: Optional. Output only. The root rollout that this rollout is
1011 // stemming from. The resource name (full URI of the resource) following the
1012 // standard naming scheme:
1013 // "projects/{project}/locations/{location}/rollouts/{rollout_id}"
1014 RootRollout string `json:"rootRollout,omitempty"`
1015 // StartTime: Optional. Output only. The time when the rollout started
1016 // executing. Will be empty if the rollout hasn't started yet.
1017 StartTime string `json:"startTime,omitempty"`
1018 // State: Output only. Current state of the rollout.
1019 //
1020 // Possible values:
1021 // "ROLLOUT_STATE_UNSPECIFIED" - Unspecified state.
1022 // "ROLLOUT_STATE_RUNNING" - Rollout is in progress.
1023 // "ROLLOUT_STATE_PAUSED" - Rollout has been paused.
1024 // "ROLLOUT_STATE_SUCCEEDED" - Rollout completed successfully.
1025 // "ROLLOUT_STATE_FAILED" - Rollout has failed.
1026 // "ROLLOUT_STATE_CANCELLED" - Rollout has been canceled.
1027 // "ROLLOUT_STATE_WAITING" - Rollout is waiting for some condition to be met
1028 // before starting.
1029 // "ROLLOUT_STATE_CANCELLING" - Rollout is being canceled.
1030 // "ROLLOUT_STATE_RESUMING" - Rollout is being resumed.
1031 // "ROLLOUT_STATE_PAUSING" - Rollout is being paused.
1032 State string `json:"state,omitempty"`
1033 // StateMessage: Output only. Human readable message indicating details about
1034 // the last state transition.
1035 StateMessage string `json:"stateMessage,omitempty"`
1036 // StateTransitionTime: Optional. Output only. The time when the rollout
1037 // transitioned into its current state.
1038 StateTransitionTime string `json:"stateTransitionTime,omitempty"`
1039 // Stats: Optional. Output only. Details about the progress of the rollout.
1040 Stats *RolloutStats `json:"stats,omitempty"`
1041 // Uid: Output only. The unique identifier of the resource. UID is unique in
1042 // the time and space for this resource within the scope of the service. It is
1043 // typically generated by the server on successful creation of a resource and
1044 // must not be changed. UID is used to uniquely identify resources with
1045 // resource name reuses. This should be a UUID4.
1046 Uid string `json:"uid,omitempty"`
1047 // UnitFilter: Optional. CEL(https://github.com/google/cel-spec) formatted
1048 // filter string against Unit. The filter will be applied to determine the
1049 // eligible unit population. This filter can only reduce, but not expand the
1050 // scope of the rollout. If not provided, the unit_filter from the RolloutKind
1051 // will be used.
1052 UnitFilter string `json:"unitFilter,omitempty"`
1053 // UpdateTime: Output only. The timestamp when the resource was last updated.
1054 // Any change to the resource made by users must refresh this value. Changes to
1055 // a resource made by the service should refresh this value.
1056 UpdateTime string `json:"updateTime,omitempty"`
1057
1058 // ServerResponse contains the HTTP response code and headers from the server.
1059 googleapi.ServerResponse `json:"-"`
1060 // ForceSendFields is a list of field names (e.g. "Annotations") to
1061 // unconditionally include in API requests. By default, fields with empty or
1062 // default values are omitted from API requests. See
1063 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1064 // details.
1065 ForceSendFields []string `json:"-"`
1066 // NullFields is a list of field names (e.g. "Annotations") to include in API
1067 // requests with the JSON null value. By default, fields with empty values are
1068 // omitted from API requests. See
1069 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1070 NullFields []string `json:"-"`
1071 }
1072
1073 func (s Rollout) MarshalJSON() ([]byte, error) {
1074 type NoMethod Rollout
1075 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1076 }
1077
1078 // RolloutControl: RolloutControl provides a way to request a change to the
1079 // execution of a Rollout by pausing or canceling it.
1080 type RolloutControl struct {
1081 // Action: Required. Action to be performed on the Rollout. The default
1082 // behavior is to run the rollout until it naturally reaches a terminal state.
1083 //
1084 // Possible values:
1085 // "ROLLOUT_ACTION_UNSPECIFIED" - Unspecified action, will be treated as RUN
1086 // by default.
1087 // "ROLLOUT_ACTION_RUN" - Run the Rollout until it naturally reaches a
1088 // terminal state. A rollout requested to run will progress through all natural
1089 // Rollout States (such as RUNNING -> SUCCEEDED or RUNNING -> FAILED). If
1090 // retriable errors are encountered during the rollout, the rollout will paused
1091 // by default and can be resumed by re-requesting this RUN action.
1092 // "ROLLOUT_ACTION_PAUSE" - Pause the Rollout until it is resumed (i.e. RUN
1093 // is requested).
1094 // "ROLLOUT_ACTION_CANCEL" - Cancel the Rollout permanently.
1095 Action string `json:"action,omitempty"`
1096 // RunParams: Optional. Parameters for the RUN action. It is an error to
1097 // specify this if the RolloutAction is not set to RUN. By default, the rollout
1098 // will retry failed operations when resumed.
1099 RunParams *RunRolloutActionParams `json:"runParams,omitempty"`
1100 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
1101 // include in API requests. By default, fields with empty or default values are
1102 // omitted from API requests. See
1103 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1104 // details.
1105 ForceSendFields []string `json:"-"`
1106 // NullFields is a list of field names (e.g. "Action") to include in API
1107 // requests with the JSON null value. By default, fields with empty values are
1108 // omitted from API requests. See
1109 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1110 NullFields []string `json:"-"`
1111 }
1112
1113 func (s RolloutControl) MarshalJSON() ([]byte, error) {
1114 type NoMethod RolloutControl
1115 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1116 }
1117
1118 // RolloutKind: An object that describes various settings of Rollout execution.
1119 // Includes built-in policies across GCP and GDC, and customizable policies.
1120 type RolloutKind struct {
1121 // Annotations: Optional. Annotations is an unstructured key-value map stored
1122 // with a resource that may be set by external tools to store and retrieve
1123 // arbitrary metadata. They are not queryable and should be preserved when
1124 // modifying objects. More info:
1125 // https://kubernetes.io/docs/user-guide/annotations
1126 Annotations map[string]string `json:"annotations,omitempty"`
1127 // CreateTime: Output only. The timestamp when the resource was created.
1128 CreateTime string `json:"createTime,omitempty"`
1129 // ErrorBudget: Optional. The configuration for error budget. If the number of
1130 // failed units exceeds max(allowed_count, allowed_ratio * total_units), the
1131 // rollout will be paused. If not set, all units will be attempted to be
1132 // updated regardless of the number of failures encountered.
1133 ErrorBudget *ErrorBudget `json:"errorBudget,omitempty"`
1134 // Etag: Output only. An opaque value that uniquely identifies a version or
1135 // generation of a resource. It can be used to confirm that the client and
1136 // server agree on the ordering of a resource being written.
1137 Etag string `json:"etag,omitempty"`
1138 // Labels: Optional. The labels on the resource, which can be used for
1139 // categorization. similar to Kubernetes resource labels.
1140 Labels map[string]string `json:"labels,omitempty"`
1141 // Name: Identifier. The resource name (full URI of the resource) following the
1142 // standard naming scheme:
1143 // "projects/{project}/locations/{location}/rolloutKinds/{rollout_kind_id}"
1144 Name string `json:"name,omitempty"`
1145 // RolloutOrchestrationStrategy: Optional. The strategy used for executing a
1146 // Rollout. This is a required field. There are two supported values strategies
1147 // which are used to control - "Google.Cloud.Simple.AllAtOnce" -
1148 // "Google.Cloud.Simple.OneLocationAtATime" A rollout with one of these simple
1149 // strategies will rollout across all locations defined in the associated
1150 // UnitKind's Saas Locations.
1151 RolloutOrchestrationStrategy string `json:"rolloutOrchestrationStrategy,omitempty"`
1152 // Uid: Output only. The unique identifier of the resource. UID is unique in
1153 // the time and space for this resource within the scope of the service. It is
1154 // typically generated by the server on successful creation of a resource and
1155 // must not be changed. UID is used to uniquely identify resources with
1156 // resource name reuses. This should be a UUID4.
1157 Uid string `json:"uid,omitempty"`
1158 // UnitFilter: Optional. CEL(https://github.com/google/cel-spec) formatted
1159 // filter string against Unit. The filter will be applied to determine the
1160 // eligible unit population. This filter can only reduce, but not expand the
1161 // scope of the rollout.
1162 UnitFilter string `json:"unitFilter,omitempty"`
1163 // UnitKind: Required. Immutable. UnitKind that this rollout kind corresponds
1164 // to. Rollouts stemming from this rollout kind will target the units of this
1165 // unit kind. In other words, this defines the population of target units to be
1166 // upgraded by rollouts.
1167 UnitKind string `json:"unitKind,omitempty"`
1168 // UpdateTime: Output only. The timestamp when the resource was last updated.
1169 // Any change to the resource made by users must refresh this value. Changes to
1170 // a resource made by the service should refresh this value.
1171 UpdateTime string `json:"updateTime,omitempty"`
1172 // UpdateUnitKindStrategy: Optional. The config for updating the unit kind. By
1173 // default, the unit kind will be updated on the rollout start.
1174 //
1175 // Possible values:
1176 // "UPDATE_UNIT_KIND_STRATEGY_UNSPECIFIED" - Strategy unspecified.
1177 // "UPDATE_UNIT_KIND_STRATEGY_ON_START" - Update the unit kind strategy on
1178 // the rollout start.
1179 // "UPDATE_UNIT_KIND_STRATEGY_NEVER" - Never update the unit kind.
1180 UpdateUnitKindStrategy string `json:"updateUnitKindStrategy,omitempty"`
1181
1182 // ServerResponse contains the HTTP response code and headers from the server.
1183 googleapi.ServerResponse `json:"-"`
1184 // ForceSendFields is a list of field names (e.g. "Annotations") to
1185 // unconditionally include in API requests. By default, fields with empty or
1186 // default values are omitted from API requests. See
1187 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1188 // details.
1189 ForceSendFields []string `json:"-"`
1190 // NullFields is a list of field names (e.g. "Annotations") to include in API
1191 // requests with the JSON null value. By default, fields with empty values are
1192 // omitted from API requests. See
1193 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1194 NullFields []string `json:"-"`
1195 }
1196
1197 func (s RolloutKind) MarshalJSON() ([]byte, error) {
1198 type NoMethod RolloutKind
1199 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1200 }
1201
1202 // RolloutStats: RolloutStats contains information about the progress of a
1203 // rollout.
1204 type RolloutStats struct {
1205 // EstimatedTotalUnitCount: Optional. Output only. Estimated number of units
1206 // based. The estimation is computed upon creation of the rollout.
1207 EstimatedTotalUnitCount int64 `json:"estimatedTotalUnitCount,omitempty,string"`
1208 // OperationsByState: Optional. Output only. Unordered list. A breakdown of the
1209 // progress of operations triggered by the rollout. Provides a count of
1210 // Operations by their state. This can be used to determine the number of units
1211 // which have been updated, or are scheduled to be updated. There will be at
1212 // most one entry per group. Possible values for operation groups are: -
1213 // "SCHEDULED" - "PENDING" - "RUNNING" - "SUCCEEDED" - "FAILED" - "CANCELLED"
1214 OperationsByState []*Aggregate `json:"operationsByState,omitempty"`
1215 // ForceSendFields is a list of field names (e.g. "EstimatedTotalUnitCount") to
1216 // unconditionally include in API requests. By default, fields with empty or
1217 // default values are omitted from API requests. See
1218 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1219 // details.
1220 ForceSendFields []string `json:"-"`
1221 // NullFields is a list of field names (e.g. "EstimatedTotalUnitCount") to
1222 // include in API requests with the JSON null value. By default, fields with
1223 // empty values are omitted from API requests. See
1224 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1225 NullFields []string `json:"-"`
1226 }
1227
1228 func (s RolloutStats) MarshalJSON() ([]byte, error) {
1229 type NoMethod RolloutStats
1230 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1231 }
1232
1233 // RunRolloutActionParams: Parameters for the RUN action controlling the
1234 // behavior of the rollout when it is resumed from a PAUSED state.
1235 type RunRolloutActionParams struct {
1236 // RetryFailedOperations: Required. If true, the rollout will retry failed
1237 // operations when resumed. This is applicable only the current state of the
1238 // Rollout is PAUSED and the requested action is RUN.
1239 RetryFailedOperations bool `json:"retryFailedOperations,omitempty"`
1240 // ForceSendFields is a list of field names (e.g. "RetryFailedOperations") to
1241 // unconditionally include in API requests. By default, fields with empty or
1242 // default values are omitted from API requests. See
1243 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1244 // details.
1245 ForceSendFields []string `json:"-"`
1246 // NullFields is a list of field names (e.g. "RetryFailedOperations") to
1247 // include in API requests with the JSON null value. By default, fields with
1248 // empty values are omitted from API requests. See
1249 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1250 NullFields []string `json:"-"`
1251 }
1252
1253 func (s RunRolloutActionParams) MarshalJSON() ([]byte, error) {
1254 type NoMethod RunRolloutActionParams
1255 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1256 }
1257
1258 // Saas: Saas is a representation of a SaaS service managed by the Producer.
1259 type Saas struct {
1260 // Annotations: Optional. Annotations is an unstructured key-value map stored
1261 // with a resource that may be set by external tools to store and retrieve
1262 // arbitrary metadata. They are not queryable and should be preserved when
1263 // modifying objects. More info:
1264 // https://kubernetes.io/docs/user-guide/annotations
1265 Annotations map[string]string `json:"annotations,omitempty"`
1266 // Conditions: Output only. A set of conditions which indicate the various
1267 // conditions this resource can have.
1268 Conditions []*SaasCondition `json:"conditions,omitempty"`
1269 // CreateTime: Output only. The timestamp when the resource was created.
1270 CreateTime string `json:"createTime,omitempty"`
1271 // Error: Output only. If the state is FAILED, the corresponding error code and
1272 // message. Defaults to code=OK for all other states.
1273 Error *Status `json:"error,omitempty"`
1274 // Etag: Output only. An opaque value that uniquely identifies a version or
1275 // generation of a resource. It can be used to confirm that the client and
1276 // server agree on the ordering of a resource being written.
1277 Etag string `json:"etag,omitempty"`
1278 // Labels: Optional. The labels on the resource, which can be used for
1279 // categorization. similar to Kubernetes resource labels.
1280 Labels map[string]string `json:"labels,omitempty"`
1281 // Locations: Optional. List of locations that the service is available in.
1282 // Rollout refers to the list to generate a rollout plan.
1283 Locations []*Location `json:"locations,omitempty"`
1284 // Name: Identifier. The resource name (full URI of the resource) following the
1285 // standard naming scheme:
1286 // "projects/{project}/locations/{location}/saas/{saas}"
1287 Name string `json:"name,omitempty"`
1288 // State: Output only. State of the Saas. It is always in ACTIVE state if the
1289 // application_template is empty.
1290 //
1291 // Possible values:
1292 // "STATE_TYPE_UNSPECIFIED" - State type is unspecified.
1293 // "STATE_ACTIVE" - The Saas is ready
1294 // "STATE_RUNNING" - In the process of importing, synchronizing or
1295 // replicating ApplicationTemplates
1296 // "STATE_FAILED" - Failure during process of importing, synchronizing or
1297 // replicating ApplicationTemplate processing
1298 // "ACTIVE" - Deprecated: Use STATE_ACTIVE.
1299 // "RUNNING" - Deprecated: Use STATE_RUNNING.
1300 // "FAILED" - Deprecated: Use STATE_FAILED.
1301 State string `json:"state,omitempty"`
1302 // Uid: Output only. The unique identifier of the resource. UID is unique in
1303 // the time and space for this resource within the scope of the service. It is
1304 // typically generated by the server on successful creation of a resource and
1305 // must not be changed. UID is used to uniquely identify resources with
1306 // resource name reuses. This should be a UUID4.
1307 Uid string `json:"uid,omitempty"`
1308 // UpdateTime: Output only. The timestamp when the resource was last updated.
1309 // Any change to the resource made by users must refresh this value. Changes to
1310 // a resource made by the service should refresh this value.
1311 UpdateTime string `json:"updateTime,omitempty"`
1312
1313 // ServerResponse contains the HTTP response code and headers from the server.
1314 googleapi.ServerResponse `json:"-"`
1315 // ForceSendFields is a list of field names (e.g. "Annotations") to
1316 // unconditionally include in API requests. By default, fields with empty or
1317 // default values are omitted from API requests. See
1318 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1319 // details.
1320 ForceSendFields []string `json:"-"`
1321 // NullFields is a list of field names (e.g. "Annotations") to include in API
1322 // requests with the JSON null value. By default, fields with empty values are
1323 // omitted from API requests. See
1324 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1325 NullFields []string `json:"-"`
1326 }
1327
1328 func (s Saas) MarshalJSON() ([]byte, error) {
1329 type NoMethod Saas
1330 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1331 }
1332
1333 // SaasCondition: SaasCondition describes the status of a Saas.
1334 type SaasCondition struct {
1335 // LastTransitionTime: Required. Last time the condition transited from one
1336 // status to another.
1337 LastTransitionTime string `json:"lastTransitionTime,omitempty"`
1338 // Message: Required. Human readable message indicating details about the last
1339 // transition.
1340 Message string `json:"message,omitempty"`
1341 // Reason: Required. Brief reason for the condition's last transition.
1342 Reason string `json:"reason,omitempty"`
1343 // Status: Required. Status of the condition.
1344 //
1345 // Possible values:
1346 // "STATUS_UNSPECIFIED" - Condition status is unspecified.
1347 // "STATUS_UNKNOWN" - Condition is unknown.
1348 // "STATUS_TRUE" - Condition is true.
1349 // "STATUS_FALSE" - Condition is false.
1350 Status string `json:"status,omitempty"`
1351 // Type: Required. Type of the condition.
1352 //
1353 // Possible values:
1354 // "TYPE_UNSPECIFIED" - Condition type is unspecified.
1355 // "TYPE_READY" - Condition type is ready.
1356 // "TYPE_SYNCHRONIZED" - Condition type is synchronized.
1357 Type string `json:"type,omitempty"`
1358 // ForceSendFields is a list of field names (e.g. "LastTransitionTime") to
1359 // unconditionally include in API requests. By default, fields with empty or
1360 // default values are omitted from API requests. See
1361 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1362 // details.
1363 ForceSendFields []string `json:"-"`
1364 // NullFields is a list of field names (e.g. "LastTransitionTime") to include
1365 // in API requests with the JSON null value. By default, fields with empty
1366 // values are omitted from API requests. See
1367 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1368 NullFields []string `json:"-"`
1369 }
1370
1371 func (s SaasCondition) MarshalJSON() ([]byte, error) {
1372 type NoMethod SaasCondition
1373 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1374 }
1375
1376 // Schedule: A time specification to schedule the maintenance.
1377 type Schedule struct {
1378 // StartTime: Optional. Start of operation. If not set, will be set to the
1379 // start of the next window. (optional)
1380 StartTime string `json:"startTime,omitempty"`
1381 // ForceSendFields is a list of field names (e.g. "StartTime") to
1382 // unconditionally include in API requests. By default, fields with empty or
1383 // default values are omitted from API requests. See
1384 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1385 // details.
1386 ForceSendFields []string `json:"-"`
1387 // NullFields is a list of field names (e.g. "StartTime") to include in API
1388 // requests with the JSON null value. By default, fields with empty values are
1389 // omitted from API requests. See
1390 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1391 NullFields []string `json:"-"`
1392 }
1393
1394 func (s Schedule) MarshalJSON() ([]byte, error) {
1395 type NoMethod Schedule
1396 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1397 }
1398
1399 // Status: The `Status` type defines a logical error model that is suitable for
1400 // different programming environments, including REST APIs and RPC APIs. It is
1401 // used by gRPC (https://github.com/grpc). Each `Status` message contains three
1402 // pieces of data: error code, error message, and error details. You can find
1403 // out more about this error model and how to work with it in the API Design
1404 // Guide (https://cloud.google.com/apis/design/errors).
1405 type Status struct {
1406 // Code: The status code, which should be an enum value of google.rpc.Code.
1407 Code int64 `json:"code,omitempty"`
1408 // Details: A list of messages that carry the error details. There is a common
1409 // set of message types for APIs to use.
1410 Details []googleapi.RawMessage `json:"details,omitempty"`
1411 // Message: A developer-facing error message, which should be in English. Any
1412 // user-facing error message should be localized and sent in the
1413 // google.rpc.Status.details field, or localized by the client.
1414 Message string `json:"message,omitempty"`
1415 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
1416 // include in API requests. By default, fields with empty or default values are
1417 // omitted from API requests. See
1418 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1419 // details.
1420 ForceSendFields []string `json:"-"`
1421 // NullFields is a list of field names (e.g. "Code") to include in API requests
1422 // with the JSON null value. By default, fields with empty values are omitted
1423 // from API requests. See
1424 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1425 NullFields []string `json:"-"`
1426 }
1427
1428 func (s Status) MarshalJSON() ([]byte, error) {
1429 type NoMethod Status
1430 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1431 }
1432
1433 // Tenant: Tenant represents the service producer side of an instance of the
1434 // service created based on a request from a consumer. In a typical scenario a
1435 // Tenant has a one-to-one mapping with a resource given out to a service
1436 // consumer. Example: tenant: name:
1437 // "projects/svc1/locations/loc/tenants/inst-068afff8" consumer_resource:
1438 // "projects/gshoe/locations/loc/shoes/black-shoe"
1439 type Tenant struct {
1440 // Annotations: Optional. Annotations is an unstructured key-value map stored
1441 // with a resource that may be set by external tools to store and retrieve
1442 // arbitrary metadata. They are not queryable and should be preserved when
1443 // modifying objects. More info:
1444 // https://kubernetes.io/docs/user-guide/annotations
1445 Annotations map[string]string `json:"annotations,omitempty"`
1446 // ConsumerResource: Optional. Immutable. A reference to the consumer resource
1447 // this SaaS Tenant is representing. The relationship with a consumer resource
1448 // can be used by App Lifecycle Manager for retrieving consumer-defined
1449 // settings and policies such as maintenance policies (using Unified
1450 // Maintenance Policy API).
1451 ConsumerResource string `json:"consumerResource,omitempty"`
1452 // CreateTime: Output only. The timestamp when the resource was created.
1453 CreateTime string `json:"createTime,omitempty"`
1454 // Etag: Output only. An opaque value that uniquely identifies a version or
1455 // generation of a resource. It can be used to confirm that the client and
1456 // server agree on the ordering of a resource being written.
1457 Etag string `json:"etag,omitempty"`
1458 // Labels: Optional. The labels on the resource, which can be used for
1459 // categorization. similar to Kubernetes resource labels.
1460 Labels map[string]string `json:"labels,omitempty"`
1461 // Name: Identifier. The resource name (full URI of the resource) following the
1462 // standard naming scheme:
1463 // "projects/{project}/locations/{location}/tenants/{tenant}"
1464 Name string `json:"name,omitempty"`
1465 // Saas: Required. Immutable. A reference to the Saas that defines the product
1466 // (managed service) that the producer wants to manage with App Lifecycle
1467 // Manager. Part of the App Lifecycle Manager common data model.
1468 Saas string `json:"saas,omitempty"`
1469 // Uid: Output only. The unique identifier of the resource. UID is unique in
1470 // the time and space for this resource within the scope of the service. It is
1471 // typically generated by the server on successful creation of a resource and
1472 // must not be changed. UID is used to uniquely identify resources with
1473 // resource name reuses. This should be a UUID4.
1474 Uid string `json:"uid,omitempty"`
1475 // UpdateTime: Output only. The timestamp when the resource was last updated.
1476 // Any change to the resource made by users must refresh this value. Changes to
1477 // a resource made by the service should refresh this value.
1478 UpdateTime string `json:"updateTime,omitempty"`
1479
1480 // ServerResponse contains the HTTP response code and headers from the server.
1481 googleapi.ServerResponse `json:"-"`
1482 // ForceSendFields is a list of field names (e.g. "Annotations") to
1483 // unconditionally include in API requests. By default, fields with empty or
1484 // default values are omitted from API requests. See
1485 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1486 // details.
1487 ForceSendFields []string `json:"-"`
1488 // NullFields is a list of field names (e.g. "Annotations") to include in API
1489 // requests with the JSON null value. By default, fields with empty values are
1490 // omitted from API requests. See
1491 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1492 NullFields []string `json:"-"`
1493 }
1494
1495 func (s Tenant) MarshalJSON() ([]byte, error) {
1496 type NoMethod Tenant
1497 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1498 }
1499
1500 // ToMapping: Input variables whose values will be passed on to dependencies
1501 type ToMapping struct {
1502 // Dependency: Required. Alias of the dependency that the inputVariable will
1503 // pass its value to
1504 Dependency string `json:"dependency,omitempty"`
1505 // IgnoreForLookup: Optional. Tells App Lifecycle Manager if this mapping
1506 // should be used during lookup or not
1507 IgnoreForLookup bool `json:"ignoreForLookup,omitempty"`
1508 // InputVariable: Required. Name of the inputVariable on the dependency
1509 InputVariable string `json:"inputVariable,omitempty"`
1510 // ForceSendFields is a list of field names (e.g. "Dependency") to
1511 // unconditionally include in API requests. By default, fields with empty or
1512 // default values are omitted from API requests. See
1513 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1514 // details.
1515 ForceSendFields []string `json:"-"`
1516 // NullFields is a list of field names (e.g. "Dependency") to include in API
1517 // requests with the JSON null value. By default, fields with empty values are
1518 // omitted from API requests. See
1519 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1520 NullFields []string `json:"-"`
1521 }
1522
1523 func (s ToMapping) MarshalJSON() ([]byte, error) {
1524 type NoMethod ToMapping
1525 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1526 }
1527
1528 // Unit: A unit of deployment that has its lifecycle via a CRUD API using an
1529 // actuation engine under the hood (e.g. based on Terraform, Helm or a custom
1530 // implementation provided by a service producer). A building block of a SaaS
1531 // Tenant.
1532 type Unit struct {
1533 // Annotations: Optional. Annotations is an unstructured key-value map stored
1534 // with a resource that may be set by external tools to store and retrieve
1535 // arbitrary metadata. They are not queryable and should be preserved when
1536 // modifying objects. More info:
1537 // https://kubernetes.io/docs/user-guide/annotations
1538 Annotations map[string]string `json:"annotations,omitempty"`
1539 // Conditions: Optional. Output only. A set of conditions which indicate the
1540 // various conditions this resource can have.
1541 Conditions []*UnitCondition `json:"conditions,omitempty"`
1542 // CreateTime: Output only. The timestamp when the resource was created.
1543 CreateTime string `json:"createTime,omitempty"`
1544 // Dependencies: Optional. Output only. Set of dependencies for this unit.
1545 // Maximum 10.
1546 Dependencies []*UnitDependency `json:"dependencies,omitempty"`
1547 // Dependents: Optional. Output only. List of Units that depend on this unit.
1548 // Unit can only be deprovisioned if this list is empty. Maximum 1000.
1549 Dependents []*UnitDependency `json:"dependents,omitempty"`
1550 // Etag: Output only. An opaque value that uniquely identifies a version or
1551 // generation of a resource. It can be used to confirm that the client and
1552 // server agree on the ordering of a resource being written.
1553 Etag string `json:"etag,omitempty"`
1554 // FlagRevisions: Optional. Output only. Flag revisions used by this Unit.
1555 FlagRevisions []string `json:"flagRevisions,omitempty"`
1556 // InputVariables: Optional. Output only. Indicates the current input variables
1557 // deployed by the unit
1558 InputVariables []*UnitVariable `json:"inputVariables,omitempty"`
1559 // Labels: Optional. The labels on the resource, which can be used for
1560 // categorization. similar to Kubernetes resource labels.
1561 Labels map[string]string `json:"labels,omitempty"`
1562 // Maintenance: Optional. Captures requested directives for performing future
1563 // maintenance on the unit. This includes a request for the unit to skip
1564 // maintenance for a period of time and remain pinned to its current release as
1565 // well as controls for postponing maintenance scheduled in future.
1566 Maintenance *MaintenanceSettings `json:"maintenance,omitempty"`
1567 // ManagementMode: Optional. Immutable. Indicates whether the Unit life cycle
1568 // is controlled by the user or by the system. Immutable once created.
1569 //
1570 // Possible values:
1571 // "MANAGEMENT_MODE_UNSPECIFIED"
1572 // "MANAGEMENT_MODE_USER" - Unit's lifecycle is managed by the user.
1573 // "MANAGEMENT_MODE_SYSTEM" - The system will decide when to deprovision and
1574 // delete the unit. User still can deprovision or delete the unit manually.
1575 ManagementMode string `json:"managementMode,omitempty"`
1576 // Name: Identifier. The resource name (full URI of the resource) following the
1577 // standard naming scheme:
1578 // "projects/{project}/locations/{location}/units/{unit}"
1579 Name string `json:"name,omitempty"`
1580 // OngoingOperations: Optional. Output only. List of concurrent UnitOperations
1581 // that are operating on this Unit.
1582 OngoingOperations []string `json:"ongoingOperations,omitempty"`
1583 // OutputVariables: Optional. Output only. Set of key/value pairs corresponding
1584 // to output variables from execution of actuation templates. The variables are
1585 // declared in actuation configs (e.g in helm chart or terraform) and the
1586 // values are fetched and returned by the actuation engine upon completion of
1587 // execution.
1588 OutputVariables []*UnitVariable `json:"outputVariables,omitempty"`
1589 // PendingOperations: Optional. Output only. List of pending (wait to be
1590 // executed) UnitOperations for this unit.
1591 PendingOperations []string `json:"pendingOperations,omitempty"`
1592 // Release: Optional. Output only. The current Release object for this Unit.
1593 Release string `json:"release,omitempty"`
1594 // SatisfiesPzi: Output only. Reserved for future use.
1595 SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
1596 // SatisfiesPzs: Output only. Indicates whether the resource location satisfies
1597 // Zone Separation constraints. This is false by default.
1598 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
1599 // ScheduledOperations: Optional. Output only. List of scheduled UnitOperations
1600 // for this unit.
1601 ScheduledOperations []string `json:"scheduledOperations,omitempty"`
1602 // State: Optional. Output only. Current lifecycle state of the resource (e.g.
1603 // if it's being created or ready to use).
1604 //
1605 // Possible values:
1606 // "UNIT_STATE_UNSPECIFIED" - Unspecified state.
1607 // "UNIT_STATE_NOT_PROVISIONED" - Unit is not provisioned.
1608 // "UNIT_STATE_PROVISIONING" - Unit is being provisioned.
1609 // "UNIT_STATE_UPDATING" - Unit is being updated. This is typically when a
1610 // unit is being upgraded to a new release or some of the input variables on
1611 // the Unit is being changed. Certain kinds of updates may cause the Unit to
1612 // become unusable while the update is in progress.
1613 // "UNIT_STATE_DEPROVISIONING" - Unit is being deleted.
1614 // "UNIT_STATE_READY" - Unit has been provisioned and is ready for use
1615 // "UNIT_STATE_ERROR" - Unit has error, when it is not ready and some error
1616 // operation
1617 State string `json:"state,omitempty"`
1618 // SystemCleanupAt: Optional. Output only. If set, indicates the time when the
1619 // system will start removing the unit.
1620 SystemCleanupAt string `json:"systemCleanupAt,omitempty"`
1621 // SystemManagedState: Optional. Output only. Indicates the system managed
1622 // state of the unit.
1623 //
1624 // Possible values:
1625 // "SYSTEM_MANAGED_STATE_UNSPECIFIED"
1626 // "SYSTEM_MANAGED_STATE_ACTIVE" - Unit has dependents attached.
1627 // "SYSTEM_MANAGED_STATE_INACTIVE" - Unit has no dependencies attached, but
1628 // attachment is allowed.
1629 // "SYSTEM_MANAGED_STATE_DECOMMISSIONED" - Unit has no dependencies attached,
1630 // and attachment is not allowed.
1631 SystemManagedState string `json:"systemManagedState,omitempty"`
1632 // Tenant: Optional. Reference to the Saas Tenant resource this unit belongs
1633 // to. This for example informs the maintenance policies to use for scheduling
1634 // future updates on a unit. (optional and immutable once created)
1635 Tenant string `json:"tenant,omitempty"`
1636 // Uid: Output only. The unique identifier of the resource. UID is unique in
1637 // the time and space for this resource within the scope of the service. It is
1638 // typically generated by the server on successful creation of a resource and
1639 // must not be changed. UID is used to uniquely identify resources with
1640 // resource name reuses. This should be a UUID4.
1641 Uid string `json:"uid,omitempty"`
1642 // UnitKind: Optional. Reference to the UnitKind this Unit belongs to.
1643 // Immutable once set.
1644 UnitKind string `json:"unitKind,omitempty"`
1645 // UpdateTime: Output only. The timestamp when the resource was last updated.
1646 // Any change to the resource made by users must refresh this value. Changes to
1647 // a resource made by the service should refresh this value.
1648 UpdateTime string `json:"updateTime,omitempty"`
1649
1650 // ServerResponse contains the HTTP response code and headers from the server.
1651 googleapi.ServerResponse `json:"-"`
1652 // ForceSendFields is a list of field names (e.g. "Annotations") to
1653 // unconditionally include in API requests. By default, fields with empty or
1654 // default values are omitted from API requests. See
1655 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1656 // details.
1657 ForceSendFields []string `json:"-"`
1658 // NullFields is a list of field names (e.g. "Annotations") to include in API
1659 // requests with the JSON null value. By default, fields with empty values are
1660 // omitted from API requests. See
1661 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1662 NullFields []string `json:"-"`
1663 }
1664
1665 func (s Unit) MarshalJSON() ([]byte, error) {
1666 type NoMethod Unit
1667 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1668 }
1669
1670 // UnitCondition: UnitCondition describes the status of an Unit. UnitCondition
1671 // is individual components that contribute to an overall state.
1672 type UnitCondition struct {
1673 // LastTransitionTime: Required. Last time the condition transited from one
1674 // status to another.
1675 LastTransitionTime string `json:"lastTransitionTime,omitempty"`
1676 // Message: Required. Human readable message indicating details about the last
1677 // transition.
1678 Message string `json:"message,omitempty"`
1679 // Reason: Required. Brief reason for the condition's last transition.
1680 Reason string `json:"reason,omitempty"`
1681 // Status: Required. Status of the condition.
1682 //
1683 // Possible values:
1684 // "STATUS_UNSPECIFIED" - Condition status is unspecified.
1685 // "STATUS_UNKNOWN" - Condition is unknown.
1686 // "STATUS_TRUE" - Condition is true.
1687 // "STATUS_FALSE" - Condition is false.
1688 Status string `json:"status,omitempty"`
1689 // Type: Required. Type of the condition.
1690 //
1691 // Possible values:
1692 // "TYPE_UNSPECIFIED" - Condition type is unspecified.
1693 // "TYPE_READY" - Condition type is ready.
1694 // "TYPE_UPDATING" - Condition type is updating.
1695 // "TYPE_PROVISIONED" - Condition type is provisioned.
1696 // "TYPE_OPERATION_ERROR" - Condition type is operationError. True when the
1697 // last unit operation fails with a non-ignorable error.
1698 Type string `json:"type,omitempty"`
1699 // ForceSendFields is a list of field names (e.g. "LastTransitionTime") to
1700 // unconditionally include in API requests. By default, fields with empty or
1701 // default values are omitted from API requests. See
1702 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1703 // details.
1704 ForceSendFields []string `json:"-"`
1705 // NullFields is a list of field names (e.g. "LastTransitionTime") to include
1706 // in API requests with the JSON null value. By default, fields with empty
1707 // values are omitted from API requests. See
1708 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1709 NullFields []string `json:"-"`
1710 }
1711
1712 func (s UnitCondition) MarshalJSON() ([]byte, error) {
1713 type NoMethod UnitCondition
1714 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1715 }
1716
1717 // UnitDependency: Set of dependencies for this unit. Maximum 10.
1718 type UnitDependency struct {
1719 // Alias: Output only. Alias for the name of the dependency.
1720 Alias string `json:"alias,omitempty"`
1721 // Unit: Output only. A reference to the Unit object.
1722 Unit string `json:"unit,omitempty"`
1723 // ForceSendFields is a list of field names (e.g. "Alias") to unconditionally
1724 // include in API requests. By default, fields with empty or default values are
1725 // omitted from API requests. See
1726 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1727 // details.
1728 ForceSendFields []string `json:"-"`
1729 // NullFields is a list of field names (e.g. "Alias") to include in API
1730 // requests with the JSON null value. By default, fields with empty values are
1731 // omitted from API requests. See
1732 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1733 NullFields []string `json:"-"`
1734 }
1735
1736 func (s UnitDependency) MarshalJSON() ([]byte, error) {
1737 type NoMethod UnitDependency
1738 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1739 }
1740
1741 // UnitKind: Definition of a Unit. Units belonging to the same UnitKind are
1742 // managed together; for example they follow the same release model
1743 // (blueprints, versions etc.) and are typically rolled out together.
1744 type UnitKind struct {
1745 // Annotations: Optional. Annotations is an unstructured key-value map stored
1746 // with a resource that may be set by external tools to store and retrieve
1747 // arbitrary metadata. They are not queryable and should be preserved when
1748 // modifying objects. More info:
1749 // https://kubernetes.io/docs/user-guide/annotations
1750 Annotations map[string]string `json:"annotations,omitempty"`
1751 // CreateTime: Output only. The timestamp when the resource was created.
1752 CreateTime string `json:"createTime,omitempty"`
1753 // DefaultFlagRevisions: Optional. Default revisions of flags for this
1754 // UnitKind. Newly created units will use the flag default_flag_revisions
1755 // present at the time of creation.
1756 DefaultFlagRevisions []string `json:"defaultFlagRevisions,omitempty"`
1757 // DefaultRelease: Optional. A reference to the Release object to use as
1758 // default for creating new units of this UnitKind (optional). If not
1759 // specified, a new unit must explicitly reference which release to use for its
1760 // creation.
1761 DefaultRelease string `json:"defaultRelease,omitempty"`
1762 // Dependencies: Optional. Immutable. List of other unit kinds that this
1763 // release will depend on. Dependencies will be automatically provisioned if
1764 // not found. Maximum 10.
1765 Dependencies []*Dependency `json:"dependencies,omitempty"`
1766 // Etag: Output only. An opaque value that uniquely identifies a version or
1767 // generation of a resource. It can be used to confirm that the client and
1768 // server agree on the ordering of a resource being written.
1769 Etag string `json:"etag,omitempty"`
1770 // InputVariableMappings: Optional. List of inputVariables for this release
1771 // that will either be retrieved from a dependency’s outputVariables, or will
1772 // be passed on to a dependency’s inputVariables. Maximum 100.
1773 InputVariableMappings []*VariableMapping `json:"inputVariableMappings,omitempty"`
1774 // Labels: Optional. The labels on the resource, which can be used for
1775 // categorization. similar to Kubernetes resource labels.
1776 Labels map[string]string `json:"labels,omitempty"`
1777 // Name: Identifier. The resource name (full URI of the resource) following the
1778 // standard naming scheme:
1779 // "projects/{project}/locations/{location}/unitKinds/{unitKind}"
1780 Name string `json:"name,omitempty"`
1781 // OutputVariableMappings: Optional. List of outputVariables for this unit kind
1782 // will be passed to this unit's outputVariables. Maximum 100.
1783 OutputVariableMappings []*VariableMapping `json:"outputVariableMappings,omitempty"`
1784 // Saas: Required. Immutable. A reference to the Saas that defines the product
1785 // (managed service) that the producer wants to manage with App Lifecycle
1786 // Manager. Part of the App Lifecycle Manager common data model. Immutable once
1787 // set.
1788 Saas string `json:"saas,omitempty"`
1789 // Uid: Output only. The unique identifier of the resource. UID is unique in
1790 // the time and space for this resource within the scope of the service. It is
1791 // typically generated by the server on successful creation of a resource and
1792 // must not be changed. UID is used to uniquely identify resources with
1793 // resource name reuses. This should be a UUID4.
1794 Uid string `json:"uid,omitempty"`
1795 // UpdateTime: Output only. The timestamp when the resource was last updated.
1796 // Any change to the resource made by users must refresh this value. Changes to
1797 // a resource made by the service should refresh this value.
1798 UpdateTime string `json:"updateTime,omitempty"`
1799
1800 // ServerResponse contains the HTTP response code and headers from the server.
1801 googleapi.ServerResponse `json:"-"`
1802 // ForceSendFields is a list of field names (e.g. "Annotations") to
1803 // unconditionally include in API requests. By default, fields with empty or
1804 // default values are omitted from API requests. See
1805 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1806 // details.
1807 ForceSendFields []string `json:"-"`
1808 // NullFields is a list of field names (e.g. "Annotations") to include in API
1809 // requests with the JSON null value. By default, fields with empty values are
1810 // omitted from API requests. See
1811 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1812 NullFields []string `json:"-"`
1813 }
1814
1815 func (s UnitKind) MarshalJSON() ([]byte, error) {
1816 type NoMethod UnitKind
1817 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1818 }
1819
1820 // UnitOperation: UnitOperation encapsulates the intent of changing/interacting
1821 // with the service component represented by the specific Unit. Multiple
1822 // UnitOperations can be created (requested) and scheduled in the future,
1823 // however only one will be allowed to execute at a time (that can change in
1824 // the future for non-mutating operations). UnitOperations allow different
1825 // actors interacting with the same unit to focus only on the change they have
1826 // requested. This is a base object that contains the common fields in all unit
1827 // operations. Next: 22
1828 type UnitOperation struct {
1829 // Annotations: Optional. Annotations is an unstructured key-value map stored
1830 // with a resource that may be set by external tools to store and retrieve
1831 // arbitrary metadata. They are not queryable and should be preserved when
1832 // modifying objects. More info:
1833 // https://kubernetes.io/docs/user-guide/annotations
1834 Annotations map[string]string `json:"annotations,omitempty"`
1835 // Cancel: Optional. When true, attempt to cancel the operation. Cancellation
1836 // may fail if the operation is already executing. (Optional)
1837 Cancel bool `json:"cancel,omitempty"`
1838 // Conditions: Optional. Output only. A set of conditions which indicate the
1839 // various conditions this resource can have.
1840 Conditions []*UnitOperationCondition `json:"conditions,omitempty"`
1841 // CreateTime: Output only. The timestamp when the resource was created.
1842 CreateTime string `json:"createTime,omitempty"`
1843 // DeleteTime: Output only. The timestamp when the resource was marked for
1844 // deletion (deletion is an asynchronous operation).
1845 DeleteTime string `json:"deleteTime,omitempty"`
1846 Deprovision *Deprovision `json:"deprovision,omitempty"`
1847 // EngineState: Optional. Output only. The engine state for on-going deployment
1848 // engine operation(s). This field is opaque for external usage.
1849 EngineState string `json:"engineState,omitempty"`
1850 // ErrorCategory: Optional. Output only. UnitOperationErrorCategory describe
1851 // the error category.
1852 //
1853 // Possible values:
1854 // "UNIT_OPERATION_ERROR_CATEGORY_UNSPECIFIED" - Unit operation error
1855 // category is unspecified
1856 // "NOT_APPLICABLE" - Unit operation error category is not applicable, or it
1857 // is not an error
1858 // "FATAL" - Unit operation error category is fatal
1859 // "RETRIABLE" - Unit operation error category is retriable
1860 // "IGNORABLE" - Unit operation error category is ignorable
1861 // "STANDARD" - Unit operation error category is standard, counts towards
1862 // Rollout error budget
1863 ErrorCategory string `json:"errorCategory,omitempty"`
1864 // Etag: Output only. An opaque value that uniquely identifies a version or
1865 // generation of a resource. It can be used to confirm that the client and
1866 // server agree on the ordering of a resource being written.
1867 Etag string `json:"etag,omitempty"`
1868 FlagUpdate *FlagUpdate `json:"flagUpdate,omitempty"`
1869 // Labels: Optional. The labels on the resource, which can be used for
1870 // categorization. similar to Kubernetes resource labels.
1871 Labels map[string]string `json:"labels,omitempty"`
1872 // Name: Identifier. The resource name (full URI of the resource) following the
1873 // standard naming scheme:
1874 // "projects/{project}/locations/{location}/unitOperations/{unitOperation}"
1875 Name string `json:"name,omitempty"`
1876 // ParentUnitOperation: Optional. Reference to parent resource: UnitOperation.
1877 // If an operation needs to create other operations as part of its workflow,
1878 // each of the child operations should have this field set to the parent. This
1879 // can be used for tracing. (Optional)
1880 ParentUnitOperation string `json:"parentUnitOperation,omitempty"`
1881 Provision *Provision `json:"provision,omitempty"`
1882 // Rollout: Optional. Specifies which rollout created this Unit Operation. This
1883 // cannot be modified and is used for filtering purposes only. If a dependent
1884 // unit and unit operation are created as part of another unit operation, they
1885 // will use the same rolloutId.
1886 Rollout string `json:"rollout,omitempty"`
1887 // Schedule: Optional. When to schedule this operation.
1888 Schedule *Schedule `json:"schedule,omitempty"`
1889 // State: Optional. Output only. UnitOperationState describes the current state
1890 // of the unit operation.
1891 //
1892 // Possible values:
1893 // "UNIT_OPERATION_STATE_UNKNOWN"
1894 // "UNIT_OPERATION_STATE_PENDING" - Unit operation is accepted but not ready
1895 // to run.
1896 // "UNIT_OPERATION_STATE_SCHEDULED" - Unit operation is accepted and
1897 // scheduled.
1898 // "UNIT_OPERATION_STATE_RUNNING" - Unit operation is running.
1899 // "UNIT_OPERATION_STATE_SUCCEEDED" - Unit operation has completed
1900 // successfully.
1901 // "UNIT_OPERATION_STATE_FAILED" - Unit operation has failed.
1902 // "UNIT_OPERATION_STATE_CANCELLED" - Unit operation was cancelled.
1903 State string `json:"state,omitempty"`
1904 // Uid: Output only. The unique identifier of the resource. UID is unique in
1905 // the time and space for this resource within the scope of the service. It is
1906 // typically generated by the server on successful creation of a resource and
1907 // must not be changed. UID is used to uniquely identify resources with
1908 // resource name reuses. This should be a UUID4.
1909 Uid string `json:"uid,omitempty"`
1910 // Unit: Required. Immutable. The Unit a given UnitOperation will act upon.
1911 Unit string `json:"unit,omitempty"`
1912 // UpdateTime: Output only. The timestamp when the resource was last updated.
1913 // Any change to the resource made by users must refresh this value. Changes to
1914 // a resource made by the service should refresh this value.
1915 UpdateTime string `json:"updateTime,omitempty"`
1916 Upgrade *Upgrade `json:"upgrade,omitempty"`
1917
1918 // ServerResponse contains the HTTP response code and headers from the server.
1919 googleapi.ServerResponse `json:"-"`
1920 // ForceSendFields is a list of field names (e.g. "Annotations") to
1921 // unconditionally include in API requests. By default, fields with empty or
1922 // default values are omitted from API requests. See
1923 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1924 // details.
1925 ForceSendFields []string `json:"-"`
1926 // NullFields is a list of field names (e.g. "Annotations") to include in API
1927 // requests with the JSON null value. By default, fields with empty values are
1928 // omitted from API requests. See
1929 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1930 NullFields []string `json:"-"`
1931 }
1932
1933 func (s UnitOperation) MarshalJSON() ([]byte, error) {
1934 type NoMethod UnitOperation
1935 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1936 }
1937
1938 // UnitOperationCondition: UnitOperationCondition describes the status of an
1939 // Unit Operation. UnitOperationCondition is individual components that
1940 // contribute to an overall state.
1941 type UnitOperationCondition struct {
1942 // LastTransitionTime: Required. Last time the condition transited from one
1943 // status to another.
1944 LastTransitionTime string `json:"lastTransitionTime,omitempty"`
1945 // Message: Required. Human readable message indicating details about the last
1946 // transition.
1947 Message string `json:"message,omitempty"`
1948 // Reason: Required. Brief reason for the condition's last transition.
1949 Reason string `json:"reason,omitempty"`
1950 // Status: Required. Status of the condition.
1951 //
1952 // Possible values:
1953 // "STATUS_UNSPECIFIED" - Condition status is unspecified.
1954 // "STATUS_UNKNOWN" - Condition is unknown.
1955 // "STATUS_TRUE" - Condition is true.
1956 // "STATUS_FALSE" - Condition is false.
1957 Status string `json:"status,omitempty"`
1958 // Type: Required. Type of the condition.
1959 //
1960 // Possible values:
1961 // "TYPE_UNSPECIFIED" - Condition type is unspecified.
1962 // "TYPE_SCHEDULED" - Condition type is scheduled.
1963 // "TYPE_RUNNING" - Condition type is running.
1964 // "TYPE_SUCCEEDED" - Condition type is succeeded.
1965 // "TYPE_CANCELLED" - Condition type is cancelled.
1966 // "TYPE_APP_CREATED" - Indicates if AppHub app has been created.
1967 // "TYPE_APP_COMPONENTS_REGISTERED" - Indicates if services and workloads
1968 // have been registered with AppHub.
1969 Type string `json:"type,omitempty"`
1970 // ForceSendFields is a list of field names (e.g. "LastTransitionTime") to
1971 // unconditionally include in API requests. By default, fields with empty or
1972 // default values are omitted from API requests. See
1973 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1974 // details.
1975 ForceSendFields []string `json:"-"`
1976 // NullFields is a list of field names (e.g. "LastTransitionTime") to include
1977 // in API requests with the JSON null value. By default, fields with empty
1978 // values are omitted from API requests. See
1979 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1980 NullFields []string `json:"-"`
1981 }
1982
1983 func (s UnitOperationCondition) MarshalJSON() ([]byte, error) {
1984 type NoMethod UnitOperationCondition
1985 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1986 }
1987
1988 // UnitVariable: UnitVariable describes a parameter for a Unit.
1989 type UnitVariable struct {
1990 // Type: Optional. Immutable. Name of a supported variable type. Supported
1991 // types are string, int, bool.
1992 //
1993 // Possible values:
1994 // "TYPE_UNSPECIFIED" - Variable type is unspecified.
1995 // "STRING" - Variable type is string.
1996 // "INT" - Variable type is int.
1997 // "BOOL" - Variable type is bool.
1998 // "STRUCT" - Variable type is struct.
1999 // "LIST" - Variable type is list.
2000 Type string `json:"type,omitempty"`
2001 // Value: Optional. String encoded value for the variable.
2002 Value string `json:"value,omitempty"`
2003 // Variable: Required. Immutable. Name of the variable from actuation configs.
2004 Variable string `json:"variable,omitempty"`
2005 // ForceSendFields is a list of field names (e.g. "Type") to unconditionally
2006 // include in API requests. By default, fields with empty or default values are
2007 // omitted from API requests. See
2008 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2009 // details.
2010 ForceSendFields []string `json:"-"`
2011 // NullFields is a list of field names (e.g. "Type") to include in API requests
2012 // with the JSON null value. By default, fields with empty values are omitted
2013 // from API requests. See
2014 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2015 NullFields []string `json:"-"`
2016 }
2017
2018 func (s UnitVariable) MarshalJSON() ([]byte, error) {
2019 type NoMethod UnitVariable
2020 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2021 }
2022
2023 // Upgrade: Upgrade is the unit operation that upgrades a provisioned unit,
2024 // which may also include the underlying resources represented by a Unit. Can
2025 // only execute if the Unit is currently provisioned.
2026 type Upgrade struct {
2027 // InputVariables: Optional. Set of input variables. Maximum 100. (optional)
2028 InputVariables []*UnitVariable `json:"inputVariables,omitempty"`
2029 // Release: Optional. Reference to the Release object to use for the Unit.
2030 // (optional).
2031 Release string `json:"release,omitempty"`
2032 // ForceSendFields is a list of field names (e.g. "InputVariables") to
2033 // unconditionally include in API requests. By default, fields with empty or
2034 // default values are omitted from API requests. See
2035 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2036 // details.
2037 ForceSendFields []string `json:"-"`
2038 // NullFields is a list of field names (e.g. "InputVariables") to include in
2039 // API requests with the JSON null value. By default, fields with empty values
2040 // are omitted from API requests. See
2041 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2042 NullFields []string `json:"-"`
2043 }
2044
2045 func (s Upgrade) MarshalJSON() ([]byte, error) {
2046 type NoMethod Upgrade
2047 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2048 }
2049
2050 // VariableMapping: Mapping of input variables to their respective output
2051 // variable for depedenencies
2052 type VariableMapping struct {
2053 // From: Optional. Output variables which will get their values from
2054 // dependencies
2055 From *FromMapping `json:"from,omitempty"`
2056 // To: Optional. Input variables whose values will be passed on to
2057 // dependencies.
2058 To *ToMapping `json:"to,omitempty"`
2059 // Variable: Required. name of the variable
2060 Variable string `json:"variable,omitempty"`
2061 // ForceSendFields is a list of field names (e.g. "From") to unconditionally
2062 // include in API requests. By default, fields with empty or default values are
2063 // omitted from API requests. See
2064 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2065 // details.
2066 ForceSendFields []string `json:"-"`
2067 // NullFields is a list of field names (e.g. "From") to include in API requests
2068 // with the JSON null value. By default, fields with empty values are omitted
2069 // from API requests. See
2070 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2071 NullFields []string `json:"-"`
2072 }
2073
2074 func (s VariableMapping) MarshalJSON() ([]byte, error) {
2075 type NoMethod VariableMapping
2076 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2077 }
2078
2079 type ProjectsLocationsGetCall struct {
2080 s *Service
2081 name string
2082 urlParams_ gensupport.URLParams
2083 ifNoneMatch_ string
2084 ctx_ context.Context
2085 header_ http.Header
2086 }
2087
2088 // Get: Gets information about a location.
2089 //
2090 // - name: Resource name for the location.
2091 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
2092 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2093 c.name = name
2094 return c
2095 }
2096
2097 // Fields allows partial responses to be retrieved. See
2098 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2099 // details.
2100 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
2101 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2102 return c
2103 }
2104
2105 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2106 // object's ETag matches the given value. This is useful for getting updates
2107 // only after the object has changed since the last request.
2108 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
2109 c.ifNoneMatch_ = entityTag
2110 return c
2111 }
2112
2113 // Context sets the context to be used in this call's Do method.
2114 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
2115 c.ctx_ = ctx
2116 return c
2117 }
2118
2119 // Header returns a http.Header that can be modified by the caller to add
2120 // headers to the request.
2121 func (c *ProjectsLocationsGetCall) Header() http.Header {
2122 if c.header_ == nil {
2123 c.header_ = make(http.Header)
2124 }
2125 return c.header_
2126 }
2127
2128 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
2129 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2130 if c.ifNoneMatch_ != "" {
2131 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2132 }
2133 c.urlParams_.Set("alt", alt)
2134 c.urlParams_.Set("prettyPrint", "false")
2135 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2136 urls += "?" + c.urlParams_.Encode()
2137 req, err := http.NewRequest("GET", urls, nil)
2138 if err != nil {
2139 return nil, err
2140 }
2141 req.Header = reqHeaders
2142 googleapi.Expand(req.URL, map[string]string{
2143 "name": c.name,
2144 })
2145 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.get", "request", internallog.HTTPRequest(req, nil))
2146 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2147 }
2148
2149 // Do executes the "saasservicemgmt.projects.locations.get" call.
2150 // Any non-2xx status code is an error. Response headers are in either
2151 // *GoogleCloudLocationLocation.ServerResponse.Header or (if a response was
2152 // returned at all) in error.(*googleapi.Error).Header. Use
2153 // googleapi.IsNotModified to check whether the returned error was because
2154 // http.StatusNotModified was returned.
2155 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationLocation, error) {
2156 gensupport.SetOptions(c.urlParams_, opts...)
2157 res, err := c.doRequest("json")
2158 if res != nil && res.StatusCode == http.StatusNotModified {
2159 if res.Body != nil {
2160 res.Body.Close()
2161 }
2162 return nil, gensupport.WrapError(&googleapi.Error{
2163 Code: res.StatusCode,
2164 Header: res.Header,
2165 })
2166 }
2167 if err != nil {
2168 return nil, err
2169 }
2170 defer googleapi.CloseBody(res)
2171 if err := googleapi.CheckResponse(res); err != nil {
2172 return nil, gensupport.WrapError(err)
2173 }
2174 ret := &GoogleCloudLocationLocation{
2175 ServerResponse: googleapi.ServerResponse{
2176 Header: res.Header,
2177 HTTPStatusCode: res.StatusCode,
2178 },
2179 }
2180 target := &ret
2181 b, err := gensupport.DecodeResponseBytes(target, res)
2182 if err != nil {
2183 return nil, err
2184 }
2185 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.get", "response", internallog.HTTPResponse(res, b))
2186 return ret, nil
2187 }
2188
2189 type ProjectsLocationsListCall struct {
2190 s *Service
2191 name string
2192 urlParams_ gensupport.URLParams
2193 ifNoneMatch_ string
2194 ctx_ context.Context
2195 header_ http.Header
2196 }
2197
2198 // List: Lists information about the supported locations for this service. This
2199 // method lists locations based on the resource scope provided in the
2200 // [ListLocationsRequest.name] field: * **Global locations**: If `name` is
2201 // empty, the method lists the public locations available to all projects. *
2202 // **Project-specific locations**: If `name` follows the format
2203 // `projects/{project}`, the method lists locations visible to that specific
2204 // project. This includes public, private, or other project-specific locations
2205 // enabled for the project. For gRPC and client library implementations, the
2206 // resource name is passed as the `name` field. For direct service calls, the
2207 // resource name is incorporated into the request path based on the specific
2208 // service implementation and version.
2209 //
2210 // - name: The resource that owns the locations collection, if applicable.
2211 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
2212 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2213 c.name = name
2214 return c
2215 }
2216
2217 // ExtraLocationTypes sets the optional parameter "extraLocationTypes": Do not
2218 // use this field. It is unsupported and is ignored unless explicitly
2219 // documented otherwise. This is primarily for internal usage.
2220 func (c *ProjectsLocationsListCall) ExtraLocationTypes(extraLocationTypes ...string) *ProjectsLocationsListCall {
2221 c.urlParams_.SetMulti("extraLocationTypes", append([]string{}, extraLocationTypes...))
2222 return c
2223 }
2224
2225 // Filter sets the optional parameter "filter": A filter to narrow down results
2226 // to a preferred subset. The filtering language accepts strings like
2227 // "displayName=tokyo", and is documented in more detail in AIP-160
2228 // (https://google.aip.dev/160).
2229 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
2230 c.urlParams_.Set("filter", filter)
2231 return c
2232 }
2233
2234 // PageSize sets the optional parameter "pageSize": The maximum number of
2235 // results to return. If not set, the service selects a default.
2236 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
2237 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2238 return c
2239 }
2240
2241 // PageToken sets the optional parameter "pageToken": A page token received
2242 // from the `next_page_token` field in the response. Send that page token to
2243 // receive the subsequent page.
2244 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
2245 c.urlParams_.Set("pageToken", pageToken)
2246 return c
2247 }
2248
2249 // Fields allows partial responses to be retrieved. See
2250 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2251 // details.
2252 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
2253 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2254 return c
2255 }
2256
2257 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2258 // object's ETag matches the given value. This is useful for getting updates
2259 // only after the object has changed since the last request.
2260 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
2261 c.ifNoneMatch_ = entityTag
2262 return c
2263 }
2264
2265 // Context sets the context to be used in this call's Do method.
2266 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
2267 c.ctx_ = ctx
2268 return c
2269 }
2270
2271 // Header returns a http.Header that can be modified by the caller to add
2272 // headers to the request.
2273 func (c *ProjectsLocationsListCall) Header() http.Header {
2274 if c.header_ == nil {
2275 c.header_ = make(http.Header)
2276 }
2277 return c.header_
2278 }
2279
2280 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
2281 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2282 if c.ifNoneMatch_ != "" {
2283 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2284 }
2285 c.urlParams_.Set("alt", alt)
2286 c.urlParams_.Set("prettyPrint", "false")
2287 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
2288 urls += "?" + c.urlParams_.Encode()
2289 req, err := http.NewRequest("GET", urls, nil)
2290 if err != nil {
2291 return nil, err
2292 }
2293 req.Header = reqHeaders
2294 googleapi.Expand(req.URL, map[string]string{
2295 "name": c.name,
2296 })
2297 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.list", "request", internallog.HTTPRequest(req, nil))
2298 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2299 }
2300
2301 // Do executes the "saasservicemgmt.projects.locations.list" call.
2302 // Any non-2xx status code is an error. Response headers are in either
2303 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
2304 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2305 // check whether the returned error was because http.StatusNotModified was
2306 // returned.
2307 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
2308 gensupport.SetOptions(c.urlParams_, opts...)
2309 res, err := c.doRequest("json")
2310 if res != nil && res.StatusCode == http.StatusNotModified {
2311 if res.Body != nil {
2312 res.Body.Close()
2313 }
2314 return nil, gensupport.WrapError(&googleapi.Error{
2315 Code: res.StatusCode,
2316 Header: res.Header,
2317 })
2318 }
2319 if err != nil {
2320 return nil, err
2321 }
2322 defer googleapi.CloseBody(res)
2323 if err := googleapi.CheckResponse(res); err != nil {
2324 return nil, gensupport.WrapError(err)
2325 }
2326 ret := &ListLocationsResponse{
2327 ServerResponse: googleapi.ServerResponse{
2328 Header: res.Header,
2329 HTTPStatusCode: res.StatusCode,
2330 },
2331 }
2332 target := &ret
2333 b, err := gensupport.DecodeResponseBytes(target, res)
2334 if err != nil {
2335 return nil, err
2336 }
2337 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.list", "response", internallog.HTTPResponse(res, b))
2338 return ret, nil
2339 }
2340
2341 // Pages invokes f for each page of results.
2342 // A non-nil error returned from f will halt the iteration.
2343 // The provided context supersedes any context provided to the Context method.
2344 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
2345 c.ctx_ = ctx
2346 defer c.PageToken(c.urlParams_.Get("pageToken"))
2347 for {
2348 x, err := c.Do()
2349 if err != nil {
2350 return err
2351 }
2352 if err := f(x); err != nil {
2353 return err
2354 }
2355 if x.NextPageToken == "" {
2356 return nil
2357 }
2358 c.PageToken(x.NextPageToken)
2359 }
2360 }
2361
2362 type ProjectsLocationsReleasesCreateCall struct {
2363 s *Service
2364 parent string
2365 release *Release
2366 urlParams_ gensupport.URLParams
2367 ctx_ context.Context
2368 header_ http.Header
2369 }
2370
2371 // Create: Create a new release.
2372 //
2373 // - parent: The parent of the release.
2374 func (r *ProjectsLocationsReleasesService) Create(parent string, release *Release) *ProjectsLocationsReleasesCreateCall {
2375 c := &ProjectsLocationsReleasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2376 c.parent = parent
2377 c.release = release
2378 return c
2379 }
2380
2381 // ReleaseId sets the optional parameter "releaseId": Required. The ID value
2382 // for the new release.
2383 func (c *ProjectsLocationsReleasesCreateCall) ReleaseId(releaseId string) *ProjectsLocationsReleasesCreateCall {
2384 c.urlParams_.Set("releaseId", releaseId)
2385 return c
2386 }
2387
2388 // RequestId sets the optional parameter "requestId": An optional request ID to
2389 // identify requests. Specify a unique request ID so that if you must retry
2390 // your request, the server will know to ignore the request if it has already
2391 // been completed. The server will guarantee that for at least 60 minutes since
2392 // the first request. For example, consider a situation where you make an
2393 // initial request and the request times out. If you make the request again
2394 // with the same request ID, the server can check if original operation with
2395 // the same request ID was received, and if so, will ignore the second request.
2396 // This prevents clients from accidentally creating duplicate commitments. The
2397 // request ID must be a valid UUID with the exception that zero UUID is not
2398 // supported (00000000-0000-0000-0000-000000000000).
2399 func (c *ProjectsLocationsReleasesCreateCall) RequestId(requestId string) *ProjectsLocationsReleasesCreateCall {
2400 c.urlParams_.Set("requestId", requestId)
2401 return c
2402 }
2403
2404 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
2405 // is set to true, the service will try to validate that this request would
2406 // succeed, but will not actually make changes.
2407 func (c *ProjectsLocationsReleasesCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsReleasesCreateCall {
2408 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
2409 return c
2410 }
2411
2412 // Fields allows partial responses to be retrieved. See
2413 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2414 // details.
2415 func (c *ProjectsLocationsReleasesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesCreateCall {
2416 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2417 return c
2418 }
2419
2420 // Context sets the context to be used in this call's Do method.
2421 func (c *ProjectsLocationsReleasesCreateCall) Context(ctx context.Context) *ProjectsLocationsReleasesCreateCall {
2422 c.ctx_ = ctx
2423 return c
2424 }
2425
2426 // Header returns a http.Header that can be modified by the caller to add
2427 // headers to the request.
2428 func (c *ProjectsLocationsReleasesCreateCall) Header() http.Header {
2429 if c.header_ == nil {
2430 c.header_ = make(http.Header)
2431 }
2432 return c.header_
2433 }
2434
2435 func (c *ProjectsLocationsReleasesCreateCall) doRequest(alt string) (*http.Response, error) {
2436 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2437 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release)
2438 if err != nil {
2439 return nil, err
2440 }
2441 c.urlParams_.Set("alt", alt)
2442 c.urlParams_.Set("prettyPrint", "false")
2443 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/releases")
2444 urls += "?" + c.urlParams_.Encode()
2445 req, err := http.NewRequest("POST", urls, body)
2446 if err != nil {
2447 return nil, err
2448 }
2449 req.Header = reqHeaders
2450 googleapi.Expand(req.URL, map[string]string{
2451 "parent": c.parent,
2452 })
2453 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2454 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2455 }
2456
2457 // Do executes the "saasservicemgmt.projects.locations.releases.create" call.
2458 // Any non-2xx status code is an error. Response headers are in either
2459 // *Release.ServerResponse.Header or (if a response was returned at all) in
2460 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2461 // whether the returned error was because http.StatusNotModified was returned.
2462 func (c *ProjectsLocationsReleasesCreateCall) Do(opts ...googleapi.CallOption) (*Release, error) {
2463 gensupport.SetOptions(c.urlParams_, opts...)
2464 res, err := c.doRequest("json")
2465 if res != nil && res.StatusCode == http.StatusNotModified {
2466 if res.Body != nil {
2467 res.Body.Close()
2468 }
2469 return nil, gensupport.WrapError(&googleapi.Error{
2470 Code: res.StatusCode,
2471 Header: res.Header,
2472 })
2473 }
2474 if err != nil {
2475 return nil, err
2476 }
2477 defer googleapi.CloseBody(res)
2478 if err := googleapi.CheckResponse(res); err != nil {
2479 return nil, gensupport.WrapError(err)
2480 }
2481 ret := &Release{
2482 ServerResponse: googleapi.ServerResponse{
2483 Header: res.Header,
2484 HTTPStatusCode: res.StatusCode,
2485 },
2486 }
2487 target := &ret
2488 b, err := gensupport.DecodeResponseBytes(target, res)
2489 if err != nil {
2490 return nil, err
2491 }
2492 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.create", "response", internallog.HTTPResponse(res, b))
2493 return ret, nil
2494 }
2495
2496 type ProjectsLocationsReleasesDeleteCall struct {
2497 s *Service
2498 name string
2499 urlParams_ gensupport.URLParams
2500 ctx_ context.Context
2501 header_ http.Header
2502 }
2503
2504 // Delete: Delete a single release.
2505 //
2506 // - name: The resource name of the resource within a service.
2507 func (r *ProjectsLocationsReleasesService) Delete(name string) *ProjectsLocationsReleasesDeleteCall {
2508 c := &ProjectsLocationsReleasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2509 c.name = name
2510 return c
2511 }
2512
2513 // Etag sets the optional parameter "etag": The etag known to the client for
2514 // the expected state of the release. This is used with state-changing methods
2515 // to prevent accidental overwrites when multiple user agents might be acting
2516 // in parallel on the same resource. An etag wildcard provide optimistic
2517 // concurrency based on the expected existence of the release. The Any wildcard
2518 // (`*`) requires that the resource must already exists, and the Not Any
2519 // wildcard (`!*`) requires that it must not.
2520 func (c *ProjectsLocationsReleasesDeleteCall) Etag(etag string) *ProjectsLocationsReleasesDeleteCall {
2521 c.urlParams_.Set("etag", etag)
2522 return c
2523 }
2524
2525 // RequestId sets the optional parameter "requestId": An optional request ID to
2526 // identify requests. Specify a unique request ID so that if you must retry
2527 // your request, the server will know to ignore the request if it has already
2528 // been completed. The server will guarantee that for at least 60 minutes since
2529 // the first request. For example, consider a situation where you make an
2530 // initial request and the request times out. If you make the request again
2531 // with the same request ID, the server can check if original operation with
2532 // the same request ID was received, and if so, will ignore the second request.
2533 // This prevents clients from accidentally creating duplicate commitments. The
2534 // request ID must be a valid UUID with the exception that zero UUID is not
2535 // supported (00000000-0000-0000-0000-000000000000).
2536 func (c *ProjectsLocationsReleasesDeleteCall) RequestId(requestId string) *ProjectsLocationsReleasesDeleteCall {
2537 c.urlParams_.Set("requestId", requestId)
2538 return c
2539 }
2540
2541 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
2542 // is set to true, the service will try to validate that this request would
2543 // succeed, but will not actually make changes.
2544 func (c *ProjectsLocationsReleasesDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsReleasesDeleteCall {
2545 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
2546 return c
2547 }
2548
2549 // Fields allows partial responses to be retrieved. See
2550 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2551 // details.
2552 func (c *ProjectsLocationsReleasesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesDeleteCall {
2553 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2554 return c
2555 }
2556
2557 // Context sets the context to be used in this call's Do method.
2558 func (c *ProjectsLocationsReleasesDeleteCall) Context(ctx context.Context) *ProjectsLocationsReleasesDeleteCall {
2559 c.ctx_ = ctx
2560 return c
2561 }
2562
2563 // Header returns a http.Header that can be modified by the caller to add
2564 // headers to the request.
2565 func (c *ProjectsLocationsReleasesDeleteCall) Header() http.Header {
2566 if c.header_ == nil {
2567 c.header_ = make(http.Header)
2568 }
2569 return c.header_
2570 }
2571
2572 func (c *ProjectsLocationsReleasesDeleteCall) doRequest(alt string) (*http.Response, error) {
2573 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2574 c.urlParams_.Set("alt", alt)
2575 c.urlParams_.Set("prettyPrint", "false")
2576 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2577 urls += "?" + c.urlParams_.Encode()
2578 req, err := http.NewRequest("DELETE", urls, nil)
2579 if err != nil {
2580 return nil, err
2581 }
2582 req.Header = reqHeaders
2583 googleapi.Expand(req.URL, map[string]string{
2584 "name": c.name,
2585 })
2586 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.delete", "request", internallog.HTTPRequest(req, nil))
2587 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2588 }
2589
2590 // Do executes the "saasservicemgmt.projects.locations.releases.delete" call.
2591 // Any non-2xx status code is an error. Response headers are in either
2592 // *Empty.ServerResponse.Header or (if a response was returned at all) in
2593 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2594 // whether the returned error was because http.StatusNotModified was returned.
2595 func (c *ProjectsLocationsReleasesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2596 gensupport.SetOptions(c.urlParams_, opts...)
2597 res, err := c.doRequest("json")
2598 if res != nil && res.StatusCode == http.StatusNotModified {
2599 if res.Body != nil {
2600 res.Body.Close()
2601 }
2602 return nil, gensupport.WrapError(&googleapi.Error{
2603 Code: res.StatusCode,
2604 Header: res.Header,
2605 })
2606 }
2607 if err != nil {
2608 return nil, err
2609 }
2610 defer googleapi.CloseBody(res)
2611 if err := googleapi.CheckResponse(res); err != nil {
2612 return nil, gensupport.WrapError(err)
2613 }
2614 ret := &Empty{
2615 ServerResponse: googleapi.ServerResponse{
2616 Header: res.Header,
2617 HTTPStatusCode: res.StatusCode,
2618 },
2619 }
2620 target := &ret
2621 b, err := gensupport.DecodeResponseBytes(target, res)
2622 if err != nil {
2623 return nil, err
2624 }
2625 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.delete", "response", internallog.HTTPResponse(res, b))
2626 return ret, nil
2627 }
2628
2629 type ProjectsLocationsReleasesGetCall struct {
2630 s *Service
2631 name string
2632 urlParams_ gensupport.URLParams
2633 ifNoneMatch_ string
2634 ctx_ context.Context
2635 header_ http.Header
2636 }
2637
2638 // Get: Retrieve a single release.
2639 //
2640 // - name: The resource name of the resource within a service.
2641 func (r *ProjectsLocationsReleasesService) Get(name string) *ProjectsLocationsReleasesGetCall {
2642 c := &ProjectsLocationsReleasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2643 c.name = name
2644 return c
2645 }
2646
2647 // Fields allows partial responses to be retrieved. See
2648 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2649 // details.
2650 func (c *ProjectsLocationsReleasesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesGetCall {
2651 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2652 return c
2653 }
2654
2655 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2656 // object's ETag matches the given value. This is useful for getting updates
2657 // only after the object has changed since the last request.
2658 func (c *ProjectsLocationsReleasesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReleasesGetCall {
2659 c.ifNoneMatch_ = entityTag
2660 return c
2661 }
2662
2663 // Context sets the context to be used in this call's Do method.
2664 func (c *ProjectsLocationsReleasesGetCall) Context(ctx context.Context) *ProjectsLocationsReleasesGetCall {
2665 c.ctx_ = ctx
2666 return c
2667 }
2668
2669 // Header returns a http.Header that can be modified by the caller to add
2670 // headers to the request.
2671 func (c *ProjectsLocationsReleasesGetCall) Header() http.Header {
2672 if c.header_ == nil {
2673 c.header_ = make(http.Header)
2674 }
2675 return c.header_
2676 }
2677
2678 func (c *ProjectsLocationsReleasesGetCall) doRequest(alt string) (*http.Response, error) {
2679 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2680 if c.ifNoneMatch_ != "" {
2681 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2682 }
2683 c.urlParams_.Set("alt", alt)
2684 c.urlParams_.Set("prettyPrint", "false")
2685 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2686 urls += "?" + c.urlParams_.Encode()
2687 req, err := http.NewRequest("GET", urls, nil)
2688 if err != nil {
2689 return nil, err
2690 }
2691 req.Header = reqHeaders
2692 googleapi.Expand(req.URL, map[string]string{
2693 "name": c.name,
2694 })
2695 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.get", "request", internallog.HTTPRequest(req, nil))
2696 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2697 }
2698
2699 // Do executes the "saasservicemgmt.projects.locations.releases.get" call.
2700 // Any non-2xx status code is an error. Response headers are in either
2701 // *Release.ServerResponse.Header or (if a response was returned at all) in
2702 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2703 // whether the returned error was because http.StatusNotModified was returned.
2704 func (c *ProjectsLocationsReleasesGetCall) Do(opts ...googleapi.CallOption) (*Release, error) {
2705 gensupport.SetOptions(c.urlParams_, opts...)
2706 res, err := c.doRequest("json")
2707 if res != nil && res.StatusCode == http.StatusNotModified {
2708 if res.Body != nil {
2709 res.Body.Close()
2710 }
2711 return nil, gensupport.WrapError(&googleapi.Error{
2712 Code: res.StatusCode,
2713 Header: res.Header,
2714 })
2715 }
2716 if err != nil {
2717 return nil, err
2718 }
2719 defer googleapi.CloseBody(res)
2720 if err := googleapi.CheckResponse(res); err != nil {
2721 return nil, gensupport.WrapError(err)
2722 }
2723 ret := &Release{
2724 ServerResponse: googleapi.ServerResponse{
2725 Header: res.Header,
2726 HTTPStatusCode: res.StatusCode,
2727 },
2728 }
2729 target := &ret
2730 b, err := gensupport.DecodeResponseBytes(target, res)
2731 if err != nil {
2732 return nil, err
2733 }
2734 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.get", "response", internallog.HTTPResponse(res, b))
2735 return ret, nil
2736 }
2737
2738 type ProjectsLocationsReleasesListCall struct {
2739 s *Service
2740 parent string
2741 urlParams_ gensupport.URLParams
2742 ifNoneMatch_ string
2743 ctx_ context.Context
2744 header_ http.Header
2745 }
2746
2747 // List: Retrieve a collection of releases.
2748 //
2749 // - parent: The parent of the release.
2750 func (r *ProjectsLocationsReleasesService) List(parent string) *ProjectsLocationsReleasesListCall {
2751 c := &ProjectsLocationsReleasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2752 c.parent = parent
2753 return c
2754 }
2755
2756 // Filter sets the optional parameter "filter": Filter the list as specified in
2757 // https://google.aip.dev/160.
2758 func (c *ProjectsLocationsReleasesListCall) Filter(filter string) *ProjectsLocationsReleasesListCall {
2759 c.urlParams_.Set("filter", filter)
2760 return c
2761 }
2762
2763 // OrderBy sets the optional parameter "orderBy": Order results as specified in
2764 // https://google.aip.dev/132.
2765 func (c *ProjectsLocationsReleasesListCall) OrderBy(orderBy string) *ProjectsLocationsReleasesListCall {
2766 c.urlParams_.Set("orderBy", orderBy)
2767 return c
2768 }
2769
2770 // PageSize sets the optional parameter "pageSize": The maximum number of
2771 // releases to send per page.
2772 func (c *ProjectsLocationsReleasesListCall) PageSize(pageSize int64) *ProjectsLocationsReleasesListCall {
2773 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2774 return c
2775 }
2776
2777 // PageToken sets the optional parameter "pageToken": The page token: If the
2778 // next_page_token from a previous response is provided, this request will send
2779 // the subsequent page.
2780 func (c *ProjectsLocationsReleasesListCall) PageToken(pageToken string) *ProjectsLocationsReleasesListCall {
2781 c.urlParams_.Set("pageToken", pageToken)
2782 return c
2783 }
2784
2785 // Fields allows partial responses to be retrieved. See
2786 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2787 // details.
2788 func (c *ProjectsLocationsReleasesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesListCall {
2789 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2790 return c
2791 }
2792
2793 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2794 // object's ETag matches the given value. This is useful for getting updates
2795 // only after the object has changed since the last request.
2796 func (c *ProjectsLocationsReleasesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReleasesListCall {
2797 c.ifNoneMatch_ = entityTag
2798 return c
2799 }
2800
2801 // Context sets the context to be used in this call's Do method.
2802 func (c *ProjectsLocationsReleasesListCall) Context(ctx context.Context) *ProjectsLocationsReleasesListCall {
2803 c.ctx_ = ctx
2804 return c
2805 }
2806
2807 // Header returns a http.Header that can be modified by the caller to add
2808 // headers to the request.
2809 func (c *ProjectsLocationsReleasesListCall) Header() http.Header {
2810 if c.header_ == nil {
2811 c.header_ = make(http.Header)
2812 }
2813 return c.header_
2814 }
2815
2816 func (c *ProjectsLocationsReleasesListCall) doRequest(alt string) (*http.Response, error) {
2817 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2818 if c.ifNoneMatch_ != "" {
2819 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2820 }
2821 c.urlParams_.Set("alt", alt)
2822 c.urlParams_.Set("prettyPrint", "false")
2823 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/releases")
2824 urls += "?" + c.urlParams_.Encode()
2825 req, err := http.NewRequest("GET", urls, nil)
2826 if err != nil {
2827 return nil, err
2828 }
2829 req.Header = reqHeaders
2830 googleapi.Expand(req.URL, map[string]string{
2831 "parent": c.parent,
2832 })
2833 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.list", "request", internallog.HTTPRequest(req, nil))
2834 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2835 }
2836
2837 // Do executes the "saasservicemgmt.projects.locations.releases.list" call.
2838 // Any non-2xx status code is an error. Response headers are in either
2839 // *ListReleasesResponse.ServerResponse.Header or (if a response was returned
2840 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2841 // check whether the returned error was because http.StatusNotModified was
2842 // returned.
2843 func (c *ProjectsLocationsReleasesListCall) Do(opts ...googleapi.CallOption) (*ListReleasesResponse, error) {
2844 gensupport.SetOptions(c.urlParams_, opts...)
2845 res, err := c.doRequest("json")
2846 if res != nil && res.StatusCode == http.StatusNotModified {
2847 if res.Body != nil {
2848 res.Body.Close()
2849 }
2850 return nil, gensupport.WrapError(&googleapi.Error{
2851 Code: res.StatusCode,
2852 Header: res.Header,
2853 })
2854 }
2855 if err != nil {
2856 return nil, err
2857 }
2858 defer googleapi.CloseBody(res)
2859 if err := googleapi.CheckResponse(res); err != nil {
2860 return nil, gensupport.WrapError(err)
2861 }
2862 ret := &ListReleasesResponse{
2863 ServerResponse: googleapi.ServerResponse{
2864 Header: res.Header,
2865 HTTPStatusCode: res.StatusCode,
2866 },
2867 }
2868 target := &ret
2869 b, err := gensupport.DecodeResponseBytes(target, res)
2870 if err != nil {
2871 return nil, err
2872 }
2873 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.list", "response", internallog.HTTPResponse(res, b))
2874 return ret, nil
2875 }
2876
2877 // Pages invokes f for each page of results.
2878 // A non-nil error returned from f will halt the iteration.
2879 // The provided context supersedes any context provided to the Context method.
2880 func (c *ProjectsLocationsReleasesListCall) Pages(ctx context.Context, f func(*ListReleasesResponse) error) error {
2881 c.ctx_ = ctx
2882 defer c.PageToken(c.urlParams_.Get("pageToken"))
2883 for {
2884 x, err := c.Do()
2885 if err != nil {
2886 return err
2887 }
2888 if err := f(x); err != nil {
2889 return err
2890 }
2891 if x.NextPageToken == "" {
2892 return nil
2893 }
2894 c.PageToken(x.NextPageToken)
2895 }
2896 }
2897
2898 type ProjectsLocationsReleasesPatchCall struct {
2899 s *Service
2900 name string
2901 release *Release
2902 urlParams_ gensupport.URLParams
2903 ctx_ context.Context
2904 header_ http.Header
2905 }
2906
2907 // Patch: Update a single release.
2908 //
2909 // - name: Identifier. The resource name (full URI of the resource) following
2910 // the standard naming scheme:
2911 // "projects/{project}/locations/{location}/releases/{release}".
2912 func (r *ProjectsLocationsReleasesService) Patch(name string, release *Release) *ProjectsLocationsReleasesPatchCall {
2913 c := &ProjectsLocationsReleasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2914 c.name = name
2915 c.release = release
2916 return c
2917 }
2918
2919 // RequestId sets the optional parameter "requestId": An optional request ID to
2920 // identify requests. Specify a unique request ID so that if you must retry
2921 // your request, the server will know to ignore the request if it has already
2922 // been completed. The server will guarantee that for at least 60 minutes since
2923 // the first request. For example, consider a situation where you make an
2924 // initial request and the request times out. If you make the request again
2925 // with the same request ID, the server can check if original operation with
2926 // the same request ID was received, and if so, will ignore the second request.
2927 // This prevents clients from accidentally creating duplicate commitments. The
2928 // request ID must be a valid UUID with the exception that zero UUID is not
2929 // supported (00000000-0000-0000-0000-000000000000).
2930 func (c *ProjectsLocationsReleasesPatchCall) RequestId(requestId string) *ProjectsLocationsReleasesPatchCall {
2931 c.urlParams_.Set("requestId", requestId)
2932 return c
2933 }
2934
2935 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
2936 // specify the fields to be overwritten in the Release resource by the update.
2937 // The fields specified in the update_mask are relative to the resource, not
2938 // the full request. A field will be overwritten if it is in the mask. If the
2939 // user does not provide a mask then all fields in the Release will be
2940 // overwritten.
2941 func (c *ProjectsLocationsReleasesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsReleasesPatchCall {
2942 c.urlParams_.Set("updateMask", updateMask)
2943 return c
2944 }
2945
2946 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
2947 // is set to true, the service will try to validate that this request would
2948 // succeed, but will not actually make changes.
2949 func (c *ProjectsLocationsReleasesPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsReleasesPatchCall {
2950 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
2951 return c
2952 }
2953
2954 // Fields allows partial responses to be retrieved. See
2955 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2956 // details.
2957 func (c *ProjectsLocationsReleasesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesPatchCall {
2958 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2959 return c
2960 }
2961
2962 // Context sets the context to be used in this call's Do method.
2963 func (c *ProjectsLocationsReleasesPatchCall) Context(ctx context.Context) *ProjectsLocationsReleasesPatchCall {
2964 c.ctx_ = ctx
2965 return c
2966 }
2967
2968 // Header returns a http.Header that can be modified by the caller to add
2969 // headers to the request.
2970 func (c *ProjectsLocationsReleasesPatchCall) Header() http.Header {
2971 if c.header_ == nil {
2972 c.header_ = make(http.Header)
2973 }
2974 return c.header_
2975 }
2976
2977 func (c *ProjectsLocationsReleasesPatchCall) doRequest(alt string) (*http.Response, error) {
2978 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2979 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release)
2980 if err != nil {
2981 return nil, err
2982 }
2983 c.urlParams_.Set("alt", alt)
2984 c.urlParams_.Set("prettyPrint", "false")
2985 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2986 urls += "?" + c.urlParams_.Encode()
2987 req, err := http.NewRequest("PATCH", urls, body)
2988 if err != nil {
2989 return nil, err
2990 }
2991 req.Header = reqHeaders
2992 googleapi.Expand(req.URL, map[string]string{
2993 "name": c.name,
2994 })
2995 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
2996 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2997 }
2998
2999 // Do executes the "saasservicemgmt.projects.locations.releases.patch" call.
3000 // Any non-2xx status code is an error. Response headers are in either
3001 // *Release.ServerResponse.Header or (if a response was returned at all) in
3002 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3003 // whether the returned error was because http.StatusNotModified was returned.
3004 func (c *ProjectsLocationsReleasesPatchCall) Do(opts ...googleapi.CallOption) (*Release, error) {
3005 gensupport.SetOptions(c.urlParams_, opts...)
3006 res, err := c.doRequest("json")
3007 if res != nil && res.StatusCode == http.StatusNotModified {
3008 if res.Body != nil {
3009 res.Body.Close()
3010 }
3011 return nil, gensupport.WrapError(&googleapi.Error{
3012 Code: res.StatusCode,
3013 Header: res.Header,
3014 })
3015 }
3016 if err != nil {
3017 return nil, err
3018 }
3019 defer googleapi.CloseBody(res)
3020 if err := googleapi.CheckResponse(res); err != nil {
3021 return nil, gensupport.WrapError(err)
3022 }
3023 ret := &Release{
3024 ServerResponse: googleapi.ServerResponse{
3025 Header: res.Header,
3026 HTTPStatusCode: res.StatusCode,
3027 },
3028 }
3029 target := &ret
3030 b, err := gensupport.DecodeResponseBytes(target, res)
3031 if err != nil {
3032 return nil, err
3033 }
3034 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.patch", "response", internallog.HTTPResponse(res, b))
3035 return ret, nil
3036 }
3037
3038 type ProjectsLocationsRolloutKindsCreateCall struct {
3039 s *Service
3040 parent string
3041 rolloutkind *RolloutKind
3042 urlParams_ gensupport.URLParams
3043 ctx_ context.Context
3044 header_ http.Header
3045 }
3046
3047 // Create: Create a new rollout kind.
3048 //
3049 // - parent: The parent of the rollout kind.
3050 func (r *ProjectsLocationsRolloutKindsService) Create(parent string, rolloutkind *RolloutKind) *ProjectsLocationsRolloutKindsCreateCall {
3051 c := &ProjectsLocationsRolloutKindsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3052 c.parent = parent
3053 c.rolloutkind = rolloutkind
3054 return c
3055 }
3056
3057 // RequestId sets the optional parameter "requestId": An optional request ID to
3058 // identify requests. Specify a unique request ID so that if you must retry
3059 // your request, the server will know to ignore the request if it has already
3060 // been completed. The server will guarantee that for at least 60 minutes since
3061 // the first request. For example, consider a situation where you make an
3062 // initial request and the request times out. If you make the request again
3063 // with the same request ID, the server can check if original operation with
3064 // the same request ID was received, and if so, will ignore the second request.
3065 // This prevents clients from accidentally creating duplicate commitments. The
3066 // request ID must be a valid UUID with the exception that zero UUID is not
3067 // supported (00000000-0000-0000-0000-000000000000).
3068 func (c *ProjectsLocationsRolloutKindsCreateCall) RequestId(requestId string) *ProjectsLocationsRolloutKindsCreateCall {
3069 c.urlParams_.Set("requestId", requestId)
3070 return c
3071 }
3072
3073 // RolloutKindId sets the optional parameter "rolloutKindId": Required. The ID
3074 // value for the new rollout kind.
3075 func (c *ProjectsLocationsRolloutKindsCreateCall) RolloutKindId(rolloutKindId string) *ProjectsLocationsRolloutKindsCreateCall {
3076 c.urlParams_.Set("rolloutKindId", rolloutKindId)
3077 return c
3078 }
3079
3080 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3081 // is set to true, the service will try to validate that this request would
3082 // succeed, but will not actually make changes.
3083 func (c *ProjectsLocationsRolloutKindsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutKindsCreateCall {
3084 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3085 return c
3086 }
3087
3088 // Fields allows partial responses to be retrieved. See
3089 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3090 // details.
3091 func (c *ProjectsLocationsRolloutKindsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsCreateCall {
3092 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3093 return c
3094 }
3095
3096 // Context sets the context to be used in this call's Do method.
3097 func (c *ProjectsLocationsRolloutKindsCreateCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsCreateCall {
3098 c.ctx_ = ctx
3099 return c
3100 }
3101
3102 // Header returns a http.Header that can be modified by the caller to add
3103 // headers to the request.
3104 func (c *ProjectsLocationsRolloutKindsCreateCall) Header() http.Header {
3105 if c.header_ == nil {
3106 c.header_ = make(http.Header)
3107 }
3108 return c.header_
3109 }
3110
3111 func (c *ProjectsLocationsRolloutKindsCreateCall) doRequest(alt string) (*http.Response, error) {
3112 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3113 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rolloutkind)
3114 if err != nil {
3115 return nil, err
3116 }
3117 c.urlParams_.Set("alt", alt)
3118 c.urlParams_.Set("prettyPrint", "false")
3119 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rolloutKinds")
3120 urls += "?" + c.urlParams_.Encode()
3121 req, err := http.NewRequest("POST", urls, body)
3122 if err != nil {
3123 return nil, err
3124 }
3125 req.Header = reqHeaders
3126 googleapi.Expand(req.URL, map[string]string{
3127 "parent": c.parent,
3128 })
3129 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3130 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3131 }
3132
3133 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.create" call.
3134 // Any non-2xx status code is an error. Response headers are in either
3135 // *RolloutKind.ServerResponse.Header or (if a response was returned at all) in
3136 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3137 // whether the returned error was because http.StatusNotModified was returned.
3138 func (c *ProjectsLocationsRolloutKindsCreateCall) Do(opts ...googleapi.CallOption) (*RolloutKind, error) {
3139 gensupport.SetOptions(c.urlParams_, opts...)
3140 res, err := c.doRequest("json")
3141 if res != nil && res.StatusCode == http.StatusNotModified {
3142 if res.Body != nil {
3143 res.Body.Close()
3144 }
3145 return nil, gensupport.WrapError(&googleapi.Error{
3146 Code: res.StatusCode,
3147 Header: res.Header,
3148 })
3149 }
3150 if err != nil {
3151 return nil, err
3152 }
3153 defer googleapi.CloseBody(res)
3154 if err := googleapi.CheckResponse(res); err != nil {
3155 return nil, gensupport.WrapError(err)
3156 }
3157 ret := &RolloutKind{
3158 ServerResponse: googleapi.ServerResponse{
3159 Header: res.Header,
3160 HTTPStatusCode: res.StatusCode,
3161 },
3162 }
3163 target := &ret
3164 b, err := gensupport.DecodeResponseBytes(target, res)
3165 if err != nil {
3166 return nil, err
3167 }
3168 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.create", "response", internallog.HTTPResponse(res, b))
3169 return ret, nil
3170 }
3171
3172 type ProjectsLocationsRolloutKindsDeleteCall struct {
3173 s *Service
3174 name string
3175 urlParams_ gensupport.URLParams
3176 ctx_ context.Context
3177 header_ http.Header
3178 }
3179
3180 // Delete: Delete a single rollout kind.
3181 //
3182 // - name: The resource name of the resource within a service.
3183 func (r *ProjectsLocationsRolloutKindsService) Delete(name string) *ProjectsLocationsRolloutKindsDeleteCall {
3184 c := &ProjectsLocationsRolloutKindsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3185 c.name = name
3186 return c
3187 }
3188
3189 // Etag sets the optional parameter "etag": The etag known to the client for
3190 // the expected state of the rollout kind. This is used with state-changing
3191 // methods to prevent accidental overwrites when multiple user agents might be
3192 // acting in parallel on the same resource. An etag wildcard provide optimistic
3193 // concurrency based on the expected existence of the rollout kind. The Any
3194 // wildcard (`*`) requires that the resource must already exists, and the Not
3195 // Any wildcard (`!*`) requires that it must not.
3196 func (c *ProjectsLocationsRolloutKindsDeleteCall) Etag(etag string) *ProjectsLocationsRolloutKindsDeleteCall {
3197 c.urlParams_.Set("etag", etag)
3198 return c
3199 }
3200
3201 // RequestId sets the optional parameter "requestId": An optional request ID to
3202 // identify requests. Specify a unique request ID so that if you must retry
3203 // your request, the server will know to ignore the request if it has already
3204 // been completed. The server will guarantee that for at least 60 minutes since
3205 // the first request. For example, consider a situation where you make an
3206 // initial request and the request times out. If you make the request again
3207 // with the same request ID, the server can check if original operation with
3208 // the same request ID was received, and if so, will ignore the second request.
3209 // This prevents clients from accidentally creating duplicate commitments. The
3210 // request ID must be a valid UUID with the exception that zero UUID is not
3211 // supported (00000000-0000-0000-0000-000000000000).
3212 func (c *ProjectsLocationsRolloutKindsDeleteCall) RequestId(requestId string) *ProjectsLocationsRolloutKindsDeleteCall {
3213 c.urlParams_.Set("requestId", requestId)
3214 return c
3215 }
3216
3217 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3218 // is set to true, the service will try to validate that this request would
3219 // succeed, but will not actually make changes.
3220 func (c *ProjectsLocationsRolloutKindsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutKindsDeleteCall {
3221 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3222 return c
3223 }
3224
3225 // Fields allows partial responses to be retrieved. See
3226 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3227 // details.
3228 func (c *ProjectsLocationsRolloutKindsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsDeleteCall {
3229 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3230 return c
3231 }
3232
3233 // Context sets the context to be used in this call's Do method.
3234 func (c *ProjectsLocationsRolloutKindsDeleteCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsDeleteCall {
3235 c.ctx_ = ctx
3236 return c
3237 }
3238
3239 // Header returns a http.Header that can be modified by the caller to add
3240 // headers to the request.
3241 func (c *ProjectsLocationsRolloutKindsDeleteCall) Header() http.Header {
3242 if c.header_ == nil {
3243 c.header_ = make(http.Header)
3244 }
3245 return c.header_
3246 }
3247
3248 func (c *ProjectsLocationsRolloutKindsDeleteCall) doRequest(alt string) (*http.Response, error) {
3249 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3250 c.urlParams_.Set("alt", alt)
3251 c.urlParams_.Set("prettyPrint", "false")
3252 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3253 urls += "?" + c.urlParams_.Encode()
3254 req, err := http.NewRequest("DELETE", urls, nil)
3255 if err != nil {
3256 return nil, err
3257 }
3258 req.Header = reqHeaders
3259 googleapi.Expand(req.URL, map[string]string{
3260 "name": c.name,
3261 })
3262 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.delete", "request", internallog.HTTPRequest(req, nil))
3263 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3264 }
3265
3266 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.delete" call.
3267 // Any non-2xx status code is an error. Response headers are in either
3268 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3269 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3270 // whether the returned error was because http.StatusNotModified was returned.
3271 func (c *ProjectsLocationsRolloutKindsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3272 gensupport.SetOptions(c.urlParams_, opts...)
3273 res, err := c.doRequest("json")
3274 if res != nil && res.StatusCode == http.StatusNotModified {
3275 if res.Body != nil {
3276 res.Body.Close()
3277 }
3278 return nil, gensupport.WrapError(&googleapi.Error{
3279 Code: res.StatusCode,
3280 Header: res.Header,
3281 })
3282 }
3283 if err != nil {
3284 return nil, err
3285 }
3286 defer googleapi.CloseBody(res)
3287 if err := googleapi.CheckResponse(res); err != nil {
3288 return nil, gensupport.WrapError(err)
3289 }
3290 ret := &Empty{
3291 ServerResponse: googleapi.ServerResponse{
3292 Header: res.Header,
3293 HTTPStatusCode: res.StatusCode,
3294 },
3295 }
3296 target := &ret
3297 b, err := gensupport.DecodeResponseBytes(target, res)
3298 if err != nil {
3299 return nil, err
3300 }
3301 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.delete", "response", internallog.HTTPResponse(res, b))
3302 return ret, nil
3303 }
3304
3305 type ProjectsLocationsRolloutKindsGetCall struct {
3306 s *Service
3307 name string
3308 urlParams_ gensupport.URLParams
3309 ifNoneMatch_ string
3310 ctx_ context.Context
3311 header_ http.Header
3312 }
3313
3314 // Get: Retrieve a single rollout kind.
3315 //
3316 // - name: The resource name of the resource within a service.
3317 func (r *ProjectsLocationsRolloutKindsService) Get(name string) *ProjectsLocationsRolloutKindsGetCall {
3318 c := &ProjectsLocationsRolloutKindsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3319 c.name = name
3320 return c
3321 }
3322
3323 // Fields allows partial responses to be retrieved. See
3324 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3325 // details.
3326 func (c *ProjectsLocationsRolloutKindsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsGetCall {
3327 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3328 return c
3329 }
3330
3331 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3332 // object's ETag matches the given value. This is useful for getting updates
3333 // only after the object has changed since the last request.
3334 func (c *ProjectsLocationsRolloutKindsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRolloutKindsGetCall {
3335 c.ifNoneMatch_ = entityTag
3336 return c
3337 }
3338
3339 // Context sets the context to be used in this call's Do method.
3340 func (c *ProjectsLocationsRolloutKindsGetCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsGetCall {
3341 c.ctx_ = ctx
3342 return c
3343 }
3344
3345 // Header returns a http.Header that can be modified by the caller to add
3346 // headers to the request.
3347 func (c *ProjectsLocationsRolloutKindsGetCall) Header() http.Header {
3348 if c.header_ == nil {
3349 c.header_ = make(http.Header)
3350 }
3351 return c.header_
3352 }
3353
3354 func (c *ProjectsLocationsRolloutKindsGetCall) doRequest(alt string) (*http.Response, error) {
3355 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3356 if c.ifNoneMatch_ != "" {
3357 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3358 }
3359 c.urlParams_.Set("alt", alt)
3360 c.urlParams_.Set("prettyPrint", "false")
3361 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3362 urls += "?" + c.urlParams_.Encode()
3363 req, err := http.NewRequest("GET", urls, nil)
3364 if err != nil {
3365 return nil, err
3366 }
3367 req.Header = reqHeaders
3368 googleapi.Expand(req.URL, map[string]string{
3369 "name": c.name,
3370 })
3371 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.get", "request", internallog.HTTPRequest(req, nil))
3372 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3373 }
3374
3375 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.get" call.
3376 // Any non-2xx status code is an error. Response headers are in either
3377 // *RolloutKind.ServerResponse.Header or (if a response was returned at all) in
3378 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3379 // whether the returned error was because http.StatusNotModified was returned.
3380 func (c *ProjectsLocationsRolloutKindsGetCall) Do(opts ...googleapi.CallOption) (*RolloutKind, error) {
3381 gensupport.SetOptions(c.urlParams_, opts...)
3382 res, err := c.doRequest("json")
3383 if res != nil && res.StatusCode == http.StatusNotModified {
3384 if res.Body != nil {
3385 res.Body.Close()
3386 }
3387 return nil, gensupport.WrapError(&googleapi.Error{
3388 Code: res.StatusCode,
3389 Header: res.Header,
3390 })
3391 }
3392 if err != nil {
3393 return nil, err
3394 }
3395 defer googleapi.CloseBody(res)
3396 if err := googleapi.CheckResponse(res); err != nil {
3397 return nil, gensupport.WrapError(err)
3398 }
3399 ret := &RolloutKind{
3400 ServerResponse: googleapi.ServerResponse{
3401 Header: res.Header,
3402 HTTPStatusCode: res.StatusCode,
3403 },
3404 }
3405 target := &ret
3406 b, err := gensupport.DecodeResponseBytes(target, res)
3407 if err != nil {
3408 return nil, err
3409 }
3410 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.get", "response", internallog.HTTPResponse(res, b))
3411 return ret, nil
3412 }
3413
3414 type ProjectsLocationsRolloutKindsListCall struct {
3415 s *Service
3416 parent string
3417 urlParams_ gensupport.URLParams
3418 ifNoneMatch_ string
3419 ctx_ context.Context
3420 header_ http.Header
3421 }
3422
3423 // List: Retrieve a collection of rollout kinds.
3424 //
3425 // - parent: The parent of the rollout kind.
3426 func (r *ProjectsLocationsRolloutKindsService) List(parent string) *ProjectsLocationsRolloutKindsListCall {
3427 c := &ProjectsLocationsRolloutKindsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3428 c.parent = parent
3429 return c
3430 }
3431
3432 // Filter sets the optional parameter "filter": Filter the list as specified in
3433 // https://google.aip.dev/160.
3434 func (c *ProjectsLocationsRolloutKindsListCall) Filter(filter string) *ProjectsLocationsRolloutKindsListCall {
3435 c.urlParams_.Set("filter", filter)
3436 return c
3437 }
3438
3439 // OrderBy sets the optional parameter "orderBy": Order results as specified in
3440 // https://google.aip.dev/132.
3441 func (c *ProjectsLocationsRolloutKindsListCall) OrderBy(orderBy string) *ProjectsLocationsRolloutKindsListCall {
3442 c.urlParams_.Set("orderBy", orderBy)
3443 return c
3444 }
3445
3446 // PageSize sets the optional parameter "pageSize": The maximum number of
3447 // rollout kinds to send per page.
3448 func (c *ProjectsLocationsRolloutKindsListCall) PageSize(pageSize int64) *ProjectsLocationsRolloutKindsListCall {
3449 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3450 return c
3451 }
3452
3453 // PageToken sets the optional parameter "pageToken": The page token: If the
3454 // next_page_token from a previous response is provided, this request will send
3455 // the subsequent page.
3456 func (c *ProjectsLocationsRolloutKindsListCall) PageToken(pageToken string) *ProjectsLocationsRolloutKindsListCall {
3457 c.urlParams_.Set("pageToken", pageToken)
3458 return c
3459 }
3460
3461 // Fields allows partial responses to be retrieved. See
3462 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3463 // details.
3464 func (c *ProjectsLocationsRolloutKindsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsListCall {
3465 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3466 return c
3467 }
3468
3469 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3470 // object's ETag matches the given value. This is useful for getting updates
3471 // only after the object has changed since the last request.
3472 func (c *ProjectsLocationsRolloutKindsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRolloutKindsListCall {
3473 c.ifNoneMatch_ = entityTag
3474 return c
3475 }
3476
3477 // Context sets the context to be used in this call's Do method.
3478 func (c *ProjectsLocationsRolloutKindsListCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsListCall {
3479 c.ctx_ = ctx
3480 return c
3481 }
3482
3483 // Header returns a http.Header that can be modified by the caller to add
3484 // headers to the request.
3485 func (c *ProjectsLocationsRolloutKindsListCall) Header() http.Header {
3486 if c.header_ == nil {
3487 c.header_ = make(http.Header)
3488 }
3489 return c.header_
3490 }
3491
3492 func (c *ProjectsLocationsRolloutKindsListCall) doRequest(alt string) (*http.Response, error) {
3493 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3494 if c.ifNoneMatch_ != "" {
3495 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3496 }
3497 c.urlParams_.Set("alt", alt)
3498 c.urlParams_.Set("prettyPrint", "false")
3499 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rolloutKinds")
3500 urls += "?" + c.urlParams_.Encode()
3501 req, err := http.NewRequest("GET", urls, nil)
3502 if err != nil {
3503 return nil, err
3504 }
3505 req.Header = reqHeaders
3506 googleapi.Expand(req.URL, map[string]string{
3507 "parent": c.parent,
3508 })
3509 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.list", "request", internallog.HTTPRequest(req, nil))
3510 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3511 }
3512
3513 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.list" call.
3514 // Any non-2xx status code is an error. Response headers are in either
3515 // *ListRolloutKindsResponse.ServerResponse.Header or (if a response was
3516 // returned at all) in error.(*googleapi.Error).Header. Use
3517 // googleapi.IsNotModified to check whether the returned error was because
3518 // http.StatusNotModified was returned.
3519 func (c *ProjectsLocationsRolloutKindsListCall) Do(opts ...googleapi.CallOption) (*ListRolloutKindsResponse, error) {
3520 gensupport.SetOptions(c.urlParams_, opts...)
3521 res, err := c.doRequest("json")
3522 if res != nil && res.StatusCode == http.StatusNotModified {
3523 if res.Body != nil {
3524 res.Body.Close()
3525 }
3526 return nil, gensupport.WrapError(&googleapi.Error{
3527 Code: res.StatusCode,
3528 Header: res.Header,
3529 })
3530 }
3531 if err != nil {
3532 return nil, err
3533 }
3534 defer googleapi.CloseBody(res)
3535 if err := googleapi.CheckResponse(res); err != nil {
3536 return nil, gensupport.WrapError(err)
3537 }
3538 ret := &ListRolloutKindsResponse{
3539 ServerResponse: googleapi.ServerResponse{
3540 Header: res.Header,
3541 HTTPStatusCode: res.StatusCode,
3542 },
3543 }
3544 target := &ret
3545 b, err := gensupport.DecodeResponseBytes(target, res)
3546 if err != nil {
3547 return nil, err
3548 }
3549 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.list", "response", internallog.HTTPResponse(res, b))
3550 return ret, nil
3551 }
3552
3553 // Pages invokes f for each page of results.
3554 // A non-nil error returned from f will halt the iteration.
3555 // The provided context supersedes any context provided to the Context method.
3556 func (c *ProjectsLocationsRolloutKindsListCall) Pages(ctx context.Context, f func(*ListRolloutKindsResponse) error) error {
3557 c.ctx_ = ctx
3558 defer c.PageToken(c.urlParams_.Get("pageToken"))
3559 for {
3560 x, err := c.Do()
3561 if err != nil {
3562 return err
3563 }
3564 if err := f(x); err != nil {
3565 return err
3566 }
3567 if x.NextPageToken == "" {
3568 return nil
3569 }
3570 c.PageToken(x.NextPageToken)
3571 }
3572 }
3573
3574 type ProjectsLocationsRolloutKindsPatchCall struct {
3575 s *Service
3576 name string
3577 rolloutkind *RolloutKind
3578 urlParams_ gensupport.URLParams
3579 ctx_ context.Context
3580 header_ http.Header
3581 }
3582
3583 // Patch: Update a single rollout kind.
3584 //
3585 // - name: Identifier. The resource name (full URI of the resource) following
3586 // the standard naming scheme:
3587 // "projects/{project}/locations/{location}/rolloutKinds/{rollout_kind_id}".
3588 func (r *ProjectsLocationsRolloutKindsService) Patch(name string, rolloutkind *RolloutKind) *ProjectsLocationsRolloutKindsPatchCall {
3589 c := &ProjectsLocationsRolloutKindsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3590 c.name = name
3591 c.rolloutkind = rolloutkind
3592 return c
3593 }
3594
3595 // RequestId sets the optional parameter "requestId": An optional request ID to
3596 // identify requests. Specify a unique request ID so that if you must retry
3597 // your request, the server will know to ignore the request if it has already
3598 // been completed. The server will guarantee that for at least 60 minutes since
3599 // the first request. For example, consider a situation where you make an
3600 // initial request and the request times out. If you make the request again
3601 // with the same request ID, the server can check if original operation with
3602 // the same request ID was received, and if so, will ignore the second request.
3603 // This prevents clients from accidentally creating duplicate commitments. The
3604 // request ID must be a valid UUID with the exception that zero UUID is not
3605 // supported (00000000-0000-0000-0000-000000000000).
3606 func (c *ProjectsLocationsRolloutKindsPatchCall) RequestId(requestId string) *ProjectsLocationsRolloutKindsPatchCall {
3607 c.urlParams_.Set("requestId", requestId)
3608 return c
3609 }
3610
3611 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
3612 // specify the fields to be overwritten in the RolloutKind resource by the
3613 // update. The fields specified in the update_mask are relative to the
3614 // resource, not the full request. A field will be overwritten if it is in the
3615 // mask. If the user does not provide a mask then all fields in the RolloutKind
3616 // will be overwritten.
3617 func (c *ProjectsLocationsRolloutKindsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRolloutKindsPatchCall {
3618 c.urlParams_.Set("updateMask", updateMask)
3619 return c
3620 }
3621
3622 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3623 // is set to true, the service will try to validate that this request would
3624 // succeed, but will not actually make changes.
3625 func (c *ProjectsLocationsRolloutKindsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutKindsPatchCall {
3626 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3627 return c
3628 }
3629
3630 // Fields allows partial responses to be retrieved. See
3631 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3632 // details.
3633 func (c *ProjectsLocationsRolloutKindsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsPatchCall {
3634 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3635 return c
3636 }
3637
3638 // Context sets the context to be used in this call's Do method.
3639 func (c *ProjectsLocationsRolloutKindsPatchCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsPatchCall {
3640 c.ctx_ = ctx
3641 return c
3642 }
3643
3644 // Header returns a http.Header that can be modified by the caller to add
3645 // headers to the request.
3646 func (c *ProjectsLocationsRolloutKindsPatchCall) Header() http.Header {
3647 if c.header_ == nil {
3648 c.header_ = make(http.Header)
3649 }
3650 return c.header_
3651 }
3652
3653 func (c *ProjectsLocationsRolloutKindsPatchCall) doRequest(alt string) (*http.Response, error) {
3654 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3655 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rolloutkind)
3656 if err != nil {
3657 return nil, err
3658 }
3659 c.urlParams_.Set("alt", alt)
3660 c.urlParams_.Set("prettyPrint", "false")
3661 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3662 urls += "?" + c.urlParams_.Encode()
3663 req, err := http.NewRequest("PATCH", urls, body)
3664 if err != nil {
3665 return nil, err
3666 }
3667 req.Header = reqHeaders
3668 googleapi.Expand(req.URL, map[string]string{
3669 "name": c.name,
3670 })
3671 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
3672 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3673 }
3674
3675 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.patch" call.
3676 // Any non-2xx status code is an error. Response headers are in either
3677 // *RolloutKind.ServerResponse.Header or (if a response was returned at all) in
3678 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3679 // whether the returned error was because http.StatusNotModified was returned.
3680 func (c *ProjectsLocationsRolloutKindsPatchCall) Do(opts ...googleapi.CallOption) (*RolloutKind, error) {
3681 gensupport.SetOptions(c.urlParams_, opts...)
3682 res, err := c.doRequest("json")
3683 if res != nil && res.StatusCode == http.StatusNotModified {
3684 if res.Body != nil {
3685 res.Body.Close()
3686 }
3687 return nil, gensupport.WrapError(&googleapi.Error{
3688 Code: res.StatusCode,
3689 Header: res.Header,
3690 })
3691 }
3692 if err != nil {
3693 return nil, err
3694 }
3695 defer googleapi.CloseBody(res)
3696 if err := googleapi.CheckResponse(res); err != nil {
3697 return nil, gensupport.WrapError(err)
3698 }
3699 ret := &RolloutKind{
3700 ServerResponse: googleapi.ServerResponse{
3701 Header: res.Header,
3702 HTTPStatusCode: res.StatusCode,
3703 },
3704 }
3705 target := &ret
3706 b, err := gensupport.DecodeResponseBytes(target, res)
3707 if err != nil {
3708 return nil, err
3709 }
3710 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.patch", "response", internallog.HTTPResponse(res, b))
3711 return ret, nil
3712 }
3713
3714 type ProjectsLocationsRolloutsCreateCall struct {
3715 s *Service
3716 parent string
3717 rollout *Rollout
3718 urlParams_ gensupport.URLParams
3719 ctx_ context.Context
3720 header_ http.Header
3721 }
3722
3723 // Create: Create a new rollout.
3724 //
3725 // - parent: The parent of the rollout.
3726 func (r *ProjectsLocationsRolloutsService) Create(parent string, rollout *Rollout) *ProjectsLocationsRolloutsCreateCall {
3727 c := &ProjectsLocationsRolloutsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3728 c.parent = parent
3729 c.rollout = rollout
3730 return c
3731 }
3732
3733 // RequestId sets the optional parameter "requestId": An optional request ID to
3734 // identify requests. Specify a unique request ID so that if you must retry
3735 // your request, the server will know to ignore the request if it has already
3736 // been completed. The server will guarantee that for at least 60 minutes since
3737 // the first request. For example, consider a situation where you make an
3738 // initial request and the request times out. If you make the request again
3739 // with the same request ID, the server can check if original operation with
3740 // the same request ID was received, and if so, will ignore the second request.
3741 // This prevents clients from accidentally creating duplicate commitments. The
3742 // request ID must be a valid UUID with the exception that zero UUID is not
3743 // supported (00000000-0000-0000-0000-000000000000).
3744 func (c *ProjectsLocationsRolloutsCreateCall) RequestId(requestId string) *ProjectsLocationsRolloutsCreateCall {
3745 c.urlParams_.Set("requestId", requestId)
3746 return c
3747 }
3748
3749 // RolloutId sets the optional parameter "rolloutId": Required. The ID value
3750 // for the new rollout.
3751 func (c *ProjectsLocationsRolloutsCreateCall) RolloutId(rolloutId string) *ProjectsLocationsRolloutsCreateCall {
3752 c.urlParams_.Set("rolloutId", rolloutId)
3753 return c
3754 }
3755
3756 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3757 // is set to true, the service will try to validate that this request would
3758 // succeed, but will not actually make changes.
3759 func (c *ProjectsLocationsRolloutsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutsCreateCall {
3760 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3761 return c
3762 }
3763
3764 // Fields allows partial responses to be retrieved. See
3765 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3766 // details.
3767 func (c *ProjectsLocationsRolloutsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsCreateCall {
3768 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3769 return c
3770 }
3771
3772 // Context sets the context to be used in this call's Do method.
3773 func (c *ProjectsLocationsRolloutsCreateCall) Context(ctx context.Context) *ProjectsLocationsRolloutsCreateCall {
3774 c.ctx_ = ctx
3775 return c
3776 }
3777
3778 // Header returns a http.Header that can be modified by the caller to add
3779 // headers to the request.
3780 func (c *ProjectsLocationsRolloutsCreateCall) Header() http.Header {
3781 if c.header_ == nil {
3782 c.header_ = make(http.Header)
3783 }
3784 return c.header_
3785 }
3786
3787 func (c *ProjectsLocationsRolloutsCreateCall) doRequest(alt string) (*http.Response, error) {
3788 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3789 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollout)
3790 if err != nil {
3791 return nil, err
3792 }
3793 c.urlParams_.Set("alt", alt)
3794 c.urlParams_.Set("prettyPrint", "false")
3795 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rollouts")
3796 urls += "?" + c.urlParams_.Encode()
3797 req, err := http.NewRequest("POST", urls, body)
3798 if err != nil {
3799 return nil, err
3800 }
3801 req.Header = reqHeaders
3802 googleapi.Expand(req.URL, map[string]string{
3803 "parent": c.parent,
3804 })
3805 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3806 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3807 }
3808
3809 // Do executes the "saasservicemgmt.projects.locations.rollouts.create" call.
3810 // Any non-2xx status code is an error. Response headers are in either
3811 // *Rollout.ServerResponse.Header or (if a response was returned at all) in
3812 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3813 // whether the returned error was because http.StatusNotModified was returned.
3814 func (c *ProjectsLocationsRolloutsCreateCall) Do(opts ...googleapi.CallOption) (*Rollout, error) {
3815 gensupport.SetOptions(c.urlParams_, opts...)
3816 res, err := c.doRequest("json")
3817 if res != nil && res.StatusCode == http.StatusNotModified {
3818 if res.Body != nil {
3819 res.Body.Close()
3820 }
3821 return nil, gensupport.WrapError(&googleapi.Error{
3822 Code: res.StatusCode,
3823 Header: res.Header,
3824 })
3825 }
3826 if err != nil {
3827 return nil, err
3828 }
3829 defer googleapi.CloseBody(res)
3830 if err := googleapi.CheckResponse(res); err != nil {
3831 return nil, gensupport.WrapError(err)
3832 }
3833 ret := &Rollout{
3834 ServerResponse: googleapi.ServerResponse{
3835 Header: res.Header,
3836 HTTPStatusCode: res.StatusCode,
3837 },
3838 }
3839 target := &ret
3840 b, err := gensupport.DecodeResponseBytes(target, res)
3841 if err != nil {
3842 return nil, err
3843 }
3844 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.create", "response", internallog.HTTPResponse(res, b))
3845 return ret, nil
3846 }
3847
3848 type ProjectsLocationsRolloutsDeleteCall struct {
3849 s *Service
3850 name string
3851 urlParams_ gensupport.URLParams
3852 ctx_ context.Context
3853 header_ http.Header
3854 }
3855
3856 // Delete: Delete a single rollout.
3857 //
3858 // - name: The resource name of the resource within a service.
3859 func (r *ProjectsLocationsRolloutsService) Delete(name string) *ProjectsLocationsRolloutsDeleteCall {
3860 c := &ProjectsLocationsRolloutsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3861 c.name = name
3862 return c
3863 }
3864
3865 // Etag sets the optional parameter "etag": The etag known to the client for
3866 // the expected state of the rollout. This is used with state-changing methods
3867 // to prevent accidental overwrites when multiple user agents might be acting
3868 // in parallel on the same resource. An etag wildcard provide optimistic
3869 // concurrency based on the expected existence of the rollout. The Any wildcard
3870 // (`*`) requires that the resource must already exists, and the Not Any
3871 // wildcard (`!*`) requires that it must not.
3872 func (c *ProjectsLocationsRolloutsDeleteCall) Etag(etag string) *ProjectsLocationsRolloutsDeleteCall {
3873 c.urlParams_.Set("etag", etag)
3874 return c
3875 }
3876
3877 // RequestId sets the optional parameter "requestId": An optional request ID to
3878 // identify requests. Specify a unique request ID so that if you must retry
3879 // your request, the server will know to ignore the request if it has already
3880 // been completed. The server will guarantee that for at least 60 minutes since
3881 // the first request. For example, consider a situation where you make an
3882 // initial request and the request times out. If you make the request again
3883 // with the same request ID, the server can check if original operation with
3884 // the same request ID was received, and if so, will ignore the second request.
3885 // This prevents clients from accidentally creating duplicate commitments. The
3886 // request ID must be a valid UUID with the exception that zero UUID is not
3887 // supported (00000000-0000-0000-0000-000000000000).
3888 func (c *ProjectsLocationsRolloutsDeleteCall) RequestId(requestId string) *ProjectsLocationsRolloutsDeleteCall {
3889 c.urlParams_.Set("requestId", requestId)
3890 return c
3891 }
3892
3893 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3894 // is set to true, the service will try to validate that this request would
3895 // succeed, but will not actually make changes.
3896 func (c *ProjectsLocationsRolloutsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutsDeleteCall {
3897 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3898 return c
3899 }
3900
3901 // Fields allows partial responses to be retrieved. See
3902 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3903 // details.
3904 func (c *ProjectsLocationsRolloutsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsDeleteCall {
3905 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3906 return c
3907 }
3908
3909 // Context sets the context to be used in this call's Do method.
3910 func (c *ProjectsLocationsRolloutsDeleteCall) Context(ctx context.Context) *ProjectsLocationsRolloutsDeleteCall {
3911 c.ctx_ = ctx
3912 return c
3913 }
3914
3915 // Header returns a http.Header that can be modified by the caller to add
3916 // headers to the request.
3917 func (c *ProjectsLocationsRolloutsDeleteCall) Header() http.Header {
3918 if c.header_ == nil {
3919 c.header_ = make(http.Header)
3920 }
3921 return c.header_
3922 }
3923
3924 func (c *ProjectsLocationsRolloutsDeleteCall) doRequest(alt string) (*http.Response, error) {
3925 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3926 c.urlParams_.Set("alt", alt)
3927 c.urlParams_.Set("prettyPrint", "false")
3928 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3929 urls += "?" + c.urlParams_.Encode()
3930 req, err := http.NewRequest("DELETE", urls, nil)
3931 if err != nil {
3932 return nil, err
3933 }
3934 req.Header = reqHeaders
3935 googleapi.Expand(req.URL, map[string]string{
3936 "name": c.name,
3937 })
3938 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.delete", "request", internallog.HTTPRequest(req, nil))
3939 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3940 }
3941
3942 // Do executes the "saasservicemgmt.projects.locations.rollouts.delete" call.
3943 // Any non-2xx status code is an error. Response headers are in either
3944 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3945 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3946 // whether the returned error was because http.StatusNotModified was returned.
3947 func (c *ProjectsLocationsRolloutsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3948 gensupport.SetOptions(c.urlParams_, opts...)
3949 res, err := c.doRequest("json")
3950 if res != nil && res.StatusCode == http.StatusNotModified {
3951 if res.Body != nil {
3952 res.Body.Close()
3953 }
3954 return nil, gensupport.WrapError(&googleapi.Error{
3955 Code: res.StatusCode,
3956 Header: res.Header,
3957 })
3958 }
3959 if err != nil {
3960 return nil, err
3961 }
3962 defer googleapi.CloseBody(res)
3963 if err := googleapi.CheckResponse(res); err != nil {
3964 return nil, gensupport.WrapError(err)
3965 }
3966 ret := &Empty{
3967 ServerResponse: googleapi.ServerResponse{
3968 Header: res.Header,
3969 HTTPStatusCode: res.StatusCode,
3970 },
3971 }
3972 target := &ret
3973 b, err := gensupport.DecodeResponseBytes(target, res)
3974 if err != nil {
3975 return nil, err
3976 }
3977 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.delete", "response", internallog.HTTPResponse(res, b))
3978 return ret, nil
3979 }
3980
3981 type ProjectsLocationsRolloutsGetCall struct {
3982 s *Service
3983 name string
3984 urlParams_ gensupport.URLParams
3985 ifNoneMatch_ string
3986 ctx_ context.Context
3987 header_ http.Header
3988 }
3989
3990 // Get: Retrieve a single rollout.
3991 //
3992 // - name: The resource name of the resource within a service.
3993 func (r *ProjectsLocationsRolloutsService) Get(name string) *ProjectsLocationsRolloutsGetCall {
3994 c := &ProjectsLocationsRolloutsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3995 c.name = name
3996 return c
3997 }
3998
3999 // Fields allows partial responses to be retrieved. See
4000 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4001 // details.
4002 func (c *ProjectsLocationsRolloutsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsGetCall {
4003 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4004 return c
4005 }
4006
4007 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4008 // object's ETag matches the given value. This is useful for getting updates
4009 // only after the object has changed since the last request.
4010 func (c *ProjectsLocationsRolloutsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRolloutsGetCall {
4011 c.ifNoneMatch_ = entityTag
4012 return c
4013 }
4014
4015 // Context sets the context to be used in this call's Do method.
4016 func (c *ProjectsLocationsRolloutsGetCall) Context(ctx context.Context) *ProjectsLocationsRolloutsGetCall {
4017 c.ctx_ = ctx
4018 return c
4019 }
4020
4021 // Header returns a http.Header that can be modified by the caller to add
4022 // headers to the request.
4023 func (c *ProjectsLocationsRolloutsGetCall) Header() http.Header {
4024 if c.header_ == nil {
4025 c.header_ = make(http.Header)
4026 }
4027 return c.header_
4028 }
4029
4030 func (c *ProjectsLocationsRolloutsGetCall) doRequest(alt string) (*http.Response, error) {
4031 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4032 if c.ifNoneMatch_ != "" {
4033 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4034 }
4035 c.urlParams_.Set("alt", alt)
4036 c.urlParams_.Set("prettyPrint", "false")
4037 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4038 urls += "?" + c.urlParams_.Encode()
4039 req, err := http.NewRequest("GET", urls, nil)
4040 if err != nil {
4041 return nil, err
4042 }
4043 req.Header = reqHeaders
4044 googleapi.Expand(req.URL, map[string]string{
4045 "name": c.name,
4046 })
4047 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.get", "request", internallog.HTTPRequest(req, nil))
4048 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4049 }
4050
4051 // Do executes the "saasservicemgmt.projects.locations.rollouts.get" call.
4052 // Any non-2xx status code is an error. Response headers are in either
4053 // *Rollout.ServerResponse.Header or (if a response was returned at all) in
4054 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4055 // whether the returned error was because http.StatusNotModified was returned.
4056 func (c *ProjectsLocationsRolloutsGetCall) Do(opts ...googleapi.CallOption) (*Rollout, error) {
4057 gensupport.SetOptions(c.urlParams_, opts...)
4058 res, err := c.doRequest("json")
4059 if res != nil && res.StatusCode == http.StatusNotModified {
4060 if res.Body != nil {
4061 res.Body.Close()
4062 }
4063 return nil, gensupport.WrapError(&googleapi.Error{
4064 Code: res.StatusCode,
4065 Header: res.Header,
4066 })
4067 }
4068 if err != nil {
4069 return nil, err
4070 }
4071 defer googleapi.CloseBody(res)
4072 if err := googleapi.CheckResponse(res); err != nil {
4073 return nil, gensupport.WrapError(err)
4074 }
4075 ret := &Rollout{
4076 ServerResponse: googleapi.ServerResponse{
4077 Header: res.Header,
4078 HTTPStatusCode: res.StatusCode,
4079 },
4080 }
4081 target := &ret
4082 b, err := gensupport.DecodeResponseBytes(target, res)
4083 if err != nil {
4084 return nil, err
4085 }
4086 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.get", "response", internallog.HTTPResponse(res, b))
4087 return ret, nil
4088 }
4089
4090 type ProjectsLocationsRolloutsListCall struct {
4091 s *Service
4092 parent string
4093 urlParams_ gensupport.URLParams
4094 ifNoneMatch_ string
4095 ctx_ context.Context
4096 header_ http.Header
4097 }
4098
4099 // List: Retrieve a collection of rollouts.
4100 //
4101 // - parent: The parent of the rollout.
4102 func (r *ProjectsLocationsRolloutsService) List(parent string) *ProjectsLocationsRolloutsListCall {
4103 c := &ProjectsLocationsRolloutsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4104 c.parent = parent
4105 return c
4106 }
4107
4108 // Filter sets the optional parameter "filter": Filter the list as specified in
4109 // https://google.aip.dev/160.
4110 func (c *ProjectsLocationsRolloutsListCall) Filter(filter string) *ProjectsLocationsRolloutsListCall {
4111 c.urlParams_.Set("filter", filter)
4112 return c
4113 }
4114
4115 // OrderBy sets the optional parameter "orderBy": Order results as specified in
4116 // https://google.aip.dev/132.
4117 func (c *ProjectsLocationsRolloutsListCall) OrderBy(orderBy string) *ProjectsLocationsRolloutsListCall {
4118 c.urlParams_.Set("orderBy", orderBy)
4119 return c
4120 }
4121
4122 // PageSize sets the optional parameter "pageSize": The maximum number of
4123 // rollouts to send per page.
4124 func (c *ProjectsLocationsRolloutsListCall) PageSize(pageSize int64) *ProjectsLocationsRolloutsListCall {
4125 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4126 return c
4127 }
4128
4129 // PageToken sets the optional parameter "pageToken": The page token: If the
4130 // next_page_token from a previous response is provided, this request will send
4131 // the subsequent page.
4132 func (c *ProjectsLocationsRolloutsListCall) PageToken(pageToken string) *ProjectsLocationsRolloutsListCall {
4133 c.urlParams_.Set("pageToken", pageToken)
4134 return c
4135 }
4136
4137 // Fields allows partial responses to be retrieved. See
4138 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4139 // details.
4140 func (c *ProjectsLocationsRolloutsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsListCall {
4141 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4142 return c
4143 }
4144
4145 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4146 // object's ETag matches the given value. This is useful for getting updates
4147 // only after the object has changed since the last request.
4148 func (c *ProjectsLocationsRolloutsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRolloutsListCall {
4149 c.ifNoneMatch_ = entityTag
4150 return c
4151 }
4152
4153 // Context sets the context to be used in this call's Do method.
4154 func (c *ProjectsLocationsRolloutsListCall) Context(ctx context.Context) *ProjectsLocationsRolloutsListCall {
4155 c.ctx_ = ctx
4156 return c
4157 }
4158
4159 // Header returns a http.Header that can be modified by the caller to add
4160 // headers to the request.
4161 func (c *ProjectsLocationsRolloutsListCall) Header() http.Header {
4162 if c.header_ == nil {
4163 c.header_ = make(http.Header)
4164 }
4165 return c.header_
4166 }
4167
4168 func (c *ProjectsLocationsRolloutsListCall) doRequest(alt string) (*http.Response, error) {
4169 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4170 if c.ifNoneMatch_ != "" {
4171 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4172 }
4173 c.urlParams_.Set("alt", alt)
4174 c.urlParams_.Set("prettyPrint", "false")
4175 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/rollouts")
4176 urls += "?" + c.urlParams_.Encode()
4177 req, err := http.NewRequest("GET", urls, nil)
4178 if err != nil {
4179 return nil, err
4180 }
4181 req.Header = reqHeaders
4182 googleapi.Expand(req.URL, map[string]string{
4183 "parent": c.parent,
4184 })
4185 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.list", "request", internallog.HTTPRequest(req, nil))
4186 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4187 }
4188
4189 // Do executes the "saasservicemgmt.projects.locations.rollouts.list" call.
4190 // Any non-2xx status code is an error. Response headers are in either
4191 // *ListRolloutsResponse.ServerResponse.Header or (if a response was returned
4192 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4193 // check whether the returned error was because http.StatusNotModified was
4194 // returned.
4195 func (c *ProjectsLocationsRolloutsListCall) Do(opts ...googleapi.CallOption) (*ListRolloutsResponse, error) {
4196 gensupport.SetOptions(c.urlParams_, opts...)
4197 res, err := c.doRequest("json")
4198 if res != nil && res.StatusCode == http.StatusNotModified {
4199 if res.Body != nil {
4200 res.Body.Close()
4201 }
4202 return nil, gensupport.WrapError(&googleapi.Error{
4203 Code: res.StatusCode,
4204 Header: res.Header,
4205 })
4206 }
4207 if err != nil {
4208 return nil, err
4209 }
4210 defer googleapi.CloseBody(res)
4211 if err := googleapi.CheckResponse(res); err != nil {
4212 return nil, gensupport.WrapError(err)
4213 }
4214 ret := &ListRolloutsResponse{
4215 ServerResponse: googleapi.ServerResponse{
4216 Header: res.Header,
4217 HTTPStatusCode: res.StatusCode,
4218 },
4219 }
4220 target := &ret
4221 b, err := gensupport.DecodeResponseBytes(target, res)
4222 if err != nil {
4223 return nil, err
4224 }
4225 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.list", "response", internallog.HTTPResponse(res, b))
4226 return ret, nil
4227 }
4228
4229 // Pages invokes f for each page of results.
4230 // A non-nil error returned from f will halt the iteration.
4231 // The provided context supersedes any context provided to the Context method.
4232 func (c *ProjectsLocationsRolloutsListCall) Pages(ctx context.Context, f func(*ListRolloutsResponse) error) error {
4233 c.ctx_ = ctx
4234 defer c.PageToken(c.urlParams_.Get("pageToken"))
4235 for {
4236 x, err := c.Do()
4237 if err != nil {
4238 return err
4239 }
4240 if err := f(x); err != nil {
4241 return err
4242 }
4243 if x.NextPageToken == "" {
4244 return nil
4245 }
4246 c.PageToken(x.NextPageToken)
4247 }
4248 }
4249
4250 type ProjectsLocationsRolloutsPatchCall struct {
4251 s *Service
4252 name string
4253 rollout *Rollout
4254 urlParams_ gensupport.URLParams
4255 ctx_ context.Context
4256 header_ http.Header
4257 }
4258
4259 // Patch: Update a single rollout.
4260 //
4261 // - name: Identifier. The resource name (full URI of the resource) following
4262 // the standard naming scheme:
4263 // "projects/{project}/locations/{location}/rollout/{rollout_id}".
4264 func (r *ProjectsLocationsRolloutsService) Patch(name string, rollout *Rollout) *ProjectsLocationsRolloutsPatchCall {
4265 c := &ProjectsLocationsRolloutsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4266 c.name = name
4267 c.rollout = rollout
4268 return c
4269 }
4270
4271 // RequestId sets the optional parameter "requestId": An optional request ID to
4272 // identify requests. Specify a unique request ID so that if you must retry
4273 // your request, the server will know to ignore the request if it has already
4274 // been completed. The server will guarantee that for at least 60 minutes since
4275 // the first request. For example, consider a situation where you make an
4276 // initial request and the request times out. If you make the request again
4277 // with the same request ID, the server can check if original operation with
4278 // the same request ID was received, and if so, will ignore the second request.
4279 // This prevents clients from accidentally creating duplicate commitments. The
4280 // request ID must be a valid UUID with the exception that zero UUID is not
4281 // supported (00000000-0000-0000-0000-000000000000).
4282 func (c *ProjectsLocationsRolloutsPatchCall) RequestId(requestId string) *ProjectsLocationsRolloutsPatchCall {
4283 c.urlParams_.Set("requestId", requestId)
4284 return c
4285 }
4286
4287 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
4288 // specify the fields to be overwritten in the Rollout resource by the update.
4289 // The fields specified in the update_mask are relative to the resource, not
4290 // the full request. A field will be overwritten if it is in the mask. If the
4291 // user does not provide a mask then all fields in the Rollout will be
4292 // overwritten.
4293 func (c *ProjectsLocationsRolloutsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRolloutsPatchCall {
4294 c.urlParams_.Set("updateMask", updateMask)
4295 return c
4296 }
4297
4298 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
4299 // is set to true, the service will try to validate that this request would
4300 // succeed, but will not actually make changes.
4301 func (c *ProjectsLocationsRolloutsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutsPatchCall {
4302 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
4303 return c
4304 }
4305
4306 // Fields allows partial responses to be retrieved. See
4307 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4308 // details.
4309 func (c *ProjectsLocationsRolloutsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsPatchCall {
4310 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4311 return c
4312 }
4313
4314 // Context sets the context to be used in this call's Do method.
4315 func (c *ProjectsLocationsRolloutsPatchCall) Context(ctx context.Context) *ProjectsLocationsRolloutsPatchCall {
4316 c.ctx_ = ctx
4317 return c
4318 }
4319
4320 // Header returns a http.Header that can be modified by the caller to add
4321 // headers to the request.
4322 func (c *ProjectsLocationsRolloutsPatchCall) Header() http.Header {
4323 if c.header_ == nil {
4324 c.header_ = make(http.Header)
4325 }
4326 return c.header_
4327 }
4328
4329 func (c *ProjectsLocationsRolloutsPatchCall) doRequest(alt string) (*http.Response, error) {
4330 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4331 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollout)
4332 if err != nil {
4333 return nil, err
4334 }
4335 c.urlParams_.Set("alt", alt)
4336 c.urlParams_.Set("prettyPrint", "false")
4337 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4338 urls += "?" + c.urlParams_.Encode()
4339 req, err := http.NewRequest("PATCH", urls, body)
4340 if err != nil {
4341 return nil, err
4342 }
4343 req.Header = reqHeaders
4344 googleapi.Expand(req.URL, map[string]string{
4345 "name": c.name,
4346 })
4347 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
4348 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4349 }
4350
4351 // Do executes the "saasservicemgmt.projects.locations.rollouts.patch" call.
4352 // Any non-2xx status code is an error. Response headers are in either
4353 // *Rollout.ServerResponse.Header or (if a response was returned at all) in
4354 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4355 // whether the returned error was because http.StatusNotModified was returned.
4356 func (c *ProjectsLocationsRolloutsPatchCall) Do(opts ...googleapi.CallOption) (*Rollout, error) {
4357 gensupport.SetOptions(c.urlParams_, opts...)
4358 res, err := c.doRequest("json")
4359 if res != nil && res.StatusCode == http.StatusNotModified {
4360 if res.Body != nil {
4361 res.Body.Close()
4362 }
4363 return nil, gensupport.WrapError(&googleapi.Error{
4364 Code: res.StatusCode,
4365 Header: res.Header,
4366 })
4367 }
4368 if err != nil {
4369 return nil, err
4370 }
4371 defer googleapi.CloseBody(res)
4372 if err := googleapi.CheckResponse(res); err != nil {
4373 return nil, gensupport.WrapError(err)
4374 }
4375 ret := &Rollout{
4376 ServerResponse: googleapi.ServerResponse{
4377 Header: res.Header,
4378 HTTPStatusCode: res.StatusCode,
4379 },
4380 }
4381 target := &ret
4382 b, err := gensupport.DecodeResponseBytes(target, res)
4383 if err != nil {
4384 return nil, err
4385 }
4386 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.patch", "response", internallog.HTTPResponse(res, b))
4387 return ret, nil
4388 }
4389
4390 type ProjectsLocationsSaasCreateCall struct {
4391 s *Service
4392 parent string
4393 saas *Saas
4394 urlParams_ gensupport.URLParams
4395 ctx_ context.Context
4396 header_ http.Header
4397 }
4398
4399 // Create: Create a new saas.
4400 //
4401 // - parent: The parent of the saas.
4402 func (r *ProjectsLocationsSaasService) Create(parent string, saas *Saas) *ProjectsLocationsSaasCreateCall {
4403 c := &ProjectsLocationsSaasCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4404 c.parent = parent
4405 c.saas = saas
4406 return c
4407 }
4408
4409 // RequestId sets the optional parameter "requestId": An optional request ID to
4410 // identify requests. Specify a unique request ID so that if you must retry
4411 // your request, the server will know to ignore the request if it has already
4412 // been completed. The server will guarantee that for at least 60 minutes since
4413 // the first request. For example, consider a situation where you make an
4414 // initial request and the request times out. If you make the request again
4415 // with the same request ID, the server can check if original operation with
4416 // the same request ID was received, and if so, will ignore the second request.
4417 // This prevents clients from accidentally creating duplicate commitments. The
4418 // request ID must be a valid UUID with the exception that zero UUID is not
4419 // supported (00000000-0000-0000-0000-000000000000).
4420 func (c *ProjectsLocationsSaasCreateCall) RequestId(requestId string) *ProjectsLocationsSaasCreateCall {
4421 c.urlParams_.Set("requestId", requestId)
4422 return c
4423 }
4424
4425 // SaasId sets the optional parameter "saasId": Required. The ID value for the
4426 // new saas.
4427 func (c *ProjectsLocationsSaasCreateCall) SaasId(saasId string) *ProjectsLocationsSaasCreateCall {
4428 c.urlParams_.Set("saasId", saasId)
4429 return c
4430 }
4431
4432 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
4433 // is set to true, the service will try to validate that this request would
4434 // succeed, but will not actually make changes.
4435 func (c *ProjectsLocationsSaasCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsSaasCreateCall {
4436 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
4437 return c
4438 }
4439
4440 // Fields allows partial responses to be retrieved. See
4441 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4442 // details.
4443 func (c *ProjectsLocationsSaasCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasCreateCall {
4444 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4445 return c
4446 }
4447
4448 // Context sets the context to be used in this call's Do method.
4449 func (c *ProjectsLocationsSaasCreateCall) Context(ctx context.Context) *ProjectsLocationsSaasCreateCall {
4450 c.ctx_ = ctx
4451 return c
4452 }
4453
4454 // Header returns a http.Header that can be modified by the caller to add
4455 // headers to the request.
4456 func (c *ProjectsLocationsSaasCreateCall) Header() http.Header {
4457 if c.header_ == nil {
4458 c.header_ = make(http.Header)
4459 }
4460 return c.header_
4461 }
4462
4463 func (c *ProjectsLocationsSaasCreateCall) doRequest(alt string) (*http.Response, error) {
4464 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4465 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.saas)
4466 if err != nil {
4467 return nil, err
4468 }
4469 c.urlParams_.Set("alt", alt)
4470 c.urlParams_.Set("prettyPrint", "false")
4471 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/saas")
4472 urls += "?" + c.urlParams_.Encode()
4473 req, err := http.NewRequest("POST", urls, body)
4474 if err != nil {
4475 return nil, err
4476 }
4477 req.Header = reqHeaders
4478 googleapi.Expand(req.URL, map[string]string{
4479 "parent": c.parent,
4480 })
4481 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.create", "request", internallog.HTTPRequest(req, body.Bytes()))
4482 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4483 }
4484
4485 // Do executes the "saasservicemgmt.projects.locations.saas.create" call.
4486 // Any non-2xx status code is an error. Response headers are in either
4487 // *Saas.ServerResponse.Header or (if a response was returned at all) in
4488 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4489 // whether the returned error was because http.StatusNotModified was returned.
4490 func (c *ProjectsLocationsSaasCreateCall) Do(opts ...googleapi.CallOption) (*Saas, error) {
4491 gensupport.SetOptions(c.urlParams_, opts...)
4492 res, err := c.doRequest("json")
4493 if res != nil && res.StatusCode == http.StatusNotModified {
4494 if res.Body != nil {
4495 res.Body.Close()
4496 }
4497 return nil, gensupport.WrapError(&googleapi.Error{
4498 Code: res.StatusCode,
4499 Header: res.Header,
4500 })
4501 }
4502 if err != nil {
4503 return nil, err
4504 }
4505 defer googleapi.CloseBody(res)
4506 if err := googleapi.CheckResponse(res); err != nil {
4507 return nil, gensupport.WrapError(err)
4508 }
4509 ret := &Saas{
4510 ServerResponse: googleapi.ServerResponse{
4511 Header: res.Header,
4512 HTTPStatusCode: res.StatusCode,
4513 },
4514 }
4515 target := &ret
4516 b, err := gensupport.DecodeResponseBytes(target, res)
4517 if err != nil {
4518 return nil, err
4519 }
4520 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.create", "response", internallog.HTTPResponse(res, b))
4521 return ret, nil
4522 }
4523
4524 type ProjectsLocationsSaasDeleteCall struct {
4525 s *Service
4526 name string
4527 urlParams_ gensupport.URLParams
4528 ctx_ context.Context
4529 header_ http.Header
4530 }
4531
4532 // Delete: Delete a single saas.
4533 //
4534 // - name: The resource name of the resource within a service.
4535 func (r *ProjectsLocationsSaasService) Delete(name string) *ProjectsLocationsSaasDeleteCall {
4536 c := &ProjectsLocationsSaasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4537 c.name = name
4538 return c
4539 }
4540
4541 // Etag sets the optional parameter "etag": The etag known to the client for
4542 // the expected state of the saas. This is used with state-changing methods to
4543 // prevent accidental overwrites when multiple user agents might be acting in
4544 // parallel on the same resource. An etag wildcard provide optimistic
4545 // concurrency based on the expected existence of the saas. The Any wildcard
4546 // (`*`) requires that the resource must already exists, and the Not Any
4547 // wildcard (`!*`) requires that it must not.
4548 func (c *ProjectsLocationsSaasDeleteCall) Etag(etag string) *ProjectsLocationsSaasDeleteCall {
4549 c.urlParams_.Set("etag", etag)
4550 return c
4551 }
4552
4553 // RequestId sets the optional parameter "requestId": An optional request ID to
4554 // identify requests. Specify a unique request ID so that if you must retry
4555 // your request, the server will know to ignore the request if it has already
4556 // been completed. The server will guarantee that for at least 60 minutes since
4557 // the first request. For example, consider a situation where you make an
4558 // initial request and the request times out. If you make the request again
4559 // with the same request ID, the server can check if original operation with
4560 // the same request ID was received, and if so, will ignore the second request.
4561 // This prevents clients from accidentally creating duplicate commitments. The
4562 // request ID must be a valid UUID with the exception that zero UUID is not
4563 // supported (00000000-0000-0000-0000-000000000000).
4564 func (c *ProjectsLocationsSaasDeleteCall) RequestId(requestId string) *ProjectsLocationsSaasDeleteCall {
4565 c.urlParams_.Set("requestId", requestId)
4566 return c
4567 }
4568
4569 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
4570 // is set to true, the service will try to validate that this request would
4571 // succeed, but will not actually make changes.
4572 func (c *ProjectsLocationsSaasDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsSaasDeleteCall {
4573 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
4574 return c
4575 }
4576
4577 // Fields allows partial responses to be retrieved. See
4578 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4579 // details.
4580 func (c *ProjectsLocationsSaasDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasDeleteCall {
4581 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4582 return c
4583 }
4584
4585 // Context sets the context to be used in this call's Do method.
4586 func (c *ProjectsLocationsSaasDeleteCall) Context(ctx context.Context) *ProjectsLocationsSaasDeleteCall {
4587 c.ctx_ = ctx
4588 return c
4589 }
4590
4591 // Header returns a http.Header that can be modified by the caller to add
4592 // headers to the request.
4593 func (c *ProjectsLocationsSaasDeleteCall) Header() http.Header {
4594 if c.header_ == nil {
4595 c.header_ = make(http.Header)
4596 }
4597 return c.header_
4598 }
4599
4600 func (c *ProjectsLocationsSaasDeleteCall) doRequest(alt string) (*http.Response, error) {
4601 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4602 c.urlParams_.Set("alt", alt)
4603 c.urlParams_.Set("prettyPrint", "false")
4604 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4605 urls += "?" + c.urlParams_.Encode()
4606 req, err := http.NewRequest("DELETE", urls, nil)
4607 if err != nil {
4608 return nil, err
4609 }
4610 req.Header = reqHeaders
4611 googleapi.Expand(req.URL, map[string]string{
4612 "name": c.name,
4613 })
4614 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.delete", "request", internallog.HTTPRequest(req, nil))
4615 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4616 }
4617
4618 // Do executes the "saasservicemgmt.projects.locations.saas.delete" call.
4619 // Any non-2xx status code is an error. Response headers are in either
4620 // *Empty.ServerResponse.Header or (if a response was returned at all) in
4621 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4622 // whether the returned error was because http.StatusNotModified was returned.
4623 func (c *ProjectsLocationsSaasDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4624 gensupport.SetOptions(c.urlParams_, opts...)
4625 res, err := c.doRequest("json")
4626 if res != nil && res.StatusCode == http.StatusNotModified {
4627 if res.Body != nil {
4628 res.Body.Close()
4629 }
4630 return nil, gensupport.WrapError(&googleapi.Error{
4631 Code: res.StatusCode,
4632 Header: res.Header,
4633 })
4634 }
4635 if err != nil {
4636 return nil, err
4637 }
4638 defer googleapi.CloseBody(res)
4639 if err := googleapi.CheckResponse(res); err != nil {
4640 return nil, gensupport.WrapError(err)
4641 }
4642 ret := &Empty{
4643 ServerResponse: googleapi.ServerResponse{
4644 Header: res.Header,
4645 HTTPStatusCode: res.StatusCode,
4646 },
4647 }
4648 target := &ret
4649 b, err := gensupport.DecodeResponseBytes(target, res)
4650 if err != nil {
4651 return nil, err
4652 }
4653 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.delete", "response", internallog.HTTPResponse(res, b))
4654 return ret, nil
4655 }
4656
4657 type ProjectsLocationsSaasGetCall struct {
4658 s *Service
4659 name string
4660 urlParams_ gensupport.URLParams
4661 ifNoneMatch_ string
4662 ctx_ context.Context
4663 header_ http.Header
4664 }
4665
4666 // Get: Retrieve a single saas.
4667 //
4668 // - name: The resource name of the resource within a service.
4669 func (r *ProjectsLocationsSaasService) Get(name string) *ProjectsLocationsSaasGetCall {
4670 c := &ProjectsLocationsSaasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4671 c.name = name
4672 return c
4673 }
4674
4675 // Fields allows partial responses to be retrieved. See
4676 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4677 // details.
4678 func (c *ProjectsLocationsSaasGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasGetCall {
4679 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4680 return c
4681 }
4682
4683 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4684 // object's ETag matches the given value. This is useful for getting updates
4685 // only after the object has changed since the last request.
4686 func (c *ProjectsLocationsSaasGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsSaasGetCall {
4687 c.ifNoneMatch_ = entityTag
4688 return c
4689 }
4690
4691 // Context sets the context to be used in this call's Do method.
4692 func (c *ProjectsLocationsSaasGetCall) Context(ctx context.Context) *ProjectsLocationsSaasGetCall {
4693 c.ctx_ = ctx
4694 return c
4695 }
4696
4697 // Header returns a http.Header that can be modified by the caller to add
4698 // headers to the request.
4699 func (c *ProjectsLocationsSaasGetCall) Header() http.Header {
4700 if c.header_ == nil {
4701 c.header_ = make(http.Header)
4702 }
4703 return c.header_
4704 }
4705
4706 func (c *ProjectsLocationsSaasGetCall) doRequest(alt string) (*http.Response, error) {
4707 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4708 if c.ifNoneMatch_ != "" {
4709 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4710 }
4711 c.urlParams_.Set("alt", alt)
4712 c.urlParams_.Set("prettyPrint", "false")
4713 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4714 urls += "?" + c.urlParams_.Encode()
4715 req, err := http.NewRequest("GET", urls, nil)
4716 if err != nil {
4717 return nil, err
4718 }
4719 req.Header = reqHeaders
4720 googleapi.Expand(req.URL, map[string]string{
4721 "name": c.name,
4722 })
4723 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.get", "request", internallog.HTTPRequest(req, nil))
4724 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4725 }
4726
4727 // Do executes the "saasservicemgmt.projects.locations.saas.get" call.
4728 // Any non-2xx status code is an error. Response headers are in either
4729 // *Saas.ServerResponse.Header or (if a response was returned at all) in
4730 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4731 // whether the returned error was because http.StatusNotModified was returned.
4732 func (c *ProjectsLocationsSaasGetCall) Do(opts ...googleapi.CallOption) (*Saas, error) {
4733 gensupport.SetOptions(c.urlParams_, opts...)
4734 res, err := c.doRequest("json")
4735 if res != nil && res.StatusCode == http.StatusNotModified {
4736 if res.Body != nil {
4737 res.Body.Close()
4738 }
4739 return nil, gensupport.WrapError(&googleapi.Error{
4740 Code: res.StatusCode,
4741 Header: res.Header,
4742 })
4743 }
4744 if err != nil {
4745 return nil, err
4746 }
4747 defer googleapi.CloseBody(res)
4748 if err := googleapi.CheckResponse(res); err != nil {
4749 return nil, gensupport.WrapError(err)
4750 }
4751 ret := &Saas{
4752 ServerResponse: googleapi.ServerResponse{
4753 Header: res.Header,
4754 HTTPStatusCode: res.StatusCode,
4755 },
4756 }
4757 target := &ret
4758 b, err := gensupport.DecodeResponseBytes(target, res)
4759 if err != nil {
4760 return nil, err
4761 }
4762 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.get", "response", internallog.HTTPResponse(res, b))
4763 return ret, nil
4764 }
4765
4766 type ProjectsLocationsSaasListCall struct {
4767 s *Service
4768 parent string
4769 urlParams_ gensupport.URLParams
4770 ifNoneMatch_ string
4771 ctx_ context.Context
4772 header_ http.Header
4773 }
4774
4775 // List: Retrieve a collection of saas.
4776 //
4777 // - parent: The parent of the saas.
4778 func (r *ProjectsLocationsSaasService) List(parent string) *ProjectsLocationsSaasListCall {
4779 c := &ProjectsLocationsSaasListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4780 c.parent = parent
4781 return c
4782 }
4783
4784 // Filter sets the optional parameter "filter": Filter the list as specified in
4785 // https://google.aip.dev/160.
4786 func (c *ProjectsLocationsSaasListCall) Filter(filter string) *ProjectsLocationsSaasListCall {
4787 c.urlParams_.Set("filter", filter)
4788 return c
4789 }
4790
4791 // OrderBy sets the optional parameter "orderBy": Order results as specified in
4792 // https://google.aip.dev/132.
4793 func (c *ProjectsLocationsSaasListCall) OrderBy(orderBy string) *ProjectsLocationsSaasListCall {
4794 c.urlParams_.Set("orderBy", orderBy)
4795 return c
4796 }
4797
4798 // PageSize sets the optional parameter "pageSize": The maximum number of saas
4799 // to send per page.
4800 func (c *ProjectsLocationsSaasListCall) PageSize(pageSize int64) *ProjectsLocationsSaasListCall {
4801 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4802 return c
4803 }
4804
4805 // PageToken sets the optional parameter "pageToken": The page token: If the
4806 // next_page_token from a previous response is provided, this request will send
4807 // the subsequent page.
4808 func (c *ProjectsLocationsSaasListCall) PageToken(pageToken string) *ProjectsLocationsSaasListCall {
4809 c.urlParams_.Set("pageToken", pageToken)
4810 return c
4811 }
4812
4813 // Fields allows partial responses to be retrieved. See
4814 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4815 // details.
4816 func (c *ProjectsLocationsSaasListCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasListCall {
4817 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4818 return c
4819 }
4820
4821 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4822 // object's ETag matches the given value. This is useful for getting updates
4823 // only after the object has changed since the last request.
4824 func (c *ProjectsLocationsSaasListCall) IfNoneMatch(entityTag string) *ProjectsLocationsSaasListCall {
4825 c.ifNoneMatch_ = entityTag
4826 return c
4827 }
4828
4829 // Context sets the context to be used in this call's Do method.
4830 func (c *ProjectsLocationsSaasListCall) Context(ctx context.Context) *ProjectsLocationsSaasListCall {
4831 c.ctx_ = ctx
4832 return c
4833 }
4834
4835 // Header returns a http.Header that can be modified by the caller to add
4836 // headers to the request.
4837 func (c *ProjectsLocationsSaasListCall) Header() http.Header {
4838 if c.header_ == nil {
4839 c.header_ = make(http.Header)
4840 }
4841 return c.header_
4842 }
4843
4844 func (c *ProjectsLocationsSaasListCall) doRequest(alt string) (*http.Response, error) {
4845 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4846 if c.ifNoneMatch_ != "" {
4847 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4848 }
4849 c.urlParams_.Set("alt", alt)
4850 c.urlParams_.Set("prettyPrint", "false")
4851 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/saas")
4852 urls += "?" + c.urlParams_.Encode()
4853 req, err := http.NewRequest("GET", urls, nil)
4854 if err != nil {
4855 return nil, err
4856 }
4857 req.Header = reqHeaders
4858 googleapi.Expand(req.URL, map[string]string{
4859 "parent": c.parent,
4860 })
4861 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.list", "request", internallog.HTTPRequest(req, nil))
4862 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4863 }
4864
4865 // Do executes the "saasservicemgmt.projects.locations.saas.list" call.
4866 // Any non-2xx status code is an error. Response headers are in either
4867 // *ListSaasResponse.ServerResponse.Header or (if a response was returned at
4868 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4869 // check whether the returned error was because http.StatusNotModified was
4870 // returned.
4871 func (c *ProjectsLocationsSaasListCall) Do(opts ...googleapi.CallOption) (*ListSaasResponse, error) {
4872 gensupport.SetOptions(c.urlParams_, opts...)
4873 res, err := c.doRequest("json")
4874 if res != nil && res.StatusCode == http.StatusNotModified {
4875 if res.Body != nil {
4876 res.Body.Close()
4877 }
4878 return nil, gensupport.WrapError(&googleapi.Error{
4879 Code: res.StatusCode,
4880 Header: res.Header,
4881 })
4882 }
4883 if err != nil {
4884 return nil, err
4885 }
4886 defer googleapi.CloseBody(res)
4887 if err := googleapi.CheckResponse(res); err != nil {
4888 return nil, gensupport.WrapError(err)
4889 }
4890 ret := &ListSaasResponse{
4891 ServerResponse: googleapi.ServerResponse{
4892 Header: res.Header,
4893 HTTPStatusCode: res.StatusCode,
4894 },
4895 }
4896 target := &ret
4897 b, err := gensupport.DecodeResponseBytes(target, res)
4898 if err != nil {
4899 return nil, err
4900 }
4901 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.list", "response", internallog.HTTPResponse(res, b))
4902 return ret, nil
4903 }
4904
4905 // Pages invokes f for each page of results.
4906 // A non-nil error returned from f will halt the iteration.
4907 // The provided context supersedes any context provided to the Context method.
4908 func (c *ProjectsLocationsSaasListCall) Pages(ctx context.Context, f func(*ListSaasResponse) error) error {
4909 c.ctx_ = ctx
4910 defer c.PageToken(c.urlParams_.Get("pageToken"))
4911 for {
4912 x, err := c.Do()
4913 if err != nil {
4914 return err
4915 }
4916 if err := f(x); err != nil {
4917 return err
4918 }
4919 if x.NextPageToken == "" {
4920 return nil
4921 }
4922 c.PageToken(x.NextPageToken)
4923 }
4924 }
4925
4926 type ProjectsLocationsSaasPatchCall struct {
4927 s *Service
4928 name string
4929 saas *Saas
4930 urlParams_ gensupport.URLParams
4931 ctx_ context.Context
4932 header_ http.Header
4933 }
4934
4935 // Patch: Update a single saas.
4936 //
4937 // - name: Identifier. The resource name (full URI of the resource) following
4938 // the standard naming scheme:
4939 // "projects/{project}/locations/{location}/saas/{saas}".
4940 func (r *ProjectsLocationsSaasService) Patch(name string, saas *Saas) *ProjectsLocationsSaasPatchCall {
4941 c := &ProjectsLocationsSaasPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4942 c.name = name
4943 c.saas = saas
4944 return c
4945 }
4946
4947 // RequestId sets the optional parameter "requestId": An optional request ID to
4948 // identify requests. Specify a unique request ID so that if you must retry
4949 // your request, the server will know to ignore the request if it has already
4950 // been completed. The server will guarantee that for at least 60 minutes since
4951 // the first request. For example, consider a situation where you make an
4952 // initial request and the request times out. If you make the request again
4953 // with the same request ID, the server can check if original operation with
4954 // the same request ID was received, and if so, will ignore the second request.
4955 // This prevents clients from accidentally creating duplicate commitments. The
4956 // request ID must be a valid UUID with the exception that zero UUID is not
4957 // supported (00000000-0000-0000-0000-000000000000).
4958 func (c *ProjectsLocationsSaasPatchCall) RequestId(requestId string) *ProjectsLocationsSaasPatchCall {
4959 c.urlParams_.Set("requestId", requestId)
4960 return c
4961 }
4962
4963 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
4964 // specify the fields to be overwritten in the Saas resource by the update. The
4965 // fields specified in the update_mask are relative to the resource, not the
4966 // full request. A field will be overwritten if it is in the mask. If the user
4967 // does not provide a mask then all fields in the Saas will be overwritten.
4968 func (c *ProjectsLocationsSaasPatchCall) UpdateMask(updateMask string) *ProjectsLocationsSaasPatchCall {
4969 c.urlParams_.Set("updateMask", updateMask)
4970 return c
4971 }
4972
4973 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
4974 // is set to true, the service will try to validate that this request would
4975 // succeed, but will not actually make changes.
4976 func (c *ProjectsLocationsSaasPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsSaasPatchCall {
4977 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
4978 return c
4979 }
4980
4981 // Fields allows partial responses to be retrieved. See
4982 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4983 // details.
4984 func (c *ProjectsLocationsSaasPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasPatchCall {
4985 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4986 return c
4987 }
4988
4989 // Context sets the context to be used in this call's Do method.
4990 func (c *ProjectsLocationsSaasPatchCall) Context(ctx context.Context) *ProjectsLocationsSaasPatchCall {
4991 c.ctx_ = ctx
4992 return c
4993 }
4994
4995 // Header returns a http.Header that can be modified by the caller to add
4996 // headers to the request.
4997 func (c *ProjectsLocationsSaasPatchCall) Header() http.Header {
4998 if c.header_ == nil {
4999 c.header_ = make(http.Header)
5000 }
5001 return c.header_
5002 }
5003
5004 func (c *ProjectsLocationsSaasPatchCall) doRequest(alt string) (*http.Response, error) {
5005 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5006 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.saas)
5007 if err != nil {
5008 return nil, err
5009 }
5010 c.urlParams_.Set("alt", alt)
5011 c.urlParams_.Set("prettyPrint", "false")
5012 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5013 urls += "?" + c.urlParams_.Encode()
5014 req, err := http.NewRequest("PATCH", urls, body)
5015 if err != nil {
5016 return nil, err
5017 }
5018 req.Header = reqHeaders
5019 googleapi.Expand(req.URL, map[string]string{
5020 "name": c.name,
5021 })
5022 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
5023 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5024 }
5025
5026 // Do executes the "saasservicemgmt.projects.locations.saas.patch" call.
5027 // Any non-2xx status code is an error. Response headers are in either
5028 // *Saas.ServerResponse.Header or (if a response was returned at all) in
5029 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5030 // whether the returned error was because http.StatusNotModified was returned.
5031 func (c *ProjectsLocationsSaasPatchCall) Do(opts ...googleapi.CallOption) (*Saas, error) {
5032 gensupport.SetOptions(c.urlParams_, opts...)
5033 res, err := c.doRequest("json")
5034 if res != nil && res.StatusCode == http.StatusNotModified {
5035 if res.Body != nil {
5036 res.Body.Close()
5037 }
5038 return nil, gensupport.WrapError(&googleapi.Error{
5039 Code: res.StatusCode,
5040 Header: res.Header,
5041 })
5042 }
5043 if err != nil {
5044 return nil, err
5045 }
5046 defer googleapi.CloseBody(res)
5047 if err := googleapi.CheckResponse(res); err != nil {
5048 return nil, gensupport.WrapError(err)
5049 }
5050 ret := &Saas{
5051 ServerResponse: googleapi.ServerResponse{
5052 Header: res.Header,
5053 HTTPStatusCode: res.StatusCode,
5054 },
5055 }
5056 target := &ret
5057 b, err := gensupport.DecodeResponseBytes(target, res)
5058 if err != nil {
5059 return nil, err
5060 }
5061 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.patch", "response", internallog.HTTPResponse(res, b))
5062 return ret, nil
5063 }
5064
5065 type ProjectsLocationsTenantsCreateCall struct {
5066 s *Service
5067 parent string
5068 tenant *Tenant
5069 urlParams_ gensupport.URLParams
5070 ctx_ context.Context
5071 header_ http.Header
5072 }
5073
5074 // Create: Create a new tenant.
5075 //
5076 // - parent: The parent of the tenant.
5077 func (r *ProjectsLocationsTenantsService) Create(parent string, tenant *Tenant) *ProjectsLocationsTenantsCreateCall {
5078 c := &ProjectsLocationsTenantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5079 c.parent = parent
5080 c.tenant = tenant
5081 return c
5082 }
5083
5084 // RequestId sets the optional parameter "requestId": An optional request ID to
5085 // identify requests. Specify a unique request ID so that if you must retry
5086 // your request, the server will know to ignore the request if it has already
5087 // been completed. The server will guarantee that for at least 60 minutes since
5088 // the first request. For example, consider a situation where you make an
5089 // initial request and the request times out. If you make the request again
5090 // with the same request ID, the server can check if original operation with
5091 // the same request ID was received, and if so, will ignore the second request.
5092 // This prevents clients from accidentally creating duplicate commitments. The
5093 // request ID must be a valid UUID with the exception that zero UUID is not
5094 // supported (00000000-0000-0000-0000-000000000000).
5095 func (c *ProjectsLocationsTenantsCreateCall) RequestId(requestId string) *ProjectsLocationsTenantsCreateCall {
5096 c.urlParams_.Set("requestId", requestId)
5097 return c
5098 }
5099
5100 // TenantId sets the optional parameter "tenantId": Required. The ID value for
5101 // the new tenant.
5102 func (c *ProjectsLocationsTenantsCreateCall) TenantId(tenantId string) *ProjectsLocationsTenantsCreateCall {
5103 c.urlParams_.Set("tenantId", tenantId)
5104 return c
5105 }
5106
5107 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5108 // is set to true, the service will try to validate that this request would
5109 // succeed, but will not actually make changes.
5110 func (c *ProjectsLocationsTenantsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTenantsCreateCall {
5111 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5112 return c
5113 }
5114
5115 // Fields allows partial responses to be retrieved. See
5116 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5117 // details.
5118 func (c *ProjectsLocationsTenantsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsCreateCall {
5119 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5120 return c
5121 }
5122
5123 // Context sets the context to be used in this call's Do method.
5124 func (c *ProjectsLocationsTenantsCreateCall) Context(ctx context.Context) *ProjectsLocationsTenantsCreateCall {
5125 c.ctx_ = ctx
5126 return c
5127 }
5128
5129 // Header returns a http.Header that can be modified by the caller to add
5130 // headers to the request.
5131 func (c *ProjectsLocationsTenantsCreateCall) Header() http.Header {
5132 if c.header_ == nil {
5133 c.header_ = make(http.Header)
5134 }
5135 return c.header_
5136 }
5137
5138 func (c *ProjectsLocationsTenantsCreateCall) doRequest(alt string) (*http.Response, error) {
5139 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5140 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tenant)
5141 if err != nil {
5142 return nil, err
5143 }
5144 c.urlParams_.Set("alt", alt)
5145 c.urlParams_.Set("prettyPrint", "false")
5146 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tenants")
5147 urls += "?" + c.urlParams_.Encode()
5148 req, err := http.NewRequest("POST", urls, body)
5149 if err != nil {
5150 return nil, err
5151 }
5152 req.Header = reqHeaders
5153 googleapi.Expand(req.URL, map[string]string{
5154 "parent": c.parent,
5155 })
5156 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5157 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5158 }
5159
5160 // Do executes the "saasservicemgmt.projects.locations.tenants.create" call.
5161 // Any non-2xx status code is an error. Response headers are in either
5162 // *Tenant.ServerResponse.Header or (if a response was returned at all) in
5163 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5164 // whether the returned error was because http.StatusNotModified was returned.
5165 func (c *ProjectsLocationsTenantsCreateCall) Do(opts ...googleapi.CallOption) (*Tenant, error) {
5166 gensupport.SetOptions(c.urlParams_, opts...)
5167 res, err := c.doRequest("json")
5168 if res != nil && res.StatusCode == http.StatusNotModified {
5169 if res.Body != nil {
5170 res.Body.Close()
5171 }
5172 return nil, gensupport.WrapError(&googleapi.Error{
5173 Code: res.StatusCode,
5174 Header: res.Header,
5175 })
5176 }
5177 if err != nil {
5178 return nil, err
5179 }
5180 defer googleapi.CloseBody(res)
5181 if err := googleapi.CheckResponse(res); err != nil {
5182 return nil, gensupport.WrapError(err)
5183 }
5184 ret := &Tenant{
5185 ServerResponse: googleapi.ServerResponse{
5186 Header: res.Header,
5187 HTTPStatusCode: res.StatusCode,
5188 },
5189 }
5190 target := &ret
5191 b, err := gensupport.DecodeResponseBytes(target, res)
5192 if err != nil {
5193 return nil, err
5194 }
5195 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.create", "response", internallog.HTTPResponse(res, b))
5196 return ret, nil
5197 }
5198
5199 type ProjectsLocationsTenantsDeleteCall struct {
5200 s *Service
5201 name string
5202 urlParams_ gensupport.URLParams
5203 ctx_ context.Context
5204 header_ http.Header
5205 }
5206
5207 // Delete: Delete a single tenant.
5208 //
5209 // - name: The resource name of the resource within a service.
5210 func (r *ProjectsLocationsTenantsService) Delete(name string) *ProjectsLocationsTenantsDeleteCall {
5211 c := &ProjectsLocationsTenantsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5212 c.name = name
5213 return c
5214 }
5215
5216 // Etag sets the optional parameter "etag": The etag known to the client for
5217 // the expected state of the tenant. This is used with state-changing methods
5218 // to prevent accidental overwrites when multiple user agents might be acting
5219 // in parallel on the same resource. An etag wildcard provide optimistic
5220 // concurrency based on the expected existence of the tenant. The Any wildcard
5221 // (`*`) requires that the resource must already exists, and the Not Any
5222 // wildcard (`!*`) requires that it must not.
5223 func (c *ProjectsLocationsTenantsDeleteCall) Etag(etag string) *ProjectsLocationsTenantsDeleteCall {
5224 c.urlParams_.Set("etag", etag)
5225 return c
5226 }
5227
5228 // RequestId sets the optional parameter "requestId": An optional request ID to
5229 // identify requests. Specify a unique request ID so that if you must retry
5230 // your request, the server will know to ignore the request if it has already
5231 // been completed. The server will guarantee that for at least 60 minutes since
5232 // the first request. For example, consider a situation where you make an
5233 // initial request and the request times out. If you make the request again
5234 // with the same request ID, the server can check if original operation with
5235 // the same request ID was received, and if so, will ignore the second request.
5236 // This prevents clients from accidentally creating duplicate commitments. The
5237 // request ID must be a valid UUID with the exception that zero UUID is not
5238 // supported (00000000-0000-0000-0000-000000000000).
5239 func (c *ProjectsLocationsTenantsDeleteCall) RequestId(requestId string) *ProjectsLocationsTenantsDeleteCall {
5240 c.urlParams_.Set("requestId", requestId)
5241 return c
5242 }
5243
5244 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5245 // is set to true, the service will try to validate that this request would
5246 // succeed, but will not actually make changes.
5247 func (c *ProjectsLocationsTenantsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTenantsDeleteCall {
5248 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5249 return c
5250 }
5251
5252 // Fields allows partial responses to be retrieved. See
5253 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5254 // details.
5255 func (c *ProjectsLocationsTenantsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsDeleteCall {
5256 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5257 return c
5258 }
5259
5260 // Context sets the context to be used in this call's Do method.
5261 func (c *ProjectsLocationsTenantsDeleteCall) Context(ctx context.Context) *ProjectsLocationsTenantsDeleteCall {
5262 c.ctx_ = ctx
5263 return c
5264 }
5265
5266 // Header returns a http.Header that can be modified by the caller to add
5267 // headers to the request.
5268 func (c *ProjectsLocationsTenantsDeleteCall) Header() http.Header {
5269 if c.header_ == nil {
5270 c.header_ = make(http.Header)
5271 }
5272 return c.header_
5273 }
5274
5275 func (c *ProjectsLocationsTenantsDeleteCall) doRequest(alt string) (*http.Response, error) {
5276 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5277 c.urlParams_.Set("alt", alt)
5278 c.urlParams_.Set("prettyPrint", "false")
5279 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5280 urls += "?" + c.urlParams_.Encode()
5281 req, err := http.NewRequest("DELETE", urls, nil)
5282 if err != nil {
5283 return nil, err
5284 }
5285 req.Header = reqHeaders
5286 googleapi.Expand(req.URL, map[string]string{
5287 "name": c.name,
5288 })
5289 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.delete", "request", internallog.HTTPRequest(req, nil))
5290 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5291 }
5292
5293 // Do executes the "saasservicemgmt.projects.locations.tenants.delete" call.
5294 // Any non-2xx status code is an error. Response headers are in either
5295 // *Empty.ServerResponse.Header or (if a response was returned at all) in
5296 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5297 // whether the returned error was because http.StatusNotModified was returned.
5298 func (c *ProjectsLocationsTenantsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5299 gensupport.SetOptions(c.urlParams_, opts...)
5300 res, err := c.doRequest("json")
5301 if res != nil && res.StatusCode == http.StatusNotModified {
5302 if res.Body != nil {
5303 res.Body.Close()
5304 }
5305 return nil, gensupport.WrapError(&googleapi.Error{
5306 Code: res.StatusCode,
5307 Header: res.Header,
5308 })
5309 }
5310 if err != nil {
5311 return nil, err
5312 }
5313 defer googleapi.CloseBody(res)
5314 if err := googleapi.CheckResponse(res); err != nil {
5315 return nil, gensupport.WrapError(err)
5316 }
5317 ret := &Empty{
5318 ServerResponse: googleapi.ServerResponse{
5319 Header: res.Header,
5320 HTTPStatusCode: res.StatusCode,
5321 },
5322 }
5323 target := &ret
5324 b, err := gensupport.DecodeResponseBytes(target, res)
5325 if err != nil {
5326 return nil, err
5327 }
5328 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.delete", "response", internallog.HTTPResponse(res, b))
5329 return ret, nil
5330 }
5331
5332 type ProjectsLocationsTenantsGetCall struct {
5333 s *Service
5334 name string
5335 urlParams_ gensupport.URLParams
5336 ifNoneMatch_ string
5337 ctx_ context.Context
5338 header_ http.Header
5339 }
5340
5341 // Get: Retrieve a single tenant.
5342 //
5343 // - name: The resource name of the resource within a service.
5344 func (r *ProjectsLocationsTenantsService) Get(name string) *ProjectsLocationsTenantsGetCall {
5345 c := &ProjectsLocationsTenantsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5346 c.name = name
5347 return c
5348 }
5349
5350 // Fields allows partial responses to be retrieved. See
5351 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5352 // details.
5353 func (c *ProjectsLocationsTenantsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsGetCall {
5354 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5355 return c
5356 }
5357
5358 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5359 // object's ETag matches the given value. This is useful for getting updates
5360 // only after the object has changed since the last request.
5361 func (c *ProjectsLocationsTenantsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTenantsGetCall {
5362 c.ifNoneMatch_ = entityTag
5363 return c
5364 }
5365
5366 // Context sets the context to be used in this call's Do method.
5367 func (c *ProjectsLocationsTenantsGetCall) Context(ctx context.Context) *ProjectsLocationsTenantsGetCall {
5368 c.ctx_ = ctx
5369 return c
5370 }
5371
5372 // Header returns a http.Header that can be modified by the caller to add
5373 // headers to the request.
5374 func (c *ProjectsLocationsTenantsGetCall) Header() http.Header {
5375 if c.header_ == nil {
5376 c.header_ = make(http.Header)
5377 }
5378 return c.header_
5379 }
5380
5381 func (c *ProjectsLocationsTenantsGetCall) doRequest(alt string) (*http.Response, error) {
5382 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5383 if c.ifNoneMatch_ != "" {
5384 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5385 }
5386 c.urlParams_.Set("alt", alt)
5387 c.urlParams_.Set("prettyPrint", "false")
5388 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5389 urls += "?" + c.urlParams_.Encode()
5390 req, err := http.NewRequest("GET", urls, nil)
5391 if err != nil {
5392 return nil, err
5393 }
5394 req.Header = reqHeaders
5395 googleapi.Expand(req.URL, map[string]string{
5396 "name": c.name,
5397 })
5398 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.get", "request", internallog.HTTPRequest(req, nil))
5399 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5400 }
5401
5402 // Do executes the "saasservicemgmt.projects.locations.tenants.get" call.
5403 // Any non-2xx status code is an error. Response headers are in either
5404 // *Tenant.ServerResponse.Header or (if a response was returned at all) in
5405 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5406 // whether the returned error was because http.StatusNotModified was returned.
5407 func (c *ProjectsLocationsTenantsGetCall) Do(opts ...googleapi.CallOption) (*Tenant, error) {
5408 gensupport.SetOptions(c.urlParams_, opts...)
5409 res, err := c.doRequest("json")
5410 if res != nil && res.StatusCode == http.StatusNotModified {
5411 if res.Body != nil {
5412 res.Body.Close()
5413 }
5414 return nil, gensupport.WrapError(&googleapi.Error{
5415 Code: res.StatusCode,
5416 Header: res.Header,
5417 })
5418 }
5419 if err != nil {
5420 return nil, err
5421 }
5422 defer googleapi.CloseBody(res)
5423 if err := googleapi.CheckResponse(res); err != nil {
5424 return nil, gensupport.WrapError(err)
5425 }
5426 ret := &Tenant{
5427 ServerResponse: googleapi.ServerResponse{
5428 Header: res.Header,
5429 HTTPStatusCode: res.StatusCode,
5430 },
5431 }
5432 target := &ret
5433 b, err := gensupport.DecodeResponseBytes(target, res)
5434 if err != nil {
5435 return nil, err
5436 }
5437 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.get", "response", internallog.HTTPResponse(res, b))
5438 return ret, nil
5439 }
5440
5441 type ProjectsLocationsTenantsListCall struct {
5442 s *Service
5443 parent string
5444 urlParams_ gensupport.URLParams
5445 ifNoneMatch_ string
5446 ctx_ context.Context
5447 header_ http.Header
5448 }
5449
5450 // List: Retrieve a collection of tenants.
5451 //
5452 // - parent: The parent of the tenant.
5453 func (r *ProjectsLocationsTenantsService) List(parent string) *ProjectsLocationsTenantsListCall {
5454 c := &ProjectsLocationsTenantsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5455 c.parent = parent
5456 return c
5457 }
5458
5459 // Filter sets the optional parameter "filter": Filter the list as specified in
5460 // https://google.aip.dev/160.
5461 func (c *ProjectsLocationsTenantsListCall) Filter(filter string) *ProjectsLocationsTenantsListCall {
5462 c.urlParams_.Set("filter", filter)
5463 return c
5464 }
5465
5466 // OrderBy sets the optional parameter "orderBy": Order results as specified in
5467 // https://google.aip.dev/132.
5468 func (c *ProjectsLocationsTenantsListCall) OrderBy(orderBy string) *ProjectsLocationsTenantsListCall {
5469 c.urlParams_.Set("orderBy", orderBy)
5470 return c
5471 }
5472
5473 // PageSize sets the optional parameter "pageSize": The maximum number of
5474 // tenants to send per page.
5475 func (c *ProjectsLocationsTenantsListCall) PageSize(pageSize int64) *ProjectsLocationsTenantsListCall {
5476 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5477 return c
5478 }
5479
5480 // PageToken sets the optional parameter "pageToken": The page token: If the
5481 // next_page_token from a previous response is provided, this request will send
5482 // the subsequent page.
5483 func (c *ProjectsLocationsTenantsListCall) PageToken(pageToken string) *ProjectsLocationsTenantsListCall {
5484 c.urlParams_.Set("pageToken", pageToken)
5485 return c
5486 }
5487
5488 // Fields allows partial responses to be retrieved. See
5489 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5490 // details.
5491 func (c *ProjectsLocationsTenantsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsListCall {
5492 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5493 return c
5494 }
5495
5496 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5497 // object's ETag matches the given value. This is useful for getting updates
5498 // only after the object has changed since the last request.
5499 func (c *ProjectsLocationsTenantsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTenantsListCall {
5500 c.ifNoneMatch_ = entityTag
5501 return c
5502 }
5503
5504 // Context sets the context to be used in this call's Do method.
5505 func (c *ProjectsLocationsTenantsListCall) Context(ctx context.Context) *ProjectsLocationsTenantsListCall {
5506 c.ctx_ = ctx
5507 return c
5508 }
5509
5510 // Header returns a http.Header that can be modified by the caller to add
5511 // headers to the request.
5512 func (c *ProjectsLocationsTenantsListCall) Header() http.Header {
5513 if c.header_ == nil {
5514 c.header_ = make(http.Header)
5515 }
5516 return c.header_
5517 }
5518
5519 func (c *ProjectsLocationsTenantsListCall) doRequest(alt string) (*http.Response, error) {
5520 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5521 if c.ifNoneMatch_ != "" {
5522 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5523 }
5524 c.urlParams_.Set("alt", alt)
5525 c.urlParams_.Set("prettyPrint", "false")
5526 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/tenants")
5527 urls += "?" + c.urlParams_.Encode()
5528 req, err := http.NewRequest("GET", urls, nil)
5529 if err != nil {
5530 return nil, err
5531 }
5532 req.Header = reqHeaders
5533 googleapi.Expand(req.URL, map[string]string{
5534 "parent": c.parent,
5535 })
5536 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.list", "request", internallog.HTTPRequest(req, nil))
5537 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5538 }
5539
5540 // Do executes the "saasservicemgmt.projects.locations.tenants.list" call.
5541 // Any non-2xx status code is an error. Response headers are in either
5542 // *ListTenantsResponse.ServerResponse.Header or (if a response was returned at
5543 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5544 // check whether the returned error was because http.StatusNotModified was
5545 // returned.
5546 func (c *ProjectsLocationsTenantsListCall) Do(opts ...googleapi.CallOption) (*ListTenantsResponse, error) {
5547 gensupport.SetOptions(c.urlParams_, opts...)
5548 res, err := c.doRequest("json")
5549 if res != nil && res.StatusCode == http.StatusNotModified {
5550 if res.Body != nil {
5551 res.Body.Close()
5552 }
5553 return nil, gensupport.WrapError(&googleapi.Error{
5554 Code: res.StatusCode,
5555 Header: res.Header,
5556 })
5557 }
5558 if err != nil {
5559 return nil, err
5560 }
5561 defer googleapi.CloseBody(res)
5562 if err := googleapi.CheckResponse(res); err != nil {
5563 return nil, gensupport.WrapError(err)
5564 }
5565 ret := &ListTenantsResponse{
5566 ServerResponse: googleapi.ServerResponse{
5567 Header: res.Header,
5568 HTTPStatusCode: res.StatusCode,
5569 },
5570 }
5571 target := &ret
5572 b, err := gensupport.DecodeResponseBytes(target, res)
5573 if err != nil {
5574 return nil, err
5575 }
5576 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.list", "response", internallog.HTTPResponse(res, b))
5577 return ret, nil
5578 }
5579
5580 // Pages invokes f for each page of results.
5581 // A non-nil error returned from f will halt the iteration.
5582 // The provided context supersedes any context provided to the Context method.
5583 func (c *ProjectsLocationsTenantsListCall) Pages(ctx context.Context, f func(*ListTenantsResponse) error) error {
5584 c.ctx_ = ctx
5585 defer c.PageToken(c.urlParams_.Get("pageToken"))
5586 for {
5587 x, err := c.Do()
5588 if err != nil {
5589 return err
5590 }
5591 if err := f(x); err != nil {
5592 return err
5593 }
5594 if x.NextPageToken == "" {
5595 return nil
5596 }
5597 c.PageToken(x.NextPageToken)
5598 }
5599 }
5600
5601 type ProjectsLocationsTenantsPatchCall struct {
5602 s *Service
5603 name string
5604 tenant *Tenant
5605 urlParams_ gensupport.URLParams
5606 ctx_ context.Context
5607 header_ http.Header
5608 }
5609
5610 // Patch: Update a single tenant.
5611 //
5612 // - name: Identifier. The resource name (full URI of the resource) following
5613 // the standard naming scheme:
5614 // "projects/{project}/locations/{location}/tenants/{tenant}".
5615 func (r *ProjectsLocationsTenantsService) Patch(name string, tenant *Tenant) *ProjectsLocationsTenantsPatchCall {
5616 c := &ProjectsLocationsTenantsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5617 c.name = name
5618 c.tenant = tenant
5619 return c
5620 }
5621
5622 // RequestId sets the optional parameter "requestId": An optional request ID to
5623 // identify requests. Specify a unique request ID so that if you must retry
5624 // your request, the server will know to ignore the request if it has already
5625 // been completed. The server will guarantee that for at least 60 minutes since
5626 // the first request. For example, consider a situation where you make an
5627 // initial request and the request times out. If you make the request again
5628 // with the same request ID, the server can check if original operation with
5629 // the same request ID was received, and if so, will ignore the second request.
5630 // This prevents clients from accidentally creating duplicate commitments. The
5631 // request ID must be a valid UUID with the exception that zero UUID is not
5632 // supported (00000000-0000-0000-0000-000000000000).
5633 func (c *ProjectsLocationsTenantsPatchCall) RequestId(requestId string) *ProjectsLocationsTenantsPatchCall {
5634 c.urlParams_.Set("requestId", requestId)
5635 return c
5636 }
5637
5638 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
5639 // specify the fields to be overwritten in the Tenant resource by the update.
5640 // The fields specified in the update_mask are relative to the resource, not
5641 // the full request. A field will be overwritten if it is in the mask. If the
5642 // user does not provide a mask then all fields in the Tenant will be
5643 // overwritten.
5644 func (c *ProjectsLocationsTenantsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTenantsPatchCall {
5645 c.urlParams_.Set("updateMask", updateMask)
5646 return c
5647 }
5648
5649 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5650 // is set to true, the service will try to validate that this request would
5651 // succeed, but will not actually make changes.
5652 func (c *ProjectsLocationsTenantsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTenantsPatchCall {
5653 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5654 return c
5655 }
5656
5657 // Fields allows partial responses to be retrieved. See
5658 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5659 // details.
5660 func (c *ProjectsLocationsTenantsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsPatchCall {
5661 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5662 return c
5663 }
5664
5665 // Context sets the context to be used in this call's Do method.
5666 func (c *ProjectsLocationsTenantsPatchCall) Context(ctx context.Context) *ProjectsLocationsTenantsPatchCall {
5667 c.ctx_ = ctx
5668 return c
5669 }
5670
5671 // Header returns a http.Header that can be modified by the caller to add
5672 // headers to the request.
5673 func (c *ProjectsLocationsTenantsPatchCall) Header() http.Header {
5674 if c.header_ == nil {
5675 c.header_ = make(http.Header)
5676 }
5677 return c.header_
5678 }
5679
5680 func (c *ProjectsLocationsTenantsPatchCall) doRequest(alt string) (*http.Response, error) {
5681 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5682 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tenant)
5683 if err != nil {
5684 return nil, err
5685 }
5686 c.urlParams_.Set("alt", alt)
5687 c.urlParams_.Set("prettyPrint", "false")
5688 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5689 urls += "?" + c.urlParams_.Encode()
5690 req, err := http.NewRequest("PATCH", urls, body)
5691 if err != nil {
5692 return nil, err
5693 }
5694 req.Header = reqHeaders
5695 googleapi.Expand(req.URL, map[string]string{
5696 "name": c.name,
5697 })
5698 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
5699 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5700 }
5701
5702 // Do executes the "saasservicemgmt.projects.locations.tenants.patch" call.
5703 // Any non-2xx status code is an error. Response headers are in either
5704 // *Tenant.ServerResponse.Header or (if a response was returned at all) in
5705 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5706 // whether the returned error was because http.StatusNotModified was returned.
5707 func (c *ProjectsLocationsTenantsPatchCall) Do(opts ...googleapi.CallOption) (*Tenant, error) {
5708 gensupport.SetOptions(c.urlParams_, opts...)
5709 res, err := c.doRequest("json")
5710 if res != nil && res.StatusCode == http.StatusNotModified {
5711 if res.Body != nil {
5712 res.Body.Close()
5713 }
5714 return nil, gensupport.WrapError(&googleapi.Error{
5715 Code: res.StatusCode,
5716 Header: res.Header,
5717 })
5718 }
5719 if err != nil {
5720 return nil, err
5721 }
5722 defer googleapi.CloseBody(res)
5723 if err := googleapi.CheckResponse(res); err != nil {
5724 return nil, gensupport.WrapError(err)
5725 }
5726 ret := &Tenant{
5727 ServerResponse: googleapi.ServerResponse{
5728 Header: res.Header,
5729 HTTPStatusCode: res.StatusCode,
5730 },
5731 }
5732 target := &ret
5733 b, err := gensupport.DecodeResponseBytes(target, res)
5734 if err != nil {
5735 return nil, err
5736 }
5737 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.patch", "response", internallog.HTTPResponse(res, b))
5738 return ret, nil
5739 }
5740
5741 type ProjectsLocationsUnitKindsCreateCall struct {
5742 s *Service
5743 parent string
5744 unitkind *UnitKind
5745 urlParams_ gensupport.URLParams
5746 ctx_ context.Context
5747 header_ http.Header
5748 }
5749
5750 // Create: Create a new unit kind.
5751 //
5752 // - parent: The parent of the unit kind.
5753 func (r *ProjectsLocationsUnitKindsService) Create(parent string, unitkind *UnitKind) *ProjectsLocationsUnitKindsCreateCall {
5754 c := &ProjectsLocationsUnitKindsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5755 c.parent = parent
5756 c.unitkind = unitkind
5757 return c
5758 }
5759
5760 // RequestId sets the optional parameter "requestId": An optional request ID to
5761 // identify requests. Specify a unique request ID so that if you must retry
5762 // your request, the server will know to ignore the request if it has already
5763 // been completed. The server will guarantee that for at least 60 minutes since
5764 // the first request. For example, consider a situation where you make an
5765 // initial request and the request times out. If you make the request again
5766 // with the same request ID, the server can check if original operation with
5767 // the same request ID was received, and if so, will ignore the second request.
5768 // This prevents clients from accidentally creating duplicate commitments. The
5769 // request ID must be a valid UUID with the exception that zero UUID is not
5770 // supported (00000000-0000-0000-0000-000000000000).
5771 func (c *ProjectsLocationsUnitKindsCreateCall) RequestId(requestId string) *ProjectsLocationsUnitKindsCreateCall {
5772 c.urlParams_.Set("requestId", requestId)
5773 return c
5774 }
5775
5776 // UnitKindId sets the optional parameter "unitKindId": Required. The ID value
5777 // for the new unit kind.
5778 func (c *ProjectsLocationsUnitKindsCreateCall) UnitKindId(unitKindId string) *ProjectsLocationsUnitKindsCreateCall {
5779 c.urlParams_.Set("unitKindId", unitKindId)
5780 return c
5781 }
5782
5783 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5784 // is set to true, the service will try to validate that this request would
5785 // succeed, but will not actually make changes.
5786 func (c *ProjectsLocationsUnitKindsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitKindsCreateCall {
5787 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5788 return c
5789 }
5790
5791 // Fields allows partial responses to be retrieved. See
5792 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5793 // details.
5794 func (c *ProjectsLocationsUnitKindsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsCreateCall {
5795 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5796 return c
5797 }
5798
5799 // Context sets the context to be used in this call's Do method.
5800 func (c *ProjectsLocationsUnitKindsCreateCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsCreateCall {
5801 c.ctx_ = ctx
5802 return c
5803 }
5804
5805 // Header returns a http.Header that can be modified by the caller to add
5806 // headers to the request.
5807 func (c *ProjectsLocationsUnitKindsCreateCall) Header() http.Header {
5808 if c.header_ == nil {
5809 c.header_ = make(http.Header)
5810 }
5811 return c.header_
5812 }
5813
5814 func (c *ProjectsLocationsUnitKindsCreateCall) doRequest(alt string) (*http.Response, error) {
5815 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5816 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unitkind)
5817 if err != nil {
5818 return nil, err
5819 }
5820 c.urlParams_.Set("alt", alt)
5821 c.urlParams_.Set("prettyPrint", "false")
5822 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/unitKinds")
5823 urls += "?" + c.urlParams_.Encode()
5824 req, err := http.NewRequest("POST", urls, body)
5825 if err != nil {
5826 return nil, err
5827 }
5828 req.Header = reqHeaders
5829 googleapi.Expand(req.URL, map[string]string{
5830 "parent": c.parent,
5831 })
5832 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5833 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5834 }
5835
5836 // Do executes the "saasservicemgmt.projects.locations.unitKinds.create" call.
5837 // Any non-2xx status code is an error. Response headers are in either
5838 // *UnitKind.ServerResponse.Header or (if a response was returned at all) in
5839 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5840 // whether the returned error was because http.StatusNotModified was returned.
5841 func (c *ProjectsLocationsUnitKindsCreateCall) Do(opts ...googleapi.CallOption) (*UnitKind, error) {
5842 gensupport.SetOptions(c.urlParams_, opts...)
5843 res, err := c.doRequest("json")
5844 if res != nil && res.StatusCode == http.StatusNotModified {
5845 if res.Body != nil {
5846 res.Body.Close()
5847 }
5848 return nil, gensupport.WrapError(&googleapi.Error{
5849 Code: res.StatusCode,
5850 Header: res.Header,
5851 })
5852 }
5853 if err != nil {
5854 return nil, err
5855 }
5856 defer googleapi.CloseBody(res)
5857 if err := googleapi.CheckResponse(res); err != nil {
5858 return nil, gensupport.WrapError(err)
5859 }
5860 ret := &UnitKind{
5861 ServerResponse: googleapi.ServerResponse{
5862 Header: res.Header,
5863 HTTPStatusCode: res.StatusCode,
5864 },
5865 }
5866 target := &ret
5867 b, err := gensupport.DecodeResponseBytes(target, res)
5868 if err != nil {
5869 return nil, err
5870 }
5871 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.create", "response", internallog.HTTPResponse(res, b))
5872 return ret, nil
5873 }
5874
5875 type ProjectsLocationsUnitKindsDeleteCall struct {
5876 s *Service
5877 name string
5878 urlParams_ gensupport.URLParams
5879 ctx_ context.Context
5880 header_ http.Header
5881 }
5882
5883 // Delete: Delete a single unit kind.
5884 //
5885 // - name: The resource name of the resource within a service.
5886 func (r *ProjectsLocationsUnitKindsService) Delete(name string) *ProjectsLocationsUnitKindsDeleteCall {
5887 c := &ProjectsLocationsUnitKindsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5888 c.name = name
5889 return c
5890 }
5891
5892 // Etag sets the optional parameter "etag": The etag known to the client for
5893 // the expected state of the unit kind. This is used with state-changing
5894 // methods to prevent accidental overwrites when multiple user agents might be
5895 // acting in parallel on the same resource. An etag wildcard provide optimistic
5896 // concurrency based on the expected existence of the unit kind. The Any
5897 // wildcard (`*`) requires that the resource must already exists, and the Not
5898 // Any wildcard (`!*`) requires that it must not.
5899 func (c *ProjectsLocationsUnitKindsDeleteCall) Etag(etag string) *ProjectsLocationsUnitKindsDeleteCall {
5900 c.urlParams_.Set("etag", etag)
5901 return c
5902 }
5903
5904 // RequestId sets the optional parameter "requestId": An optional request ID to
5905 // identify requests. Specify a unique request ID so that if you must retry
5906 // your request, the server will know to ignore the request if it has already
5907 // been completed. The server will guarantee that for at least 60 minutes since
5908 // the first request. For example, consider a situation where you make an
5909 // initial request and the request times out. If you make the request again
5910 // with the same request ID, the server can check if original operation with
5911 // the same request ID was received, and if so, will ignore the second request.
5912 // This prevents clients from accidentally creating duplicate commitments. The
5913 // request ID must be a valid UUID with the exception that zero UUID is not
5914 // supported (00000000-0000-0000-0000-000000000000).
5915 func (c *ProjectsLocationsUnitKindsDeleteCall) RequestId(requestId string) *ProjectsLocationsUnitKindsDeleteCall {
5916 c.urlParams_.Set("requestId", requestId)
5917 return c
5918 }
5919
5920 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5921 // is set to true, the service will try to validate that this request would
5922 // succeed, but will not actually make changes.
5923 func (c *ProjectsLocationsUnitKindsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitKindsDeleteCall {
5924 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5925 return c
5926 }
5927
5928 // Fields allows partial responses to be retrieved. See
5929 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5930 // details.
5931 func (c *ProjectsLocationsUnitKindsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsDeleteCall {
5932 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5933 return c
5934 }
5935
5936 // Context sets the context to be used in this call's Do method.
5937 func (c *ProjectsLocationsUnitKindsDeleteCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsDeleteCall {
5938 c.ctx_ = ctx
5939 return c
5940 }
5941
5942 // Header returns a http.Header that can be modified by the caller to add
5943 // headers to the request.
5944 func (c *ProjectsLocationsUnitKindsDeleteCall) Header() http.Header {
5945 if c.header_ == nil {
5946 c.header_ = make(http.Header)
5947 }
5948 return c.header_
5949 }
5950
5951 func (c *ProjectsLocationsUnitKindsDeleteCall) doRequest(alt string) (*http.Response, error) {
5952 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5953 c.urlParams_.Set("alt", alt)
5954 c.urlParams_.Set("prettyPrint", "false")
5955 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5956 urls += "?" + c.urlParams_.Encode()
5957 req, err := http.NewRequest("DELETE", urls, nil)
5958 if err != nil {
5959 return nil, err
5960 }
5961 req.Header = reqHeaders
5962 googleapi.Expand(req.URL, map[string]string{
5963 "name": c.name,
5964 })
5965 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.delete", "request", internallog.HTTPRequest(req, nil))
5966 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5967 }
5968
5969 // Do executes the "saasservicemgmt.projects.locations.unitKinds.delete" call.
5970 // Any non-2xx status code is an error. Response headers are in either
5971 // *Empty.ServerResponse.Header or (if a response was returned at all) in
5972 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5973 // whether the returned error was because http.StatusNotModified was returned.
5974 func (c *ProjectsLocationsUnitKindsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5975 gensupport.SetOptions(c.urlParams_, opts...)
5976 res, err := c.doRequest("json")
5977 if res != nil && res.StatusCode == http.StatusNotModified {
5978 if res.Body != nil {
5979 res.Body.Close()
5980 }
5981 return nil, gensupport.WrapError(&googleapi.Error{
5982 Code: res.StatusCode,
5983 Header: res.Header,
5984 })
5985 }
5986 if err != nil {
5987 return nil, err
5988 }
5989 defer googleapi.CloseBody(res)
5990 if err := googleapi.CheckResponse(res); err != nil {
5991 return nil, gensupport.WrapError(err)
5992 }
5993 ret := &Empty{
5994 ServerResponse: googleapi.ServerResponse{
5995 Header: res.Header,
5996 HTTPStatusCode: res.StatusCode,
5997 },
5998 }
5999 target := &ret
6000 b, err := gensupport.DecodeResponseBytes(target, res)
6001 if err != nil {
6002 return nil, err
6003 }
6004 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.delete", "response", internallog.HTTPResponse(res, b))
6005 return ret, nil
6006 }
6007
6008 type ProjectsLocationsUnitKindsGetCall struct {
6009 s *Service
6010 name string
6011 urlParams_ gensupport.URLParams
6012 ifNoneMatch_ string
6013 ctx_ context.Context
6014 header_ http.Header
6015 }
6016
6017 // Get: Retrieve a single unit kind.
6018 //
6019 // - name: The resource name of the resource within a service.
6020 func (r *ProjectsLocationsUnitKindsService) Get(name string) *ProjectsLocationsUnitKindsGetCall {
6021 c := &ProjectsLocationsUnitKindsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6022 c.name = name
6023 return c
6024 }
6025
6026 // Fields allows partial responses to be retrieved. See
6027 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6028 // details.
6029 func (c *ProjectsLocationsUnitKindsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsGetCall {
6030 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6031 return c
6032 }
6033
6034 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6035 // object's ETag matches the given value. This is useful for getting updates
6036 // only after the object has changed since the last request.
6037 func (c *ProjectsLocationsUnitKindsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitKindsGetCall {
6038 c.ifNoneMatch_ = entityTag
6039 return c
6040 }
6041
6042 // Context sets the context to be used in this call's Do method.
6043 func (c *ProjectsLocationsUnitKindsGetCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsGetCall {
6044 c.ctx_ = ctx
6045 return c
6046 }
6047
6048 // Header returns a http.Header that can be modified by the caller to add
6049 // headers to the request.
6050 func (c *ProjectsLocationsUnitKindsGetCall) Header() http.Header {
6051 if c.header_ == nil {
6052 c.header_ = make(http.Header)
6053 }
6054 return c.header_
6055 }
6056
6057 func (c *ProjectsLocationsUnitKindsGetCall) doRequest(alt string) (*http.Response, error) {
6058 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6059 if c.ifNoneMatch_ != "" {
6060 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6061 }
6062 c.urlParams_.Set("alt", alt)
6063 c.urlParams_.Set("prettyPrint", "false")
6064 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6065 urls += "?" + c.urlParams_.Encode()
6066 req, err := http.NewRequest("GET", urls, nil)
6067 if err != nil {
6068 return nil, err
6069 }
6070 req.Header = reqHeaders
6071 googleapi.Expand(req.URL, map[string]string{
6072 "name": c.name,
6073 })
6074 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.get", "request", internallog.HTTPRequest(req, nil))
6075 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6076 }
6077
6078 // Do executes the "saasservicemgmt.projects.locations.unitKinds.get" call.
6079 // Any non-2xx status code is an error. Response headers are in either
6080 // *UnitKind.ServerResponse.Header or (if a response was returned at all) in
6081 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6082 // whether the returned error was because http.StatusNotModified was returned.
6083 func (c *ProjectsLocationsUnitKindsGetCall) Do(opts ...googleapi.CallOption) (*UnitKind, error) {
6084 gensupport.SetOptions(c.urlParams_, opts...)
6085 res, err := c.doRequest("json")
6086 if res != nil && res.StatusCode == http.StatusNotModified {
6087 if res.Body != nil {
6088 res.Body.Close()
6089 }
6090 return nil, gensupport.WrapError(&googleapi.Error{
6091 Code: res.StatusCode,
6092 Header: res.Header,
6093 })
6094 }
6095 if err != nil {
6096 return nil, err
6097 }
6098 defer googleapi.CloseBody(res)
6099 if err := googleapi.CheckResponse(res); err != nil {
6100 return nil, gensupport.WrapError(err)
6101 }
6102 ret := &UnitKind{
6103 ServerResponse: googleapi.ServerResponse{
6104 Header: res.Header,
6105 HTTPStatusCode: res.StatusCode,
6106 },
6107 }
6108 target := &ret
6109 b, err := gensupport.DecodeResponseBytes(target, res)
6110 if err != nil {
6111 return nil, err
6112 }
6113 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.get", "response", internallog.HTTPResponse(res, b))
6114 return ret, nil
6115 }
6116
6117 type ProjectsLocationsUnitKindsListCall struct {
6118 s *Service
6119 parent string
6120 urlParams_ gensupport.URLParams
6121 ifNoneMatch_ string
6122 ctx_ context.Context
6123 header_ http.Header
6124 }
6125
6126 // List: Retrieve a collection of unit kinds.
6127 //
6128 // - parent: The parent of the unit kind.
6129 func (r *ProjectsLocationsUnitKindsService) List(parent string) *ProjectsLocationsUnitKindsListCall {
6130 c := &ProjectsLocationsUnitKindsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6131 c.parent = parent
6132 return c
6133 }
6134
6135 // Filter sets the optional parameter "filter": Filter the list as specified in
6136 // https://google.aip.dev/160.
6137 func (c *ProjectsLocationsUnitKindsListCall) Filter(filter string) *ProjectsLocationsUnitKindsListCall {
6138 c.urlParams_.Set("filter", filter)
6139 return c
6140 }
6141
6142 // OrderBy sets the optional parameter "orderBy": Order results as specified in
6143 // https://google.aip.dev/132.
6144 func (c *ProjectsLocationsUnitKindsListCall) OrderBy(orderBy string) *ProjectsLocationsUnitKindsListCall {
6145 c.urlParams_.Set("orderBy", orderBy)
6146 return c
6147 }
6148
6149 // PageSize sets the optional parameter "pageSize": The maximum number of unit
6150 // kinds to send per page.
6151 func (c *ProjectsLocationsUnitKindsListCall) PageSize(pageSize int64) *ProjectsLocationsUnitKindsListCall {
6152 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6153 return c
6154 }
6155
6156 // PageToken sets the optional parameter "pageToken": The page token: If the
6157 // next_page_token from a previous response is provided, this request will send
6158 // the subsequent page.
6159 func (c *ProjectsLocationsUnitKindsListCall) PageToken(pageToken string) *ProjectsLocationsUnitKindsListCall {
6160 c.urlParams_.Set("pageToken", pageToken)
6161 return c
6162 }
6163
6164 // Fields allows partial responses to be retrieved. See
6165 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6166 // details.
6167 func (c *ProjectsLocationsUnitKindsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsListCall {
6168 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6169 return c
6170 }
6171
6172 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6173 // object's ETag matches the given value. This is useful for getting updates
6174 // only after the object has changed since the last request.
6175 func (c *ProjectsLocationsUnitKindsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitKindsListCall {
6176 c.ifNoneMatch_ = entityTag
6177 return c
6178 }
6179
6180 // Context sets the context to be used in this call's Do method.
6181 func (c *ProjectsLocationsUnitKindsListCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsListCall {
6182 c.ctx_ = ctx
6183 return c
6184 }
6185
6186 // Header returns a http.Header that can be modified by the caller to add
6187 // headers to the request.
6188 func (c *ProjectsLocationsUnitKindsListCall) Header() http.Header {
6189 if c.header_ == nil {
6190 c.header_ = make(http.Header)
6191 }
6192 return c.header_
6193 }
6194
6195 func (c *ProjectsLocationsUnitKindsListCall) doRequest(alt string) (*http.Response, error) {
6196 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6197 if c.ifNoneMatch_ != "" {
6198 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6199 }
6200 c.urlParams_.Set("alt", alt)
6201 c.urlParams_.Set("prettyPrint", "false")
6202 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/unitKinds")
6203 urls += "?" + c.urlParams_.Encode()
6204 req, err := http.NewRequest("GET", urls, nil)
6205 if err != nil {
6206 return nil, err
6207 }
6208 req.Header = reqHeaders
6209 googleapi.Expand(req.URL, map[string]string{
6210 "parent": c.parent,
6211 })
6212 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.list", "request", internallog.HTTPRequest(req, nil))
6213 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6214 }
6215
6216 // Do executes the "saasservicemgmt.projects.locations.unitKinds.list" call.
6217 // Any non-2xx status code is an error. Response headers are in either
6218 // *ListUnitKindsResponse.ServerResponse.Header or (if a response was returned
6219 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6220 // check whether the returned error was because http.StatusNotModified was
6221 // returned.
6222 func (c *ProjectsLocationsUnitKindsListCall) Do(opts ...googleapi.CallOption) (*ListUnitKindsResponse, error) {
6223 gensupport.SetOptions(c.urlParams_, opts...)
6224 res, err := c.doRequest("json")
6225 if res != nil && res.StatusCode == http.StatusNotModified {
6226 if res.Body != nil {
6227 res.Body.Close()
6228 }
6229 return nil, gensupport.WrapError(&googleapi.Error{
6230 Code: res.StatusCode,
6231 Header: res.Header,
6232 })
6233 }
6234 if err != nil {
6235 return nil, err
6236 }
6237 defer googleapi.CloseBody(res)
6238 if err := googleapi.CheckResponse(res); err != nil {
6239 return nil, gensupport.WrapError(err)
6240 }
6241 ret := &ListUnitKindsResponse{
6242 ServerResponse: googleapi.ServerResponse{
6243 Header: res.Header,
6244 HTTPStatusCode: res.StatusCode,
6245 },
6246 }
6247 target := &ret
6248 b, err := gensupport.DecodeResponseBytes(target, res)
6249 if err != nil {
6250 return nil, err
6251 }
6252 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.list", "response", internallog.HTTPResponse(res, b))
6253 return ret, nil
6254 }
6255
6256 // Pages invokes f for each page of results.
6257 // A non-nil error returned from f will halt the iteration.
6258 // The provided context supersedes any context provided to the Context method.
6259 func (c *ProjectsLocationsUnitKindsListCall) Pages(ctx context.Context, f func(*ListUnitKindsResponse) error) error {
6260 c.ctx_ = ctx
6261 defer c.PageToken(c.urlParams_.Get("pageToken"))
6262 for {
6263 x, err := c.Do()
6264 if err != nil {
6265 return err
6266 }
6267 if err := f(x); err != nil {
6268 return err
6269 }
6270 if x.NextPageToken == "" {
6271 return nil
6272 }
6273 c.PageToken(x.NextPageToken)
6274 }
6275 }
6276
6277 type ProjectsLocationsUnitKindsPatchCall struct {
6278 s *Service
6279 name string
6280 unitkind *UnitKind
6281 urlParams_ gensupport.URLParams
6282 ctx_ context.Context
6283 header_ http.Header
6284 }
6285
6286 // Patch: Update a single unit kind.
6287 //
6288 // - name: Identifier. The resource name (full URI of the resource) following
6289 // the standard naming scheme:
6290 // "projects/{project}/locations/{location}/unitKinds/{unitKind}".
6291 func (r *ProjectsLocationsUnitKindsService) Patch(name string, unitkind *UnitKind) *ProjectsLocationsUnitKindsPatchCall {
6292 c := &ProjectsLocationsUnitKindsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6293 c.name = name
6294 c.unitkind = unitkind
6295 return c
6296 }
6297
6298 // RequestId sets the optional parameter "requestId": An optional request ID to
6299 // identify requests. Specify a unique request ID so that if you must retry
6300 // your request, the server will know to ignore the request if it has already
6301 // been completed. The server will guarantee that for at least 60 minutes since
6302 // the first request. For example, consider a situation where you make an
6303 // initial request and the request times out. If you make the request again
6304 // with the same request ID, the server can check if original operation with
6305 // the same request ID was received, and if so, will ignore the second request.
6306 // This prevents clients from accidentally creating duplicate commitments. The
6307 // request ID must be a valid UUID with the exception that zero UUID is not
6308 // supported (00000000-0000-0000-0000-000000000000).
6309 func (c *ProjectsLocationsUnitKindsPatchCall) RequestId(requestId string) *ProjectsLocationsUnitKindsPatchCall {
6310 c.urlParams_.Set("requestId", requestId)
6311 return c
6312 }
6313
6314 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
6315 // specify the fields to be overwritten in the UnitKind resource by the update.
6316 // The fields specified in the update_mask are relative to the resource, not
6317 // the full request. A field will be overwritten if it is in the mask. If the
6318 // user does not provide a mask then all fields in the UnitKind will be
6319 // overwritten.
6320 func (c *ProjectsLocationsUnitKindsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsUnitKindsPatchCall {
6321 c.urlParams_.Set("updateMask", updateMask)
6322 return c
6323 }
6324
6325 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
6326 // is set to true, the service will try to validate that this request would
6327 // succeed, but will not actually make changes.
6328 func (c *ProjectsLocationsUnitKindsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitKindsPatchCall {
6329 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
6330 return c
6331 }
6332
6333 // Fields allows partial responses to be retrieved. See
6334 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6335 // details.
6336 func (c *ProjectsLocationsUnitKindsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsPatchCall {
6337 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6338 return c
6339 }
6340
6341 // Context sets the context to be used in this call's Do method.
6342 func (c *ProjectsLocationsUnitKindsPatchCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsPatchCall {
6343 c.ctx_ = ctx
6344 return c
6345 }
6346
6347 // Header returns a http.Header that can be modified by the caller to add
6348 // headers to the request.
6349 func (c *ProjectsLocationsUnitKindsPatchCall) Header() http.Header {
6350 if c.header_ == nil {
6351 c.header_ = make(http.Header)
6352 }
6353 return c.header_
6354 }
6355
6356 func (c *ProjectsLocationsUnitKindsPatchCall) doRequest(alt string) (*http.Response, error) {
6357 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6358 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unitkind)
6359 if err != nil {
6360 return nil, err
6361 }
6362 c.urlParams_.Set("alt", alt)
6363 c.urlParams_.Set("prettyPrint", "false")
6364 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6365 urls += "?" + c.urlParams_.Encode()
6366 req, err := http.NewRequest("PATCH", urls, body)
6367 if err != nil {
6368 return nil, err
6369 }
6370 req.Header = reqHeaders
6371 googleapi.Expand(req.URL, map[string]string{
6372 "name": c.name,
6373 })
6374 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
6375 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6376 }
6377
6378 // Do executes the "saasservicemgmt.projects.locations.unitKinds.patch" call.
6379 // Any non-2xx status code is an error. Response headers are in either
6380 // *UnitKind.ServerResponse.Header or (if a response was returned at all) in
6381 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6382 // whether the returned error was because http.StatusNotModified was returned.
6383 func (c *ProjectsLocationsUnitKindsPatchCall) Do(opts ...googleapi.CallOption) (*UnitKind, error) {
6384 gensupport.SetOptions(c.urlParams_, opts...)
6385 res, err := c.doRequest("json")
6386 if res != nil && res.StatusCode == http.StatusNotModified {
6387 if res.Body != nil {
6388 res.Body.Close()
6389 }
6390 return nil, gensupport.WrapError(&googleapi.Error{
6391 Code: res.StatusCode,
6392 Header: res.Header,
6393 })
6394 }
6395 if err != nil {
6396 return nil, err
6397 }
6398 defer googleapi.CloseBody(res)
6399 if err := googleapi.CheckResponse(res); err != nil {
6400 return nil, gensupport.WrapError(err)
6401 }
6402 ret := &UnitKind{
6403 ServerResponse: googleapi.ServerResponse{
6404 Header: res.Header,
6405 HTTPStatusCode: res.StatusCode,
6406 },
6407 }
6408 target := &ret
6409 b, err := gensupport.DecodeResponseBytes(target, res)
6410 if err != nil {
6411 return nil, err
6412 }
6413 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.patch", "response", internallog.HTTPResponse(res, b))
6414 return ret, nil
6415 }
6416
6417 type ProjectsLocationsUnitOperationsCreateCall struct {
6418 s *Service
6419 parent string
6420 unitoperation *UnitOperation
6421 urlParams_ gensupport.URLParams
6422 ctx_ context.Context
6423 header_ http.Header
6424 }
6425
6426 // Create: Create a new unit operation.
6427 //
6428 // - parent: The parent of the unit operation.
6429 func (r *ProjectsLocationsUnitOperationsService) Create(parent string, unitoperation *UnitOperation) *ProjectsLocationsUnitOperationsCreateCall {
6430 c := &ProjectsLocationsUnitOperationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6431 c.parent = parent
6432 c.unitoperation = unitoperation
6433 return c
6434 }
6435
6436 // RequestId sets the optional parameter "requestId": An optional request ID to
6437 // identify requests. Specify a unique request ID so that if you must retry
6438 // your request, the server will know to ignore the request if it has already
6439 // been completed. The server will guarantee that for at least 60 minutes since
6440 // the first request. For example, consider a situation where you make an
6441 // initial request and the request times out. If you make the request again
6442 // with the same request ID, the server can check if original operation with
6443 // the same request ID was received, and if so, will ignore the second request.
6444 // This prevents clients from accidentally creating duplicate commitments. The
6445 // request ID must be a valid UUID with the exception that zero UUID is not
6446 // supported (00000000-0000-0000-0000-000000000000).
6447 func (c *ProjectsLocationsUnitOperationsCreateCall) RequestId(requestId string) *ProjectsLocationsUnitOperationsCreateCall {
6448 c.urlParams_.Set("requestId", requestId)
6449 return c
6450 }
6451
6452 // UnitOperationId sets the optional parameter "unitOperationId": Required. The
6453 // ID value for the new unit operation.
6454 func (c *ProjectsLocationsUnitOperationsCreateCall) UnitOperationId(unitOperationId string) *ProjectsLocationsUnitOperationsCreateCall {
6455 c.urlParams_.Set("unitOperationId", unitOperationId)
6456 return c
6457 }
6458
6459 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
6460 // is set to true, the service will try to validate that this request would
6461 // succeed, but will not actually make changes.
6462 func (c *ProjectsLocationsUnitOperationsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitOperationsCreateCall {
6463 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
6464 return c
6465 }
6466
6467 // Fields allows partial responses to be retrieved. See
6468 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6469 // details.
6470 func (c *ProjectsLocationsUnitOperationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsCreateCall {
6471 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6472 return c
6473 }
6474
6475 // Context sets the context to be used in this call's Do method.
6476 func (c *ProjectsLocationsUnitOperationsCreateCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsCreateCall {
6477 c.ctx_ = ctx
6478 return c
6479 }
6480
6481 // Header returns a http.Header that can be modified by the caller to add
6482 // headers to the request.
6483 func (c *ProjectsLocationsUnitOperationsCreateCall) Header() http.Header {
6484 if c.header_ == nil {
6485 c.header_ = make(http.Header)
6486 }
6487 return c.header_
6488 }
6489
6490 func (c *ProjectsLocationsUnitOperationsCreateCall) doRequest(alt string) (*http.Response, error) {
6491 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6492 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unitoperation)
6493 if err != nil {
6494 return nil, err
6495 }
6496 c.urlParams_.Set("alt", alt)
6497 c.urlParams_.Set("prettyPrint", "false")
6498 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/unitOperations")
6499 urls += "?" + c.urlParams_.Encode()
6500 req, err := http.NewRequest("POST", urls, body)
6501 if err != nil {
6502 return nil, err
6503 }
6504 req.Header = reqHeaders
6505 googleapi.Expand(req.URL, map[string]string{
6506 "parent": c.parent,
6507 })
6508 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.create", "request", internallog.HTTPRequest(req, body.Bytes()))
6509 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6510 }
6511
6512 // Do executes the "saasservicemgmt.projects.locations.unitOperations.create" call.
6513 // Any non-2xx status code is an error. Response headers are in either
6514 // *UnitOperation.ServerResponse.Header or (if a response was returned at all)
6515 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6516 // whether the returned error was because http.StatusNotModified was returned.
6517 func (c *ProjectsLocationsUnitOperationsCreateCall) Do(opts ...googleapi.CallOption) (*UnitOperation, error) {
6518 gensupport.SetOptions(c.urlParams_, opts...)
6519 res, err := c.doRequest("json")
6520 if res != nil && res.StatusCode == http.StatusNotModified {
6521 if res.Body != nil {
6522 res.Body.Close()
6523 }
6524 return nil, gensupport.WrapError(&googleapi.Error{
6525 Code: res.StatusCode,
6526 Header: res.Header,
6527 })
6528 }
6529 if err != nil {
6530 return nil, err
6531 }
6532 defer googleapi.CloseBody(res)
6533 if err := googleapi.CheckResponse(res); err != nil {
6534 return nil, gensupport.WrapError(err)
6535 }
6536 ret := &UnitOperation{
6537 ServerResponse: googleapi.ServerResponse{
6538 Header: res.Header,
6539 HTTPStatusCode: res.StatusCode,
6540 },
6541 }
6542 target := &ret
6543 b, err := gensupport.DecodeResponseBytes(target, res)
6544 if err != nil {
6545 return nil, err
6546 }
6547 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.create", "response", internallog.HTTPResponse(res, b))
6548 return ret, nil
6549 }
6550
6551 type ProjectsLocationsUnitOperationsDeleteCall struct {
6552 s *Service
6553 name string
6554 urlParams_ gensupport.URLParams
6555 ctx_ context.Context
6556 header_ http.Header
6557 }
6558
6559 // Delete: Delete a single unit operation.
6560 //
6561 // - name: The resource name of the resource within a service.
6562 func (r *ProjectsLocationsUnitOperationsService) Delete(name string) *ProjectsLocationsUnitOperationsDeleteCall {
6563 c := &ProjectsLocationsUnitOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6564 c.name = name
6565 return c
6566 }
6567
6568 // Etag sets the optional parameter "etag": The etag known to the client for
6569 // the expected state of the unit operation. This is used with state-changing
6570 // methods to prevent accidental overwrites when multiple user agents might be
6571 // acting in parallel on the same resource. An etag wildcard provide optimistic
6572 // concurrency based on the expected existence of the unit operation. The Any
6573 // wildcard (`*`) requires that the resource must already exists, and the Not
6574 // Any wildcard (`!*`) requires that it must not.
6575 func (c *ProjectsLocationsUnitOperationsDeleteCall) Etag(etag string) *ProjectsLocationsUnitOperationsDeleteCall {
6576 c.urlParams_.Set("etag", etag)
6577 return c
6578 }
6579
6580 // RequestId sets the optional parameter "requestId": An optional request ID to
6581 // identify requests. Specify a unique request ID so that if you must retry
6582 // your request, the server will know to ignore the request if it has already
6583 // been completed. The server will guarantee that for at least 60 minutes since
6584 // the first request. For example, consider a situation where you make an
6585 // initial request and the request times out. If you make the request again
6586 // with the same request ID, the server can check if original operation with
6587 // the same request ID was received, and if so, will ignore the second request.
6588 // This prevents clients from accidentally creating duplicate commitments. The
6589 // request ID must be a valid UUID with the exception that zero UUID is not
6590 // supported (00000000-0000-0000-0000-000000000000).
6591 func (c *ProjectsLocationsUnitOperationsDeleteCall) RequestId(requestId string) *ProjectsLocationsUnitOperationsDeleteCall {
6592 c.urlParams_.Set("requestId", requestId)
6593 return c
6594 }
6595
6596 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
6597 // is set to true, the service will try to validate that this request would
6598 // succeed, but will not actually make changes.
6599 func (c *ProjectsLocationsUnitOperationsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitOperationsDeleteCall {
6600 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
6601 return c
6602 }
6603
6604 // Fields allows partial responses to be retrieved. See
6605 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6606 // details.
6607 func (c *ProjectsLocationsUnitOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsDeleteCall {
6608 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6609 return c
6610 }
6611
6612 // Context sets the context to be used in this call's Do method.
6613 func (c *ProjectsLocationsUnitOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsDeleteCall {
6614 c.ctx_ = ctx
6615 return c
6616 }
6617
6618 // Header returns a http.Header that can be modified by the caller to add
6619 // headers to the request.
6620 func (c *ProjectsLocationsUnitOperationsDeleteCall) Header() http.Header {
6621 if c.header_ == nil {
6622 c.header_ = make(http.Header)
6623 }
6624 return c.header_
6625 }
6626
6627 func (c *ProjectsLocationsUnitOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
6628 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6629 c.urlParams_.Set("alt", alt)
6630 c.urlParams_.Set("prettyPrint", "false")
6631 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6632 urls += "?" + c.urlParams_.Encode()
6633 req, err := http.NewRequest("DELETE", urls, nil)
6634 if err != nil {
6635 return nil, err
6636 }
6637 req.Header = reqHeaders
6638 googleapi.Expand(req.URL, map[string]string{
6639 "name": c.name,
6640 })
6641 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.delete", "request", internallog.HTTPRequest(req, nil))
6642 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6643 }
6644
6645 // Do executes the "saasservicemgmt.projects.locations.unitOperations.delete" call.
6646 // Any non-2xx status code is an error. Response headers are in either
6647 // *Empty.ServerResponse.Header or (if a response was returned at all) in
6648 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6649 // whether the returned error was because http.StatusNotModified was returned.
6650 func (c *ProjectsLocationsUnitOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6651 gensupport.SetOptions(c.urlParams_, opts...)
6652 res, err := c.doRequest("json")
6653 if res != nil && res.StatusCode == http.StatusNotModified {
6654 if res.Body != nil {
6655 res.Body.Close()
6656 }
6657 return nil, gensupport.WrapError(&googleapi.Error{
6658 Code: res.StatusCode,
6659 Header: res.Header,
6660 })
6661 }
6662 if err != nil {
6663 return nil, err
6664 }
6665 defer googleapi.CloseBody(res)
6666 if err := googleapi.CheckResponse(res); err != nil {
6667 return nil, gensupport.WrapError(err)
6668 }
6669 ret := &Empty{
6670 ServerResponse: googleapi.ServerResponse{
6671 Header: res.Header,
6672 HTTPStatusCode: res.StatusCode,
6673 },
6674 }
6675 target := &ret
6676 b, err := gensupport.DecodeResponseBytes(target, res)
6677 if err != nil {
6678 return nil, err
6679 }
6680 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.delete", "response", internallog.HTTPResponse(res, b))
6681 return ret, nil
6682 }
6683
6684 type ProjectsLocationsUnitOperationsGetCall struct {
6685 s *Service
6686 name string
6687 urlParams_ gensupport.URLParams
6688 ifNoneMatch_ string
6689 ctx_ context.Context
6690 header_ http.Header
6691 }
6692
6693 // Get: Retrieve a single unit operation.
6694 //
6695 // - name: The resource name of the resource within a service.
6696 func (r *ProjectsLocationsUnitOperationsService) Get(name string) *ProjectsLocationsUnitOperationsGetCall {
6697 c := &ProjectsLocationsUnitOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6698 c.name = name
6699 return c
6700 }
6701
6702 // Fields allows partial responses to be retrieved. See
6703 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6704 // details.
6705 func (c *ProjectsLocationsUnitOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsGetCall {
6706 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6707 return c
6708 }
6709
6710 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6711 // object's ETag matches the given value. This is useful for getting updates
6712 // only after the object has changed since the last request.
6713 func (c *ProjectsLocationsUnitOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitOperationsGetCall {
6714 c.ifNoneMatch_ = entityTag
6715 return c
6716 }
6717
6718 // Context sets the context to be used in this call's Do method.
6719 func (c *ProjectsLocationsUnitOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsGetCall {
6720 c.ctx_ = ctx
6721 return c
6722 }
6723
6724 // Header returns a http.Header that can be modified by the caller to add
6725 // headers to the request.
6726 func (c *ProjectsLocationsUnitOperationsGetCall) Header() http.Header {
6727 if c.header_ == nil {
6728 c.header_ = make(http.Header)
6729 }
6730 return c.header_
6731 }
6732
6733 func (c *ProjectsLocationsUnitOperationsGetCall) doRequest(alt string) (*http.Response, error) {
6734 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6735 if c.ifNoneMatch_ != "" {
6736 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6737 }
6738 c.urlParams_.Set("alt", alt)
6739 c.urlParams_.Set("prettyPrint", "false")
6740 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
6741 urls += "?" + c.urlParams_.Encode()
6742 req, err := http.NewRequest("GET", urls, nil)
6743 if err != nil {
6744 return nil, err
6745 }
6746 req.Header = reqHeaders
6747 googleapi.Expand(req.URL, map[string]string{
6748 "name": c.name,
6749 })
6750 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.get", "request", internallog.HTTPRequest(req, nil))
6751 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6752 }
6753
6754 // Do executes the "saasservicemgmt.projects.locations.unitOperations.get" call.
6755 // Any non-2xx status code is an error. Response headers are in either
6756 // *UnitOperation.ServerResponse.Header or (if a response was returned at all)
6757 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6758 // whether the returned error was because http.StatusNotModified was returned.
6759 func (c *ProjectsLocationsUnitOperationsGetCall) Do(opts ...googleapi.CallOption) (*UnitOperation, error) {
6760 gensupport.SetOptions(c.urlParams_, opts...)
6761 res, err := c.doRequest("json")
6762 if res != nil && res.StatusCode == http.StatusNotModified {
6763 if res.Body != nil {
6764 res.Body.Close()
6765 }
6766 return nil, gensupport.WrapError(&googleapi.Error{
6767 Code: res.StatusCode,
6768 Header: res.Header,
6769 })
6770 }
6771 if err != nil {
6772 return nil, err
6773 }
6774 defer googleapi.CloseBody(res)
6775 if err := googleapi.CheckResponse(res); err != nil {
6776 return nil, gensupport.WrapError(err)
6777 }
6778 ret := &UnitOperation{
6779 ServerResponse: googleapi.ServerResponse{
6780 Header: res.Header,
6781 HTTPStatusCode: res.StatusCode,
6782 },
6783 }
6784 target := &ret
6785 b, err := gensupport.DecodeResponseBytes(target, res)
6786 if err != nil {
6787 return nil, err
6788 }
6789 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.get", "response", internallog.HTTPResponse(res, b))
6790 return ret, nil
6791 }
6792
6793 type ProjectsLocationsUnitOperationsListCall struct {
6794 s *Service
6795 parent string
6796 urlParams_ gensupport.URLParams
6797 ifNoneMatch_ string
6798 ctx_ context.Context
6799 header_ http.Header
6800 }
6801
6802 // List: Retrieve a collection of unit operations.
6803 //
6804 // - parent: The parent of the unit operation.
6805 func (r *ProjectsLocationsUnitOperationsService) List(parent string) *ProjectsLocationsUnitOperationsListCall {
6806 c := &ProjectsLocationsUnitOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6807 c.parent = parent
6808 return c
6809 }
6810
6811 // Filter sets the optional parameter "filter": Filter the list as specified in
6812 // https://google.aip.dev/160.
6813 func (c *ProjectsLocationsUnitOperationsListCall) Filter(filter string) *ProjectsLocationsUnitOperationsListCall {
6814 c.urlParams_.Set("filter", filter)
6815 return c
6816 }
6817
6818 // OrderBy sets the optional parameter "orderBy": Order results as specified in
6819 // https://google.aip.dev/132.
6820 func (c *ProjectsLocationsUnitOperationsListCall) OrderBy(orderBy string) *ProjectsLocationsUnitOperationsListCall {
6821 c.urlParams_.Set("orderBy", orderBy)
6822 return c
6823 }
6824
6825 // PageSize sets the optional parameter "pageSize": The maximum number of unit
6826 // operations to send per page.
6827 func (c *ProjectsLocationsUnitOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsUnitOperationsListCall {
6828 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6829 return c
6830 }
6831
6832 // PageToken sets the optional parameter "pageToken": The page token: If the
6833 // next_page_token from a previous response is provided, this request will send
6834 // the subsequent page.
6835 func (c *ProjectsLocationsUnitOperationsListCall) PageToken(pageToken string) *ProjectsLocationsUnitOperationsListCall {
6836 c.urlParams_.Set("pageToken", pageToken)
6837 return c
6838 }
6839
6840 // Fields allows partial responses to be retrieved. See
6841 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6842 // details.
6843 func (c *ProjectsLocationsUnitOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsListCall {
6844 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6845 return c
6846 }
6847
6848 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6849 // object's ETag matches the given value. This is useful for getting updates
6850 // only after the object has changed since the last request.
6851 func (c *ProjectsLocationsUnitOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitOperationsListCall {
6852 c.ifNoneMatch_ = entityTag
6853 return c
6854 }
6855
6856 // Context sets the context to be used in this call's Do method.
6857 func (c *ProjectsLocationsUnitOperationsListCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsListCall {
6858 c.ctx_ = ctx
6859 return c
6860 }
6861
6862 // Header returns a http.Header that can be modified by the caller to add
6863 // headers to the request.
6864 func (c *ProjectsLocationsUnitOperationsListCall) Header() http.Header {
6865 if c.header_ == nil {
6866 c.header_ = make(http.Header)
6867 }
6868 return c.header_
6869 }
6870
6871 func (c *ProjectsLocationsUnitOperationsListCall) doRequest(alt string) (*http.Response, error) {
6872 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6873 if c.ifNoneMatch_ != "" {
6874 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6875 }
6876 c.urlParams_.Set("alt", alt)
6877 c.urlParams_.Set("prettyPrint", "false")
6878 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/unitOperations")
6879 urls += "?" + c.urlParams_.Encode()
6880 req, err := http.NewRequest("GET", urls, nil)
6881 if err != nil {
6882 return nil, err
6883 }
6884 req.Header = reqHeaders
6885 googleapi.Expand(req.URL, map[string]string{
6886 "parent": c.parent,
6887 })
6888 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.list", "request", internallog.HTTPRequest(req, nil))
6889 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6890 }
6891
6892 // Do executes the "saasservicemgmt.projects.locations.unitOperations.list" call.
6893 // Any non-2xx status code is an error. Response headers are in either
6894 // *ListUnitOperationsResponse.ServerResponse.Header or (if a response was
6895 // returned at all) in error.(*googleapi.Error).Header. Use
6896 // googleapi.IsNotModified to check whether the returned error was because
6897 // http.StatusNotModified was returned.
6898 func (c *ProjectsLocationsUnitOperationsListCall) Do(opts ...googleapi.CallOption) (*ListUnitOperationsResponse, error) {
6899 gensupport.SetOptions(c.urlParams_, opts...)
6900 res, err := c.doRequest("json")
6901 if res != nil && res.StatusCode == http.StatusNotModified {
6902 if res.Body != nil {
6903 res.Body.Close()
6904 }
6905 return nil, gensupport.WrapError(&googleapi.Error{
6906 Code: res.StatusCode,
6907 Header: res.Header,
6908 })
6909 }
6910 if err != nil {
6911 return nil, err
6912 }
6913 defer googleapi.CloseBody(res)
6914 if err := googleapi.CheckResponse(res); err != nil {
6915 return nil, gensupport.WrapError(err)
6916 }
6917 ret := &ListUnitOperationsResponse{
6918 ServerResponse: googleapi.ServerResponse{
6919 Header: res.Header,
6920 HTTPStatusCode: res.StatusCode,
6921 },
6922 }
6923 target := &ret
6924 b, err := gensupport.DecodeResponseBytes(target, res)
6925 if err != nil {
6926 return nil, err
6927 }
6928 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.list", "response", internallog.HTTPResponse(res, b))
6929 return ret, nil
6930 }
6931
6932 // Pages invokes f for each page of results.
6933 // A non-nil error returned from f will halt the iteration.
6934 // The provided context supersedes any context provided to the Context method.
6935 func (c *ProjectsLocationsUnitOperationsListCall) Pages(ctx context.Context, f func(*ListUnitOperationsResponse) error) error {
6936 c.ctx_ = ctx
6937 defer c.PageToken(c.urlParams_.Get("pageToken"))
6938 for {
6939 x, err := c.Do()
6940 if err != nil {
6941 return err
6942 }
6943 if err := f(x); err != nil {
6944 return err
6945 }
6946 if x.NextPageToken == "" {
6947 return nil
6948 }
6949 c.PageToken(x.NextPageToken)
6950 }
6951 }
6952
6953 type ProjectsLocationsUnitOperationsPatchCall struct {
6954 s *Service
6955 name string
6956 unitoperation *UnitOperation
6957 urlParams_ gensupport.URLParams
6958 ctx_ context.Context
6959 header_ http.Header
6960 }
6961
6962 // Patch: Update a single unit operation.
6963 //
6964 // - name: Identifier. The resource name (full URI of the resource) following
6965 // the standard naming scheme:
6966 // "projects/{project}/locations/{location}/unitOperations/{unitOperation}".
6967 func (r *ProjectsLocationsUnitOperationsService) Patch(name string, unitoperation *UnitOperation) *ProjectsLocationsUnitOperationsPatchCall {
6968 c := &ProjectsLocationsUnitOperationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6969 c.name = name
6970 c.unitoperation = unitoperation
6971 return c
6972 }
6973
6974 // RequestId sets the optional parameter "requestId": An optional request ID to
6975 // identify requests. Specify a unique request ID so that if you must retry
6976 // your request, the server will know to ignore the request if it has already
6977 // been completed. The server will guarantee that for at least 60 minutes since
6978 // the first request. For example, consider a situation where you make an
6979 // initial request and the request times out. If you make the request again
6980 // with the same request ID, the server can check if original operation with
6981 // the same request ID was received, and if so, will ignore the second request.
6982 // This prevents clients from accidentally creating duplicate commitments. The
6983 // request ID must be a valid UUID with the exception that zero UUID is not
6984 // supported (00000000-0000-0000-0000-000000000000).
6985 func (c *ProjectsLocationsUnitOperationsPatchCall) RequestId(requestId string) *ProjectsLocationsUnitOperationsPatchCall {
6986 c.urlParams_.Set("requestId", requestId)
6987 return c
6988 }
6989
6990 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
6991 // specify the fields to be overwritten in the UnitOperation resource by the
6992 // update. The fields specified in the update_mask are relative to the
6993 // resource, not the full request. A field will be overwritten if it is in the
6994 // mask. If the user does not provide a mask then all fields in the
6995 // UnitOperation will be overwritten.
6996 func (c *ProjectsLocationsUnitOperationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsUnitOperationsPatchCall {
6997 c.urlParams_.Set("updateMask", updateMask)
6998 return c
6999 }
7000
7001 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
7002 // is set to true, the service will try to validate that this request would
7003 // succeed, but will not actually make changes.
7004 func (c *ProjectsLocationsUnitOperationsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitOperationsPatchCall {
7005 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
7006 return c
7007 }
7008
7009 // Fields allows partial responses to be retrieved. See
7010 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7011 // details.
7012 func (c *ProjectsLocationsUnitOperationsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsPatchCall {
7013 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7014 return c
7015 }
7016
7017 // Context sets the context to be used in this call's Do method.
7018 func (c *ProjectsLocationsUnitOperationsPatchCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsPatchCall {
7019 c.ctx_ = ctx
7020 return c
7021 }
7022
7023 // Header returns a http.Header that can be modified by the caller to add
7024 // headers to the request.
7025 func (c *ProjectsLocationsUnitOperationsPatchCall) Header() http.Header {
7026 if c.header_ == nil {
7027 c.header_ = make(http.Header)
7028 }
7029 return c.header_
7030 }
7031
7032 func (c *ProjectsLocationsUnitOperationsPatchCall) doRequest(alt string) (*http.Response, error) {
7033 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7034 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unitoperation)
7035 if err != nil {
7036 return nil, err
7037 }
7038 c.urlParams_.Set("alt", alt)
7039 c.urlParams_.Set("prettyPrint", "false")
7040 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7041 urls += "?" + c.urlParams_.Encode()
7042 req, err := http.NewRequest("PATCH", urls, body)
7043 if err != nil {
7044 return nil, err
7045 }
7046 req.Header = reqHeaders
7047 googleapi.Expand(req.URL, map[string]string{
7048 "name": c.name,
7049 })
7050 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7051 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7052 }
7053
7054 // Do executes the "saasservicemgmt.projects.locations.unitOperations.patch" call.
7055 // Any non-2xx status code is an error. Response headers are in either
7056 // *UnitOperation.ServerResponse.Header or (if a response was returned at all)
7057 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7058 // whether the returned error was because http.StatusNotModified was returned.
7059 func (c *ProjectsLocationsUnitOperationsPatchCall) Do(opts ...googleapi.CallOption) (*UnitOperation, error) {
7060 gensupport.SetOptions(c.urlParams_, opts...)
7061 res, err := c.doRequest("json")
7062 if res != nil && res.StatusCode == http.StatusNotModified {
7063 if res.Body != nil {
7064 res.Body.Close()
7065 }
7066 return nil, gensupport.WrapError(&googleapi.Error{
7067 Code: res.StatusCode,
7068 Header: res.Header,
7069 })
7070 }
7071 if err != nil {
7072 return nil, err
7073 }
7074 defer googleapi.CloseBody(res)
7075 if err := googleapi.CheckResponse(res); err != nil {
7076 return nil, gensupport.WrapError(err)
7077 }
7078 ret := &UnitOperation{
7079 ServerResponse: googleapi.ServerResponse{
7080 Header: res.Header,
7081 HTTPStatusCode: res.StatusCode,
7082 },
7083 }
7084 target := &ret
7085 b, err := gensupport.DecodeResponseBytes(target, res)
7086 if err != nil {
7087 return nil, err
7088 }
7089 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.patch", "response", internallog.HTTPResponse(res, b))
7090 return ret, nil
7091 }
7092
7093 type ProjectsLocationsUnitsCreateCall struct {
7094 s *Service
7095 parent string
7096 unit *Unit
7097 urlParams_ gensupport.URLParams
7098 ctx_ context.Context
7099 header_ http.Header
7100 }
7101
7102 // Create: Create a new unit.
7103 //
7104 // - parent: The parent of the unit.
7105 func (r *ProjectsLocationsUnitsService) Create(parent string, unit *Unit) *ProjectsLocationsUnitsCreateCall {
7106 c := &ProjectsLocationsUnitsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7107 c.parent = parent
7108 c.unit = unit
7109 return c
7110 }
7111
7112 // RequestId sets the optional parameter "requestId": An optional request ID to
7113 // identify requests. Specify a unique request ID so that if you must retry
7114 // your request, the server will know to ignore the request if it has already
7115 // been completed. The server will guarantee that for at least 60 minutes since
7116 // the first request. For example, consider a situation where you make an
7117 // initial request and the request times out. If you make the request again
7118 // with the same request ID, the server can check if original operation with
7119 // the same request ID was received, and if so, will ignore the second request.
7120 // This prevents clients from accidentally creating duplicate commitments. The
7121 // request ID must be a valid UUID with the exception that zero UUID is not
7122 // supported (00000000-0000-0000-0000-000000000000).
7123 func (c *ProjectsLocationsUnitsCreateCall) RequestId(requestId string) *ProjectsLocationsUnitsCreateCall {
7124 c.urlParams_.Set("requestId", requestId)
7125 return c
7126 }
7127
7128 // UnitId sets the optional parameter "unitId": Required. The ID value for the
7129 // new unit.
7130 func (c *ProjectsLocationsUnitsCreateCall) UnitId(unitId string) *ProjectsLocationsUnitsCreateCall {
7131 c.urlParams_.Set("unitId", unitId)
7132 return c
7133 }
7134
7135 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
7136 // is set to true, the service will try to validate that this request would
7137 // succeed, but will not actually make changes.
7138 func (c *ProjectsLocationsUnitsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitsCreateCall {
7139 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
7140 return c
7141 }
7142
7143 // Fields allows partial responses to be retrieved. See
7144 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7145 // details.
7146 func (c *ProjectsLocationsUnitsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsCreateCall {
7147 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7148 return c
7149 }
7150
7151 // Context sets the context to be used in this call's Do method.
7152 func (c *ProjectsLocationsUnitsCreateCall) Context(ctx context.Context) *ProjectsLocationsUnitsCreateCall {
7153 c.ctx_ = ctx
7154 return c
7155 }
7156
7157 // Header returns a http.Header that can be modified by the caller to add
7158 // headers to the request.
7159 func (c *ProjectsLocationsUnitsCreateCall) Header() http.Header {
7160 if c.header_ == nil {
7161 c.header_ = make(http.Header)
7162 }
7163 return c.header_
7164 }
7165
7166 func (c *ProjectsLocationsUnitsCreateCall) doRequest(alt string) (*http.Response, error) {
7167 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7168 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unit)
7169 if err != nil {
7170 return nil, err
7171 }
7172 c.urlParams_.Set("alt", alt)
7173 c.urlParams_.Set("prettyPrint", "false")
7174 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/units")
7175 urls += "?" + c.urlParams_.Encode()
7176 req, err := http.NewRequest("POST", urls, body)
7177 if err != nil {
7178 return nil, err
7179 }
7180 req.Header = reqHeaders
7181 googleapi.Expand(req.URL, map[string]string{
7182 "parent": c.parent,
7183 })
7184 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.create", "request", internallog.HTTPRequest(req, body.Bytes()))
7185 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7186 }
7187
7188 // Do executes the "saasservicemgmt.projects.locations.units.create" call.
7189 // Any non-2xx status code is an error. Response headers are in either
7190 // *Unit.ServerResponse.Header or (if a response was returned at all) in
7191 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7192 // whether the returned error was because http.StatusNotModified was returned.
7193 func (c *ProjectsLocationsUnitsCreateCall) Do(opts ...googleapi.CallOption) (*Unit, error) {
7194 gensupport.SetOptions(c.urlParams_, opts...)
7195 res, err := c.doRequest("json")
7196 if res != nil && res.StatusCode == http.StatusNotModified {
7197 if res.Body != nil {
7198 res.Body.Close()
7199 }
7200 return nil, gensupport.WrapError(&googleapi.Error{
7201 Code: res.StatusCode,
7202 Header: res.Header,
7203 })
7204 }
7205 if err != nil {
7206 return nil, err
7207 }
7208 defer googleapi.CloseBody(res)
7209 if err := googleapi.CheckResponse(res); err != nil {
7210 return nil, gensupport.WrapError(err)
7211 }
7212 ret := &Unit{
7213 ServerResponse: googleapi.ServerResponse{
7214 Header: res.Header,
7215 HTTPStatusCode: res.StatusCode,
7216 },
7217 }
7218 target := &ret
7219 b, err := gensupport.DecodeResponseBytes(target, res)
7220 if err != nil {
7221 return nil, err
7222 }
7223 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.create", "response", internallog.HTTPResponse(res, b))
7224 return ret, nil
7225 }
7226
7227 type ProjectsLocationsUnitsDeleteCall struct {
7228 s *Service
7229 name string
7230 urlParams_ gensupport.URLParams
7231 ctx_ context.Context
7232 header_ http.Header
7233 }
7234
7235 // Delete: Delete a single unit.
7236 //
7237 // - name: The resource name of the resource within a service.
7238 func (r *ProjectsLocationsUnitsService) Delete(name string) *ProjectsLocationsUnitsDeleteCall {
7239 c := &ProjectsLocationsUnitsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7240 c.name = name
7241 return c
7242 }
7243
7244 // Etag sets the optional parameter "etag": The etag known to the client for
7245 // the expected state of the unit. This is used with state-changing methods to
7246 // prevent accidental overwrites when multiple user agents might be acting in
7247 // parallel on the same resource. An etag wildcard provide optimistic
7248 // concurrency based on the expected existence of the unit. The Any wildcard
7249 // (`*`) requires that the resource must already exists, and the Not Any
7250 // wildcard (`!*`) requires that it must not.
7251 func (c *ProjectsLocationsUnitsDeleteCall) Etag(etag string) *ProjectsLocationsUnitsDeleteCall {
7252 c.urlParams_.Set("etag", etag)
7253 return c
7254 }
7255
7256 // RequestId sets the optional parameter "requestId": An optional request ID to
7257 // identify requests. Specify a unique request ID so that if you must retry
7258 // your request, the server will know to ignore the request if it has already
7259 // been completed. The server will guarantee that for at least 60 minutes since
7260 // the first request. For example, consider a situation where you make an
7261 // initial request and the request times out. If you make the request again
7262 // with the same request ID, the server can check if original operation with
7263 // the same request ID was received, and if so, will ignore the second request.
7264 // This prevents clients from accidentally creating duplicate commitments. The
7265 // request ID must be a valid UUID with the exception that zero UUID is not
7266 // supported (00000000-0000-0000-0000-000000000000).
7267 func (c *ProjectsLocationsUnitsDeleteCall) RequestId(requestId string) *ProjectsLocationsUnitsDeleteCall {
7268 c.urlParams_.Set("requestId", requestId)
7269 return c
7270 }
7271
7272 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
7273 // is set to true, the service will try to validate that this request would
7274 // succeed, but will not actually make changes.
7275 func (c *ProjectsLocationsUnitsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitsDeleteCall {
7276 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
7277 return c
7278 }
7279
7280 // Fields allows partial responses to be retrieved. See
7281 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7282 // details.
7283 func (c *ProjectsLocationsUnitsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsDeleteCall {
7284 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7285 return c
7286 }
7287
7288 // Context sets the context to be used in this call's Do method.
7289 func (c *ProjectsLocationsUnitsDeleteCall) Context(ctx context.Context) *ProjectsLocationsUnitsDeleteCall {
7290 c.ctx_ = ctx
7291 return c
7292 }
7293
7294 // Header returns a http.Header that can be modified by the caller to add
7295 // headers to the request.
7296 func (c *ProjectsLocationsUnitsDeleteCall) Header() http.Header {
7297 if c.header_ == nil {
7298 c.header_ = make(http.Header)
7299 }
7300 return c.header_
7301 }
7302
7303 func (c *ProjectsLocationsUnitsDeleteCall) doRequest(alt string) (*http.Response, error) {
7304 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7305 c.urlParams_.Set("alt", alt)
7306 c.urlParams_.Set("prettyPrint", "false")
7307 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7308 urls += "?" + c.urlParams_.Encode()
7309 req, err := http.NewRequest("DELETE", urls, nil)
7310 if err != nil {
7311 return nil, err
7312 }
7313 req.Header = reqHeaders
7314 googleapi.Expand(req.URL, map[string]string{
7315 "name": c.name,
7316 })
7317 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.delete", "request", internallog.HTTPRequest(req, nil))
7318 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7319 }
7320
7321 // Do executes the "saasservicemgmt.projects.locations.units.delete" call.
7322 // Any non-2xx status code is an error. Response headers are in either
7323 // *Empty.ServerResponse.Header or (if a response was returned at all) in
7324 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7325 // whether the returned error was because http.StatusNotModified was returned.
7326 func (c *ProjectsLocationsUnitsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
7327 gensupport.SetOptions(c.urlParams_, opts...)
7328 res, err := c.doRequest("json")
7329 if res != nil && res.StatusCode == http.StatusNotModified {
7330 if res.Body != nil {
7331 res.Body.Close()
7332 }
7333 return nil, gensupport.WrapError(&googleapi.Error{
7334 Code: res.StatusCode,
7335 Header: res.Header,
7336 })
7337 }
7338 if err != nil {
7339 return nil, err
7340 }
7341 defer googleapi.CloseBody(res)
7342 if err := googleapi.CheckResponse(res); err != nil {
7343 return nil, gensupport.WrapError(err)
7344 }
7345 ret := &Empty{
7346 ServerResponse: googleapi.ServerResponse{
7347 Header: res.Header,
7348 HTTPStatusCode: res.StatusCode,
7349 },
7350 }
7351 target := &ret
7352 b, err := gensupport.DecodeResponseBytes(target, res)
7353 if err != nil {
7354 return nil, err
7355 }
7356 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.delete", "response", internallog.HTTPResponse(res, b))
7357 return ret, nil
7358 }
7359
7360 type ProjectsLocationsUnitsGetCall struct {
7361 s *Service
7362 name string
7363 urlParams_ gensupport.URLParams
7364 ifNoneMatch_ string
7365 ctx_ context.Context
7366 header_ http.Header
7367 }
7368
7369 // Get: Retrieve a single unit.
7370 //
7371 // - name: The resource name of the resource within a service.
7372 func (r *ProjectsLocationsUnitsService) Get(name string) *ProjectsLocationsUnitsGetCall {
7373 c := &ProjectsLocationsUnitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7374 c.name = name
7375 return c
7376 }
7377
7378 // Fields allows partial responses to be retrieved. See
7379 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7380 // details.
7381 func (c *ProjectsLocationsUnitsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsGetCall {
7382 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7383 return c
7384 }
7385
7386 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7387 // object's ETag matches the given value. This is useful for getting updates
7388 // only after the object has changed since the last request.
7389 func (c *ProjectsLocationsUnitsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitsGetCall {
7390 c.ifNoneMatch_ = entityTag
7391 return c
7392 }
7393
7394 // Context sets the context to be used in this call's Do method.
7395 func (c *ProjectsLocationsUnitsGetCall) Context(ctx context.Context) *ProjectsLocationsUnitsGetCall {
7396 c.ctx_ = ctx
7397 return c
7398 }
7399
7400 // Header returns a http.Header that can be modified by the caller to add
7401 // headers to the request.
7402 func (c *ProjectsLocationsUnitsGetCall) Header() http.Header {
7403 if c.header_ == nil {
7404 c.header_ = make(http.Header)
7405 }
7406 return c.header_
7407 }
7408
7409 func (c *ProjectsLocationsUnitsGetCall) doRequest(alt string) (*http.Response, error) {
7410 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7411 if c.ifNoneMatch_ != "" {
7412 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7413 }
7414 c.urlParams_.Set("alt", alt)
7415 c.urlParams_.Set("prettyPrint", "false")
7416 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7417 urls += "?" + c.urlParams_.Encode()
7418 req, err := http.NewRequest("GET", urls, nil)
7419 if err != nil {
7420 return nil, err
7421 }
7422 req.Header = reqHeaders
7423 googleapi.Expand(req.URL, map[string]string{
7424 "name": c.name,
7425 })
7426 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.get", "request", internallog.HTTPRequest(req, nil))
7427 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7428 }
7429
7430 // Do executes the "saasservicemgmt.projects.locations.units.get" call.
7431 // Any non-2xx status code is an error. Response headers are in either
7432 // *Unit.ServerResponse.Header or (if a response was returned at all) in
7433 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7434 // whether the returned error was because http.StatusNotModified was returned.
7435 func (c *ProjectsLocationsUnitsGetCall) Do(opts ...googleapi.CallOption) (*Unit, error) {
7436 gensupport.SetOptions(c.urlParams_, opts...)
7437 res, err := c.doRequest("json")
7438 if res != nil && res.StatusCode == http.StatusNotModified {
7439 if res.Body != nil {
7440 res.Body.Close()
7441 }
7442 return nil, gensupport.WrapError(&googleapi.Error{
7443 Code: res.StatusCode,
7444 Header: res.Header,
7445 })
7446 }
7447 if err != nil {
7448 return nil, err
7449 }
7450 defer googleapi.CloseBody(res)
7451 if err := googleapi.CheckResponse(res); err != nil {
7452 return nil, gensupport.WrapError(err)
7453 }
7454 ret := &Unit{
7455 ServerResponse: googleapi.ServerResponse{
7456 Header: res.Header,
7457 HTTPStatusCode: res.StatusCode,
7458 },
7459 }
7460 target := &ret
7461 b, err := gensupport.DecodeResponseBytes(target, res)
7462 if err != nil {
7463 return nil, err
7464 }
7465 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.get", "response", internallog.HTTPResponse(res, b))
7466 return ret, nil
7467 }
7468
7469 type ProjectsLocationsUnitsListCall struct {
7470 s *Service
7471 parent string
7472 urlParams_ gensupport.URLParams
7473 ifNoneMatch_ string
7474 ctx_ context.Context
7475 header_ http.Header
7476 }
7477
7478 // List: Retrieve a collection of units.
7479 //
7480 // - parent: The parent of the unit.
7481 func (r *ProjectsLocationsUnitsService) List(parent string) *ProjectsLocationsUnitsListCall {
7482 c := &ProjectsLocationsUnitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7483 c.parent = parent
7484 return c
7485 }
7486
7487 // Filter sets the optional parameter "filter": Filter the list as specified in
7488 // https://google.aip.dev/160.
7489 func (c *ProjectsLocationsUnitsListCall) Filter(filter string) *ProjectsLocationsUnitsListCall {
7490 c.urlParams_.Set("filter", filter)
7491 return c
7492 }
7493
7494 // OrderBy sets the optional parameter "orderBy": Order results as specified in
7495 // https://google.aip.dev/132.
7496 func (c *ProjectsLocationsUnitsListCall) OrderBy(orderBy string) *ProjectsLocationsUnitsListCall {
7497 c.urlParams_.Set("orderBy", orderBy)
7498 return c
7499 }
7500
7501 // PageSize sets the optional parameter "pageSize": The maximum number of units
7502 // to send per page.
7503 func (c *ProjectsLocationsUnitsListCall) PageSize(pageSize int64) *ProjectsLocationsUnitsListCall {
7504 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7505 return c
7506 }
7507
7508 // PageToken sets the optional parameter "pageToken": The page token: If the
7509 // next_page_token from a previous response is provided, this request will send
7510 // the subsequent page.
7511 func (c *ProjectsLocationsUnitsListCall) PageToken(pageToken string) *ProjectsLocationsUnitsListCall {
7512 c.urlParams_.Set("pageToken", pageToken)
7513 return c
7514 }
7515
7516 // Fields allows partial responses to be retrieved. See
7517 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7518 // details.
7519 func (c *ProjectsLocationsUnitsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsListCall {
7520 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7521 return c
7522 }
7523
7524 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7525 // object's ETag matches the given value. This is useful for getting updates
7526 // only after the object has changed since the last request.
7527 func (c *ProjectsLocationsUnitsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitsListCall {
7528 c.ifNoneMatch_ = entityTag
7529 return c
7530 }
7531
7532 // Context sets the context to be used in this call's Do method.
7533 func (c *ProjectsLocationsUnitsListCall) Context(ctx context.Context) *ProjectsLocationsUnitsListCall {
7534 c.ctx_ = ctx
7535 return c
7536 }
7537
7538 // Header returns a http.Header that can be modified by the caller to add
7539 // headers to the request.
7540 func (c *ProjectsLocationsUnitsListCall) Header() http.Header {
7541 if c.header_ == nil {
7542 c.header_ = make(http.Header)
7543 }
7544 return c.header_
7545 }
7546
7547 func (c *ProjectsLocationsUnitsListCall) doRequest(alt string) (*http.Response, error) {
7548 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7549 if c.ifNoneMatch_ != "" {
7550 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7551 }
7552 c.urlParams_.Set("alt", alt)
7553 c.urlParams_.Set("prettyPrint", "false")
7554 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/units")
7555 urls += "?" + c.urlParams_.Encode()
7556 req, err := http.NewRequest("GET", urls, nil)
7557 if err != nil {
7558 return nil, err
7559 }
7560 req.Header = reqHeaders
7561 googleapi.Expand(req.URL, map[string]string{
7562 "parent": c.parent,
7563 })
7564 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.list", "request", internallog.HTTPRequest(req, nil))
7565 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7566 }
7567
7568 // Do executes the "saasservicemgmt.projects.locations.units.list" call.
7569 // Any non-2xx status code is an error. Response headers are in either
7570 // *ListUnitsResponse.ServerResponse.Header or (if a response was returned at
7571 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7572 // check whether the returned error was because http.StatusNotModified was
7573 // returned.
7574 func (c *ProjectsLocationsUnitsListCall) Do(opts ...googleapi.CallOption) (*ListUnitsResponse, error) {
7575 gensupport.SetOptions(c.urlParams_, opts...)
7576 res, err := c.doRequest("json")
7577 if res != nil && res.StatusCode == http.StatusNotModified {
7578 if res.Body != nil {
7579 res.Body.Close()
7580 }
7581 return nil, gensupport.WrapError(&googleapi.Error{
7582 Code: res.StatusCode,
7583 Header: res.Header,
7584 })
7585 }
7586 if err != nil {
7587 return nil, err
7588 }
7589 defer googleapi.CloseBody(res)
7590 if err := googleapi.CheckResponse(res); err != nil {
7591 return nil, gensupport.WrapError(err)
7592 }
7593 ret := &ListUnitsResponse{
7594 ServerResponse: googleapi.ServerResponse{
7595 Header: res.Header,
7596 HTTPStatusCode: res.StatusCode,
7597 },
7598 }
7599 target := &ret
7600 b, err := gensupport.DecodeResponseBytes(target, res)
7601 if err != nil {
7602 return nil, err
7603 }
7604 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.list", "response", internallog.HTTPResponse(res, b))
7605 return ret, nil
7606 }
7607
7608 // Pages invokes f for each page of results.
7609 // A non-nil error returned from f will halt the iteration.
7610 // The provided context supersedes any context provided to the Context method.
7611 func (c *ProjectsLocationsUnitsListCall) Pages(ctx context.Context, f func(*ListUnitsResponse) error) error {
7612 c.ctx_ = ctx
7613 defer c.PageToken(c.urlParams_.Get("pageToken"))
7614 for {
7615 x, err := c.Do()
7616 if err != nil {
7617 return err
7618 }
7619 if err := f(x); err != nil {
7620 return err
7621 }
7622 if x.NextPageToken == "" {
7623 return nil
7624 }
7625 c.PageToken(x.NextPageToken)
7626 }
7627 }
7628
7629 type ProjectsLocationsUnitsPatchCall struct {
7630 s *Service
7631 name string
7632 unit *Unit
7633 urlParams_ gensupport.URLParams
7634 ctx_ context.Context
7635 header_ http.Header
7636 }
7637
7638 // Patch: Update a single unit.
7639 //
7640 // - name: Identifier. The resource name (full URI of the resource) following
7641 // the standard naming scheme:
7642 // "projects/{project}/locations/{location}/units/{unit}".
7643 func (r *ProjectsLocationsUnitsService) Patch(name string, unit *Unit) *ProjectsLocationsUnitsPatchCall {
7644 c := &ProjectsLocationsUnitsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7645 c.name = name
7646 c.unit = unit
7647 return c
7648 }
7649
7650 // RequestId sets the optional parameter "requestId": An optional request ID to
7651 // identify requests. Specify a unique request ID so that if you must retry
7652 // your request, the server will know to ignore the request if it has already
7653 // been completed. The server will guarantee that for at least 60 minutes since
7654 // the first request. For example, consider a situation where you make an
7655 // initial request and the request times out. If you make the request again
7656 // with the same request ID, the server can check if original operation with
7657 // the same request ID was received, and if so, will ignore the second request.
7658 // This prevents clients from accidentally creating duplicate commitments. The
7659 // request ID must be a valid UUID with the exception that zero UUID is not
7660 // supported (00000000-0000-0000-0000-000000000000).
7661 func (c *ProjectsLocationsUnitsPatchCall) RequestId(requestId string) *ProjectsLocationsUnitsPatchCall {
7662 c.urlParams_.Set("requestId", requestId)
7663 return c
7664 }
7665
7666 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
7667 // specify the fields to be overwritten in the Unit resource by the update. The
7668 // fields specified in the update_mask are relative to the resource, not the
7669 // full request. A field will be overwritten if it is in the mask. If the user
7670 // does not provide a mask then all fields in the Unit will be overwritten.
7671 func (c *ProjectsLocationsUnitsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsUnitsPatchCall {
7672 c.urlParams_.Set("updateMask", updateMask)
7673 return c
7674 }
7675
7676 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
7677 // is set to true, the service will try to validate that this request would
7678 // succeed, but will not actually make changes.
7679 func (c *ProjectsLocationsUnitsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitsPatchCall {
7680 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
7681 return c
7682 }
7683
7684 // Fields allows partial responses to be retrieved. See
7685 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7686 // details.
7687 func (c *ProjectsLocationsUnitsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsPatchCall {
7688 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7689 return c
7690 }
7691
7692 // Context sets the context to be used in this call's Do method.
7693 func (c *ProjectsLocationsUnitsPatchCall) Context(ctx context.Context) *ProjectsLocationsUnitsPatchCall {
7694 c.ctx_ = ctx
7695 return c
7696 }
7697
7698 // Header returns a http.Header that can be modified by the caller to add
7699 // headers to the request.
7700 func (c *ProjectsLocationsUnitsPatchCall) Header() http.Header {
7701 if c.header_ == nil {
7702 c.header_ = make(http.Header)
7703 }
7704 return c.header_
7705 }
7706
7707 func (c *ProjectsLocationsUnitsPatchCall) doRequest(alt string) (*http.Response, error) {
7708 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7709 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unit)
7710 if err != nil {
7711 return nil, err
7712 }
7713 c.urlParams_.Set("alt", alt)
7714 c.urlParams_.Set("prettyPrint", "false")
7715 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
7716 urls += "?" + c.urlParams_.Encode()
7717 req, err := http.NewRequest("PATCH", urls, body)
7718 if err != nil {
7719 return nil, err
7720 }
7721 req.Header = reqHeaders
7722 googleapi.Expand(req.URL, map[string]string{
7723 "name": c.name,
7724 })
7725 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7726 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7727 }
7728
7729 // Do executes the "saasservicemgmt.projects.locations.units.patch" call.
7730 // Any non-2xx status code is an error. Response headers are in either
7731 // *Unit.ServerResponse.Header or (if a response was returned at all) in
7732 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7733 // whether the returned error was because http.StatusNotModified was returned.
7734 func (c *ProjectsLocationsUnitsPatchCall) Do(opts ...googleapi.CallOption) (*Unit, error) {
7735 gensupport.SetOptions(c.urlParams_, opts...)
7736 res, err := c.doRequest("json")
7737 if res != nil && res.StatusCode == http.StatusNotModified {
7738 if res.Body != nil {
7739 res.Body.Close()
7740 }
7741 return nil, gensupport.WrapError(&googleapi.Error{
7742 Code: res.StatusCode,
7743 Header: res.Header,
7744 })
7745 }
7746 if err != nil {
7747 return nil, err
7748 }
7749 defer googleapi.CloseBody(res)
7750 if err := googleapi.CheckResponse(res); err != nil {
7751 return nil, gensupport.WrapError(err)
7752 }
7753 ret := &Unit{
7754 ServerResponse: googleapi.ServerResponse{
7755 Header: res.Header,
7756 HTTPStatusCode: res.StatusCode,
7757 },
7758 }
7759 target := &ret
7760 b, err := gensupport.DecodeResponseBytes(target, res)
7761 if err != nil {
7762 return nil, err
7763 }
7764 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.patch", "response", internallog.HTTPResponse(res, b))
7765 return ret, nil
7766 }