Debian Codegraph @

saasservicemgmt/v1beta1/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/v1beta1"
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/v1beta1"
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:v1beta1"
93 const apiName = "saasservicemgmt"
94 const apiVersion = "v1beta1"
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.FlagAttributes = NewProjectsLocationsFlagAttributesService(s)
172 rs.FlagReleases = NewProjectsLocationsFlagReleasesService(s)
173 rs.FlagRevisions = NewProjectsLocationsFlagRevisionsService(s)
174 rs.Flags = NewProjectsLocationsFlagsService(s)
175 rs.Releases = NewProjectsLocationsReleasesService(s)
176 rs.RolloutKinds = NewProjectsLocationsRolloutKindsService(s)
177 rs.Rollouts = NewProjectsLocationsRolloutsService(s)
178 rs.Saas = NewProjectsLocationsSaasService(s)
179 rs.Tenants = NewProjectsLocationsTenantsService(s)
180 rs.UnitKinds = NewProjectsLocationsUnitKindsService(s)
181 rs.UnitOperations = NewProjectsLocationsUnitOperationsService(s)
182 rs.Units = NewProjectsLocationsUnitsService(s)
183 return rs
184 }
185
186 type ProjectsLocationsService struct {
187 s *Service
188
189 FlagAttributes *ProjectsLocationsFlagAttributesService
190
191 FlagReleases *ProjectsLocationsFlagReleasesService
192
193 FlagRevisions *ProjectsLocationsFlagRevisionsService
194
195 Flags *ProjectsLocationsFlagsService
196
197 Releases *ProjectsLocationsReleasesService
198
199 RolloutKinds *ProjectsLocationsRolloutKindsService
200
201 Rollouts *ProjectsLocationsRolloutsService
202
203 Saas *ProjectsLocationsSaasService
204
205 Tenants *ProjectsLocationsTenantsService
206
207 UnitKinds *ProjectsLocationsUnitKindsService
208
209 UnitOperations *ProjectsLocationsUnitOperationsService
210
211 Units *ProjectsLocationsUnitsService
212 }
213
214 func NewProjectsLocationsFlagAttributesService(s *Service) *ProjectsLocationsFlagAttributesService {
215 rs := &ProjectsLocationsFlagAttributesService{s: s}
216 return rs
217 }
218
219 type ProjectsLocationsFlagAttributesService struct {
220 s *Service
221 }
222
223 func NewProjectsLocationsFlagReleasesService(s *Service) *ProjectsLocationsFlagReleasesService {
224 rs := &ProjectsLocationsFlagReleasesService{s: s}
225 return rs
226 }
227
228 type ProjectsLocationsFlagReleasesService struct {
229 s *Service
230 }
231
232 func NewProjectsLocationsFlagRevisionsService(s *Service) *ProjectsLocationsFlagRevisionsService {
233 rs := &ProjectsLocationsFlagRevisionsService{s: s}
234 return rs
235 }
236
237 type ProjectsLocationsFlagRevisionsService struct {
238 s *Service
239 }
240
241 func NewProjectsLocationsFlagsService(s *Service) *ProjectsLocationsFlagsService {
242 rs := &ProjectsLocationsFlagsService{s: s}
243 return rs
244 }
245
246 type ProjectsLocationsFlagsService struct {
247 s *Service
248 }
249
250 func NewProjectsLocationsReleasesService(s *Service) *ProjectsLocationsReleasesService {
251 rs := &ProjectsLocationsReleasesService{s: s}
252 return rs
253 }
254
255 type ProjectsLocationsReleasesService struct {
256 s *Service
257 }
258
259 func NewProjectsLocationsRolloutKindsService(s *Service) *ProjectsLocationsRolloutKindsService {
260 rs := &ProjectsLocationsRolloutKindsService{s: s}
261 return rs
262 }
263
264 type ProjectsLocationsRolloutKindsService struct {
265 s *Service
266 }
267
268 func NewProjectsLocationsRolloutsService(s *Service) *ProjectsLocationsRolloutsService {
269 rs := &ProjectsLocationsRolloutsService{s: s}
270 return rs
271 }
272
273 type ProjectsLocationsRolloutsService struct {
274 s *Service
275 }
276
277 func NewProjectsLocationsSaasService(s *Service) *ProjectsLocationsSaasService {
278 rs := &ProjectsLocationsSaasService{s: s}
279 return rs
280 }
281
282 type ProjectsLocationsSaasService struct {
283 s *Service
284 }
285
286 func NewProjectsLocationsTenantsService(s *Service) *ProjectsLocationsTenantsService {
287 rs := &ProjectsLocationsTenantsService{s: s}
288 return rs
289 }
290
291 type ProjectsLocationsTenantsService struct {
292 s *Service
293 }
294
295 func NewProjectsLocationsUnitKindsService(s *Service) *ProjectsLocationsUnitKindsService {
296 rs := &ProjectsLocationsUnitKindsService{s: s}
297 return rs
298 }
299
300 type ProjectsLocationsUnitKindsService struct {
301 s *Service
302 }
303
304 func NewProjectsLocationsUnitOperationsService(s *Service) *ProjectsLocationsUnitOperationsService {
305 rs := &ProjectsLocationsUnitOperationsService{s: s}
306 return rs
307 }
308
309 type ProjectsLocationsUnitOperationsService struct {
310 s *Service
311 }
312
313 func NewProjectsLocationsUnitsService(s *Service) *ProjectsLocationsUnitsService {
314 rs := &ProjectsLocationsUnitsService{s: s}
315 return rs
316 }
317
318 type ProjectsLocationsUnitsService struct {
319 s *Service
320 }
321
322 // Aggregate: Represents the aggregation of a set of population of like records
323 // by a certain group. For example, a collection of unit counts can be
324 // aggregated and grouped by their state.
325 type Aggregate struct {
326 // Count: Required. Number of records in the group.
327 Count int64 `json:"count,omitempty"`
328 // Group: Required. Group by which to aggregate.
329 Group string `json:"group,omitempty"`
330 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally
331 // include in API requests. By default, fields with empty or default values are
332 // omitted from API requests. See
333 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
334 // details.
335 ForceSendFields []string `json:"-"`
336 // NullFields is a list of field names (e.g. "Count") to include in API
337 // requests with the JSON null value. By default, fields with empty values are
338 // omitted from API requests. See
339 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
340 NullFields []string `json:"-"`
341 }
342
343 func (s Aggregate) MarshalJSON() ([]byte, error) {
344 type NoMethod Aggregate
345 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
346 }
347
348 // Allocation: Allocation defines a set of weighted flag variants, specifying
349 // how traffic is split based on the randomization unit.
350 type Allocation struct {
351 // Description: Optional. Description of the allocation. Max length: 500 bytes.
352 Description string `json:"description,omitempty"`
353 // Id: Required. Allocation ID. Max length: 128 bytes.
354 Id string `json:"id,omitempty"`
355 // RandomizedOn: Required. Key of the context attribute that is used for
356 // traffic splitting.
357 RandomizedOn string `json:"randomizedOn,omitempty"`
358 // Slots: Required. Slots defines the weighted distribution of variants.
359 Slots []*AllocationSlot `json:"slots,omitempty"`
360 // ForceSendFields is a list of field names (e.g. "Description") to
361 // unconditionally include in API requests. By default, fields with empty or
362 // default values are omitted from API requests. See
363 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
364 // details.
365 ForceSendFields []string `json:"-"`
366 // NullFields is a list of field names (e.g. "Description") to include in API
367 // requests with the JSON null value. By default, fields with empty values are
368 // omitted from API requests. See
369 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
370 NullFields []string `json:"-"`
371 }
372
373 func (s Allocation) MarshalJSON() ([]byte, error) {
374 type NoMethod Allocation
375 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
376 }
377
378 // AllocationSlot: AllocationSlot specifies a variant and the proportion of
379 // traffic allocated to it.
380 type AllocationSlot struct {
381 // Variant: Required. Variant of the allocation slot.
382 Variant string `json:"variant,omitempty"`
383 // Weight: Required. Weight defines the proportion of traffic to allocate to
384 // the variant, relative to other slots in the same allocation.
385 Weight int64 `json:"weight,omitempty"`
386 // ForceSendFields is a list of field names (e.g. "Variant") to unconditionally
387 // include in API requests. By default, fields with empty or default values are
388 // omitted from API requests. See
389 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
390 // details.
391 ForceSendFields []string `json:"-"`
392 // NullFields is a list of field names (e.g. "Variant") to include in API
393 // requests with the JSON null value. By default, fields with empty values are
394 // omitted from API requests. See
395 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
396 NullFields []string `json:"-"`
397 }
398
399 func (s AllocationSlot) MarshalJSON() ([]byte, error) {
400 type NoMethod AllocationSlot
401 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
402 }
403
404 // AppParams: AppParams contains the parameters for creating an AppHub
405 // Application.
406 type AppParams struct {
407 // Group: Grouping used to construct the name of the AppHub Application.
408 // Multiple UnitKinds can specify the same group to use the same Application
409 // across their respective units. Corresponds to the app_boundary_id in the ADC
410 // composite ApplicationTemplate. Defaults to UnitKind.name
411 Group string `json:"group,omitempty"`
412 // Scope: Corresponds to the scope in the ADC composite ApplicationTemplate.
413 // Defaults to TYPE_REGIONAL.
414 Scope *Scope `json:"scope,omitempty"`
415 // ForceSendFields is a list of field names (e.g. "Group") to unconditionally
416 // include in API requests. By default, fields with empty or default values are
417 // omitted from API requests. See
418 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
419 // details.
420 ForceSendFields []string `json:"-"`
421 // NullFields is a list of field names (e.g. "Group") to include in API
422 // requests with the JSON null value. By default, fields with empty values are
423 // omitted from API requests. See
424 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
425 NullFields []string `json:"-"`
426 }
427
428 func (s AppParams) MarshalJSON() ([]byte, error) {
429 type NoMethod AppParams
430 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
431 }
432
433 // Blueprint: Blueprints are OCI Images that contain all of the artifacts
434 // needed to provision a unit. Metadata such as, type of the engine used to
435 // actuate the blueprint (e.g. terraform, helm etc) and version will come from
436 // the image manifest. If the hostname is omitted, it will be assumed to be the
437 // regional path to Artifact Registry (eg. us-east1-docker.pkg.dev).
438 type Blueprint struct {
439 // Engine: Output only. Type of the engine used to actuate the blueprint. e.g.
440 // terraform, helm etc.
441 Engine string `json:"engine,omitempty"`
442 // Package: Optional. Immutable. URI to a blueprint used by the Unit (required
443 // unless unitKind or release is set).
444 Package string `json:"package,omitempty"`
445 // Version: Output only. Version metadata if present on the blueprint.
446 Version string `json:"version,omitempty"`
447 // ForceSendFields is a list of field names (e.g. "Engine") to unconditionally
448 // include in API requests. By default, fields with empty or default values are
449 // omitted from API requests. See
450 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
451 // details.
452 ForceSendFields []string `json:"-"`
453 // NullFields is a list of field names (e.g. "Engine") to include in API
454 // requests with the JSON null value. By default, fields with empty values are
455 // omitted from API requests. See
456 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
457 NullFields []string `json:"-"`
458 }
459
460 func (s Blueprint) MarshalJSON() ([]byte, error) {
461 type NoMethod Blueprint
462 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
463 }
464
465 // ComponentRef: ComponentRef represents a reference to a component resource.
466 // Next ID: 4
467 type ComponentRef struct {
468 // Component: Name of the component in composite.Components
469 Component string `json:"component,omitempty"`
470 // CompositeRef: Reference to the Composite ApplicationTemplate.
471 CompositeRef *CompositeRef `json:"compositeRef,omitempty"`
472 // Revision: Revision of the component. If the component does not have a
473 // revision, this field will be explicitly set to the revision of the composite
474 // ApplicationTemplate.
475 Revision string `json:"revision,omitempty"`
476 // ForceSendFields is a list of field names (e.g. "Component") to
477 // unconditionally include in API requests. By default, fields with empty or
478 // default values are omitted from API requests. See
479 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
480 // details.
481 ForceSendFields []string `json:"-"`
482 // NullFields is a list of field names (e.g. "Component") to include in API
483 // requests with the JSON null value. By default, fields with empty values are
484 // omitted from API requests. See
485 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
486 NullFields []string `json:"-"`
487 }
488
489 func (s ComponentRef) MarshalJSON() ([]byte, error) {
490 type NoMethod ComponentRef
491 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
492 }
493
494 // CompositeRef: CompositeRef represents a reference to a composite resource.
495 // Next ID: 4
496 type CompositeRef struct {
497 // ApplicationTemplate: Required. Reference to the ApplicationTemplate
498 // resource.
499 ApplicationTemplate string `json:"applicationTemplate,omitempty"`
500 // Revision: Revision of the ApplicationTemplate to use. Changes to revision
501 // will trigger manual resynchronization. If empty, ApplicationTemplate will be
502 // ignored.
503 Revision string `json:"revision,omitempty"`
504 // SyncOperation: Output only. Reference to on-going AppTemplate import and
505 // replication operation (i.e. the operation_id for the long-running
506 // operation). This field is opaque for external usage.
507 SyncOperation string `json:"syncOperation,omitempty"`
508 // ForceSendFields is a list of field names (e.g. "ApplicationTemplate") to
509 // unconditionally include in API requests. By default, fields with empty or
510 // default values are omitted from API requests. See
511 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
512 // details.
513 ForceSendFields []string `json:"-"`
514 // NullFields is a list of field names (e.g. "ApplicationTemplate") to include
515 // in API requests with the JSON null value. By default, fields with empty
516 // values are omitted from API requests. See
517 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
518 NullFields []string `json:"-"`
519 }
520
521 func (s CompositeRef) MarshalJSON() ([]byte, error) {
522 type NoMethod CompositeRef
523 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
524 }
525
526 // Dependency: Dependency represent a single dependency with another unit kind
527 // by alias.
528 type Dependency struct {
529 // Alias: Required. An alias for the dependency. Used for input variable
530 // mapping.
531 Alias string `json:"alias,omitempty"`
532 // UnitKind: Required. Immutable. The unit kind of the dependency.
533 UnitKind string `json:"unitKind,omitempty"`
534 // ForceSendFields is a list of field names (e.g. "Alias") to unconditionally
535 // include in API requests. By default, fields with empty or default values are
536 // omitted from API requests. See
537 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
538 // details.
539 ForceSendFields []string `json:"-"`
540 // NullFields is a list of field names (e.g. "Alias") to include in API
541 // requests with the JSON null value. By default, fields with empty values are
542 // omitted from API requests. See
543 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
544 NullFields []string `json:"-"`
545 }
546
547 func (s Dependency) MarshalJSON() ([]byte, error) {
548 type NoMethod Dependency
549 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
550 }
551
552 // Deprovision: Deprovision is the unit operation that deprovision the
553 // underlying resources represented by a Unit. Can only execute if the Unit is
554 // currently provisioned.
555 type Deprovision struct {
556 }
557
558 // Empty: A generic empty message that you can re-use to avoid defining
559 // duplicated empty messages in your APIs. A typical example is to use it as
560 // the request or the response type of an API method. For instance: service Foo
561 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
562 type Empty struct {
563 // ServerResponse contains the HTTP response code and headers from the server.
564 googleapi.ServerResponse `json:"-"`
565 }
566
567 // ErrorBudget: The configuration for error budget. If the number of failed
568 // units exceeds max(allowed_count, allowed_ratio * total_units), the rollout
569 // will be paused.
570 type ErrorBudget struct {
571 // AllowedCount: Optional. The maximum number of failed units allowed in a
572 // location without pausing the rollout.
573 AllowedCount int64 `json:"allowedCount,omitempty"`
574 // AllowedPercentage: Optional. The maximum percentage of units allowed to fail
575 // (0, 100] within a location without pausing the rollout.
576 AllowedPercentage int64 `json:"allowedPercentage,omitempty"`
577 // ForceSendFields is a list of field names (e.g. "AllowedCount") to
578 // unconditionally include in API requests. By default, fields with empty or
579 // default values are omitted from API requests. See
580 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
581 // details.
582 ForceSendFields []string `json:"-"`
583 // NullFields is a list of field names (e.g. "AllowedCount") to include in API
584 // requests with the JSON null value. By default, fields with empty values are
585 // omitted from API requests. See
586 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
587 NullFields []string `json:"-"`
588 }
589
590 func (s ErrorBudget) MarshalJSON() ([]byte, error) {
591 type NoMethod ErrorBudget
592 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
593 }
594
595 // EvaluationRule: EvaluationRule defines a single rule for evaluating a
596 // feature flag. A rule consists of a condition that, if met, assigns a
597 // specific variant or allocation to the user.
598 type EvaluationRule struct {
599 // Condition: Required. A Common Expression Language (CEL) expression that
600 // evaluates to a boolean. The expression is evaluated against the provided
601 // context. If it returns true, the rule's target is applied.
602 Condition string `json:"condition,omitempty"`
603 // Id: Required. Evaluation rule ID. Max length: 128 bytes.
604 Id string `json:"id,omitempty"`
605 // Target: Required. The target variant or allocation to apply if the condition
606 // is met. This should match the name of a defined variant or allocation's ID.
607 Target string `json:"target,omitempty"`
608 // ForceSendFields is a list of field names (e.g. "Condition") to
609 // unconditionally include in API requests. By default, fields with empty or
610 // default values are omitted from API requests. See
611 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
612 // details.
613 ForceSendFields []string `json:"-"`
614 // NullFields is a list of field names (e.g. "Condition") to include in API
615 // requests with the JSON null value. By default, fields with empty values are
616 // omitted from API requests. See
617 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
618 NullFields []string `json:"-"`
619 }
620
621 func (s EvaluationRule) MarshalJSON() ([]byte, error) {
622 type NoMethod EvaluationRule
623 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
624 }
625
626 // EvaluationSpec: EvaluationSpec holds rules for evaluating the value of a
627 // flag.
628 type EvaluationSpec struct {
629 // Allocations: Optional. A list of allocations.
630 Allocations []*Allocation `json:"allocations,omitempty"`
631 // Attributes: Optional. Names of the context attributes that are used in the
632 // evaluation rules and allocations.
633 Attributes []string `json:"attributes,omitempty"`
634 // DefaultTarget: Required. Default variant or allocation of the flag.
635 DefaultTarget string `json:"defaultTarget,omitempty"`
636 // Rules: Optional. Evaluation rules define the logic for evaluating the flag
637 // against a given context. The rules are evaluated sequentially in their
638 // specified order.
639 Rules []*EvaluationRule `json:"rules,omitempty"`
640 // Variants: Optional. A list of variants.
641 Variants []*Variant `json:"variants,omitempty"`
642 // ForceSendFields is a list of field names (e.g. "Allocations") to
643 // unconditionally include in API requests. By default, fields with empty or
644 // default values are omitted from API requests. See
645 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
646 // details.
647 ForceSendFields []string `json:"-"`
648 // NullFields is a list of field names (e.g. "Allocations") to include in API
649 // requests with the JSON null value. By default, fields with empty values are
650 // omitted from API requests. See
651 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
652 NullFields []string `json:"-"`
653 }
654
655 func (s EvaluationSpec) MarshalJSON() ([]byte, error) {
656 type NoMethod EvaluationSpec
657 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
658 }
659
660 // Flag: Represents a single Flag.
661 type Flag struct {
662 // Annotations: Optional. Annotations is an unstructured key-value map stored
663 // with a resource that may be set by external tools to store and retrieve
664 // arbitrary metadata. They are not queryable and should be preserved when
665 // modifying objects. More info:
666 // https://kubernetes.io/docs/user-guide/annotations
667 Annotations map[string]string `json:"annotations,omitempty"`
668 // CreateTime: Output only. The timestamp when the resource was created.
669 CreateTime string `json:"createTime,omitempty"`
670 // Description: Optional. Description of the flag. Max length: 500 bytes.
671 Description string `json:"description,omitempty"`
672 // Etag: Output only. An opaque value that uniquely identifies a version or
673 // generation of a resource. It can be used to confirm that the client and
674 // server agree on the ordering of a resource being written.
675 Etag string `json:"etag,omitempty"`
676 // EvaluationSpec: Optional. Specification of how the flag value should be
677 // evaluated. If a bool flag is created without an evaluation_spec specified,
678 // two default variants, "Enabled" (with bool_value = true) and "Disabled"
679 // (with bool_value = false), are created by default, and "Disabled" is set as
680 // the default_target.
681 EvaluationSpec *EvaluationSpec `json:"evaluationSpec,omitempty"`
682 // FlagSet: Optional. Flag set this flag belongs to.
683 FlagSet string `json:"flagSet,omitempty"`
684 // FlagValueType: Optional. Immutable. Flag value type.
685 //
686 // Possible values:
687 // "FLAG_VALUE_TYPE_UNSPECIFIED" - Unspecified flag value type.
688 // "FLAG_VALUE_TYPE_BOOLEAN" - Boolean flag value type.
689 // "FLAG_VALUE_TYPE_INTEGER" - Integer flag value type.
690 // "FLAG_VALUE_TYPE_STRING" - String flag value type.
691 // "FLAG_VALUE_TYPE_DOUBLE" - Double flag value type.
692 FlagValueType string `json:"flagValueType,omitempty"`
693 // Key: Required. Immutable. Flag key used in runtime evaluation APIs
694 // (OpenFeature). Max length: 256 bytes.
695 Key string `json:"key,omitempty"`
696 // Labels: Optional. The labels on the resource, which can be used for
697 // categorization. similar to Kubernetes resource labels.
698 Labels map[string]string `json:"labels,omitempty"`
699 // Name: Identifier. The resource name (full URI of the resource) following the
700 // standard naming scheme:
701 // "projects/{project}/locations/{location}/flags/{flag_id}"
702 Name string `json:"name,omitempty"`
703 // State: Optional. Current state of the flag.
704 //
705 // Possible values:
706 // "FLAG_STATE_UNSPECIFIED" - Flag state is unspecified.
707 // "FLAG_STATE_IN_DEVELOPMENT" - Flag is in development state.
708 // "FLAG_STATE_ACTIVE" - Flag is in active state.
709 // "FLAG_STATE_SUNSETTING" - Flag is in deprecated state.
710 // "FLAG_STATE_CLEANUP" - Flag is in cleanup state.
711 State string `json:"state,omitempty"`
712 // Uid: Output only. The unique identifier of the resource. UID is unique in
713 // the time and space for this resource within the scope of the service. It is
714 // typically generated by the server on successful creation of a resource and
715 // must not be changed. UID is used to uniquely identify resources with
716 // resource name reuses. This should be a UUID4.
717 Uid string `json:"uid,omitempty"`
718 // UnitKind: Required. Immutable. UnitKind that can consume this flag.
719 UnitKind string `json:"unitKind,omitempty"`
720 // UpdateTime: Output only. The timestamp when the resource was last updated.
721 // Any change to the resource made by users must refresh this value. Changes to
722 // a resource made by the service should refresh this value.
723 UpdateTime string `json:"updateTime,omitempty"`
724 // ValueType: Optional. Immutable. Deprecated: Use `flag_value_type` instead.
725 // Flag value type.
726 //
727 // Possible values:
728 // "FLAG_VALUE_TYPE_UNSPECIFIED"
729 // "FLAG_VALUE_TYPE_BOOL" - Boolean flag value type.
730 // "FLAG_VALUE_TYPE_INT" - Integer flag value type.
731 // "FLAG_VALUE_TYPE_STRING" - String flag value type.
732 // "FLAG_VALUE_TYPE_DOUBLE" - Double flag type.
733 ValueType string `json:"valueType,omitempty"`
734 // Variants: Optional. A list of variants.
735 Variants []*FlagVariant `json:"variants,omitempty"`
736
737 // ServerResponse contains the HTTP response code and headers from the server.
738 googleapi.ServerResponse `json:"-"`
739 // ForceSendFields is a list of field names (e.g. "Annotations") to
740 // unconditionally include in API requests. By default, fields with empty or
741 // default values are omitted from API requests. See
742 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
743 // details.
744 ForceSendFields []string `json:"-"`
745 // NullFields is a list of field names (e.g. "Annotations") to include in API
746 // requests with the JSON null value. By default, fields with empty values are
747 // omitted from API requests. See
748 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
749 NullFields []string `json:"-"`
750 }
751
752 func (s Flag) MarshalJSON() ([]byte, error) {
753 type NoMethod Flag
754 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
755 }
756
757 // FlagAttribute: FlagAttribute defines a custom property in the evaluation
758 // context.
759 type FlagAttribute struct {
760 // Annotations: Optional. Annotations is an unstructured key-value map stored
761 // with a resource that may be set by external tools to store and retrieve
762 // arbitrary metadata. They are not queryable and should be preserved when
763 // modifying objects. More info:
764 // https://kubernetes.io/docs/user-guide/annotations
765 Annotations map[string]string `json:"annotations,omitempty"`
766 // AttributeValueType: Optional. Immutable. Type of the attribute.
767 //
768 // Possible values:
769 // "FLAG_ATTRIBUTE_VALUE_TYPE_UNSPECIFIED" - Unspecified flag attribute value
770 // type.
771 // "FLAG_ATTRIBUTE_VALUE_TYPE_BOOLEAN" - Boolean flag attribute value type.
772 // "FLAG_ATTRIBUTE_VALUE_TYPE_INTEGER" - Integer flag attribute value type.
773 // "FLAG_ATTRIBUTE_VALUE_TYPE_STRING" - String flag attribute value type.
774 // "FLAG_ATTRIBUTE_VALUE_TYPE_DOUBLE" - Double flag attribute value type.
775 AttributeValueType string `json:"attributeValueType,omitempty"`
776 // CreateTime: Output only. The timestamp when the resource was created.
777 CreateTime string `json:"createTime,omitempty"`
778 // Etag: Output only. An opaque value that uniquely identifies a version or
779 // generation of a resource. It can be used to confirm that the client and
780 // server agree on the ordering of a resource being written.
781 Etag string `json:"etag,omitempty"`
782 // Key: Required. Immutable. The identifier for the attribute, used as the key
783 // in the evaluation context. The attribute key is referenced in the evaluation
784 // rules and used in the OpenFeature evaluation API to specify the attribute
785 // context.
786 Key string `json:"key,omitempty"`
787 // Labels: Optional. The labels on the resource, which can be used for
788 // categorization. similar to Kubernetes resource labels.
789 Labels map[string]string `json:"labels,omitempty"`
790 // Name: Identifier. The resource name (full URI of the resource) following the
791 // standard naming scheme:
792 // "projects/{project}/locations/{location}/flagAttributes/{flag_attribute_id}"
793 Name string `json:"name,omitempty"`
794 // Uid: Output only. The unique identifier of the resource. UID is unique in
795 // the time and space for this resource within the scope of the service. It is
796 // typically generated by the server on successful creation of a resource and
797 // must not be changed. UID is used to uniquely identify resources with
798 // resource name reuses. This should be a UUID4.
799 Uid string `json:"uid,omitempty"`
800 // UpdateTime: Output only. The timestamp when the resource was last updated.
801 // Any change to the resource made by users must refresh this value. Changes to
802 // a resource made by the service should refresh this value.
803 UpdateTime string `json:"updateTime,omitempty"`
804 // ValueType: Optional. Immutable. Deprecated: Use `attribute_value_type`
805 // instead. Type of the attribute.
806 //
807 // Possible values:
808 // "FLAG_ATTRIBUTE_VALUE_TYPE_UNSPECIFIED" - Unspecified flag attribute value
809 // type.
810 // "BOOLEAN" - Boolean flag attribute value type.
811 // "INTEGER" - Integer flag attribute value type.
812 // "STRING" - String flag attribute value type.
813 // "DOUBLE" - Double flag attribute value type.
814 ValueType string `json:"valueType,omitempty"`
815
816 // ServerResponse contains the HTTP response code and headers from the server.
817 googleapi.ServerResponse `json:"-"`
818 // ForceSendFields is a list of field names (e.g. "Annotations") to
819 // unconditionally include in API requests. By default, fields with empty or
820 // default values are omitted from API requests. See
821 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
822 // details.
823 ForceSendFields []string `json:"-"`
824 // NullFields is a list of field names (e.g. "Annotations") to include in API
825 // requests with the JSON null value. By default, fields with empty values are
826 // omitted from API requests. See
827 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
828 NullFields []string `json:"-"`
829 }
830
831 func (s FlagAttribute) MarshalJSON() ([]byte, error) {
832 type NoMethod FlagAttribute
833 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
834 }
835
836 // FlagRelease: A collection of FlagRevisions.
837 type FlagRelease struct {
838 // AllFlags: Optional. Immutable. DEPRECATED: Use all_flags_release instead.
839 // Rollout all flags in the provided UnitKind. Only one of flag_revisions,
840 // all_flags, or flag_sets can be set.
841 AllFlags bool `json:"allFlags,omitempty"`
842 // AllFlagsRelease: Optional. Immutable. Specifies the release includes all
843 // flags.
844 AllFlagsRelease bool `json:"allFlagsRelease,omitempty"`
845 // Annotations: Optional. Annotations is an unstructured key-value map stored
846 // with a resource that may be set by external tools to store and retrieve
847 // arbitrary metadata. They are not queryable and should be preserved when
848 // modifying objects. More info:
849 // https://kubernetes.io/docs/user-guide/annotations
850 Annotations map[string]string `json:"annotations,omitempty"`
851 // CreateTime: Output only. The timestamp when the resource was created.
852 CreateTime string `json:"createTime,omitempty"`
853 // EffectiveFlagRevisions: Output only. An OUTPUT_ONLY field that contains
854 // FlagRevisions to be rolled out. This is the ultimate source of truth of what
855 // a Rollout or a UnitOperation carries.
856 EffectiveFlagRevisions []string `json:"effectiveFlagRevisions,omitempty"`
857 // Etag: Output only. An opaque value that uniquely identifies a version or
858 // generation of a resource. It can be used to confirm that the client and
859 // server agree on the ordering of a resource being written.
860 Etag string `json:"etag,omitempty"`
861 // FlagRevisions: Optional. Immutable. DEPRECATED: Use flag_revisions_release
862 // instead. FlagRevisions to be rolled out. Only one of flag_revisions,
863 // all_flags, or flag_sets can be set. It used to be the ultimate source to
864 // truth and has been moved to effective_flag_revisions.
865 FlagRevisions []string `json:"flagRevisions,omitempty"`
866 // FlagRevisionsRelease: Optional. Immutable. Specifies the release consists of
867 // a list of flag revisions.
868 FlagRevisionsRelease *FlagRevisionList `json:"flagRevisionsRelease,omitempty"`
869 // FlagSets: Optional. Immutable. DEPRECATED: Use flag_sets_release instead.
870 // Flag sets to be rolled out. Only one of flag_revisions, all_flags, or
871 // flag_sets can be set.
872 FlagSets []string `json:"flagSets,omitempty"`
873 // FlagSetsRelease: Optional. Immutable. Specifies the release consists of a
874 // list of flag sets.
875 FlagSetsRelease *FlagSetList `json:"flagSetsRelease,omitempty"`
876 // Labels: Optional. The labels on the resource, which can be used for
877 // categorization. similar to Kubernetes resource labels.
878 Labels map[string]string `json:"labels,omitempty"`
879 // Name: Identifier. The resource name (full URI of the resource) following the
880 // standard naming scheme:
881 // "projects/{project}/locations/{location}/flagReleases/{flag_release_id}"
882 Name string `json:"name,omitempty"`
883 // ObsoleteFlags: Optional. Immutable. Deprecated: Use the 'state' field in the
884 // 'Flag' resource to manage the cleanup of flag lifecycles including removal
885 // from UnitKind and Units. Flags to be removed from given UnitKind and all
886 // related Units. If Flag is provided here, its FlagRevisions will be removed
887 // from UnitKind and Units.
888 ObsoleteFlags []string `json:"obsoleteFlags,omitempty"`
889 // Uid: Output only. The unique identifier of the resource. UID is unique in
890 // the time and space for this resource within the scope of the service. It is
891 // typically generated by the server on successful creation of a resource and
892 // must not be changed. UID is used to uniquely identify resources with
893 // resource name reuses. This should be a UUID4.
894 Uid string `json:"uid,omitempty"`
895 // UnitKind: Required. Immutable. The UnitKind this FlagRelease applies to.
896 UnitKind string `json:"unitKind,omitempty"`
897 // UpdateTime: Output only. The timestamp when the resource was last updated.
898 // Any change to the resource made by users must refresh this value. Changes to
899 // a resource made by the service should refresh this value.
900 UpdateTime string `json:"updateTime,omitempty"`
901
902 // ServerResponse contains the HTTP response code and headers from the server.
903 googleapi.ServerResponse `json:"-"`
904 // ForceSendFields is a list of field names (e.g. "AllFlags") to
905 // unconditionally include in API requests. By default, fields with empty or
906 // default values are omitted from API requests. See
907 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
908 // details.
909 ForceSendFields []string `json:"-"`
910 // NullFields is a list of field names (e.g. "AllFlags") to include in API
911 // requests with the JSON null value. By default, fields with empty values are
912 // omitted from API requests. See
913 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
914 NullFields []string `json:"-"`
915 }
916
917 func (s FlagRelease) MarshalJSON() ([]byte, error) {
918 type NoMethod FlagRelease
919 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
920 }
921
922 // FlagRevision: A snapshot of the EvaluationSpec for the Flag.
923 type FlagRevision struct {
924 // Annotations: Optional. Annotations is an unstructured key-value map stored
925 // with a resource that may be set by external tools to store and retrieve
926 // arbitrary metadata. They are not queryable and should be preserved when
927 // modifying objects. More info:
928 // https://kubernetes.io/docs/user-guide/annotations
929 Annotations map[string]string `json:"annotations,omitempty"`
930 // CreateTime: Output only. The timestamp when the resource was created.
931 CreateTime string `json:"createTime,omitempty"`
932 // Etag: Output only. An opaque value that uniquely identifies a version or
933 // generation of a resource. It can be used to confirm that the client and
934 // server agree on the ordering of a resource being written.
935 Etag string `json:"etag,omitempty"`
936 // EvaluationSpec: Output only. Immutable. Snapshot of the EvaluationSpec for
937 // the flag. DEPRECATED: Use snapshot instead.
938 EvaluationSpec *EvaluationSpec `json:"evaluationSpec,omitempty"`
939 // Flag: Required. Immutable. Name of the Flag this is a revision of.
940 Flag string `json:"flag,omitempty"`
941 // Labels: Optional. The labels on the resource, which can be used for
942 // categorization. similar to Kubernetes resource labels.
943 Labels map[string]string `json:"labels,omitempty"`
944 // Name: Identifier. The resource name (full URI of the resource) following the
945 // standard naming scheme:
946 // "projects/{project}/locations/{location}/flagRevisions/{flag_revision_id}"
947 Name string `json:"name,omitempty"`
948 // Snapshot: Output only. Immutable. Snapshot of the Flag.
949 Snapshot *Flag `json:"snapshot,omitempty"`
950 // Uid: Output only. The unique identifier of the resource. UID is unique in
951 // the time and space for this resource within the scope of the service. It is
952 // typically generated by the server on successful creation of a resource and
953 // must not be changed. UID is used to uniquely identify resources with
954 // resource name reuses. This should be a UUID4.
955 Uid string `json:"uid,omitempty"`
956 // UpdateTime: Output only. The timestamp when the resource was last updated.
957 // Any change to the resource made by users must refresh this value. Changes to
958 // a resource made by the service should refresh this value.
959 UpdateTime string `json:"updateTime,omitempty"`
960
961 // ServerResponse contains the HTTP response code and headers from the server.
962 googleapi.ServerResponse `json:"-"`
963 // ForceSendFields is a list of field names (e.g. "Annotations") to
964 // unconditionally include in API requests. By default, fields with empty or
965 // default values are omitted from API requests. See
966 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
967 // details.
968 ForceSendFields []string `json:"-"`
969 // NullFields is a list of field names (e.g. "Annotations") to include in API
970 // requests with the JSON null value. By default, fields with empty values are
971 // omitted from API requests. See
972 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
973 NullFields []string `json:"-"`
974 }
975
976 func (s FlagRevision) MarshalJSON() ([]byte, error) {
977 type NoMethod FlagRevision
978 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
979 }
980
981 // FlagRevisionList: Wrapper for a list of flag revisions.
982 type FlagRevisionList struct {
983 // Revisions: Required. FlagRevisions to be rolled out.
984 Revisions []string `json:"revisions,omitempty"`
985 // ForceSendFields is a list of field names (e.g. "Revisions") to
986 // unconditionally include in API requests. By default, fields with empty or
987 // default values are omitted from API requests. See
988 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
989 // details.
990 ForceSendFields []string `json:"-"`
991 // NullFields is a list of field names (e.g. "Revisions") to include in API
992 // requests with the JSON null value. By default, fields with empty values are
993 // omitted from API requests. See
994 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
995 NullFields []string `json:"-"`
996 }
997
998 func (s FlagRevisionList) MarshalJSON() ([]byte, error) {
999 type NoMethod FlagRevisionList
1000 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1001 }
1002
1003 // FlagSetList: Wrapper for a list of flag sets.
1004 type FlagSetList struct {
1005 // Sets: Required. Flag sets to be rolled out.
1006 Sets []string `json:"sets,omitempty"`
1007 // ForceSendFields is a list of field names (e.g. "Sets") to unconditionally
1008 // include in API requests. By default, fields with empty or default values are
1009 // omitted from API requests. See
1010 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1011 // details.
1012 ForceSendFields []string `json:"-"`
1013 // NullFields is a list of field names (e.g. "Sets") to include in API requests
1014 // with the JSON null value. By default, fields with empty values are omitted
1015 // from API requests. See
1016 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1017 NullFields []string `json:"-"`
1018 }
1019
1020 func (s FlagSetList) MarshalJSON() ([]byte, error) {
1021 type NoMethod FlagSetList
1022 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1023 }
1024
1025 // FlagUpdate: FlagUpdate is a UnitOperation that pushes new flag values to
1026 // Units.
1027 type FlagUpdate struct {
1028 // FlagRelease: Required. Flag release being applied by UnitOperation.
1029 FlagRelease string `json:"flagRelease,omitempty"`
1030 // ForceSendFields is a list of field names (e.g. "FlagRelease") to
1031 // unconditionally include in API requests. By default, fields with empty or
1032 // default values are omitted from API requests. See
1033 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1034 // details.
1035 ForceSendFields []string `json:"-"`
1036 // NullFields is a list of field names (e.g. "FlagRelease") to include in API
1037 // requests with the JSON null value. By default, fields with empty values are
1038 // omitted from API requests. See
1039 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1040 NullFields []string `json:"-"`
1041 }
1042
1043 func (s FlagUpdate) MarshalJSON() ([]byte, error) {
1044 type NoMethod FlagUpdate
1045 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1046 }
1047
1048 // FlagVariant: Variant is an identifier for a value (name assigned to a
1049 // value).
1050 type FlagVariant struct {
1051 // BooleanValue: Optional. Boolean variant value.
1052 BooleanValue bool `json:"booleanValue,omitempty"`
1053 // Description: Optional. A human-readable description of what this variant
1054 // does or represents.
1055 Description string `json:"description,omitempty"`
1056 // DoubleValue: Optional. Double variant value.
1057 DoubleValue float64 `json:"doubleValue,omitempty"`
1058 // Id: Required. Variant ID. Max length: 128 bytes.
1059 Id string `json:"id,omitempty"`
1060 // IntegerValue: Optional. Integer variant value.
1061 IntegerValue int64 `json:"integerValue,omitempty,string"`
1062 // StringValue: Optional. String variant value.
1063 StringValue string `json:"stringValue,omitempty"`
1064 // TrackingId: Optional. trackingId is unique depending on name and value of
1065 // the variant within the scope of the service. It is typically generated by
1066 // the server and must not be changed. trackingId is used to uniquely identify
1067 // and track variants.
1068 TrackingId string `json:"trackingId,omitempty"`
1069 // ForceSendFields is a list of field names (e.g. "BooleanValue") to
1070 // unconditionally include in API requests. By default, fields with empty or
1071 // default values are omitted from API requests. See
1072 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1073 // details.
1074 ForceSendFields []string `json:"-"`
1075 // NullFields is a list of field names (e.g. "BooleanValue") to include in API
1076 // requests with the JSON null value. By default, fields with empty values are
1077 // omitted from API requests. See
1078 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1079 NullFields []string `json:"-"`
1080 }
1081
1082 func (s FlagVariant) MarshalJSON() ([]byte, error) {
1083 type NoMethod FlagVariant
1084 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1085 }
1086
1087 func (s *FlagVariant) UnmarshalJSON(data []byte) error {
1088 type NoMethod FlagVariant
1089 var s1 struct {
1090 DoubleValue gensupport.JSONFloat64 `json:"doubleValue"`
1091 *NoMethod
1092 }
1093 s1.NoMethod = (*NoMethod)(s)
1094 if err := json.Unmarshal(data, &s1); err != nil {
1095 return err
1096 }
1097 s.DoubleValue = float64(s1.DoubleValue)
1098 return nil
1099 }
1100
1101 // FromMapping: Output variables whose values will be passed on to dependencies
1102 type FromMapping struct {
1103 // Dependency: Required. Alias of the dependency that the outputVariable will
1104 // pass its value to
1105 Dependency string `json:"dependency,omitempty"`
1106 // OutputVariable: Required. Name of the outputVariable on the dependency
1107 OutputVariable string `json:"outputVariable,omitempty"`
1108 // ForceSendFields is a list of field names (e.g. "Dependency") to
1109 // unconditionally include in API requests. By default, fields with empty or
1110 // default values are omitted from API requests. See
1111 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1112 // details.
1113 ForceSendFields []string `json:"-"`
1114 // NullFields is a list of field names (e.g. "Dependency") to include in API
1115 // requests with the JSON null value. By default, fields with empty values are
1116 // omitted from API requests. See
1117 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1118 NullFields []string `json:"-"`
1119 }
1120
1121 func (s FromMapping) MarshalJSON() ([]byte, error) {
1122 type NoMethod FromMapping
1123 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1124 }
1125
1126 // GoogleCloudLocationLocation: A resource that represents a Google Cloud
1127 // location.
1128 type GoogleCloudLocationLocation struct {
1129 // DisplayName: The friendly name for this location, typically a nearby city
1130 // name. For example, "Tokyo".
1131 DisplayName string `json:"displayName,omitempty"`
1132 // Labels: Cross-service attributes for the location. For example
1133 // {"cloud.googleapis.com/region": "us-east1"}
1134 Labels map[string]string `json:"labels,omitempty"`
1135 // LocationId: The canonical id for this location. For example: "us-east1".
1136 LocationId string `json:"locationId,omitempty"`
1137 // Metadata: Service-specific metadata. For example the available capacity at
1138 // the given location.
1139 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1140 // Name: Resource name for the location, which may vary between
1141 // implementations. For example:
1142 // "projects/example-project/locations/us-east1"
1143 Name string `json:"name,omitempty"`
1144
1145 // ServerResponse contains the HTTP response code and headers from the server.
1146 googleapi.ServerResponse `json:"-"`
1147 // ForceSendFields is a list of field names (e.g. "DisplayName") to
1148 // unconditionally include in API requests. By default, fields with empty or
1149 // default values are omitted from API requests. See
1150 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1151 // details.
1152 ForceSendFields []string `json:"-"`
1153 // NullFields is a list of field names (e.g. "DisplayName") to include in API
1154 // requests with the JSON null value. By default, fields with empty values are
1155 // omitted from API requests. See
1156 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1157 NullFields []string `json:"-"`
1158 }
1159
1160 func (s GoogleCloudLocationLocation) MarshalJSON() ([]byte, error) {
1161 type NoMethod GoogleCloudLocationLocation
1162 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1163 }
1164
1165 // ListFlagAttributesResponse: The response structure for the
1166 // ListFlagAttributes method.
1167 type ListFlagAttributesResponse struct {
1168 // FlagAttributes: The resulting flag attributes.
1169 FlagAttributes []*FlagAttribute `json:"flagAttributes,omitempty"`
1170 // NextPageToken: If present, the next page token can be provided to a
1171 // subsequent ListFlagAttributes call to list the next page. If empty, there
1172 // are no more pages.
1173 NextPageToken string `json:"nextPageToken,omitempty"`
1174 // Unreachable: Locations that could not be reached.
1175 Unreachable []string `json:"unreachable,omitempty"`
1176
1177 // ServerResponse contains the HTTP response code and headers from the server.
1178 googleapi.ServerResponse `json:"-"`
1179 // ForceSendFields is a list of field names (e.g. "FlagAttributes") to
1180 // unconditionally include in API requests. By default, fields with empty or
1181 // default values are omitted from API requests. See
1182 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1183 // details.
1184 ForceSendFields []string `json:"-"`
1185 // NullFields is a list of field names (e.g. "FlagAttributes") to include in
1186 // API requests with the JSON null value. By default, fields with empty values
1187 // are omitted from API requests. See
1188 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1189 NullFields []string `json:"-"`
1190 }
1191
1192 func (s ListFlagAttributesResponse) MarshalJSON() ([]byte, error) {
1193 type NoMethod ListFlagAttributesResponse
1194 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1195 }
1196
1197 // ListFlagReleasesResponse: The response structure for the ListFlagReleases
1198 // method.
1199 type ListFlagReleasesResponse struct {
1200 // FlagReleases: The resulting flag releases.
1201 FlagReleases []*FlagRelease `json:"flagReleases,omitempty"`
1202 // NextPageToken: If present, the next page token can be provided to a
1203 // subsequent ListFlagReleases call to list the next page. If empty, there are
1204 // no more pages.
1205 NextPageToken string `json:"nextPageToken,omitempty"`
1206 // Unreachable: Locations that could not be reached.
1207 Unreachable []string `json:"unreachable,omitempty"`
1208
1209 // ServerResponse contains the HTTP response code and headers from the server.
1210 googleapi.ServerResponse `json:"-"`
1211 // ForceSendFields is a list of field names (e.g. "FlagReleases") to
1212 // unconditionally include in API requests. By default, fields with empty or
1213 // default values are omitted from API requests. See
1214 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1215 // details.
1216 ForceSendFields []string `json:"-"`
1217 // NullFields is a list of field names (e.g. "FlagReleases") to include in API
1218 // requests with the JSON null value. By default, fields with empty values are
1219 // omitted from API requests. See
1220 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1221 NullFields []string `json:"-"`
1222 }
1223
1224 func (s ListFlagReleasesResponse) MarshalJSON() ([]byte, error) {
1225 type NoMethod ListFlagReleasesResponse
1226 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1227 }
1228
1229 // ListFlagRevisionsResponse: The response structure for the ListFlagRevisions
1230 // method.
1231 type ListFlagRevisionsResponse struct {
1232 // FlagRevisions: The resulting flag revisions.
1233 FlagRevisions []*FlagRevision `json:"flagRevisions,omitempty"`
1234 // NextPageToken: If present, the next page token can be provided to a
1235 // subsequent ListFlagRevisions call to list the next page. If empty, there are
1236 // no more pages.
1237 NextPageToken string `json:"nextPageToken,omitempty"`
1238 // Unreachable: Locations that could not be reached.
1239 Unreachable []string `json:"unreachable,omitempty"`
1240
1241 // ServerResponse contains the HTTP response code and headers from the server.
1242 googleapi.ServerResponse `json:"-"`
1243 // ForceSendFields is a list of field names (e.g. "FlagRevisions") to
1244 // unconditionally include in API requests. By default, fields with empty or
1245 // default values are omitted from API requests. See
1246 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1247 // details.
1248 ForceSendFields []string `json:"-"`
1249 // NullFields is a list of field names (e.g. "FlagRevisions") to include in API
1250 // requests with the JSON null value. By default, fields with empty values are
1251 // omitted from API requests. See
1252 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1253 NullFields []string `json:"-"`
1254 }
1255
1256 func (s ListFlagRevisionsResponse) MarshalJSON() ([]byte, error) {
1257 type NoMethod ListFlagRevisionsResponse
1258 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1259 }
1260
1261 // ListFlagsResponse: The response structure for the ListFlags method.
1262 type ListFlagsResponse struct {
1263 // Flags: The resulting flags.
1264 Flags []*Flag `json:"flags,omitempty"`
1265 // NextPageToken: If present, the next page token can be provided to a
1266 // subsequent ListFlags call to list the next page. If empty, there are no more
1267 // pages.
1268 NextPageToken string `json:"nextPageToken,omitempty"`
1269 // Unreachable: Locations that could not be reached.
1270 Unreachable []string `json:"unreachable,omitempty"`
1271
1272 // ServerResponse contains the HTTP response code and headers from the server.
1273 googleapi.ServerResponse `json:"-"`
1274 // ForceSendFields is a list of field names (e.g. "Flags") to unconditionally
1275 // include in API requests. By default, fields with empty or default values are
1276 // omitted from API requests. See
1277 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1278 // details.
1279 ForceSendFields []string `json:"-"`
1280 // NullFields is a list of field names (e.g. "Flags") to include in API
1281 // requests with the JSON null value. By default, fields with empty values are
1282 // omitted from API requests. See
1283 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1284 NullFields []string `json:"-"`
1285 }
1286
1287 func (s ListFlagsResponse) MarshalJSON() ([]byte, error) {
1288 type NoMethod ListFlagsResponse
1289 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1290 }
1291
1292 // ListLocationsResponse: The response message for Locations.ListLocations.
1293 type ListLocationsResponse struct {
1294 // Locations: A list of locations that matches the specified filter in the
1295 // request.
1296 Locations []*GoogleCloudLocationLocation `json:"locations,omitempty"`
1297 // NextPageToken: The standard List next-page token.
1298 NextPageToken string `json:"nextPageToken,omitempty"`
1299
1300 // ServerResponse contains the HTTP response code and headers from the server.
1301 googleapi.ServerResponse `json:"-"`
1302 // ForceSendFields is a list of field names (e.g. "Locations") to
1303 // unconditionally include in API requests. By default, fields with empty or
1304 // default values are omitted from API requests. See
1305 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1306 // details.
1307 ForceSendFields []string `json:"-"`
1308 // NullFields is a list of field names (e.g. "Locations") to include in API
1309 // requests with the JSON null value. By default, fields with empty values are
1310 // omitted from API requests. See
1311 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1312 NullFields []string `json:"-"`
1313 }
1314
1315 func (s ListLocationsResponse) MarshalJSON() ([]byte, error) {
1316 type NoMethod ListLocationsResponse
1317 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1318 }
1319
1320 // ListReleasesResponse: The response structure for the ListReleases method.
1321 type ListReleasesResponse struct {
1322 // NextPageToken: If present, the next page token can be provided to a
1323 // subsequent ListReleases call to list the next page. If empty, there are no
1324 // more pages.
1325 NextPageToken string `json:"nextPageToken,omitempty"`
1326 // Releases: The resulting releases.
1327 Releases []*Release `json:"releases,omitempty"`
1328 // Unreachable: Locations that could not be reached.
1329 Unreachable []string `json:"unreachable,omitempty"`
1330
1331 // ServerResponse contains the HTTP response code and headers from the server.
1332 googleapi.ServerResponse `json:"-"`
1333 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1334 // unconditionally include in API requests. By default, fields with empty or
1335 // default values are omitted from API requests. See
1336 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1337 // details.
1338 ForceSendFields []string `json:"-"`
1339 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1340 // requests with the JSON null value. By default, fields with empty values are
1341 // omitted from API requests. See
1342 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1343 NullFields []string `json:"-"`
1344 }
1345
1346 func (s ListReleasesResponse) MarshalJSON() ([]byte, error) {
1347 type NoMethod ListReleasesResponse
1348 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1349 }
1350
1351 // ListRolloutKindsResponse: The response structure for the ListRolloutKinds
1352 // method.
1353 type ListRolloutKindsResponse struct {
1354 // NextPageToken: If present, the next page token can be provided to a
1355 // subsequent ListRolloutKinds call to list the next page. If empty, there are
1356 // no more pages.
1357 NextPageToken string `json:"nextPageToken,omitempty"`
1358 // RolloutKinds: The resulting rollout kinds.
1359 RolloutKinds []*RolloutKind `json:"rolloutKinds,omitempty"`
1360 // Unreachable: Locations that could not be reached.
1361 Unreachable []string `json:"unreachable,omitempty"`
1362
1363 // ServerResponse contains the HTTP response code and headers from the server.
1364 googleapi.ServerResponse `json:"-"`
1365 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1366 // unconditionally include in API requests. By default, fields with empty or
1367 // default values are omitted from API requests. See
1368 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1369 // details.
1370 ForceSendFields []string `json:"-"`
1371 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1372 // requests with the JSON null value. By default, fields with empty values are
1373 // omitted from API requests. See
1374 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1375 NullFields []string `json:"-"`
1376 }
1377
1378 func (s ListRolloutKindsResponse) MarshalJSON() ([]byte, error) {
1379 type NoMethod ListRolloutKindsResponse
1380 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1381 }
1382
1383 // ListRolloutsResponse: The response structure for the ListRollouts method.
1384 type ListRolloutsResponse struct {
1385 // NextPageToken: If present, the next page token can be provided to a
1386 // subsequent ListRollouts call to list the next page. If empty, there are no
1387 // more pages.
1388 NextPageToken string `json:"nextPageToken,omitempty"`
1389 // Rollouts: The resulting rollouts.
1390 Rollouts []*Rollout `json:"rollouts,omitempty"`
1391 // Unreachable: Locations that could not be reached.
1392 Unreachable []string `json:"unreachable,omitempty"`
1393
1394 // ServerResponse contains the HTTP response code and headers from the server.
1395 googleapi.ServerResponse `json:"-"`
1396 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1397 // unconditionally include in API requests. By default, fields with empty or
1398 // default values are omitted from API requests. See
1399 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1400 // details.
1401 ForceSendFields []string `json:"-"`
1402 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1403 // requests with the JSON null value. By default, fields with empty values are
1404 // omitted from API requests. See
1405 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1406 NullFields []string `json:"-"`
1407 }
1408
1409 func (s ListRolloutsResponse) MarshalJSON() ([]byte, error) {
1410 type NoMethod ListRolloutsResponse
1411 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1412 }
1413
1414 // ListSaasResponse: The response structure for the ListSaas method.
1415 type ListSaasResponse struct {
1416 // NextPageToken: If present, the next page token can be provided to a
1417 // subsequent ListSaas call to list the next page. If empty, there are no more
1418 // pages.
1419 NextPageToken string `json:"nextPageToken,omitempty"`
1420 // Saas: The resulting saas.
1421 Saas []*Saas `json:"saas,omitempty"`
1422 // Unreachable: Locations that could not be reached.
1423 Unreachable []string `json:"unreachable,omitempty"`
1424
1425 // ServerResponse contains the HTTP response code and headers from the server.
1426 googleapi.ServerResponse `json:"-"`
1427 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1428 // unconditionally include in API requests. By default, fields with empty or
1429 // default values are omitted from API requests. See
1430 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1431 // details.
1432 ForceSendFields []string `json:"-"`
1433 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1434 // requests with the JSON null value. By default, fields with empty values are
1435 // omitted from API requests. See
1436 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1437 NullFields []string `json:"-"`
1438 }
1439
1440 func (s ListSaasResponse) MarshalJSON() ([]byte, error) {
1441 type NoMethod ListSaasResponse
1442 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1443 }
1444
1445 // ListTenantsResponse: The response structure for the ListTenants method.
1446 type ListTenantsResponse struct {
1447 // NextPageToken: If present, the next page token can be provided to a
1448 // subsequent ListTenants call to list the next page. If empty, there are no
1449 // more pages.
1450 NextPageToken string `json:"nextPageToken,omitempty"`
1451 // Tenants: The resulting tenants.
1452 Tenants []*Tenant `json:"tenants,omitempty"`
1453 // Unreachable: Locations that could not be reached.
1454 Unreachable []string `json:"unreachable,omitempty"`
1455
1456 // ServerResponse contains the HTTP response code and headers from the server.
1457 googleapi.ServerResponse `json:"-"`
1458 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1459 // unconditionally include in API requests. By default, fields with empty or
1460 // default values are omitted from API requests. See
1461 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1462 // details.
1463 ForceSendFields []string `json:"-"`
1464 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1465 // requests with the JSON null value. By default, fields with empty values are
1466 // omitted from API requests. See
1467 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1468 NullFields []string `json:"-"`
1469 }
1470
1471 func (s ListTenantsResponse) MarshalJSON() ([]byte, error) {
1472 type NoMethod ListTenantsResponse
1473 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1474 }
1475
1476 // ListUnitKindsResponse: The response structure for the ListUnitKinds method.
1477 type ListUnitKindsResponse struct {
1478 // NextPageToken: If present, the next page token can be provided to a
1479 // subsequent ListUnitKinds call to list the next page. If empty, there are no
1480 // more pages.
1481 NextPageToken string `json:"nextPageToken,omitempty"`
1482 // UnitKinds: The resulting unit kinds.
1483 UnitKinds []*UnitKind `json:"unitKinds,omitempty"`
1484 // Unreachable: Locations that could not be reached.
1485 Unreachable []string `json:"unreachable,omitempty"`
1486
1487 // ServerResponse contains the HTTP response code and headers from the server.
1488 googleapi.ServerResponse `json:"-"`
1489 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1490 // unconditionally include in API requests. By default, fields with empty or
1491 // default values are omitted from API requests. See
1492 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1493 // details.
1494 ForceSendFields []string `json:"-"`
1495 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1496 // requests with the JSON null value. By default, fields with empty values are
1497 // omitted from API requests. See
1498 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1499 NullFields []string `json:"-"`
1500 }
1501
1502 func (s ListUnitKindsResponse) MarshalJSON() ([]byte, error) {
1503 type NoMethod ListUnitKindsResponse
1504 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1505 }
1506
1507 // ListUnitOperationsResponse: The response structure for the
1508 // ListUnitOperations method.
1509 type ListUnitOperationsResponse struct {
1510 // NextPageToken: If present, the next page token can be provided to a
1511 // subsequent ListUnitOperations call to list the next page. If empty, there
1512 // are no more pages.
1513 NextPageToken string `json:"nextPageToken,omitempty"`
1514 // UnitOperations: The resulting unit operations.
1515 UnitOperations []*UnitOperation `json:"unitOperations,omitempty"`
1516 // Unreachable: Locations that could not be reached.
1517 Unreachable []string `json:"unreachable,omitempty"`
1518
1519 // ServerResponse contains the HTTP response code and headers from the server.
1520 googleapi.ServerResponse `json:"-"`
1521 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1522 // unconditionally include in API requests. By default, fields with empty or
1523 // default values are omitted from API requests. See
1524 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1525 // details.
1526 ForceSendFields []string `json:"-"`
1527 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1528 // requests with the JSON null value. By default, fields with empty values are
1529 // omitted from API requests. See
1530 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1531 NullFields []string `json:"-"`
1532 }
1533
1534 func (s ListUnitOperationsResponse) MarshalJSON() ([]byte, error) {
1535 type NoMethod ListUnitOperationsResponse
1536 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1537 }
1538
1539 // ListUnitsResponse: The response structure for the ListUnits method.
1540 type ListUnitsResponse struct {
1541 // NextPageToken: If present, the next page token can be provided to a
1542 // subsequent ListUnits call to list the next page. If empty, there are no more
1543 // pages.
1544 NextPageToken string `json:"nextPageToken,omitempty"`
1545 // Units: The resulting units.
1546 Units []*Unit `json:"units,omitempty"`
1547 // Unreachable: Locations that could not be reached.
1548 Unreachable []string `json:"unreachable,omitempty"`
1549
1550 // ServerResponse contains the HTTP response code and headers from the server.
1551 googleapi.ServerResponse `json:"-"`
1552 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1553 // unconditionally include in API requests. By default, fields with empty or
1554 // default values are omitted from API requests. See
1555 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1556 // details.
1557 ForceSendFields []string `json:"-"`
1558 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1559 // requests with the JSON null value. By default, fields with empty values are
1560 // omitted from API requests. See
1561 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1562 NullFields []string `json:"-"`
1563 }
1564
1565 func (s ListUnitsResponse) MarshalJSON() ([]byte, error) {
1566 type NoMethod ListUnitsResponse
1567 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1568 }
1569
1570 // Location: Location information that the service is available in.
1571 type Location struct {
1572 // Name: Optional. Name of location.
1573 Name string `json:"name,omitempty"`
1574 // ForceSendFields is a list of field names (e.g. "Name") to unconditionally
1575 // include in API requests. By default, fields with empty or default values are
1576 // omitted from API requests. See
1577 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1578 // details.
1579 ForceSendFields []string `json:"-"`
1580 // NullFields is a list of field names (e.g. "Name") to include in API requests
1581 // with the JSON null value. By default, fields with empty values are omitted
1582 // from API requests. See
1583 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1584 NullFields []string `json:"-"`
1585 }
1586
1587 func (s Location) MarshalJSON() ([]byte, error) {
1588 type NoMethod Location
1589 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1590 }
1591
1592 // MaintenanceSettings: Captures requested directives for performing future
1593 // maintenance on the unit. This includes a request for the unit to skip
1594 // maintenance for a period of time and remain pinned to its current release as
1595 // well as controls for postponing maintenance scheduled in future.
1596 type MaintenanceSettings struct {
1597 // PinnedUntilTime: Optional. If present, it fixes the release on the unit
1598 // until the given time; i.e. changes to the release field will be rejected.
1599 // Rollouts should and will also respect this by not requesting an upgrade in
1600 // the first place.
1601 PinnedUntilTime string `json:"pinnedUntilTime,omitempty"`
1602 // ForceSendFields is a list of field names (e.g. "PinnedUntilTime") to
1603 // unconditionally include in API requests. By default, fields with empty or
1604 // default values are omitted from API requests. See
1605 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1606 // details.
1607 ForceSendFields []string `json:"-"`
1608 // NullFields is a list of field names (e.g. "PinnedUntilTime") to include in
1609 // API requests with the JSON null value. By default, fields with empty values
1610 // are omitted from API requests. See
1611 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1612 NullFields []string `json:"-"`
1613 }
1614
1615 func (s MaintenanceSettings) MarshalJSON() ([]byte, error) {
1616 type NoMethod MaintenanceSettings
1617 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1618 }
1619
1620 // Provision: Provision is the unit operation that provision the underlying
1621 // resources represented by a Unit. Can only execute if the Unit is not
1622 // currently provisioned.
1623 type Provision struct {
1624 // InputVariables: Optional. Set of input variables. Maximum 100. (optional)
1625 InputVariables []*UnitVariable `json:"inputVariables,omitempty"`
1626 // Release: Optional. Reference to the Release object to use for the Unit.
1627 // (optional).
1628 Release string `json:"release,omitempty"`
1629 // ForceSendFields is a list of field names (e.g. "InputVariables") to
1630 // unconditionally include in API requests. By default, fields with empty or
1631 // default values are omitted from API requests. See
1632 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1633 // details.
1634 ForceSendFields []string `json:"-"`
1635 // NullFields is a list of field names (e.g. "InputVariables") to include in
1636 // API requests with the JSON null value. By default, fields with empty values
1637 // are omitted from API requests. See
1638 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1639 NullFields []string `json:"-"`
1640 }
1641
1642 func (s Provision) MarshalJSON() ([]byte, error) {
1643 type NoMethod Provision
1644 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1645 }
1646
1647 // Release: A new version to be propagated and deployed to units. This includes
1648 // pointers to packaged blueprints for actuation (e.g Helm or Terraform
1649 // configuration packages) via artifact registry.
1650 type Release struct {
1651 // Annotations: Optional. Annotations is an unstructured key-value map stored
1652 // with a resource that may be set by external tools to store and retrieve
1653 // arbitrary metadata. They are not queryable and should be preserved when
1654 // modifying objects. More info:
1655 // https://kubernetes.io/docs/user-guide/annotations
1656 Annotations map[string]string `json:"annotations,omitempty"`
1657 // ApplicationTemplateComponent: Output only. Reference to component and
1658 // revision in a composite ApplicationTemplate.
1659 ApplicationTemplateComponent *ComponentRef `json:"applicationTemplateComponent,omitempty"`
1660 // Blueprint: Optional. Blueprints are OCI Images that contain all of the
1661 // artifacts needed to provision a unit.
1662 Blueprint *Blueprint `json:"blueprint,omitempty"`
1663 // CreateTime: Output only. The timestamp when the resource was created.
1664 CreateTime string `json:"createTime,omitempty"`
1665 // Etag: Output only. An opaque value that uniquely identifies a version or
1666 // generation of a resource. It can be used to confirm that the client and
1667 // server agree on the ordering of a resource being written.
1668 Etag string `json:"etag,omitempty"`
1669 // InputVariableDefaults: Optional. Mapping of input variables to default
1670 // values. Maximum 100
1671 InputVariableDefaults []*UnitVariable `json:"inputVariableDefaults,omitempty"`
1672 // InputVariables: Optional. Output only. List of input variables declared on
1673 // the blueprint and can be present with their values on the unit spec
1674 InputVariables []*UnitVariable `json:"inputVariables,omitempty"`
1675 // Labels: Optional. The labels on the resource, which can be used for
1676 // categorization. similar to Kubernetes resource labels.
1677 Labels map[string]string `json:"labels,omitempty"`
1678 // Name: Identifier. The resource name (full URI of the resource) following the
1679 // standard naming scheme:
1680 // "projects/{project}/locations/{location}/releases/{release}"
1681 Name string `json:"name,omitempty"`
1682 // OutputVariables: Optional. Output only. List of output variables declared on
1683 // the blueprint and can be present with their values on the unit status
1684 OutputVariables []*UnitVariable `json:"outputVariables,omitempty"`
1685 // ReleaseRequirements: Optional. Set of requirements to be fulfilled on the
1686 // Unit when using this Release.
1687 ReleaseRequirements *ReleaseRequirements `json:"releaseRequirements,omitempty"`
1688 // Uid: Output only. The unique identifier of the resource. UID is unique in
1689 // the time and space for this resource within the scope of the service. It is
1690 // typically generated by the server on successful creation of a resource and
1691 // must not be changed. UID is used to uniquely identify resources with
1692 // resource name reuses. This should be a UUID4.
1693 Uid string `json:"uid,omitempty"`
1694 // UnitKind: Required. Immutable. Reference to the UnitKind this Release
1695 // corresponds to (required and immutable once created).
1696 UnitKind string `json:"unitKind,omitempty"`
1697 // UpdateTime: Output only. The timestamp when the resource was last updated.
1698 // Any change to the resource made by users must refresh this value. Changes to
1699 // a resource made by the service should refresh this value.
1700 UpdateTime string `json:"updateTime,omitempty"`
1701
1702 // ServerResponse contains the HTTP response code and headers from the server.
1703 googleapi.ServerResponse `json:"-"`
1704 // ForceSendFields is a list of field names (e.g. "Annotations") to
1705 // unconditionally include in API requests. By default, fields with empty or
1706 // default values are omitted from API requests. See
1707 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1708 // details.
1709 ForceSendFields []string `json:"-"`
1710 // NullFields is a list of field names (e.g. "Annotations") to include in API
1711 // requests with the JSON null value. By default, fields with empty values are
1712 // omitted from API requests. See
1713 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1714 NullFields []string `json:"-"`
1715 }
1716
1717 func (s Release) MarshalJSON() ([]byte, error) {
1718 type NoMethod Release
1719 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1720 }
1721
1722 // ReleaseRequirements: Set of requirements to be fulfilled on the Unit when
1723 // using this Release.
1724 type ReleaseRequirements struct {
1725 // UpgradeableFromReleases: Optional. A list of releases from which a unit can
1726 // be upgraded to this one (optional). If left empty no constraints will be
1727 // applied. When provided, unit upgrade requests to this release will check and
1728 // enforce this constraint.
1729 UpgradeableFromReleases []string `json:"upgradeableFromReleases,omitempty"`
1730 // ForceSendFields is a list of field names (e.g. "UpgradeableFromReleases") to
1731 // unconditionally include in API requests. By default, fields with empty or
1732 // default values are omitted from API requests. See
1733 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1734 // details.
1735 ForceSendFields []string `json:"-"`
1736 // NullFields is a list of field names (e.g. "UpgradeableFromReleases") to
1737 // include in API requests with the JSON null value. By default, fields with
1738 // empty values are omitted from API requests. See
1739 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1740 NullFields []string `json:"-"`
1741 }
1742
1743 func (s ReleaseRequirements) MarshalJSON() ([]byte, error) {
1744 type NoMethod ReleaseRequirements
1745 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1746 }
1747
1748 // Rollout: Represents a single rollout execution and its results
1749 type Rollout struct {
1750 // Annotations: Optional. Annotations is an unstructured key-value map stored
1751 // with a resource that may be set by external tools to store and retrieve
1752 // arbitrary metadata. They are not queryable and should be preserved when
1753 // modifying objects. More info:
1754 // https://kubernetes.io/docs/user-guide/annotations
1755 Annotations map[string]string `json:"annotations,omitempty"`
1756 // Control: Optional. Requested change to the execution of this rollout.
1757 // Default RolloutControl.action is ROLLOUT_ACTION_RUN meaning the rollout will
1758 // be executed to completion while progressing through all natural Rollout
1759 // States (such as RUNNING -> SUCCEEDED or RUNNING -> FAILED). Requests can
1760 // only be made when the Rollout is in a non-terminal state.
1761 Control *RolloutControl `json:"control,omitempty"`
1762 // CreateTime: Output only. The timestamp when the resource was created.
1763 CreateTime string `json:"createTime,omitempty"`
1764 // DeleteTime: Output only. The timestamp when the resource was marked for
1765 // deletion (deletion is an asynchronous operation).
1766 DeleteTime string `json:"deleteTime,omitempty"`
1767 // EffectiveUnitFilter: Optional. Output only. Output only snapshot of the
1768 // effective unit filter at Rollout start time. Contains a
1769 // CEL(https://github.com/google/cel-spec) expression consisting of a
1770 // conjunction of Rollout.unit_filter and RolloutKind.unit_filter. This field
1771 // captures the filter applied by the Rollout to determine the Unit population.
1772 // If the associated RolloutKind's unit_filter is modified after the rollout is
1773 // started, it will not be updated here.
1774 EffectiveUnitFilter string `json:"effectiveUnitFilter,omitempty"`
1775 // EndTime: Optional. Output only. The time when the rollout finished execution
1776 // (regardless of success, failure, or cancellation). Will be empty if the
1777 // rollout hasn't finished yet. Once set, the rollout is in terminal state and
1778 // all the results are final.
1779 EndTime string `json:"endTime,omitempty"`
1780 // Etag: Output only. An opaque value that uniquely identifies a version or
1781 // generation of a resource. It can be used to confirm that the client and
1782 // server agree on the ordering of a resource being written.
1783 Etag string `json:"etag,omitempty"`
1784 // FlagRelease: Optional. Immutable. Name of the FlagRelease to be rolled out
1785 // to the target Units. Release and FlagRelease are mutually exclusive. Note:
1786 // `release` comment needs to be adjusted to mention that "Release and
1787 // FlagRelease are mutually exclusive" when visibility restriction will be
1788 // lifted.
1789 FlagRelease string `json:"flagRelease,omitempty"`
1790 // Labels: Optional. The labels on the resource, which can be used for
1791 // categorization. similar to Kubernetes resource labels.
1792 Labels map[string]string `json:"labels,omitempty"`
1793 // Name: Identifier. The resource name (full URI of the resource) following the
1794 // standard naming scheme:
1795 // "projects/{project}/locations/{location}/rollout/{rollout_id}"
1796 Name string `json:"name,omitempty"`
1797 // ParentRollout: Optional. Output only. The direct parent rollout that this
1798 // rollout is stemming from. The resource name (full URI of the resource)
1799 // following the standard naming scheme:
1800 // "projects/{project}/locations/{location}/rollouts/{rollout_id}"
1801 ParentRollout string `json:"parentRollout,omitempty"`
1802 // Release: Optional. Immutable. Name of the Release that gets rolled out to
1803 // target Units. Required if no other type of release is specified.
1804 Release string `json:"release,omitempty"`
1805 // RolloutKind: Required. Immutable. Name of the RolloutKind this rollout is
1806 // stemming from and adhering to.
1807 RolloutKind string `json:"rolloutKind,omitempty"`
1808 // RolloutOrchestrationStrategy: Optional. The strategy used for executing this
1809 // Rollout. This strategy will override whatever strategy is specified in the
1810 // RolloutKind. If not specified on creation, the strategy from RolloutKind
1811 // will be used. There are two supported values strategies which are used to
1812 // control - "Google.Cloud.Simple.AllAtOnce" -
1813 // "Google.Cloud.Simple.OneLocationAtATime" A rollout with one of these simple
1814 // strategies will rollout across all locations defined in the targeted
1815 // UnitKind's Saas Locations.
1816 RolloutOrchestrationStrategy string `json:"rolloutOrchestrationStrategy,omitempty"`
1817 // RootRollout: Optional. Output only. The root rollout that this rollout is
1818 // stemming from. The resource name (full URI of the resource) following the
1819 // standard naming scheme:
1820 // "projects/{project}/locations/{location}/rollouts/{rollout_id}"
1821 RootRollout string `json:"rootRollout,omitempty"`
1822 // StartTime: Optional. Output only. The time when the rollout started
1823 // executing. Will be empty if the rollout hasn't started yet.
1824 StartTime string `json:"startTime,omitempty"`
1825 // State: Output only. Current state of the rollout.
1826 //
1827 // Possible values:
1828 // "ROLLOUT_STATE_UNSPECIFIED" - Unspecified state.
1829 // "ROLLOUT_STATE_RUNNING" - Rollout is in progress.
1830 // "ROLLOUT_STATE_PAUSED" - Rollout has been paused.
1831 // "ROLLOUT_STATE_SUCCEEDED" - Rollout completed successfully.
1832 // "ROLLOUT_STATE_FAILED" - Rollout has failed.
1833 // "ROLLOUT_STATE_CANCELLED" - Rollout has been canceled.
1834 // "ROLLOUT_STATE_WAITING" - Rollout is waiting for some condition to be met
1835 // before starting.
1836 // "ROLLOUT_STATE_CANCELLING" - Rollout is being canceled.
1837 // "ROLLOUT_STATE_RESUMING" - Rollout is being resumed.
1838 // "ROLLOUT_STATE_PAUSING" - Rollout is being paused.
1839 State string `json:"state,omitempty"`
1840 // StateMessage: Output only. Human readable message indicating details about
1841 // the last state transition.
1842 StateMessage string `json:"stateMessage,omitempty"`
1843 // StateTransitionTime: Optional. Output only. The time when the rollout
1844 // transitioned into its current state.
1845 StateTransitionTime string `json:"stateTransitionTime,omitempty"`
1846 // Stats: Optional. Output only. Details about the progress of the rollout.
1847 Stats *RolloutStats `json:"stats,omitempty"`
1848 // Uid: Output only. The unique identifier of the resource. UID is unique in
1849 // the time and space for this resource within the scope of the service. It is
1850 // typically generated by the server on successful creation of a resource and
1851 // must not be changed. UID is used to uniquely identify resources with
1852 // resource name reuses. This should be a UUID4.
1853 Uid string `json:"uid,omitempty"`
1854 // UnitFilter: Optional. CEL(https://github.com/google/cel-spec) formatted
1855 // filter string against Unit. The filter will be applied to determine the
1856 // eligible unit population. This filter can only reduce, but not expand the
1857 // scope of the rollout. If not provided, the unit_filter from the RolloutKind
1858 // will be used.
1859 UnitFilter string `json:"unitFilter,omitempty"`
1860 // UpdateTime: Output only. The timestamp when the resource was last updated.
1861 // Any change to the resource made by users must refresh this value. Changes to
1862 // a resource made by the service should refresh this value.
1863 UpdateTime string `json:"updateTime,omitempty"`
1864
1865 // ServerResponse contains the HTTP response code and headers from the server.
1866 googleapi.ServerResponse `json:"-"`
1867 // ForceSendFields is a list of field names (e.g. "Annotations") to
1868 // unconditionally include in API requests. By default, fields with empty or
1869 // default values are omitted from API requests. See
1870 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1871 // details.
1872 ForceSendFields []string `json:"-"`
1873 // NullFields is a list of field names (e.g. "Annotations") to include in API
1874 // requests with the JSON null value. By default, fields with empty values are
1875 // omitted from API requests. See
1876 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1877 NullFields []string `json:"-"`
1878 }
1879
1880 func (s Rollout) MarshalJSON() ([]byte, error) {
1881 type NoMethod Rollout
1882 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1883 }
1884
1885 // RolloutControl: RolloutControl provides a way to request a change to the
1886 // execution of a Rollout by pausing or canceling it.
1887 type RolloutControl struct {
1888 // Action: Required. Action to be performed on the Rollout. The default
1889 // behavior is to run the rollout until it naturally reaches a terminal state.
1890 //
1891 // Possible values:
1892 // "ROLLOUT_ACTION_UNSPECIFIED" - Unspecified action, will be treated as RUN
1893 // by default.
1894 // "ROLLOUT_ACTION_RUN" - Run the Rollout until it naturally reaches a
1895 // terminal state. A rollout requested to run will progress through all natural
1896 // Rollout States (such as RUNNING -> SUCCEEDED or RUNNING -> FAILED). If
1897 // retriable errors are encountered during the rollout, the rollout will paused
1898 // by default and can be resumed by re-requesting this RUN action.
1899 // "ROLLOUT_ACTION_PAUSE" - Pause the Rollout until it is resumed (i.e. RUN
1900 // is requested).
1901 // "ROLLOUT_ACTION_CANCEL" - Cancel the Rollout permanently.
1902 Action string `json:"action,omitempty"`
1903 // RunParams: Optional. Parameters for the RUN action. It is an error to
1904 // specify this if the RolloutAction is not set to RUN. By default, the rollout
1905 // will retry failed operations when resumed.
1906 RunParams *RunRolloutActionParams `json:"runParams,omitempty"`
1907 // ForceSendFields is a list of field names (e.g. "Action") to unconditionally
1908 // include in API requests. By default, fields with empty or default values are
1909 // omitted from API requests. See
1910 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1911 // details.
1912 ForceSendFields []string `json:"-"`
1913 // NullFields is a list of field names (e.g. "Action") to include in API
1914 // requests with the JSON null value. By default, fields with empty values are
1915 // omitted from API requests. See
1916 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1917 NullFields []string `json:"-"`
1918 }
1919
1920 func (s RolloutControl) MarshalJSON() ([]byte, error) {
1921 type NoMethod RolloutControl
1922 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1923 }
1924
1925 // RolloutKind: An object that describes various settings of Rollout execution.
1926 // Includes built-in policies across GCP and GDC, and customizable policies.
1927 type RolloutKind struct {
1928 // Annotations: Optional. Annotations is an unstructured key-value map stored
1929 // with a resource that may be set by external tools to store and retrieve
1930 // arbitrary metadata. They are not queryable and should be preserved when
1931 // modifying objects. More info:
1932 // https://kubernetes.io/docs/user-guide/annotations
1933 Annotations map[string]string `json:"annotations,omitempty"`
1934 // CreateTime: Output only. The timestamp when the resource was created.
1935 CreateTime string `json:"createTime,omitempty"`
1936 // ErrorBudget: Optional. The configuration for error budget. If the number of
1937 // failed units exceeds max(allowed_count, allowed_ratio * total_units), the
1938 // rollout will be paused. If not set, all units will be attempted to be
1939 // updated regardless of the number of failures encountered.
1940 ErrorBudget *ErrorBudget `json:"errorBudget,omitempty"`
1941 // Etag: Output only. An opaque value that uniquely identifies a version or
1942 // generation of a resource. It can be used to confirm that the client and
1943 // server agree on the ordering of a resource being written.
1944 Etag string `json:"etag,omitempty"`
1945 // Labels: Optional. The labels on the resource, which can be used for
1946 // categorization. similar to Kubernetes resource labels.
1947 Labels map[string]string `json:"labels,omitempty"`
1948 // Name: Identifier. The resource name (full URI of the resource) following the
1949 // standard naming scheme:
1950 // "projects/{project}/locations/{location}/rolloutKinds/{rollout_kind_id}"
1951 Name string `json:"name,omitempty"`
1952 // RolloutOrchestrationStrategy: Optional. The strategy used for executing a
1953 // Rollout. This is a required field. There are two supported values strategies
1954 // which are used to control - "Google.Cloud.Simple.AllAtOnce" -
1955 // "Google.Cloud.Simple.OneLocationAtATime" A rollout with one of these simple
1956 // strategies will rollout across all locations defined in the associated
1957 // UnitKind's Saas Locations.
1958 RolloutOrchestrationStrategy string `json:"rolloutOrchestrationStrategy,omitempty"`
1959 // Uid: Output only. The unique identifier of the resource. UID is unique in
1960 // the time and space for this resource within the scope of the service. It is
1961 // typically generated by the server on successful creation of a resource and
1962 // must not be changed. UID is used to uniquely identify resources with
1963 // resource name reuses. This should be a UUID4.
1964 Uid string `json:"uid,omitempty"`
1965 // UnitFilter: Optional. CEL(https://github.com/google/cel-spec) formatted
1966 // filter string against Unit. The filter will be applied to determine the
1967 // eligible unit population. This filter can only reduce, but not expand the
1968 // scope of the rollout.
1969 UnitFilter string `json:"unitFilter,omitempty"`
1970 // UnitKind: Required. Immutable. UnitKind that this rollout kind corresponds
1971 // to. Rollouts stemming from this rollout kind will target the units of this
1972 // unit kind. In other words, this defines the population of target units to be
1973 // upgraded by rollouts.
1974 UnitKind string `json:"unitKind,omitempty"`
1975 // UpdateTime: Output only. The timestamp when the resource was last updated.
1976 // Any change to the resource made by users must refresh this value. Changes to
1977 // a resource made by the service should refresh this value.
1978 UpdateTime string `json:"updateTime,omitempty"`
1979 // UpdateUnitKindStrategy: Optional. The config for updating the unit kind. By
1980 // default, the unit kind will be updated on the rollout start.
1981 //
1982 // Possible values:
1983 // "UPDATE_UNIT_KIND_STRATEGY_UNSPECIFIED" - Strategy unspecified.
1984 // "UPDATE_UNIT_KIND_STRATEGY_ON_START" - Update the unit kind strategy on
1985 // the rollout start.
1986 // "UPDATE_UNIT_KIND_STRATEGY_NEVER" - Never update the unit kind.
1987 UpdateUnitKindStrategy string `json:"updateUnitKindStrategy,omitempty"`
1988
1989 // ServerResponse contains the HTTP response code and headers from the server.
1990 googleapi.ServerResponse `json:"-"`
1991 // ForceSendFields is a list of field names (e.g. "Annotations") to
1992 // unconditionally include in API requests. By default, fields with empty or
1993 // default values are omitted from API requests. See
1994 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1995 // details.
1996 ForceSendFields []string `json:"-"`
1997 // NullFields is a list of field names (e.g. "Annotations") to include in API
1998 // requests with the JSON null value. By default, fields with empty values are
1999 // omitted from API requests. See
2000 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2001 NullFields []string `json:"-"`
2002 }
2003
2004 func (s RolloutKind) MarshalJSON() ([]byte, error) {
2005 type NoMethod RolloutKind
2006 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2007 }
2008
2009 // RolloutStats: RolloutStats contains information about the progress of a
2010 // rollout.
2011 type RolloutStats struct {
2012 // EstimatedTotalUnitCount: Optional. Output only. Estimated number of units
2013 // based. The estimation is computed upon creation of the rollout.
2014 EstimatedTotalUnitCount int64 `json:"estimatedTotalUnitCount,omitempty,string"`
2015 // OperationsByState: Optional. Output only. Unordered list. A breakdown of the
2016 // progress of operations triggered by the rollout. Provides a count of
2017 // Operations by their state. This can be used to determine the number of units
2018 // which have been updated, or are scheduled to be updated. There will be at
2019 // most one entry per group. Possible values for operation groups are: -
2020 // "SCHEDULED" - "PENDING" - "RUNNING" - "SUCCEEDED" - "FAILED" - "CANCELLED"
2021 OperationsByState []*Aggregate `json:"operationsByState,omitempty"`
2022 // ForceSendFields is a list of field names (e.g. "EstimatedTotalUnitCount") to
2023 // unconditionally include in API requests. By default, fields with empty or
2024 // default values are omitted from API requests. See
2025 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2026 // details.
2027 ForceSendFields []string `json:"-"`
2028 // NullFields is a list of field names (e.g. "EstimatedTotalUnitCount") to
2029 // include in API requests with the JSON null value. By default, fields with
2030 // empty values are omitted from API requests. See
2031 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2032 NullFields []string `json:"-"`
2033 }
2034
2035 func (s RolloutStats) MarshalJSON() ([]byte, error) {
2036 type NoMethod RolloutStats
2037 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2038 }
2039
2040 // RunRolloutActionParams: Parameters for the RUN action controlling the
2041 // behavior of the rollout when it is resumed from a PAUSED state.
2042 type RunRolloutActionParams struct {
2043 // RetryFailedOperations: Required. If true, the rollout will retry failed
2044 // operations when resumed. This is applicable only the current state of the
2045 // Rollout is PAUSED and the requested action is RUN.
2046 RetryFailedOperations bool `json:"retryFailedOperations,omitempty"`
2047 // ForceSendFields is a list of field names (e.g. "RetryFailedOperations") to
2048 // unconditionally include in API requests. By default, fields with empty or
2049 // default values are omitted from API requests. See
2050 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2051 // details.
2052 ForceSendFields []string `json:"-"`
2053 // NullFields is a list of field names (e.g. "RetryFailedOperations") to
2054 // include in API requests with the JSON null value. By default, fields with
2055 // empty values are omitted from API requests. See
2056 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2057 NullFields []string `json:"-"`
2058 }
2059
2060 func (s RunRolloutActionParams) MarshalJSON() ([]byte, error) {
2061 type NoMethod RunRolloutActionParams
2062 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2063 }
2064
2065 // Saas: Saas is a representation of a SaaS service managed by the Producer.
2066 type Saas struct {
2067 // Annotations: Optional. Annotations is an unstructured key-value map stored
2068 // with a resource that may be set by external tools to store and retrieve
2069 // arbitrary metadata. They are not queryable and should be preserved when
2070 // modifying objects. More info:
2071 // https://kubernetes.io/docs/user-guide/annotations
2072 Annotations map[string]string `json:"annotations,omitempty"`
2073 // ApplicationTemplate: Reference to composite ApplicationTemplate. When
2074 // specified, the template components will be imported into their equivalent
2075 // UnitKind, Release and Blueprint resources. Deleted references will not
2076 // delete imported resources. Should only be specified on source regions, and
2077 // be unspecified on replica regions.
2078 ApplicationTemplate *CompositeRef `json:"applicationTemplate,omitempty"`
2079 // BlueprintRepo: Output only. Name of repository in Artifact Registry for
2080 // system-generated Blueprints, eg. Blueprints of imported
2081 // ApplicationTemplates.
2082 BlueprintRepo string `json:"blueprintRepo,omitempty"`
2083 // Conditions: Output only. A set of conditions which indicate the various
2084 // conditions this resource can have.
2085 Conditions []*SaasCondition `json:"conditions,omitempty"`
2086 // CreateTime: Output only. The timestamp when the resource was created.
2087 CreateTime string `json:"createTime,omitempty"`
2088 // Error: Output only. If the state is FAILED, the corresponding error code and
2089 // message. Defaults to code=OK for all other states.
2090 Error *Status `json:"error,omitempty"`
2091 // Etag: Output only. An opaque value that uniquely identifies a version or
2092 // generation of a resource. It can be used to confirm that the client and
2093 // server agree on the ordering of a resource being written.
2094 Etag string `json:"etag,omitempty"`
2095 // Labels: Optional. The labels on the resource, which can be used for
2096 // categorization. similar to Kubernetes resource labels.
2097 Labels map[string]string `json:"labels,omitempty"`
2098 // Locations: Optional. List of locations that the service is available in.
2099 // Rollout refers to the list to generate a rollout plan.
2100 Locations []*Location `json:"locations,omitempty"`
2101 // Name: Identifier. The resource name (full URI of the resource) following the
2102 // standard naming scheme:
2103 // "projects/{project}/locations/{location}/saas/{saas}"
2104 Name string `json:"name,omitempty"`
2105 // State: Output only. State of the Saas. It is always in ACTIVE state if the
2106 // application_template is empty.
2107 //
2108 // Possible values:
2109 // "STATE_TYPE_UNSPECIFIED" - State type is unspecified.
2110 // "STATE_ACTIVE" - The Saas is ready
2111 // "STATE_RUNNING" - In the process of importing, synchronizing or
2112 // replicating ApplicationTemplates
2113 // "STATE_FAILED" - Failure during process of importing, synchronizing or
2114 // replicating ApplicationTemplate processing
2115 // "ACTIVE" - Deprecated: Use STATE_ACTIVE.
2116 // "RUNNING" - Deprecated: Use STATE_RUNNING.
2117 // "FAILED" - Deprecated: Use STATE_FAILED.
2118 State string `json:"state,omitempty"`
2119 // Uid: Output only. The unique identifier of the resource. UID is unique in
2120 // the time and space for this resource within the scope of the service. It is
2121 // typically generated by the server on successful creation of a resource and
2122 // must not be changed. UID is used to uniquely identify resources with
2123 // resource name reuses. This should be a UUID4.
2124 Uid string `json:"uid,omitempty"`
2125 // UpdateTime: Output only. The timestamp when the resource was last updated.
2126 // Any change to the resource made by users must refresh this value. Changes to
2127 // a resource made by the service should refresh this value.
2128 UpdateTime string `json:"updateTime,omitempty"`
2129
2130 // ServerResponse contains the HTTP response code and headers from the server.
2131 googleapi.ServerResponse `json:"-"`
2132 // ForceSendFields is a list of field names (e.g. "Annotations") to
2133 // unconditionally include in API requests. By default, fields with empty or
2134 // default values are omitted from API requests. See
2135 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2136 // details.
2137 ForceSendFields []string `json:"-"`
2138 // NullFields is a list of field names (e.g. "Annotations") to include in API
2139 // requests with the JSON null value. By default, fields with empty values are
2140 // omitted from API requests. See
2141 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2142 NullFields []string `json:"-"`
2143 }
2144
2145 func (s Saas) MarshalJSON() ([]byte, error) {
2146 type NoMethod Saas
2147 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2148 }
2149
2150 // SaasCondition: SaasCondition describes the status of a Saas.
2151 type SaasCondition struct {
2152 // LastTransitionTime: Required. Last time the condition transited from one
2153 // status to another.
2154 LastTransitionTime string `json:"lastTransitionTime,omitempty"`
2155 // Message: Required. Human readable message indicating details about the last
2156 // transition.
2157 Message string `json:"message,omitempty"`
2158 // Reason: Required. Brief reason for the condition's last transition.
2159 Reason string `json:"reason,omitempty"`
2160 // Status: Required. Status of the condition.
2161 //
2162 // Possible values:
2163 // "STATUS_UNSPECIFIED" - Condition status is unspecified.
2164 // "STATUS_UNKNOWN" - Condition is unknown.
2165 // "STATUS_TRUE" - Condition is true.
2166 // "STATUS_FALSE" - Condition is false.
2167 Status string `json:"status,omitempty"`
2168 // Type: Required. Type of the condition.
2169 //
2170 // Possible values:
2171 // "TYPE_UNSPECIFIED" - Condition type is unspecified.
2172 // "TYPE_READY" - Condition type is ready.
2173 // "TYPE_SYNCHRONIZED" - Condition type is synchronized.
2174 Type string `json:"type,omitempty"`
2175 // ForceSendFields is a list of field names (e.g. "LastTransitionTime") to
2176 // unconditionally include in API requests. By default, fields with empty or
2177 // default values are omitted from API requests. See
2178 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2179 // details.
2180 ForceSendFields []string `json:"-"`
2181 // NullFields is a list of field names (e.g. "LastTransitionTime") to include
2182 // in API requests with the JSON null value. By default, fields with empty
2183 // values are omitted from API requests. See
2184 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2185 NullFields []string `json:"-"`
2186 }
2187
2188 func (s SaasCondition) MarshalJSON() ([]byte, error) {
2189 type NoMethod SaasCondition
2190 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2191 }
2192
2193 // Schedule: A time specification to schedule the maintenance.
2194 type Schedule struct {
2195 // StartTime: Optional. Start of operation. If not set, will be set to the
2196 // start of the next window. (optional)
2197 StartTime string `json:"startTime,omitempty"`
2198 // ForceSendFields is a list of field names (e.g. "StartTime") to
2199 // unconditionally include in API requests. By default, fields with empty or
2200 // default values are omitted from API requests. See
2201 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2202 // details.
2203 ForceSendFields []string `json:"-"`
2204 // NullFields is a list of field names (e.g. "StartTime") to include in API
2205 // requests with the JSON null value. By default, fields with empty values are
2206 // omitted from API requests. See
2207 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2208 NullFields []string `json:"-"`
2209 }
2210
2211 func (s Schedule) MarshalJSON() ([]byte, error) {
2212 type NoMethod Schedule
2213 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2214 }
2215
2216 // Scope: Scope of an application.
2217 type Scope struct {
2218 // Type: Required. Scope Type.
2219 //
2220 // Possible values:
2221 // "TYPE_UNSPECIFIED" - Unspecified type.
2222 // "TYPE_REGIONAL" - Regional type.
2223 // "TYPE_GLOBAL" - Global type.
2224 // "REGIONAL" - Deprecated: Use TYPE_REGIONAL.
2225 // "GLOBAL" - Deprecated: Use TYPE_GLOBAL.
2226 Type string `json:"type,omitempty"`
2227 // ForceSendFields is a list of field names (e.g. "Type") to unconditionally
2228 // include in API requests. By default, fields with empty or default values are
2229 // omitted from API requests. See
2230 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2231 // details.
2232 ForceSendFields []string `json:"-"`
2233 // NullFields is a list of field names (e.g. "Type") to include in API requests
2234 // with the JSON null value. By default, fields with empty values are omitted
2235 // from API requests. See
2236 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2237 NullFields []string `json:"-"`
2238 }
2239
2240 func (s Scope) MarshalJSON() ([]byte, error) {
2241 type NoMethod Scope
2242 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2243 }
2244
2245 // Status: The `Status` type defines a logical error model that is suitable for
2246 // different programming environments, including REST APIs and RPC APIs. It is
2247 // used by gRPC (https://github.com/grpc). Each `Status` message contains three
2248 // pieces of data: error code, error message, and error details. You can find
2249 // out more about this error model and how to work with it in the API Design
2250 // Guide (https://cloud.google.com/apis/design/errors).
2251 type Status struct {
2252 // Code: The status code, which should be an enum value of google.rpc.Code.
2253 Code int64 `json:"code,omitempty"`
2254 // Details: A list of messages that carry the error details. There is a common
2255 // set of message types for APIs to use.
2256 Details []googleapi.RawMessage `json:"details,omitempty"`
2257 // Message: A developer-facing error message, which should be in English. Any
2258 // user-facing error message should be localized and sent in the
2259 // google.rpc.Status.details field, or localized by the client.
2260 Message string `json:"message,omitempty"`
2261 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
2262 // include in API requests. By default, fields with empty or default values are
2263 // omitted from API requests. See
2264 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2265 // details.
2266 ForceSendFields []string `json:"-"`
2267 // NullFields is a list of field names (e.g. "Code") to include in API requests
2268 // with the JSON null value. By default, fields with empty values are omitted
2269 // from API requests. See
2270 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2271 NullFields []string `json:"-"`
2272 }
2273
2274 func (s Status) MarshalJSON() ([]byte, error) {
2275 type NoMethod Status
2276 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2277 }
2278
2279 // Tenant: Tenant represents the service producer side of an instance of the
2280 // service created based on a request from a consumer. In a typical scenario a
2281 // Tenant has a one-to-one mapping with a resource given out to a service
2282 // consumer. Example: tenant: name:
2283 // "projects/svc1/locations/loc/tenants/inst-068afff8" consumer_resource:
2284 // "projects/gshoe/locations/loc/shoes/black-shoe"
2285 type Tenant struct {
2286 // Annotations: Optional. Annotations is an unstructured key-value map stored
2287 // with a resource that may be set by external tools to store and retrieve
2288 // arbitrary metadata. They are not queryable and should be preserved when
2289 // modifying objects. More info:
2290 // https://kubernetes.io/docs/user-guide/annotations
2291 Annotations map[string]string `json:"annotations,omitempty"`
2292 // ConsumerResource: Optional. Immutable. A reference to the consumer resource
2293 // this SaaS Tenant is representing. The relationship with a consumer resource
2294 // can be used by App Lifecycle Manager for retrieving consumer-defined
2295 // settings and policies such as maintenance policies (using Unified
2296 // Maintenance Policy API).
2297 ConsumerResource string `json:"consumerResource,omitempty"`
2298 // CreateTime: Output only. The timestamp when the resource was created.
2299 CreateTime string `json:"createTime,omitempty"`
2300 // Etag: Output only. An opaque value that uniquely identifies a version or
2301 // generation of a resource. It can be used to confirm that the client and
2302 // server agree on the ordering of a resource being written.
2303 Etag string `json:"etag,omitempty"`
2304 // Labels: Optional. The labels on the resource, which can be used for
2305 // categorization. similar to Kubernetes resource labels.
2306 Labels map[string]string `json:"labels,omitempty"`
2307 // Name: Identifier. The resource name (full URI of the resource) following the
2308 // standard naming scheme:
2309 // "projects/{project}/locations/{location}/tenants/{tenant}"
2310 Name string `json:"name,omitempty"`
2311 // Saas: Required. Immutable. A reference to the Saas that defines the product
2312 // (managed service) that the producer wants to manage with App Lifecycle
2313 // Manager. Part of the App Lifecycle Manager common data model.
2314 Saas string `json:"saas,omitempty"`
2315 // Uid: Output only. The unique identifier of the resource. UID is unique in
2316 // the time and space for this resource within the scope of the service. It is
2317 // typically generated by the server on successful creation of a resource and
2318 // must not be changed. UID is used to uniquely identify resources with
2319 // resource name reuses. This should be a UUID4.
2320 Uid string `json:"uid,omitempty"`
2321 // UpdateTime: Output only. The timestamp when the resource was last updated.
2322 // Any change to the resource made by users must refresh this value. Changes to
2323 // a resource made by the service should refresh this value.
2324 UpdateTime string `json:"updateTime,omitempty"`
2325
2326 // ServerResponse contains the HTTP response code and headers from the server.
2327 googleapi.ServerResponse `json:"-"`
2328 // ForceSendFields is a list of field names (e.g. "Annotations") to
2329 // unconditionally include in API requests. By default, fields with empty or
2330 // default values are omitted from API requests. See
2331 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2332 // details.
2333 ForceSendFields []string `json:"-"`
2334 // NullFields is a list of field names (e.g. "Annotations") to include in API
2335 // requests with the JSON null value. By default, fields with empty values are
2336 // omitted from API requests. See
2337 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2338 NullFields []string `json:"-"`
2339 }
2340
2341 func (s Tenant) MarshalJSON() ([]byte, error) {
2342 type NoMethod Tenant
2343 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2344 }
2345
2346 // ToMapping: Input variables whose values will be passed on to dependencies
2347 type ToMapping struct {
2348 // Dependency: Required. Alias of the dependency that the inputVariable will
2349 // pass its value to
2350 Dependency string `json:"dependency,omitempty"`
2351 // IgnoreForLookup: Optional. Tells App Lifecycle Manager if this mapping
2352 // should be used during lookup or not
2353 IgnoreForLookup bool `json:"ignoreForLookup,omitempty"`
2354 // InputVariable: Required. Name of the inputVariable on the dependency
2355 InputVariable string `json:"inputVariable,omitempty"`
2356 // ForceSendFields is a list of field names (e.g. "Dependency") to
2357 // unconditionally include in API requests. By default, fields with empty or
2358 // default values are omitted from API requests. See
2359 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2360 // details.
2361 ForceSendFields []string `json:"-"`
2362 // NullFields is a list of field names (e.g. "Dependency") to include in API
2363 // requests with the JSON null value. By default, fields with empty values are
2364 // omitted from API requests. See
2365 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2366 NullFields []string `json:"-"`
2367 }
2368
2369 func (s ToMapping) MarshalJSON() ([]byte, error) {
2370 type NoMethod ToMapping
2371 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2372 }
2373
2374 // Unit: A unit of deployment that has its lifecycle via a CRUD API using an
2375 // actuation engine under the hood (e.g. based on Terraform, Helm or a custom
2376 // implementation provided by a service producer). A building block of a SaaS
2377 // Tenant.
2378 type Unit struct {
2379 // Annotations: Optional. Annotations is an unstructured key-value map stored
2380 // with a resource that may be set by external tools to store and retrieve
2381 // arbitrary metadata. They are not queryable and should be preserved when
2382 // modifying objects. More info:
2383 // https://kubernetes.io/docs/user-guide/annotations
2384 Annotations map[string]string `json:"annotations,omitempty"`
2385 // Application: Optional. Reference to the AppHub Application this unit belongs
2386 // to. All resources deployed in this Unit will be associated with the
2387 // specified Application.
2388 Application string `json:"application,omitempty"`
2389 // Conditions: Optional. Output only. A set of conditions which indicate the
2390 // various conditions this resource can have.
2391 Conditions []*UnitCondition `json:"conditions,omitempty"`
2392 // CreateTime: Output only. The timestamp when the resource was created.
2393 CreateTime string `json:"createTime,omitempty"`
2394 // Dependencies: Optional. Output only. Set of dependencies for this unit.
2395 // Maximum 10.
2396 Dependencies []*UnitDependency `json:"dependencies,omitempty"`
2397 // Dependents: Optional. Output only. List of Units that depend on this unit.
2398 // Unit can only be deprovisioned if this list is empty. Maximum 1000.
2399 Dependents []*UnitDependency `json:"dependents,omitempty"`
2400 // Etag: Output only. An opaque value that uniquely identifies a version or
2401 // generation of a resource. It can be used to confirm that the client and
2402 // server agree on the ordering of a resource being written.
2403 Etag string `json:"etag,omitempty"`
2404 // FlagConfigName: Output only. This field stores the unique identifier for the
2405 // flag configuration to be used by this Unit.
2406 FlagConfigName string `json:"flagConfigName,omitempty"`
2407 // FlagRevisions: Optional. Output only. Flag revisions used by this Unit.
2408 FlagRevisions []string `json:"flagRevisions,omitempty"`
2409 // InputVariables: Optional. Output only. Indicates the current input variables
2410 // deployed by the unit
2411 InputVariables []*UnitVariable `json:"inputVariables,omitempty"`
2412 // Labels: Optional. The labels on the resource, which can be used for
2413 // categorization. similar to Kubernetes resource labels.
2414 Labels map[string]string `json:"labels,omitempty"`
2415 // Maintenance: Optional. Captures requested directives for performing future
2416 // maintenance on the unit. This includes a request for the unit to skip
2417 // maintenance for a period of time and remain pinned to its current release as
2418 // well as controls for postponing maintenance scheduled in future.
2419 Maintenance *MaintenanceSettings `json:"maintenance,omitempty"`
2420 // ManagementMode: Optional. Immutable. Indicates whether the Unit life cycle
2421 // is controlled by the user or by the system. Immutable once created.
2422 //
2423 // Possible values:
2424 // "MANAGEMENT_MODE_UNSPECIFIED"
2425 // "MANAGEMENT_MODE_USER" - Unit's lifecycle is managed by the user.
2426 // "MANAGEMENT_MODE_SYSTEM" - The system will decide when to deprovision and
2427 // delete the unit. User still can deprovision or delete the unit manually.
2428 ManagementMode string `json:"managementMode,omitempty"`
2429 // Name: Identifier. The resource name (full URI of the resource) following the
2430 // standard naming scheme:
2431 // "projects/{project}/locations/{location}/units/{unit}"
2432 Name string `json:"name,omitempty"`
2433 // OngoingOperations: Optional. Output only. List of concurrent UnitOperations
2434 // that are operating on this Unit.
2435 OngoingOperations []string `json:"ongoingOperations,omitempty"`
2436 // OutputVariables: Optional. Output only. Set of key/value pairs corresponding
2437 // to output variables from execution of actuation templates. The variables are
2438 // declared in actuation configs (e.g in helm chart or terraform) and the
2439 // values are fetched and returned by the actuation engine upon completion of
2440 // execution.
2441 OutputVariables []*UnitVariable `json:"outputVariables,omitempty"`
2442 // PendingOperations: Optional. Output only. List of pending (wait to be
2443 // executed) UnitOperations for this unit.
2444 PendingOperations []string `json:"pendingOperations,omitempty"`
2445 // Release: Optional. Output only. The current Release object for this Unit.
2446 Release string `json:"release,omitempty"`
2447 // SatisfiesPzi: Output only. Reserved for future use.
2448 SatisfiesPzi bool `json:"satisfiesPzi,omitempty"`
2449 // SatisfiesPzs: Output only. Indicates whether the resource location satisfies
2450 // Zone Separation constraints. This is false by default.
2451 SatisfiesPzs bool `json:"satisfiesPzs,omitempty"`
2452 // ScheduledOperations: Optional. Output only. List of scheduled UnitOperations
2453 // for this unit.
2454 ScheduledOperations []string `json:"scheduledOperations,omitempty"`
2455 // State: Optional. Output only. Current lifecycle state of the resource (e.g.
2456 // if it's being created or ready to use).
2457 //
2458 // Possible values:
2459 // "UNIT_STATE_UNSPECIFIED" - Unspecified state.
2460 // "UNIT_STATE_NOT_PROVISIONED" - Unit is not provisioned.
2461 // "UNIT_STATE_PROVISIONING" - Unit is being provisioned.
2462 // "UNIT_STATE_UPDATING" - Unit is being updated. This is typically when a
2463 // unit is being upgraded to a new release or some of the input variables on
2464 // the Unit is being changed. Certain kinds of updates may cause the Unit to
2465 // become unusable while the update is in progress.
2466 // "UNIT_STATE_DEPROVISIONING" - Unit is being deleted.
2467 // "UNIT_STATE_READY" - Unit has been provisioned and is ready for use
2468 // "UNIT_STATE_ERROR" - Unit has error, when it is not ready and some error
2469 // operation
2470 State string `json:"state,omitempty"`
2471 // SystemCleanupAt: Optional. Output only. If set, indicates the time when the
2472 // system will start removing the unit.
2473 SystemCleanupAt string `json:"systemCleanupAt,omitempty"`
2474 // SystemManagedState: Optional. Output only. Indicates the system managed
2475 // state of the unit.
2476 //
2477 // Possible values:
2478 // "SYSTEM_MANAGED_STATE_UNSPECIFIED"
2479 // "SYSTEM_MANAGED_STATE_ACTIVE" - Unit has dependents attached.
2480 // "SYSTEM_MANAGED_STATE_INACTIVE" - Unit has no dependencies attached, but
2481 // attachment is allowed.
2482 // "SYSTEM_MANAGED_STATE_DECOMMISSIONED" - Unit has no dependencies attached,
2483 // and attachment is not allowed.
2484 SystemManagedState string `json:"systemManagedState,omitempty"`
2485 // Tenant: Optional. Reference to the Saas Tenant resource this unit belongs
2486 // to. This for example informs the maintenance policies to use for scheduling
2487 // future updates on a unit. (optional and immutable once created)
2488 Tenant string `json:"tenant,omitempty"`
2489 // Uid: Output only. The unique identifier of the resource. UID is unique in
2490 // the time and space for this resource within the scope of the service. It is
2491 // typically generated by the server on successful creation of a resource and
2492 // must not be changed. UID is used to uniquely identify resources with
2493 // resource name reuses. This should be a UUID4.
2494 Uid string `json:"uid,omitempty"`
2495 // UnitKind: Optional. Reference to the UnitKind this Unit belongs to.
2496 // Immutable once set.
2497 UnitKind string `json:"unitKind,omitempty"`
2498 // UpdateTime: Output only. The timestamp when the resource was last updated.
2499 // Any change to the resource made by users must refresh this value. Changes to
2500 // a resource made by the service should refresh this value.
2501 UpdateTime string `json:"updateTime,omitempty"`
2502
2503 // ServerResponse contains the HTTP response code and headers from the server.
2504 googleapi.ServerResponse `json:"-"`
2505 // ForceSendFields is a list of field names (e.g. "Annotations") to
2506 // unconditionally include in API requests. By default, fields with empty or
2507 // default values are omitted from API requests. See
2508 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2509 // details.
2510 ForceSendFields []string `json:"-"`
2511 // NullFields is a list of field names (e.g. "Annotations") to include in API
2512 // requests with the JSON null value. By default, fields with empty values are
2513 // omitted from API requests. See
2514 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2515 NullFields []string `json:"-"`
2516 }
2517
2518 func (s Unit) MarshalJSON() ([]byte, error) {
2519 type NoMethod Unit
2520 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2521 }
2522
2523 // UnitCondition: UnitCondition describes the status of an Unit. UnitCondition
2524 // is individual components that contribute to an overall state.
2525 type UnitCondition struct {
2526 // LastTransitionTime: Required. Last time the condition transited from one
2527 // status to another.
2528 LastTransitionTime string `json:"lastTransitionTime,omitempty"`
2529 // Message: Required. Human readable message indicating details about the last
2530 // transition.
2531 Message string `json:"message,omitempty"`
2532 // Reason: Required. Brief reason for the condition's last transition.
2533 Reason string `json:"reason,omitempty"`
2534 // Status: Required. Status of the condition.
2535 //
2536 // Possible values:
2537 // "STATUS_UNSPECIFIED" - Condition status is unspecified.
2538 // "STATUS_UNKNOWN" - Condition is unknown.
2539 // "STATUS_TRUE" - Condition is true.
2540 // "STATUS_FALSE" - Condition is false.
2541 Status string `json:"status,omitempty"`
2542 // Type: Required. Type of the condition.
2543 //
2544 // Possible values:
2545 // "TYPE_UNSPECIFIED" - Condition type is unspecified.
2546 // "TYPE_READY" - Condition type is ready.
2547 // "TYPE_UPDATING" - Condition type is updating.
2548 // "TYPE_PROVISIONED" - Condition type is provisioned.
2549 // "TYPE_OPERATION_ERROR" - Condition type is operationError. True when the
2550 // last unit operation fails with a non-ignorable error.
2551 Type string `json:"type,omitempty"`
2552 // ForceSendFields is a list of field names (e.g. "LastTransitionTime") to
2553 // unconditionally include in API requests. By default, fields with empty or
2554 // default values are omitted from API requests. See
2555 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2556 // details.
2557 ForceSendFields []string `json:"-"`
2558 // NullFields is a list of field names (e.g. "LastTransitionTime") to include
2559 // in API requests with the JSON null value. By default, fields with empty
2560 // values are omitted from API requests. See
2561 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2562 NullFields []string `json:"-"`
2563 }
2564
2565 func (s UnitCondition) MarshalJSON() ([]byte, error) {
2566 type NoMethod UnitCondition
2567 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2568 }
2569
2570 // UnitDependency: Set of dependencies for this unit. Maximum 10.
2571 type UnitDependency struct {
2572 // Alias: Output only. Alias for the name of the dependency.
2573 Alias string `json:"alias,omitempty"`
2574 // Unit: Output only. A reference to the Unit object.
2575 Unit string `json:"unit,omitempty"`
2576 // ForceSendFields is a list of field names (e.g. "Alias") to unconditionally
2577 // include in API requests. By default, fields with empty or default values are
2578 // omitted from API requests. See
2579 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2580 // details.
2581 ForceSendFields []string `json:"-"`
2582 // NullFields is a list of field names (e.g. "Alias") to include in API
2583 // requests with the JSON null value. By default, fields with empty values are
2584 // omitted from API requests. See
2585 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2586 NullFields []string `json:"-"`
2587 }
2588
2589 func (s UnitDependency) MarshalJSON() ([]byte, error) {
2590 type NoMethod UnitDependency
2591 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2592 }
2593
2594 // UnitKind: Definition of a Unit. Units belonging to the same UnitKind are
2595 // managed together; for example they follow the same release model
2596 // (blueprints, versions etc.) and are typically rolled out together.
2597 type UnitKind struct {
2598 // Annotations: Optional. Annotations is an unstructured key-value map stored
2599 // with a resource that may be set by external tools to store and retrieve
2600 // arbitrary metadata. They are not queryable and should be preserved when
2601 // modifying objects. More info:
2602 // https://kubernetes.io/docs/user-guide/annotations
2603 Annotations map[string]string `json:"annotations,omitempty"`
2604 // AppParams: AppParams contains the parameters for creating an AppHub
2605 // Application.
2606 AppParams *AppParams `json:"appParams,omitempty"`
2607 // ApplicationTemplateComponent: Output only. Reference to component and
2608 // revision in a composite ApplicationTemplate.
2609 ApplicationTemplateComponent *ComponentRef `json:"applicationTemplateComponent,omitempty"`
2610 // CreateTime: Output only. The timestamp when the resource was created.
2611 CreateTime string `json:"createTime,omitempty"`
2612 // DefaultFlagRevisions: Optional. Default revisions of flags for this
2613 // UnitKind. Newly created units will use the flag default_flag_revisions
2614 // present at the time of creation.
2615 DefaultFlagRevisions []string `json:"defaultFlagRevisions,omitempty"`
2616 // DefaultRelease: Optional. A reference to the Release object to use as
2617 // default for creating new units of this UnitKind (optional). If not
2618 // specified, a new unit must explicitly reference which release to use for its
2619 // creation.
2620 DefaultRelease string `json:"defaultRelease,omitempty"`
2621 // Dependencies: Optional. Immutable. List of other unit kinds that this
2622 // release will depend on. Dependencies will be automatically provisioned if
2623 // not found. Maximum 10.
2624 Dependencies []*Dependency `json:"dependencies,omitempty"`
2625 // Etag: Output only. An opaque value that uniquely identifies a version or
2626 // generation of a resource. It can be used to confirm that the client and
2627 // server agree on the ordering of a resource being written.
2628 Etag string `json:"etag,omitempty"`
2629 // InputVariableMappings: Optional. List of inputVariables for this release
2630 // that will either be retrieved from a dependency’s outputVariables, or will
2631 // be passed on to a dependency’s inputVariables. Maximum 100.
2632 InputVariableMappings []*VariableMapping `json:"inputVariableMappings,omitempty"`
2633 // Labels: Optional. The labels on the resource, which can be used for
2634 // categorization. similar to Kubernetes resource labels.
2635 Labels map[string]string `json:"labels,omitempty"`
2636 // Name: Identifier. The resource name (full URI of the resource) following the
2637 // standard naming scheme:
2638 // "projects/{project}/locations/{location}/unitKinds/{unitKind}"
2639 Name string `json:"name,omitempty"`
2640 // OutputVariableMappings: Optional. List of outputVariables for this unit kind
2641 // will be passed to this unit's outputVariables. Maximum 100.
2642 OutputVariableMappings []*VariableMapping `json:"outputVariableMappings,omitempty"`
2643 // Saas: Required. Immutable. A reference to the Saas that defines the product
2644 // (managed service) that the producer wants to manage with App Lifecycle
2645 // Manager. Part of the App Lifecycle Manager common data model. Immutable once
2646 // set.
2647 Saas string `json:"saas,omitempty"`
2648 // Uid: Output only. The unique identifier of the resource. UID is unique in
2649 // the time and space for this resource within the scope of the service. It is
2650 // typically generated by the server on successful creation of a resource and
2651 // must not be changed. UID is used to uniquely identify resources with
2652 // resource name reuses. This should be a UUID4.
2653 Uid string `json:"uid,omitempty"`
2654 // UpdateTime: Output only. The timestamp when the resource was last updated.
2655 // Any change to the resource made by users must refresh this value. Changes to
2656 // a resource made by the service should refresh this value.
2657 UpdateTime string `json:"updateTime,omitempty"`
2658
2659 // ServerResponse contains the HTTP response code and headers from the server.
2660 googleapi.ServerResponse `json:"-"`
2661 // ForceSendFields is a list of field names (e.g. "Annotations") to
2662 // unconditionally include in API requests. By default, fields with empty or
2663 // default values are omitted from API requests. See
2664 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2665 // details.
2666 ForceSendFields []string `json:"-"`
2667 // NullFields is a list of field names (e.g. "Annotations") to include in API
2668 // requests with the JSON null value. By default, fields with empty values are
2669 // omitted from API requests. See
2670 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2671 NullFields []string `json:"-"`
2672 }
2673
2674 func (s UnitKind) MarshalJSON() ([]byte, error) {
2675 type NoMethod UnitKind
2676 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2677 }
2678
2679 // UnitOperation: UnitOperation encapsulates the intent of changing/interacting
2680 // with the service component represented by the specific Unit. Multiple
2681 // UnitOperations can be created (requested) and scheduled in the future,
2682 // however only one will be allowed to execute at a time (that can change in
2683 // the future for non-mutating operations). UnitOperations allow different
2684 // actors interacting with the same unit to focus only on the change they have
2685 // requested. This is a base object that contains the common fields in all unit
2686 // operations. Next: 22
2687 type UnitOperation struct {
2688 // Annotations: Optional. Annotations is an unstructured key-value map stored
2689 // with a resource that may be set by external tools to store and retrieve
2690 // arbitrary metadata. They are not queryable and should be preserved when
2691 // modifying objects. More info:
2692 // https://kubernetes.io/docs/user-guide/annotations
2693 Annotations map[string]string `json:"annotations,omitempty"`
2694 // Cancel: Optional. When true, attempt to cancel the operation. Cancellation
2695 // may fail if the operation is already executing. (Optional)
2696 Cancel bool `json:"cancel,omitempty"`
2697 // Conditions: Optional. Output only. A set of conditions which indicate the
2698 // various conditions this resource can have.
2699 Conditions []*UnitOperationCondition `json:"conditions,omitempty"`
2700 // CreateTime: Output only. The timestamp when the resource was created.
2701 CreateTime string `json:"createTime,omitempty"`
2702 // DeleteTime: Output only. The timestamp when the resource was marked for
2703 // deletion (deletion is an asynchronous operation).
2704 DeleteTime string `json:"deleteTime,omitempty"`
2705 Deprovision *Deprovision `json:"deprovision,omitempty"`
2706 // EngineState: Optional. Output only. The engine state for on-going deployment
2707 // engine operation(s). This field is opaque for external usage.
2708 EngineState string `json:"engineState,omitempty"`
2709 // ErrorCategory: Optional. Output only. UnitOperationErrorCategory describe
2710 // the error category.
2711 //
2712 // Possible values:
2713 // "UNIT_OPERATION_ERROR_CATEGORY_UNSPECIFIED" - Unit operation error
2714 // category is unspecified
2715 // "NOT_APPLICABLE" - Unit operation error category is not applicable, or it
2716 // is not an error
2717 // "FATAL" - Unit operation error category is fatal
2718 // "RETRIABLE" - Unit operation error category is retriable
2719 // "IGNORABLE" - Unit operation error category is ignorable
2720 // "STANDARD" - Unit operation error category is standard, counts towards
2721 // Rollout error budget
2722 ErrorCategory string `json:"errorCategory,omitempty"`
2723 // Etag: Output only. An opaque value that uniquely identifies a version or
2724 // generation of a resource. It can be used to confirm that the client and
2725 // server agree on the ordering of a resource being written.
2726 Etag string `json:"etag,omitempty"`
2727 FlagUpdate *FlagUpdate `json:"flagUpdate,omitempty"`
2728 // Labels: Optional. The labels on the resource, which can be used for
2729 // categorization. similar to Kubernetes resource labels.
2730 Labels map[string]string `json:"labels,omitempty"`
2731 // Name: Identifier. The resource name (full URI of the resource) following the
2732 // standard naming scheme:
2733 // "projects/{project}/locations/{location}/unitOperations/{unitOperation}"
2734 Name string `json:"name,omitempty"`
2735 // ParentUnitOperation: Optional. Reference to parent resource: UnitOperation.
2736 // If an operation needs to create other operations as part of its workflow,
2737 // each of the child operations should have this field set to the parent. This
2738 // can be used for tracing. (Optional)
2739 ParentUnitOperation string `json:"parentUnitOperation,omitempty"`
2740 Provision *Provision `json:"provision,omitempty"`
2741 // Rollout: Optional. Specifies which rollout created this Unit Operation. This
2742 // cannot be modified and is used for filtering purposes only. If a dependent
2743 // unit and unit operation are created as part of another unit operation, they
2744 // will use the same rolloutId.
2745 Rollout string `json:"rollout,omitempty"`
2746 // Schedule: Optional. When to schedule this operation.
2747 Schedule *Schedule `json:"schedule,omitempty"`
2748 // State: Optional. Output only. UnitOperationState describes the current state
2749 // of the unit operation.
2750 //
2751 // Possible values:
2752 // "UNIT_OPERATION_STATE_UNKNOWN"
2753 // "UNIT_OPERATION_STATE_PENDING" - Unit operation is accepted but not ready
2754 // to run.
2755 // "UNIT_OPERATION_STATE_SCHEDULED" - Unit operation is accepted and
2756 // scheduled.
2757 // "UNIT_OPERATION_STATE_RUNNING" - Unit operation is running.
2758 // "UNIT_OPERATION_STATE_SUCCEEDED" - Unit operation has completed
2759 // successfully.
2760 // "UNIT_OPERATION_STATE_FAILED" - Unit operation has failed.
2761 // "UNIT_OPERATION_STATE_CANCELLED" - Unit operation was cancelled.
2762 State string `json:"state,omitempty"`
2763 // Uid: Output only. The unique identifier of the resource. UID is unique in
2764 // the time and space for this resource within the scope of the service. It is
2765 // typically generated by the server on successful creation of a resource and
2766 // must not be changed. UID is used to uniquely identify resources with
2767 // resource name reuses. This should be a UUID4.
2768 Uid string `json:"uid,omitempty"`
2769 // Unit: Required. Immutable. The Unit a given UnitOperation will act upon.
2770 Unit string `json:"unit,omitempty"`
2771 // UpdateTime: Output only. The timestamp when the resource was last updated.
2772 // Any change to the resource made by users must refresh this value. Changes to
2773 // a resource made by the service should refresh this value.
2774 UpdateTime string `json:"updateTime,omitempty"`
2775 Upgrade *Upgrade `json:"upgrade,omitempty"`
2776
2777 // ServerResponse contains the HTTP response code and headers from the server.
2778 googleapi.ServerResponse `json:"-"`
2779 // ForceSendFields is a list of field names (e.g. "Annotations") to
2780 // unconditionally include in API requests. By default, fields with empty or
2781 // default values are omitted from API requests. See
2782 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2783 // details.
2784 ForceSendFields []string `json:"-"`
2785 // NullFields is a list of field names (e.g. "Annotations") to include in API
2786 // requests with the JSON null value. By default, fields with empty values are
2787 // omitted from API requests. See
2788 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2789 NullFields []string `json:"-"`
2790 }
2791
2792 func (s UnitOperation) MarshalJSON() ([]byte, error) {
2793 type NoMethod UnitOperation
2794 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2795 }
2796
2797 // UnitOperationCondition: UnitOperationCondition describes the status of an
2798 // Unit Operation. UnitOperationCondition is individual components that
2799 // contribute to an overall state.
2800 type UnitOperationCondition struct {
2801 // LastTransitionTime: Required. Last time the condition transited from one
2802 // status to another.
2803 LastTransitionTime string `json:"lastTransitionTime,omitempty"`
2804 // Message: Required. Human readable message indicating details about the last
2805 // transition.
2806 Message string `json:"message,omitempty"`
2807 // Reason: Required. Brief reason for the condition's last transition.
2808 Reason string `json:"reason,omitempty"`
2809 // Status: Required. Status of the condition.
2810 //
2811 // Possible values:
2812 // "STATUS_UNSPECIFIED" - Condition status is unspecified.
2813 // "STATUS_UNKNOWN" - Condition is unknown.
2814 // "STATUS_TRUE" - Condition is true.
2815 // "STATUS_FALSE" - Condition is false.
2816 Status string `json:"status,omitempty"`
2817 // Type: Required. Type of the condition.
2818 //
2819 // Possible values:
2820 // "TYPE_UNSPECIFIED" - Condition type is unspecified.
2821 // "TYPE_SCHEDULED" - Condition type is scheduled.
2822 // "TYPE_RUNNING" - Condition type is running.
2823 // "TYPE_SUCCEEDED" - Condition type is succeeded.
2824 // "TYPE_CANCELLED" - Condition type is cancelled.
2825 // "TYPE_APP_CREATED" - Indicates if AppHub app has been created.
2826 // "TYPE_APP_COMPONENTS_REGISTERED" - Indicates if services and workloads
2827 // have been registered with AppHub.
2828 Type string `json:"type,omitempty"`
2829 // ForceSendFields is a list of field names (e.g. "LastTransitionTime") to
2830 // unconditionally include in API requests. By default, fields with empty or
2831 // default values are omitted from API requests. See
2832 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2833 // details.
2834 ForceSendFields []string `json:"-"`
2835 // NullFields is a list of field names (e.g. "LastTransitionTime") to include
2836 // in API requests with the JSON null value. By default, fields with empty
2837 // values are omitted from API requests. See
2838 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2839 NullFields []string `json:"-"`
2840 }
2841
2842 func (s UnitOperationCondition) MarshalJSON() ([]byte, error) {
2843 type NoMethod UnitOperationCondition
2844 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2845 }
2846
2847 // UnitVariable: UnitVariable describes a parameter for a Unit.
2848 type UnitVariable struct {
2849 // Type: Optional. Immutable. Name of a supported variable type. Supported
2850 // types are string, int, bool.
2851 //
2852 // Possible values:
2853 // "TYPE_UNSPECIFIED" - Variable type is unspecified.
2854 // "STRING" - Variable type is string.
2855 // "INT" - Variable type is int.
2856 // "BOOL" - Variable type is bool.
2857 // "STRUCT" - Variable type is struct.
2858 // "LIST" - Variable type is list.
2859 Type string `json:"type,omitempty"`
2860 // Value: Optional. String encoded value for the variable.
2861 Value string `json:"value,omitempty"`
2862 // Variable: Required. Immutable. Name of the variable from actuation configs.
2863 Variable string `json:"variable,omitempty"`
2864 // ForceSendFields is a list of field names (e.g. "Type") to unconditionally
2865 // include in API requests. By default, fields with empty or default values are
2866 // omitted from API requests. See
2867 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2868 // details.
2869 ForceSendFields []string `json:"-"`
2870 // NullFields is a list of field names (e.g. "Type") to include in API requests
2871 // with the JSON null value. By default, fields with empty values are omitted
2872 // from API requests. See
2873 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2874 NullFields []string `json:"-"`
2875 }
2876
2877 func (s UnitVariable) MarshalJSON() ([]byte, error) {
2878 type NoMethod UnitVariable
2879 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2880 }
2881
2882 // Upgrade: Upgrade is the unit operation that upgrades a provisioned unit,
2883 // which may also include the underlying resources represented by a Unit. Can
2884 // only execute if the Unit is currently provisioned.
2885 type Upgrade struct {
2886 // InputVariables: Optional. Set of input variables. Maximum 100. (optional)
2887 InputVariables []*UnitVariable `json:"inputVariables,omitempty"`
2888 // Release: Optional. Reference to the Release object to use for the Unit.
2889 // (optional).
2890 Release string `json:"release,omitempty"`
2891 // ForceSendFields is a list of field names (e.g. "InputVariables") to
2892 // unconditionally include in API requests. By default, fields with empty or
2893 // default values are omitted from API requests. See
2894 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2895 // details.
2896 ForceSendFields []string `json:"-"`
2897 // NullFields is a list of field names (e.g. "InputVariables") to include in
2898 // API requests with the JSON null value. By default, fields with empty values
2899 // are omitted from API requests. See
2900 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2901 NullFields []string `json:"-"`
2902 }
2903
2904 func (s Upgrade) MarshalJSON() ([]byte, error) {
2905 type NoMethod Upgrade
2906 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2907 }
2908
2909 // VariableMapping: Mapping of input variables to their respective output
2910 // variable for depedenencies
2911 type VariableMapping struct {
2912 // From: Optional. Output variables which will get their values from
2913 // dependencies
2914 From *FromMapping `json:"from,omitempty"`
2915 // To: Optional. Input variables whose values will be passed on to
2916 // dependencies.
2917 To *ToMapping `json:"to,omitempty"`
2918 // Variable: Required. name of the variable
2919 Variable string `json:"variable,omitempty"`
2920 // ForceSendFields is a list of field names (e.g. "From") to unconditionally
2921 // include in API requests. By default, fields with empty or default values are
2922 // omitted from API requests. See
2923 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2924 // details.
2925 ForceSendFields []string `json:"-"`
2926 // NullFields is a list of field names (e.g. "From") to include in API requests
2927 // with the JSON null value. By default, fields with empty values are omitted
2928 // from API requests. See
2929 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2930 NullFields []string `json:"-"`
2931 }
2932
2933 func (s VariableMapping) MarshalJSON() ([]byte, error) {
2934 type NoMethod VariableMapping
2935 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2936 }
2937
2938 // Variant: Variant is an identifier for a value (name assigned to a value).
2939 // DEPRECATED: Use Flag.Variants instead.
2940 type Variant struct {
2941 // BoolValue: Optional. Boolean flag value.
2942 BoolValue bool `json:"boolValue,omitempty"`
2943 // DoubleValue: Optional. Double flag value.
2944 DoubleValue float64 `json:"doubleValue,omitempty"`
2945 // IntValue: Optional. Integer flag value.
2946 IntValue int64 `json:"intValue,omitempty,string"`
2947 // Name: Required. Name of the variant. Max length: 128 bytes.
2948 Name string `json:"name,omitempty"`
2949 // StringValue: Optional. String flag value.
2950 StringValue string `json:"stringValue,omitempty"`
2951 // ForceSendFields is a list of field names (e.g. "BoolValue") to
2952 // unconditionally include in API requests. By default, fields with empty or
2953 // default values are omitted from API requests. See
2954 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2955 // details.
2956 ForceSendFields []string `json:"-"`
2957 // NullFields is a list of field names (e.g. "BoolValue") to include in API
2958 // requests with the JSON null value. By default, fields with empty values are
2959 // omitted from API requests. See
2960 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2961 NullFields []string `json:"-"`
2962 }
2963
2964 func (s Variant) MarshalJSON() ([]byte, error) {
2965 type NoMethod Variant
2966 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2967 }
2968
2969 func (s *Variant) UnmarshalJSON(data []byte) error {
2970 type NoMethod Variant
2971 var s1 struct {
2972 DoubleValue gensupport.JSONFloat64 `json:"doubleValue"`
2973 *NoMethod
2974 }
2975 s1.NoMethod = (*NoMethod)(s)
2976 if err := json.Unmarshal(data, &s1); err != nil {
2977 return err
2978 }
2979 s.DoubleValue = float64(s1.DoubleValue)
2980 return nil
2981 }
2982
2983 type ProjectsLocationsGetCall struct {
2984 s *Service
2985 name string
2986 urlParams_ gensupport.URLParams
2987 ifNoneMatch_ string
2988 ctx_ context.Context
2989 header_ http.Header
2990 }
2991
2992 // Get: Gets information about a location.
2993 //
2994 // - name: Resource name for the location.
2995 func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
2996 c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2997 c.name = name
2998 return c
2999 }
3000
3001 // Fields allows partial responses to be retrieved. See
3002 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3003 // details.
3004 func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
3005 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3006 return c
3007 }
3008
3009 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3010 // object's ETag matches the given value. This is useful for getting updates
3011 // only after the object has changed since the last request.
3012 func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
3013 c.ifNoneMatch_ = entityTag
3014 return c
3015 }
3016
3017 // Context sets the context to be used in this call's Do method.
3018 func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
3019 c.ctx_ = ctx
3020 return c
3021 }
3022
3023 // Header returns a http.Header that can be modified by the caller to add
3024 // headers to the request.
3025 func (c *ProjectsLocationsGetCall) Header() http.Header {
3026 if c.header_ == nil {
3027 c.header_ = make(http.Header)
3028 }
3029 return c.header_
3030 }
3031
3032 func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
3033 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3034 if c.ifNoneMatch_ != "" {
3035 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3036 }
3037 c.urlParams_.Set("alt", alt)
3038 c.urlParams_.Set("prettyPrint", "false")
3039 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
3040 urls += "?" + c.urlParams_.Encode()
3041 req, err := http.NewRequest("GET", urls, nil)
3042 if err != nil {
3043 return nil, err
3044 }
3045 req.Header = reqHeaders
3046 googleapi.Expand(req.URL, map[string]string{
3047 "name": c.name,
3048 })
3049 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.get", "request", internallog.HTTPRequest(req, nil))
3050 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3051 }
3052
3053 // Do executes the "saasservicemgmt.projects.locations.get" call.
3054 // Any non-2xx status code is an error. Response headers are in either
3055 // *GoogleCloudLocationLocation.ServerResponse.Header or (if a response was
3056 // returned at all) in error.(*googleapi.Error).Header. Use
3057 // googleapi.IsNotModified to check whether the returned error was because
3058 // http.StatusNotModified was returned.
3059 func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudLocationLocation, error) {
3060 gensupport.SetOptions(c.urlParams_, opts...)
3061 res, err := c.doRequest("json")
3062 if res != nil && res.StatusCode == http.StatusNotModified {
3063 if res.Body != nil {
3064 res.Body.Close()
3065 }
3066 return nil, gensupport.WrapError(&googleapi.Error{
3067 Code: res.StatusCode,
3068 Header: res.Header,
3069 })
3070 }
3071 if err != nil {
3072 return nil, err
3073 }
3074 defer googleapi.CloseBody(res)
3075 if err := googleapi.CheckResponse(res); err != nil {
3076 return nil, gensupport.WrapError(err)
3077 }
3078 ret := &GoogleCloudLocationLocation{
3079 ServerResponse: googleapi.ServerResponse{
3080 Header: res.Header,
3081 HTTPStatusCode: res.StatusCode,
3082 },
3083 }
3084 target := &ret
3085 b, err := gensupport.DecodeResponseBytes(target, res)
3086 if err != nil {
3087 return nil, err
3088 }
3089 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.get", "response", internallog.HTTPResponse(res, b))
3090 return ret, nil
3091 }
3092
3093 type ProjectsLocationsListCall struct {
3094 s *Service
3095 name string
3096 urlParams_ gensupport.URLParams
3097 ifNoneMatch_ string
3098 ctx_ context.Context
3099 header_ http.Header
3100 }
3101
3102 // List: Lists information about the supported locations for this service. This
3103 // method lists locations based on the resource scope provided in the
3104 // [ListLocationsRequest.name] field: * **Global locations**: If `name` is
3105 // empty, the method lists the public locations available to all projects. *
3106 // **Project-specific locations**: If `name` follows the format
3107 // `projects/{project}`, the method lists locations visible to that specific
3108 // project. This includes public, private, or other project-specific locations
3109 // enabled for the project. For gRPC and client library implementations, the
3110 // resource name is passed as the `name` field. For direct service calls, the
3111 // resource name is incorporated into the request path based on the specific
3112 // service implementation and version.
3113 //
3114 // - name: The resource that owns the locations collection, if applicable.
3115 func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
3116 c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3117 c.name = name
3118 return c
3119 }
3120
3121 // ExtraLocationTypes sets the optional parameter "extraLocationTypes": Do not
3122 // use this field. It is unsupported and is ignored unless explicitly
3123 // documented otherwise. This is primarily for internal usage.
3124 func (c *ProjectsLocationsListCall) ExtraLocationTypes(extraLocationTypes ...string) *ProjectsLocationsListCall {
3125 c.urlParams_.SetMulti("extraLocationTypes", append([]string{}, extraLocationTypes...))
3126 return c
3127 }
3128
3129 // Filter sets the optional parameter "filter": A filter to narrow down results
3130 // to a preferred subset. The filtering language accepts strings like
3131 // "displayName=tokyo", and is documented in more detail in AIP-160
3132 // (https://google.aip.dev/160).
3133 func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
3134 c.urlParams_.Set("filter", filter)
3135 return c
3136 }
3137
3138 // PageSize sets the optional parameter "pageSize": The maximum number of
3139 // results to return. If not set, the service selects a default.
3140 func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
3141 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3142 return c
3143 }
3144
3145 // PageToken sets the optional parameter "pageToken": A page token received
3146 // from the `next_page_token` field in the response. Send that page token to
3147 // receive the subsequent page.
3148 func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
3149 c.urlParams_.Set("pageToken", pageToken)
3150 return c
3151 }
3152
3153 // Fields allows partial responses to be retrieved. See
3154 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3155 // details.
3156 func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
3157 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3158 return c
3159 }
3160
3161 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3162 // object's ETag matches the given value. This is useful for getting updates
3163 // only after the object has changed since the last request.
3164 func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
3165 c.ifNoneMatch_ = entityTag
3166 return c
3167 }
3168
3169 // Context sets the context to be used in this call's Do method.
3170 func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
3171 c.ctx_ = ctx
3172 return c
3173 }
3174
3175 // Header returns a http.Header that can be modified by the caller to add
3176 // headers to the request.
3177 func (c *ProjectsLocationsListCall) Header() http.Header {
3178 if c.header_ == nil {
3179 c.header_ = make(http.Header)
3180 }
3181 return c.header_
3182 }
3183
3184 func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
3185 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3186 if c.ifNoneMatch_ != "" {
3187 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3188 }
3189 c.urlParams_.Set("alt", alt)
3190 c.urlParams_.Set("prettyPrint", "false")
3191 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}/locations")
3192 urls += "?" + c.urlParams_.Encode()
3193 req, err := http.NewRequest("GET", urls, nil)
3194 if err != nil {
3195 return nil, err
3196 }
3197 req.Header = reqHeaders
3198 googleapi.Expand(req.URL, map[string]string{
3199 "name": c.name,
3200 })
3201 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.list", "request", internallog.HTTPRequest(req, nil))
3202 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3203 }
3204
3205 // Do executes the "saasservicemgmt.projects.locations.list" call.
3206 // Any non-2xx status code is an error. Response headers are in either
3207 // *ListLocationsResponse.ServerResponse.Header or (if a response was returned
3208 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3209 // check whether the returned error was because http.StatusNotModified was
3210 // returned.
3211 func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
3212 gensupport.SetOptions(c.urlParams_, opts...)
3213 res, err := c.doRequest("json")
3214 if res != nil && res.StatusCode == http.StatusNotModified {
3215 if res.Body != nil {
3216 res.Body.Close()
3217 }
3218 return nil, gensupport.WrapError(&googleapi.Error{
3219 Code: res.StatusCode,
3220 Header: res.Header,
3221 })
3222 }
3223 if err != nil {
3224 return nil, err
3225 }
3226 defer googleapi.CloseBody(res)
3227 if err := googleapi.CheckResponse(res); err != nil {
3228 return nil, gensupport.WrapError(err)
3229 }
3230 ret := &ListLocationsResponse{
3231 ServerResponse: googleapi.ServerResponse{
3232 Header: res.Header,
3233 HTTPStatusCode: res.StatusCode,
3234 },
3235 }
3236 target := &ret
3237 b, err := gensupport.DecodeResponseBytes(target, res)
3238 if err != nil {
3239 return nil, err
3240 }
3241 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.list", "response", internallog.HTTPResponse(res, b))
3242 return ret, nil
3243 }
3244
3245 // Pages invokes f for each page of results.
3246 // A non-nil error returned from f will halt the iteration.
3247 // The provided context supersedes any context provided to the Context method.
3248 func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
3249 c.ctx_ = ctx
3250 defer c.PageToken(c.urlParams_.Get("pageToken"))
3251 for {
3252 x, err := c.Do()
3253 if err != nil {
3254 return err
3255 }
3256 if err := f(x); err != nil {
3257 return err
3258 }
3259 if x.NextPageToken == "" {
3260 return nil
3261 }
3262 c.PageToken(x.NextPageToken)
3263 }
3264 }
3265
3266 type ProjectsLocationsFlagAttributesCreateCall struct {
3267 s *Service
3268 parent string
3269 flagattribute *FlagAttribute
3270 urlParams_ gensupport.URLParams
3271 ctx_ context.Context
3272 header_ http.Header
3273 }
3274
3275 // Create: Create a new flag attribute.
3276 //
3277 // - parent: The parent of the flag attribute.
3278 func (r *ProjectsLocationsFlagAttributesService) Create(parent string, flagattribute *FlagAttribute) *ProjectsLocationsFlagAttributesCreateCall {
3279 c := &ProjectsLocationsFlagAttributesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3280 c.parent = parent
3281 c.flagattribute = flagattribute
3282 return c
3283 }
3284
3285 // FlagAttributeId sets the optional parameter "flagAttributeId": Required. The
3286 // ID value for the new flag attribute.
3287 func (c *ProjectsLocationsFlagAttributesCreateCall) FlagAttributeId(flagAttributeId string) *ProjectsLocationsFlagAttributesCreateCall {
3288 c.urlParams_.Set("flagAttributeId", flagAttributeId)
3289 return c
3290 }
3291
3292 // RequestId sets the optional parameter "requestId": An optional request ID to
3293 // identify requests. Specify a unique request ID so that if you must retry
3294 // your request, the server will know to ignore the request if it has already
3295 // been completed. The server will guarantee that for at least 60 minutes since
3296 // the first request. For example, consider a situation where you make an
3297 // initial request and the request times out. If you make the request again
3298 // with the same request ID, the server can check if original operation with
3299 // the same request ID was received, and if so, will ignore the second request.
3300 // This prevents clients from accidentally creating duplicate commitments. The
3301 // request ID must be a valid UUID with the exception that zero UUID is not
3302 // supported (00000000-0000-0000-0000-000000000000).
3303 func (c *ProjectsLocationsFlagAttributesCreateCall) RequestId(requestId string) *ProjectsLocationsFlagAttributesCreateCall {
3304 c.urlParams_.Set("requestId", requestId)
3305 return c
3306 }
3307
3308 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3309 // is set to true, the service will try to validate that this request would
3310 // succeed, but will not actually make changes.
3311 func (c *ProjectsLocationsFlagAttributesCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagAttributesCreateCall {
3312 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3313 return c
3314 }
3315
3316 // Fields allows partial responses to be retrieved. See
3317 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3318 // details.
3319 func (c *ProjectsLocationsFlagAttributesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagAttributesCreateCall {
3320 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3321 return c
3322 }
3323
3324 // Context sets the context to be used in this call's Do method.
3325 func (c *ProjectsLocationsFlagAttributesCreateCall) Context(ctx context.Context) *ProjectsLocationsFlagAttributesCreateCall {
3326 c.ctx_ = ctx
3327 return c
3328 }
3329
3330 // Header returns a http.Header that can be modified by the caller to add
3331 // headers to the request.
3332 func (c *ProjectsLocationsFlagAttributesCreateCall) Header() http.Header {
3333 if c.header_ == nil {
3334 c.header_ = make(http.Header)
3335 }
3336 return c.header_
3337 }
3338
3339 func (c *ProjectsLocationsFlagAttributesCreateCall) doRequest(alt string) (*http.Response, error) {
3340 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3341 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flagattribute)
3342 if err != nil {
3343 return nil, err
3344 }
3345 c.urlParams_.Set("alt", alt)
3346 c.urlParams_.Set("prettyPrint", "false")
3347 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/flagAttributes")
3348 urls += "?" + c.urlParams_.Encode()
3349 req, err := http.NewRequest("POST", urls, body)
3350 if err != nil {
3351 return nil, err
3352 }
3353 req.Header = reqHeaders
3354 googleapi.Expand(req.URL, map[string]string{
3355 "parent": c.parent,
3356 })
3357 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3358 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3359 }
3360
3361 // Do executes the "saasservicemgmt.projects.locations.flagAttributes.create" call.
3362 // Any non-2xx status code is an error. Response headers are in either
3363 // *FlagAttribute.ServerResponse.Header or (if a response was returned at all)
3364 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3365 // whether the returned error was because http.StatusNotModified was returned.
3366 func (c *ProjectsLocationsFlagAttributesCreateCall) Do(opts ...googleapi.CallOption) (*FlagAttribute, error) {
3367 gensupport.SetOptions(c.urlParams_, opts...)
3368 res, err := c.doRequest("json")
3369 if res != nil && res.StatusCode == http.StatusNotModified {
3370 if res.Body != nil {
3371 res.Body.Close()
3372 }
3373 return nil, gensupport.WrapError(&googleapi.Error{
3374 Code: res.StatusCode,
3375 Header: res.Header,
3376 })
3377 }
3378 if err != nil {
3379 return nil, err
3380 }
3381 defer googleapi.CloseBody(res)
3382 if err := googleapi.CheckResponse(res); err != nil {
3383 return nil, gensupport.WrapError(err)
3384 }
3385 ret := &FlagAttribute{
3386 ServerResponse: googleapi.ServerResponse{
3387 Header: res.Header,
3388 HTTPStatusCode: res.StatusCode,
3389 },
3390 }
3391 target := &ret
3392 b, err := gensupport.DecodeResponseBytes(target, res)
3393 if err != nil {
3394 return nil, err
3395 }
3396 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.create", "response", internallog.HTTPResponse(res, b))
3397 return ret, nil
3398 }
3399
3400 type ProjectsLocationsFlagAttributesDeleteCall struct {
3401 s *Service
3402 name string
3403 urlParams_ gensupport.URLParams
3404 ctx_ context.Context
3405 header_ http.Header
3406 }
3407
3408 // Delete: Delete a single flag attribute.
3409 //
3410 // - name: The resource name of the resource within a service.
3411 func (r *ProjectsLocationsFlagAttributesService) Delete(name string) *ProjectsLocationsFlagAttributesDeleteCall {
3412 c := &ProjectsLocationsFlagAttributesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3413 c.name = name
3414 return c
3415 }
3416
3417 // Etag sets the optional parameter "etag": The etag known to the client for
3418 // the expected state of the flag attribute. This is used with state-changing
3419 // methods to prevent accidental overwrites when multiple user agents might be
3420 // acting in parallel on the same resource. An etag wildcard provide optimistic
3421 // concurrency based on the expected existence of the flag attribute. The Any
3422 // wildcard (`*`) requires that the resource must already exists, and the Not
3423 // Any wildcard (`!*`) requires that it must not.
3424 func (c *ProjectsLocationsFlagAttributesDeleteCall) Etag(etag string) *ProjectsLocationsFlagAttributesDeleteCall {
3425 c.urlParams_.Set("etag", etag)
3426 return c
3427 }
3428
3429 // RequestId sets the optional parameter "requestId": An optional request ID to
3430 // identify requests. Specify a unique request ID so that if you must retry
3431 // your request, the server will know to ignore the request if it has already
3432 // been completed. The server will guarantee that for at least 60 minutes since
3433 // the first request. For example, consider a situation where you make an
3434 // initial request and the request times out. If you make the request again
3435 // with the same request ID, the server can check if original operation with
3436 // the same request ID was received, and if so, will ignore the second request.
3437 // This prevents clients from accidentally creating duplicate commitments. The
3438 // request ID must be a valid UUID with the exception that zero UUID is not
3439 // supported (00000000-0000-0000-0000-000000000000).
3440 func (c *ProjectsLocationsFlagAttributesDeleteCall) RequestId(requestId string) *ProjectsLocationsFlagAttributesDeleteCall {
3441 c.urlParams_.Set("requestId", requestId)
3442 return c
3443 }
3444
3445 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3446 // is set to true, the service will try to validate that this request would
3447 // succeed, but will not actually make changes.
3448 func (c *ProjectsLocationsFlagAttributesDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagAttributesDeleteCall {
3449 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3450 return c
3451 }
3452
3453 // Fields allows partial responses to be retrieved. See
3454 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3455 // details.
3456 func (c *ProjectsLocationsFlagAttributesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagAttributesDeleteCall {
3457 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3458 return c
3459 }
3460
3461 // Context sets the context to be used in this call's Do method.
3462 func (c *ProjectsLocationsFlagAttributesDeleteCall) Context(ctx context.Context) *ProjectsLocationsFlagAttributesDeleteCall {
3463 c.ctx_ = ctx
3464 return c
3465 }
3466
3467 // Header returns a http.Header that can be modified by the caller to add
3468 // headers to the request.
3469 func (c *ProjectsLocationsFlagAttributesDeleteCall) Header() http.Header {
3470 if c.header_ == nil {
3471 c.header_ = make(http.Header)
3472 }
3473 return c.header_
3474 }
3475
3476 func (c *ProjectsLocationsFlagAttributesDeleteCall) doRequest(alt string) (*http.Response, error) {
3477 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3478 c.urlParams_.Set("alt", alt)
3479 c.urlParams_.Set("prettyPrint", "false")
3480 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
3481 urls += "?" + c.urlParams_.Encode()
3482 req, err := http.NewRequest("DELETE", urls, nil)
3483 if err != nil {
3484 return nil, err
3485 }
3486 req.Header = reqHeaders
3487 googleapi.Expand(req.URL, map[string]string{
3488 "name": c.name,
3489 })
3490 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.delete", "request", internallog.HTTPRequest(req, nil))
3491 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3492 }
3493
3494 // Do executes the "saasservicemgmt.projects.locations.flagAttributes.delete" call.
3495 // Any non-2xx status code is an error. Response headers are in either
3496 // *Empty.ServerResponse.Header or (if a response was returned at all) in
3497 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3498 // whether the returned error was because http.StatusNotModified was returned.
3499 func (c *ProjectsLocationsFlagAttributesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3500 gensupport.SetOptions(c.urlParams_, opts...)
3501 res, err := c.doRequest("json")
3502 if res != nil && res.StatusCode == http.StatusNotModified {
3503 if res.Body != nil {
3504 res.Body.Close()
3505 }
3506 return nil, gensupport.WrapError(&googleapi.Error{
3507 Code: res.StatusCode,
3508 Header: res.Header,
3509 })
3510 }
3511 if err != nil {
3512 return nil, err
3513 }
3514 defer googleapi.CloseBody(res)
3515 if err := googleapi.CheckResponse(res); err != nil {
3516 return nil, gensupport.WrapError(err)
3517 }
3518 ret := &Empty{
3519 ServerResponse: googleapi.ServerResponse{
3520 Header: res.Header,
3521 HTTPStatusCode: res.StatusCode,
3522 },
3523 }
3524 target := &ret
3525 b, err := gensupport.DecodeResponseBytes(target, res)
3526 if err != nil {
3527 return nil, err
3528 }
3529 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.delete", "response", internallog.HTTPResponse(res, b))
3530 return ret, nil
3531 }
3532
3533 type ProjectsLocationsFlagAttributesGetCall struct {
3534 s *Service
3535 name string
3536 urlParams_ gensupport.URLParams
3537 ifNoneMatch_ string
3538 ctx_ context.Context
3539 header_ http.Header
3540 }
3541
3542 // Get: Retrieve a single flag attribute.
3543 //
3544 // - name: The resource name of the resource within a service.
3545 func (r *ProjectsLocationsFlagAttributesService) Get(name string) *ProjectsLocationsFlagAttributesGetCall {
3546 c := &ProjectsLocationsFlagAttributesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3547 c.name = name
3548 return c
3549 }
3550
3551 // Fields allows partial responses to be retrieved. See
3552 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3553 // details.
3554 func (c *ProjectsLocationsFlagAttributesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagAttributesGetCall {
3555 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3556 return c
3557 }
3558
3559 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3560 // object's ETag matches the given value. This is useful for getting updates
3561 // only after the object has changed since the last request.
3562 func (c *ProjectsLocationsFlagAttributesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFlagAttributesGetCall {
3563 c.ifNoneMatch_ = entityTag
3564 return c
3565 }
3566
3567 // Context sets the context to be used in this call's Do method.
3568 func (c *ProjectsLocationsFlagAttributesGetCall) Context(ctx context.Context) *ProjectsLocationsFlagAttributesGetCall {
3569 c.ctx_ = ctx
3570 return c
3571 }
3572
3573 // Header returns a http.Header that can be modified by the caller to add
3574 // headers to the request.
3575 func (c *ProjectsLocationsFlagAttributesGetCall) Header() http.Header {
3576 if c.header_ == nil {
3577 c.header_ = make(http.Header)
3578 }
3579 return c.header_
3580 }
3581
3582 func (c *ProjectsLocationsFlagAttributesGetCall) doRequest(alt string) (*http.Response, error) {
3583 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3584 if c.ifNoneMatch_ != "" {
3585 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3586 }
3587 c.urlParams_.Set("alt", alt)
3588 c.urlParams_.Set("prettyPrint", "false")
3589 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
3590 urls += "?" + c.urlParams_.Encode()
3591 req, err := http.NewRequest("GET", urls, nil)
3592 if err != nil {
3593 return nil, err
3594 }
3595 req.Header = reqHeaders
3596 googleapi.Expand(req.URL, map[string]string{
3597 "name": c.name,
3598 })
3599 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.get", "request", internallog.HTTPRequest(req, nil))
3600 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3601 }
3602
3603 // Do executes the "saasservicemgmt.projects.locations.flagAttributes.get" call.
3604 // Any non-2xx status code is an error. Response headers are in either
3605 // *FlagAttribute.ServerResponse.Header or (if a response was returned at all)
3606 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3607 // whether the returned error was because http.StatusNotModified was returned.
3608 func (c *ProjectsLocationsFlagAttributesGetCall) Do(opts ...googleapi.CallOption) (*FlagAttribute, error) {
3609 gensupport.SetOptions(c.urlParams_, opts...)
3610 res, err := c.doRequest("json")
3611 if res != nil && res.StatusCode == http.StatusNotModified {
3612 if res.Body != nil {
3613 res.Body.Close()
3614 }
3615 return nil, gensupport.WrapError(&googleapi.Error{
3616 Code: res.StatusCode,
3617 Header: res.Header,
3618 })
3619 }
3620 if err != nil {
3621 return nil, err
3622 }
3623 defer googleapi.CloseBody(res)
3624 if err := googleapi.CheckResponse(res); err != nil {
3625 return nil, gensupport.WrapError(err)
3626 }
3627 ret := &FlagAttribute{
3628 ServerResponse: googleapi.ServerResponse{
3629 Header: res.Header,
3630 HTTPStatusCode: res.StatusCode,
3631 },
3632 }
3633 target := &ret
3634 b, err := gensupport.DecodeResponseBytes(target, res)
3635 if err != nil {
3636 return nil, err
3637 }
3638 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.get", "response", internallog.HTTPResponse(res, b))
3639 return ret, nil
3640 }
3641
3642 type ProjectsLocationsFlagAttributesListCall struct {
3643 s *Service
3644 parent string
3645 urlParams_ gensupport.URLParams
3646 ifNoneMatch_ string
3647 ctx_ context.Context
3648 header_ http.Header
3649 }
3650
3651 // List: Retrieve a collection of flag attributes.
3652 //
3653 // - parent: The parent of the flag attribute.
3654 func (r *ProjectsLocationsFlagAttributesService) List(parent string) *ProjectsLocationsFlagAttributesListCall {
3655 c := &ProjectsLocationsFlagAttributesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3656 c.parent = parent
3657 return c
3658 }
3659
3660 // Filter sets the optional parameter "filter": Filter the list as specified in
3661 // https://google.aip.dev/160.
3662 func (c *ProjectsLocationsFlagAttributesListCall) Filter(filter string) *ProjectsLocationsFlagAttributesListCall {
3663 c.urlParams_.Set("filter", filter)
3664 return c
3665 }
3666
3667 // OrderBy sets the optional parameter "orderBy": Order results as specified in
3668 // https://google.aip.dev/132.
3669 func (c *ProjectsLocationsFlagAttributesListCall) OrderBy(orderBy string) *ProjectsLocationsFlagAttributesListCall {
3670 c.urlParams_.Set("orderBy", orderBy)
3671 return c
3672 }
3673
3674 // PageSize sets the optional parameter "pageSize": The maximum number of flag
3675 // attributes to send per page.
3676 func (c *ProjectsLocationsFlagAttributesListCall) PageSize(pageSize int64) *ProjectsLocationsFlagAttributesListCall {
3677 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3678 return c
3679 }
3680
3681 // PageToken sets the optional parameter "pageToken": The page token: If the
3682 // next_page_token from a previous response is provided, this request will send
3683 // the subsequent page.
3684 func (c *ProjectsLocationsFlagAttributesListCall) PageToken(pageToken string) *ProjectsLocationsFlagAttributesListCall {
3685 c.urlParams_.Set("pageToken", pageToken)
3686 return c
3687 }
3688
3689 // Fields allows partial responses to be retrieved. See
3690 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3691 // details.
3692 func (c *ProjectsLocationsFlagAttributesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagAttributesListCall {
3693 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3694 return c
3695 }
3696
3697 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3698 // object's ETag matches the given value. This is useful for getting updates
3699 // only after the object has changed since the last request.
3700 func (c *ProjectsLocationsFlagAttributesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFlagAttributesListCall {
3701 c.ifNoneMatch_ = entityTag
3702 return c
3703 }
3704
3705 // Context sets the context to be used in this call's Do method.
3706 func (c *ProjectsLocationsFlagAttributesListCall) Context(ctx context.Context) *ProjectsLocationsFlagAttributesListCall {
3707 c.ctx_ = ctx
3708 return c
3709 }
3710
3711 // Header returns a http.Header that can be modified by the caller to add
3712 // headers to the request.
3713 func (c *ProjectsLocationsFlagAttributesListCall) Header() http.Header {
3714 if c.header_ == nil {
3715 c.header_ = make(http.Header)
3716 }
3717 return c.header_
3718 }
3719
3720 func (c *ProjectsLocationsFlagAttributesListCall) doRequest(alt string) (*http.Response, error) {
3721 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3722 if c.ifNoneMatch_ != "" {
3723 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3724 }
3725 c.urlParams_.Set("alt", alt)
3726 c.urlParams_.Set("prettyPrint", "false")
3727 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/flagAttributes")
3728 urls += "?" + c.urlParams_.Encode()
3729 req, err := http.NewRequest("GET", urls, nil)
3730 if err != nil {
3731 return nil, err
3732 }
3733 req.Header = reqHeaders
3734 googleapi.Expand(req.URL, map[string]string{
3735 "parent": c.parent,
3736 })
3737 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.list", "request", internallog.HTTPRequest(req, nil))
3738 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3739 }
3740
3741 // Do executes the "saasservicemgmt.projects.locations.flagAttributes.list" call.
3742 // Any non-2xx status code is an error. Response headers are in either
3743 // *ListFlagAttributesResponse.ServerResponse.Header or (if a response was
3744 // returned at all) in error.(*googleapi.Error).Header. Use
3745 // googleapi.IsNotModified to check whether the returned error was because
3746 // http.StatusNotModified was returned.
3747 func (c *ProjectsLocationsFlagAttributesListCall) Do(opts ...googleapi.CallOption) (*ListFlagAttributesResponse, error) {
3748 gensupport.SetOptions(c.urlParams_, opts...)
3749 res, err := c.doRequest("json")
3750 if res != nil && res.StatusCode == http.StatusNotModified {
3751 if res.Body != nil {
3752 res.Body.Close()
3753 }
3754 return nil, gensupport.WrapError(&googleapi.Error{
3755 Code: res.StatusCode,
3756 Header: res.Header,
3757 })
3758 }
3759 if err != nil {
3760 return nil, err
3761 }
3762 defer googleapi.CloseBody(res)
3763 if err := googleapi.CheckResponse(res); err != nil {
3764 return nil, gensupport.WrapError(err)
3765 }
3766 ret := &ListFlagAttributesResponse{
3767 ServerResponse: googleapi.ServerResponse{
3768 Header: res.Header,
3769 HTTPStatusCode: res.StatusCode,
3770 },
3771 }
3772 target := &ret
3773 b, err := gensupport.DecodeResponseBytes(target, res)
3774 if err != nil {
3775 return nil, err
3776 }
3777 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.list", "response", internallog.HTTPResponse(res, b))
3778 return ret, nil
3779 }
3780
3781 // Pages invokes f for each page of results.
3782 // A non-nil error returned from f will halt the iteration.
3783 // The provided context supersedes any context provided to the Context method.
3784 func (c *ProjectsLocationsFlagAttributesListCall) Pages(ctx context.Context, f func(*ListFlagAttributesResponse) error) error {
3785 c.ctx_ = ctx
3786 defer c.PageToken(c.urlParams_.Get("pageToken"))
3787 for {
3788 x, err := c.Do()
3789 if err != nil {
3790 return err
3791 }
3792 if err := f(x); err != nil {
3793 return err
3794 }
3795 if x.NextPageToken == "" {
3796 return nil
3797 }
3798 c.PageToken(x.NextPageToken)
3799 }
3800 }
3801
3802 type ProjectsLocationsFlagAttributesPatchCall struct {
3803 s *Service
3804 name string
3805 flagattribute *FlagAttribute
3806 urlParams_ gensupport.URLParams
3807 ctx_ context.Context
3808 header_ http.Header
3809 }
3810
3811 // Patch: Update a single flag attribute.
3812 //
3813 // - name: Identifier. The resource name (full URI of the resource) following
3814 // the standard naming scheme:
3815 // "projects/{project}/locations/{location}/flagAttributes/{flag_attribute_id}
3816 // ".
3817 func (r *ProjectsLocationsFlagAttributesService) Patch(name string, flagattribute *FlagAttribute) *ProjectsLocationsFlagAttributesPatchCall {
3818 c := &ProjectsLocationsFlagAttributesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3819 c.name = name
3820 c.flagattribute = flagattribute
3821 return c
3822 }
3823
3824 // RequestId sets the optional parameter "requestId": An optional request ID to
3825 // identify requests. Specify a unique request ID so that if you must retry
3826 // your request, the server will know to ignore the request if it has already
3827 // been completed. The server will guarantee that for at least 60 minutes since
3828 // the first request. For example, consider a situation where you make an
3829 // initial request and the request times out. If you make the request again
3830 // with the same request ID, the server can check if original operation with
3831 // the same request ID was received, and if so, will ignore the second request.
3832 // This prevents clients from accidentally creating duplicate commitments. The
3833 // request ID must be a valid UUID with the exception that zero UUID is not
3834 // supported (00000000-0000-0000-0000-000000000000).
3835 func (c *ProjectsLocationsFlagAttributesPatchCall) RequestId(requestId string) *ProjectsLocationsFlagAttributesPatchCall {
3836 c.urlParams_.Set("requestId", requestId)
3837 return c
3838 }
3839
3840 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
3841 // specify the fields to be overwritten in the FlagAttribute resource by the
3842 // update. The fields specified in the update_mask are relative to the
3843 // resource, not the full request. A field will be overwritten if it is in the
3844 // mask. If the user does not provide a mask then all fields in the
3845 // FlagAttribute will be overwritten.
3846 func (c *ProjectsLocationsFlagAttributesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFlagAttributesPatchCall {
3847 c.urlParams_.Set("updateMask", updateMask)
3848 return c
3849 }
3850
3851 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3852 // is set to true, the service will try to validate that this request would
3853 // succeed, but will not actually make changes.
3854 func (c *ProjectsLocationsFlagAttributesPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagAttributesPatchCall {
3855 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3856 return c
3857 }
3858
3859 // Fields allows partial responses to be retrieved. See
3860 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3861 // details.
3862 func (c *ProjectsLocationsFlagAttributesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagAttributesPatchCall {
3863 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3864 return c
3865 }
3866
3867 // Context sets the context to be used in this call's Do method.
3868 func (c *ProjectsLocationsFlagAttributesPatchCall) Context(ctx context.Context) *ProjectsLocationsFlagAttributesPatchCall {
3869 c.ctx_ = ctx
3870 return c
3871 }
3872
3873 // Header returns a http.Header that can be modified by the caller to add
3874 // headers to the request.
3875 func (c *ProjectsLocationsFlagAttributesPatchCall) Header() http.Header {
3876 if c.header_ == nil {
3877 c.header_ = make(http.Header)
3878 }
3879 return c.header_
3880 }
3881
3882 func (c *ProjectsLocationsFlagAttributesPatchCall) doRequest(alt string) (*http.Response, error) {
3883 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3884 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flagattribute)
3885 if err != nil {
3886 return nil, err
3887 }
3888 c.urlParams_.Set("alt", alt)
3889 c.urlParams_.Set("prettyPrint", "false")
3890 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
3891 urls += "?" + c.urlParams_.Encode()
3892 req, err := http.NewRequest("PATCH", urls, body)
3893 if err != nil {
3894 return nil, err
3895 }
3896 req.Header = reqHeaders
3897 googleapi.Expand(req.URL, map[string]string{
3898 "name": c.name,
3899 })
3900 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
3901 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3902 }
3903
3904 // Do executes the "saasservicemgmt.projects.locations.flagAttributes.patch" call.
3905 // Any non-2xx status code is an error. Response headers are in either
3906 // *FlagAttribute.ServerResponse.Header or (if a response was returned at all)
3907 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3908 // whether the returned error was because http.StatusNotModified was returned.
3909 func (c *ProjectsLocationsFlagAttributesPatchCall) Do(opts ...googleapi.CallOption) (*FlagAttribute, error) {
3910 gensupport.SetOptions(c.urlParams_, opts...)
3911 res, err := c.doRequest("json")
3912 if res != nil && res.StatusCode == http.StatusNotModified {
3913 if res.Body != nil {
3914 res.Body.Close()
3915 }
3916 return nil, gensupport.WrapError(&googleapi.Error{
3917 Code: res.StatusCode,
3918 Header: res.Header,
3919 })
3920 }
3921 if err != nil {
3922 return nil, err
3923 }
3924 defer googleapi.CloseBody(res)
3925 if err := googleapi.CheckResponse(res); err != nil {
3926 return nil, gensupport.WrapError(err)
3927 }
3928 ret := &FlagAttribute{
3929 ServerResponse: googleapi.ServerResponse{
3930 Header: res.Header,
3931 HTTPStatusCode: res.StatusCode,
3932 },
3933 }
3934 target := &ret
3935 b, err := gensupport.DecodeResponseBytes(target, res)
3936 if err != nil {
3937 return nil, err
3938 }
3939 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagAttributes.patch", "response", internallog.HTTPResponse(res, b))
3940 return ret, nil
3941 }
3942
3943 type ProjectsLocationsFlagReleasesCreateCall struct {
3944 s *Service
3945 parent string
3946 flagrelease *FlagRelease
3947 urlParams_ gensupport.URLParams
3948 ctx_ context.Context
3949 header_ http.Header
3950 }
3951
3952 // Create: Create a new flag release.
3953 //
3954 // - parent: The parent of the flag release.
3955 func (r *ProjectsLocationsFlagReleasesService) Create(parent string, flagrelease *FlagRelease) *ProjectsLocationsFlagReleasesCreateCall {
3956 c := &ProjectsLocationsFlagReleasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3957 c.parent = parent
3958 c.flagrelease = flagrelease
3959 return c
3960 }
3961
3962 // FlagReleaseId sets the optional parameter "flagReleaseId": Required. The ID
3963 // value for the new flag release.
3964 func (c *ProjectsLocationsFlagReleasesCreateCall) FlagReleaseId(flagReleaseId string) *ProjectsLocationsFlagReleasesCreateCall {
3965 c.urlParams_.Set("flagReleaseId", flagReleaseId)
3966 return c
3967 }
3968
3969 // RequestId sets the optional parameter "requestId": An optional request ID to
3970 // identify requests. Specify a unique request ID so that if you must retry
3971 // your request, the server will know to ignore the request if it has already
3972 // been completed. The server will guarantee that for at least 60 minutes since
3973 // the first request. For example, consider a situation where you make an
3974 // initial request and the request times out. If you make the request again
3975 // with the same request ID, the server can check if original operation with
3976 // the same request ID was received, and if so, will ignore the second request.
3977 // This prevents clients from accidentally creating duplicate commitments. The
3978 // request ID must be a valid UUID with the exception that zero UUID is not
3979 // supported (00000000-0000-0000-0000-000000000000).
3980 func (c *ProjectsLocationsFlagReleasesCreateCall) RequestId(requestId string) *ProjectsLocationsFlagReleasesCreateCall {
3981 c.urlParams_.Set("requestId", requestId)
3982 return c
3983 }
3984
3985 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
3986 // is set to true, the service will try to validate that this request would
3987 // succeed, but will not actually make changes.
3988 func (c *ProjectsLocationsFlagReleasesCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagReleasesCreateCall {
3989 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
3990 return c
3991 }
3992
3993 // Fields allows partial responses to be retrieved. See
3994 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3995 // details.
3996 func (c *ProjectsLocationsFlagReleasesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagReleasesCreateCall {
3997 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3998 return c
3999 }
4000
4001 // Context sets the context to be used in this call's Do method.
4002 func (c *ProjectsLocationsFlagReleasesCreateCall) Context(ctx context.Context) *ProjectsLocationsFlagReleasesCreateCall {
4003 c.ctx_ = ctx
4004 return c
4005 }
4006
4007 // Header returns a http.Header that can be modified by the caller to add
4008 // headers to the request.
4009 func (c *ProjectsLocationsFlagReleasesCreateCall) Header() http.Header {
4010 if c.header_ == nil {
4011 c.header_ = make(http.Header)
4012 }
4013 return c.header_
4014 }
4015
4016 func (c *ProjectsLocationsFlagReleasesCreateCall) doRequest(alt string) (*http.Response, error) {
4017 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4018 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flagrelease)
4019 if err != nil {
4020 return nil, err
4021 }
4022 c.urlParams_.Set("alt", alt)
4023 c.urlParams_.Set("prettyPrint", "false")
4024 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/flagReleases")
4025 urls += "?" + c.urlParams_.Encode()
4026 req, err := http.NewRequest("POST", urls, body)
4027 if err != nil {
4028 return nil, err
4029 }
4030 req.Header = reqHeaders
4031 googleapi.Expand(req.URL, map[string]string{
4032 "parent": c.parent,
4033 })
4034 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.create", "request", internallog.HTTPRequest(req, body.Bytes()))
4035 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4036 }
4037
4038 // Do executes the "saasservicemgmt.projects.locations.flagReleases.create" call.
4039 // Any non-2xx status code is an error. Response headers are in either
4040 // *FlagRelease.ServerResponse.Header or (if a response was returned at all) in
4041 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4042 // whether the returned error was because http.StatusNotModified was returned.
4043 func (c *ProjectsLocationsFlagReleasesCreateCall) Do(opts ...googleapi.CallOption) (*FlagRelease, error) {
4044 gensupport.SetOptions(c.urlParams_, opts...)
4045 res, err := c.doRequest("json")
4046 if res != nil && res.StatusCode == http.StatusNotModified {
4047 if res.Body != nil {
4048 res.Body.Close()
4049 }
4050 return nil, gensupport.WrapError(&googleapi.Error{
4051 Code: res.StatusCode,
4052 Header: res.Header,
4053 })
4054 }
4055 if err != nil {
4056 return nil, err
4057 }
4058 defer googleapi.CloseBody(res)
4059 if err := googleapi.CheckResponse(res); err != nil {
4060 return nil, gensupport.WrapError(err)
4061 }
4062 ret := &FlagRelease{
4063 ServerResponse: googleapi.ServerResponse{
4064 Header: res.Header,
4065 HTTPStatusCode: res.StatusCode,
4066 },
4067 }
4068 target := &ret
4069 b, err := gensupport.DecodeResponseBytes(target, res)
4070 if err != nil {
4071 return nil, err
4072 }
4073 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.create", "response", internallog.HTTPResponse(res, b))
4074 return ret, nil
4075 }
4076
4077 type ProjectsLocationsFlagReleasesDeleteCall struct {
4078 s *Service
4079 name string
4080 urlParams_ gensupport.URLParams
4081 ctx_ context.Context
4082 header_ http.Header
4083 }
4084
4085 // Delete: Delete a single flag release.
4086 //
4087 // - name: The resource name of the resource within a service.
4088 func (r *ProjectsLocationsFlagReleasesService) Delete(name string) *ProjectsLocationsFlagReleasesDeleteCall {
4089 c := &ProjectsLocationsFlagReleasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4090 c.name = name
4091 return c
4092 }
4093
4094 // Etag sets the optional parameter "etag": The etag known to the client for
4095 // the expected state of the flag release. This is used with state-changing
4096 // methods to prevent accidental overwrites when multiple user agents might be
4097 // acting in parallel on the same resource. An etag wildcard provide optimistic
4098 // concurrency based on the expected existence of the flag release. The Any
4099 // wildcard (`*`) requires that the resource must already exists, and the Not
4100 // Any wildcard (`!*`) requires that it must not.
4101 func (c *ProjectsLocationsFlagReleasesDeleteCall) Etag(etag string) *ProjectsLocationsFlagReleasesDeleteCall {
4102 c.urlParams_.Set("etag", etag)
4103 return c
4104 }
4105
4106 // RequestId sets the optional parameter "requestId": An optional request ID to
4107 // identify requests. Specify a unique request ID so that if you must retry
4108 // your request, the server will know to ignore the request if it has already
4109 // been completed. The server will guarantee that for at least 60 minutes since
4110 // the first request. For example, consider a situation where you make an
4111 // initial request and the request times out. If you make the request again
4112 // with the same request ID, the server can check if original operation with
4113 // the same request ID was received, and if so, will ignore the second request.
4114 // This prevents clients from accidentally creating duplicate commitments. The
4115 // request ID must be a valid UUID with the exception that zero UUID is not
4116 // supported (00000000-0000-0000-0000-000000000000).
4117 func (c *ProjectsLocationsFlagReleasesDeleteCall) RequestId(requestId string) *ProjectsLocationsFlagReleasesDeleteCall {
4118 c.urlParams_.Set("requestId", requestId)
4119 return c
4120 }
4121
4122 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
4123 // is set to true, the service will try to validate that this request would
4124 // succeed, but will not actually make changes.
4125 func (c *ProjectsLocationsFlagReleasesDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagReleasesDeleteCall {
4126 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
4127 return c
4128 }
4129
4130 // Fields allows partial responses to be retrieved. See
4131 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4132 // details.
4133 func (c *ProjectsLocationsFlagReleasesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagReleasesDeleteCall {
4134 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4135 return c
4136 }
4137
4138 // Context sets the context to be used in this call's Do method.
4139 func (c *ProjectsLocationsFlagReleasesDeleteCall) Context(ctx context.Context) *ProjectsLocationsFlagReleasesDeleteCall {
4140 c.ctx_ = ctx
4141 return c
4142 }
4143
4144 // Header returns a http.Header that can be modified by the caller to add
4145 // headers to the request.
4146 func (c *ProjectsLocationsFlagReleasesDeleteCall) Header() http.Header {
4147 if c.header_ == nil {
4148 c.header_ = make(http.Header)
4149 }
4150 return c.header_
4151 }
4152
4153 func (c *ProjectsLocationsFlagReleasesDeleteCall) doRequest(alt string) (*http.Response, error) {
4154 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4155 c.urlParams_.Set("alt", alt)
4156 c.urlParams_.Set("prettyPrint", "false")
4157 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
4158 urls += "?" + c.urlParams_.Encode()
4159 req, err := http.NewRequest("DELETE", urls, nil)
4160 if err != nil {
4161 return nil, err
4162 }
4163 req.Header = reqHeaders
4164 googleapi.Expand(req.URL, map[string]string{
4165 "name": c.name,
4166 })
4167 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.delete", "request", internallog.HTTPRequest(req, nil))
4168 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4169 }
4170
4171 // Do executes the "saasservicemgmt.projects.locations.flagReleases.delete" call.
4172 // Any non-2xx status code is an error. Response headers are in either
4173 // *Empty.ServerResponse.Header or (if a response was returned at all) in
4174 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4175 // whether the returned error was because http.StatusNotModified was returned.
4176 func (c *ProjectsLocationsFlagReleasesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4177 gensupport.SetOptions(c.urlParams_, opts...)
4178 res, err := c.doRequest("json")
4179 if res != nil && res.StatusCode == http.StatusNotModified {
4180 if res.Body != nil {
4181 res.Body.Close()
4182 }
4183 return nil, gensupport.WrapError(&googleapi.Error{
4184 Code: res.StatusCode,
4185 Header: res.Header,
4186 })
4187 }
4188 if err != nil {
4189 return nil, err
4190 }
4191 defer googleapi.CloseBody(res)
4192 if err := googleapi.CheckResponse(res); err != nil {
4193 return nil, gensupport.WrapError(err)
4194 }
4195 ret := &Empty{
4196 ServerResponse: googleapi.ServerResponse{
4197 Header: res.Header,
4198 HTTPStatusCode: res.StatusCode,
4199 },
4200 }
4201 target := &ret
4202 b, err := gensupport.DecodeResponseBytes(target, res)
4203 if err != nil {
4204 return nil, err
4205 }
4206 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.delete", "response", internallog.HTTPResponse(res, b))
4207 return ret, nil
4208 }
4209
4210 type ProjectsLocationsFlagReleasesGetCall struct {
4211 s *Service
4212 name string
4213 urlParams_ gensupport.URLParams
4214 ifNoneMatch_ string
4215 ctx_ context.Context
4216 header_ http.Header
4217 }
4218
4219 // Get: Retrieve a single flag release.
4220 //
4221 // - name: The resource name of the resource within a service.
4222 func (r *ProjectsLocationsFlagReleasesService) Get(name string) *ProjectsLocationsFlagReleasesGetCall {
4223 c := &ProjectsLocationsFlagReleasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4224 c.name = name
4225 return c
4226 }
4227
4228 // Fields allows partial responses to be retrieved. See
4229 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4230 // details.
4231 func (c *ProjectsLocationsFlagReleasesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagReleasesGetCall {
4232 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4233 return c
4234 }
4235
4236 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4237 // object's ETag matches the given value. This is useful for getting updates
4238 // only after the object has changed since the last request.
4239 func (c *ProjectsLocationsFlagReleasesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFlagReleasesGetCall {
4240 c.ifNoneMatch_ = entityTag
4241 return c
4242 }
4243
4244 // Context sets the context to be used in this call's Do method.
4245 func (c *ProjectsLocationsFlagReleasesGetCall) Context(ctx context.Context) *ProjectsLocationsFlagReleasesGetCall {
4246 c.ctx_ = ctx
4247 return c
4248 }
4249
4250 // Header returns a http.Header that can be modified by the caller to add
4251 // headers to the request.
4252 func (c *ProjectsLocationsFlagReleasesGetCall) Header() http.Header {
4253 if c.header_ == nil {
4254 c.header_ = make(http.Header)
4255 }
4256 return c.header_
4257 }
4258
4259 func (c *ProjectsLocationsFlagReleasesGetCall) doRequest(alt string) (*http.Response, error) {
4260 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4261 if c.ifNoneMatch_ != "" {
4262 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4263 }
4264 c.urlParams_.Set("alt", alt)
4265 c.urlParams_.Set("prettyPrint", "false")
4266 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
4267 urls += "?" + c.urlParams_.Encode()
4268 req, err := http.NewRequest("GET", urls, nil)
4269 if err != nil {
4270 return nil, err
4271 }
4272 req.Header = reqHeaders
4273 googleapi.Expand(req.URL, map[string]string{
4274 "name": c.name,
4275 })
4276 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.get", "request", internallog.HTTPRequest(req, nil))
4277 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4278 }
4279
4280 // Do executes the "saasservicemgmt.projects.locations.flagReleases.get" call.
4281 // Any non-2xx status code is an error. Response headers are in either
4282 // *FlagRelease.ServerResponse.Header or (if a response was returned at all) in
4283 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4284 // whether the returned error was because http.StatusNotModified was returned.
4285 func (c *ProjectsLocationsFlagReleasesGetCall) Do(opts ...googleapi.CallOption) (*FlagRelease, error) {
4286 gensupport.SetOptions(c.urlParams_, opts...)
4287 res, err := c.doRequest("json")
4288 if res != nil && res.StatusCode == http.StatusNotModified {
4289 if res.Body != nil {
4290 res.Body.Close()
4291 }
4292 return nil, gensupport.WrapError(&googleapi.Error{
4293 Code: res.StatusCode,
4294 Header: res.Header,
4295 })
4296 }
4297 if err != nil {
4298 return nil, err
4299 }
4300 defer googleapi.CloseBody(res)
4301 if err := googleapi.CheckResponse(res); err != nil {
4302 return nil, gensupport.WrapError(err)
4303 }
4304 ret := &FlagRelease{
4305 ServerResponse: googleapi.ServerResponse{
4306 Header: res.Header,
4307 HTTPStatusCode: res.StatusCode,
4308 },
4309 }
4310 target := &ret
4311 b, err := gensupport.DecodeResponseBytes(target, res)
4312 if err != nil {
4313 return nil, err
4314 }
4315 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.get", "response", internallog.HTTPResponse(res, b))
4316 return ret, nil
4317 }
4318
4319 type ProjectsLocationsFlagReleasesListCall struct {
4320 s *Service
4321 parent string
4322 urlParams_ gensupport.URLParams
4323 ifNoneMatch_ string
4324 ctx_ context.Context
4325 header_ http.Header
4326 }
4327
4328 // List: Retrieve a collection of flag releases.
4329 //
4330 // - parent: The parent of the flag release.
4331 func (r *ProjectsLocationsFlagReleasesService) List(parent string) *ProjectsLocationsFlagReleasesListCall {
4332 c := &ProjectsLocationsFlagReleasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4333 c.parent = parent
4334 return c
4335 }
4336
4337 // Filter sets the optional parameter "filter": Filter the list as specified in
4338 // https://google.aip.dev/160.
4339 func (c *ProjectsLocationsFlagReleasesListCall) Filter(filter string) *ProjectsLocationsFlagReleasesListCall {
4340 c.urlParams_.Set("filter", filter)
4341 return c
4342 }
4343
4344 // OrderBy sets the optional parameter "orderBy": Order results as specified in
4345 // https://google.aip.dev/132.
4346 func (c *ProjectsLocationsFlagReleasesListCall) OrderBy(orderBy string) *ProjectsLocationsFlagReleasesListCall {
4347 c.urlParams_.Set("orderBy", orderBy)
4348 return c
4349 }
4350
4351 // PageSize sets the optional parameter "pageSize": The maximum number of flag
4352 // releases to send per page.
4353 func (c *ProjectsLocationsFlagReleasesListCall) PageSize(pageSize int64) *ProjectsLocationsFlagReleasesListCall {
4354 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4355 return c
4356 }
4357
4358 // PageToken sets the optional parameter "pageToken": The page token: If the
4359 // next_page_token from a previous response is provided, this request will send
4360 // the subsequent page.
4361 func (c *ProjectsLocationsFlagReleasesListCall) PageToken(pageToken string) *ProjectsLocationsFlagReleasesListCall {
4362 c.urlParams_.Set("pageToken", pageToken)
4363 return c
4364 }
4365
4366 // Fields allows partial responses to be retrieved. See
4367 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4368 // details.
4369 func (c *ProjectsLocationsFlagReleasesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagReleasesListCall {
4370 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4371 return c
4372 }
4373
4374 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4375 // object's ETag matches the given value. This is useful for getting updates
4376 // only after the object has changed since the last request.
4377 func (c *ProjectsLocationsFlagReleasesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFlagReleasesListCall {
4378 c.ifNoneMatch_ = entityTag
4379 return c
4380 }
4381
4382 // Context sets the context to be used in this call's Do method.
4383 func (c *ProjectsLocationsFlagReleasesListCall) Context(ctx context.Context) *ProjectsLocationsFlagReleasesListCall {
4384 c.ctx_ = ctx
4385 return c
4386 }
4387
4388 // Header returns a http.Header that can be modified by the caller to add
4389 // headers to the request.
4390 func (c *ProjectsLocationsFlagReleasesListCall) Header() http.Header {
4391 if c.header_ == nil {
4392 c.header_ = make(http.Header)
4393 }
4394 return c.header_
4395 }
4396
4397 func (c *ProjectsLocationsFlagReleasesListCall) doRequest(alt string) (*http.Response, error) {
4398 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4399 if c.ifNoneMatch_ != "" {
4400 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4401 }
4402 c.urlParams_.Set("alt", alt)
4403 c.urlParams_.Set("prettyPrint", "false")
4404 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/flagReleases")
4405 urls += "?" + c.urlParams_.Encode()
4406 req, err := http.NewRequest("GET", urls, nil)
4407 if err != nil {
4408 return nil, err
4409 }
4410 req.Header = reqHeaders
4411 googleapi.Expand(req.URL, map[string]string{
4412 "parent": c.parent,
4413 })
4414 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.list", "request", internallog.HTTPRequest(req, nil))
4415 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4416 }
4417
4418 // Do executes the "saasservicemgmt.projects.locations.flagReleases.list" call.
4419 // Any non-2xx status code is an error. Response headers are in either
4420 // *ListFlagReleasesResponse.ServerResponse.Header or (if a response was
4421 // returned at all) in error.(*googleapi.Error).Header. Use
4422 // googleapi.IsNotModified to check whether the returned error was because
4423 // http.StatusNotModified was returned.
4424 func (c *ProjectsLocationsFlagReleasesListCall) Do(opts ...googleapi.CallOption) (*ListFlagReleasesResponse, error) {
4425 gensupport.SetOptions(c.urlParams_, opts...)
4426 res, err := c.doRequest("json")
4427 if res != nil && res.StatusCode == http.StatusNotModified {
4428 if res.Body != nil {
4429 res.Body.Close()
4430 }
4431 return nil, gensupport.WrapError(&googleapi.Error{
4432 Code: res.StatusCode,
4433 Header: res.Header,
4434 })
4435 }
4436 if err != nil {
4437 return nil, err
4438 }
4439 defer googleapi.CloseBody(res)
4440 if err := googleapi.CheckResponse(res); err != nil {
4441 return nil, gensupport.WrapError(err)
4442 }
4443 ret := &ListFlagReleasesResponse{
4444 ServerResponse: googleapi.ServerResponse{
4445 Header: res.Header,
4446 HTTPStatusCode: res.StatusCode,
4447 },
4448 }
4449 target := &ret
4450 b, err := gensupport.DecodeResponseBytes(target, res)
4451 if err != nil {
4452 return nil, err
4453 }
4454 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.list", "response", internallog.HTTPResponse(res, b))
4455 return ret, nil
4456 }
4457
4458 // Pages invokes f for each page of results.
4459 // A non-nil error returned from f will halt the iteration.
4460 // The provided context supersedes any context provided to the Context method.
4461 func (c *ProjectsLocationsFlagReleasesListCall) Pages(ctx context.Context, f func(*ListFlagReleasesResponse) error) error {
4462 c.ctx_ = ctx
4463 defer c.PageToken(c.urlParams_.Get("pageToken"))
4464 for {
4465 x, err := c.Do()
4466 if err != nil {
4467 return err
4468 }
4469 if err := f(x); err != nil {
4470 return err
4471 }
4472 if x.NextPageToken == "" {
4473 return nil
4474 }
4475 c.PageToken(x.NextPageToken)
4476 }
4477 }
4478
4479 type ProjectsLocationsFlagReleasesPatchCall struct {
4480 s *Service
4481 name string
4482 flagrelease *FlagRelease
4483 urlParams_ gensupport.URLParams
4484 ctx_ context.Context
4485 header_ http.Header
4486 }
4487
4488 // Patch: Update a single flag release.
4489 //
4490 // - name: Identifier. The resource name (full URI of the resource) following
4491 // the standard naming scheme:
4492 // "projects/{project}/locations/{location}/flagReleases/{flag_release_id}".
4493 func (r *ProjectsLocationsFlagReleasesService) Patch(name string, flagrelease *FlagRelease) *ProjectsLocationsFlagReleasesPatchCall {
4494 c := &ProjectsLocationsFlagReleasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4495 c.name = name
4496 c.flagrelease = flagrelease
4497 return c
4498 }
4499
4500 // RequestId sets the optional parameter "requestId": An optional request ID to
4501 // identify requests. Specify a unique request ID so that if you must retry
4502 // your request, the server will know to ignore the request if it has already
4503 // been completed. The server will guarantee that for at least 60 minutes since
4504 // the first request. For example, consider a situation where you make an
4505 // initial request and the request times out. If you make the request again
4506 // with the same request ID, the server can check if original operation with
4507 // the same request ID was received, and if so, will ignore the second request.
4508 // This prevents clients from accidentally creating duplicate commitments. The
4509 // request ID must be a valid UUID with the exception that zero UUID is not
4510 // supported (00000000-0000-0000-0000-000000000000).
4511 func (c *ProjectsLocationsFlagReleasesPatchCall) RequestId(requestId string) *ProjectsLocationsFlagReleasesPatchCall {
4512 c.urlParams_.Set("requestId", requestId)
4513 return c
4514 }
4515
4516 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
4517 // specify the fields to be overwritten in the FlagRelease resource by the
4518 // update. The fields specified in the update_mask are relative to the
4519 // resource, not the full request. A field will be overwritten if it is in the
4520 // mask. If the user does not provide a mask then all fields in the FlagRelease
4521 // will be overwritten.
4522 func (c *ProjectsLocationsFlagReleasesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFlagReleasesPatchCall {
4523 c.urlParams_.Set("updateMask", updateMask)
4524 return c
4525 }
4526
4527 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
4528 // is set to true, the service will try to validate that this request would
4529 // succeed, but will not actually make changes.
4530 func (c *ProjectsLocationsFlagReleasesPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagReleasesPatchCall {
4531 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
4532 return c
4533 }
4534
4535 // Fields allows partial responses to be retrieved. See
4536 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4537 // details.
4538 func (c *ProjectsLocationsFlagReleasesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagReleasesPatchCall {
4539 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4540 return c
4541 }
4542
4543 // Context sets the context to be used in this call's Do method.
4544 func (c *ProjectsLocationsFlagReleasesPatchCall) Context(ctx context.Context) *ProjectsLocationsFlagReleasesPatchCall {
4545 c.ctx_ = ctx
4546 return c
4547 }
4548
4549 // Header returns a http.Header that can be modified by the caller to add
4550 // headers to the request.
4551 func (c *ProjectsLocationsFlagReleasesPatchCall) Header() http.Header {
4552 if c.header_ == nil {
4553 c.header_ = make(http.Header)
4554 }
4555 return c.header_
4556 }
4557
4558 func (c *ProjectsLocationsFlagReleasesPatchCall) doRequest(alt string) (*http.Response, error) {
4559 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4560 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flagrelease)
4561 if err != nil {
4562 return nil, err
4563 }
4564 c.urlParams_.Set("alt", alt)
4565 c.urlParams_.Set("prettyPrint", "false")
4566 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
4567 urls += "?" + c.urlParams_.Encode()
4568 req, err := http.NewRequest("PATCH", urls, body)
4569 if err != nil {
4570 return nil, err
4571 }
4572 req.Header = reqHeaders
4573 googleapi.Expand(req.URL, map[string]string{
4574 "name": c.name,
4575 })
4576 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
4577 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4578 }
4579
4580 // Do executes the "saasservicemgmt.projects.locations.flagReleases.patch" call.
4581 // Any non-2xx status code is an error. Response headers are in either
4582 // *FlagRelease.ServerResponse.Header or (if a response was returned at all) in
4583 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4584 // whether the returned error was because http.StatusNotModified was returned.
4585 func (c *ProjectsLocationsFlagReleasesPatchCall) Do(opts ...googleapi.CallOption) (*FlagRelease, error) {
4586 gensupport.SetOptions(c.urlParams_, opts...)
4587 res, err := c.doRequest("json")
4588 if res != nil && res.StatusCode == http.StatusNotModified {
4589 if res.Body != nil {
4590 res.Body.Close()
4591 }
4592 return nil, gensupport.WrapError(&googleapi.Error{
4593 Code: res.StatusCode,
4594 Header: res.Header,
4595 })
4596 }
4597 if err != nil {
4598 return nil, err
4599 }
4600 defer googleapi.CloseBody(res)
4601 if err := googleapi.CheckResponse(res); err != nil {
4602 return nil, gensupport.WrapError(err)
4603 }
4604 ret := &FlagRelease{
4605 ServerResponse: googleapi.ServerResponse{
4606 Header: res.Header,
4607 HTTPStatusCode: res.StatusCode,
4608 },
4609 }
4610 target := &ret
4611 b, err := gensupport.DecodeResponseBytes(target, res)
4612 if err != nil {
4613 return nil, err
4614 }
4615 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagReleases.patch", "response", internallog.HTTPResponse(res, b))
4616 return ret, nil
4617 }
4618
4619 type ProjectsLocationsFlagRevisionsCreateCall struct {
4620 s *Service
4621 parent string
4622 flagrevision *FlagRevision
4623 urlParams_ gensupport.URLParams
4624 ctx_ context.Context
4625 header_ http.Header
4626 }
4627
4628 // Create: Create a new flag revision.
4629 //
4630 // - parent: The parent of the flag revision.
4631 func (r *ProjectsLocationsFlagRevisionsService) Create(parent string, flagrevision *FlagRevision) *ProjectsLocationsFlagRevisionsCreateCall {
4632 c := &ProjectsLocationsFlagRevisionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4633 c.parent = parent
4634 c.flagrevision = flagrevision
4635 return c
4636 }
4637
4638 // FlagRevisionId sets the optional parameter "flagRevisionId": Required. The
4639 // ID value for the new flag revision.
4640 func (c *ProjectsLocationsFlagRevisionsCreateCall) FlagRevisionId(flagRevisionId string) *ProjectsLocationsFlagRevisionsCreateCall {
4641 c.urlParams_.Set("flagRevisionId", flagRevisionId)
4642 return c
4643 }
4644
4645 // RequestId sets the optional parameter "requestId": An optional request ID to
4646 // identify requests. Specify a unique request ID so that if you must retry
4647 // your request, the server will know to ignore the request if it has already
4648 // been completed. The server will guarantee that for at least 60 minutes since
4649 // the first request. For example, consider a situation where you make an
4650 // initial request and the request times out. If you make the request again
4651 // with the same request ID, the server can check if original operation with
4652 // the same request ID was received, and if so, will ignore the second request.
4653 // This prevents clients from accidentally creating duplicate commitments. The
4654 // request ID must be a valid UUID with the exception that zero UUID is not
4655 // supported (00000000-0000-0000-0000-000000000000).
4656 func (c *ProjectsLocationsFlagRevisionsCreateCall) RequestId(requestId string) *ProjectsLocationsFlagRevisionsCreateCall {
4657 c.urlParams_.Set("requestId", requestId)
4658 return c
4659 }
4660
4661 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
4662 // is set to true, the service will try to validate that this request would
4663 // succeed, but will not actually make changes.
4664 func (c *ProjectsLocationsFlagRevisionsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagRevisionsCreateCall {
4665 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
4666 return c
4667 }
4668
4669 // Fields allows partial responses to be retrieved. See
4670 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4671 // details.
4672 func (c *ProjectsLocationsFlagRevisionsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagRevisionsCreateCall {
4673 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4674 return c
4675 }
4676
4677 // Context sets the context to be used in this call's Do method.
4678 func (c *ProjectsLocationsFlagRevisionsCreateCall) Context(ctx context.Context) *ProjectsLocationsFlagRevisionsCreateCall {
4679 c.ctx_ = ctx
4680 return c
4681 }
4682
4683 // Header returns a http.Header that can be modified by the caller to add
4684 // headers to the request.
4685 func (c *ProjectsLocationsFlagRevisionsCreateCall) Header() http.Header {
4686 if c.header_ == nil {
4687 c.header_ = make(http.Header)
4688 }
4689 return c.header_
4690 }
4691
4692 func (c *ProjectsLocationsFlagRevisionsCreateCall) doRequest(alt string) (*http.Response, error) {
4693 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4694 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flagrevision)
4695 if err != nil {
4696 return nil, err
4697 }
4698 c.urlParams_.Set("alt", alt)
4699 c.urlParams_.Set("prettyPrint", "false")
4700 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/flagRevisions")
4701 urls += "?" + c.urlParams_.Encode()
4702 req, err := http.NewRequest("POST", urls, body)
4703 if err != nil {
4704 return nil, err
4705 }
4706 req.Header = reqHeaders
4707 googleapi.Expand(req.URL, map[string]string{
4708 "parent": c.parent,
4709 })
4710 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.create", "request", internallog.HTTPRequest(req, body.Bytes()))
4711 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4712 }
4713
4714 // Do executes the "saasservicemgmt.projects.locations.flagRevisions.create" call.
4715 // Any non-2xx status code is an error. Response headers are in either
4716 // *FlagRevision.ServerResponse.Header or (if a response was returned at all)
4717 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4718 // whether the returned error was because http.StatusNotModified was returned.
4719 func (c *ProjectsLocationsFlagRevisionsCreateCall) Do(opts ...googleapi.CallOption) (*FlagRevision, error) {
4720 gensupport.SetOptions(c.urlParams_, opts...)
4721 res, err := c.doRequest("json")
4722 if res != nil && res.StatusCode == http.StatusNotModified {
4723 if res.Body != nil {
4724 res.Body.Close()
4725 }
4726 return nil, gensupport.WrapError(&googleapi.Error{
4727 Code: res.StatusCode,
4728 Header: res.Header,
4729 })
4730 }
4731 if err != nil {
4732 return nil, err
4733 }
4734 defer googleapi.CloseBody(res)
4735 if err := googleapi.CheckResponse(res); err != nil {
4736 return nil, gensupport.WrapError(err)
4737 }
4738 ret := &FlagRevision{
4739 ServerResponse: googleapi.ServerResponse{
4740 Header: res.Header,
4741 HTTPStatusCode: res.StatusCode,
4742 },
4743 }
4744 target := &ret
4745 b, err := gensupport.DecodeResponseBytes(target, res)
4746 if err != nil {
4747 return nil, err
4748 }
4749 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.create", "response", internallog.HTTPResponse(res, b))
4750 return ret, nil
4751 }
4752
4753 type ProjectsLocationsFlagRevisionsDeleteCall struct {
4754 s *Service
4755 name string
4756 urlParams_ gensupport.URLParams
4757 ctx_ context.Context
4758 header_ http.Header
4759 }
4760
4761 // Delete: Delete a single flag revision.
4762 //
4763 // - name: The resource name of the resource within a service.
4764 func (r *ProjectsLocationsFlagRevisionsService) Delete(name string) *ProjectsLocationsFlagRevisionsDeleteCall {
4765 c := &ProjectsLocationsFlagRevisionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4766 c.name = name
4767 return c
4768 }
4769
4770 // Etag sets the optional parameter "etag": The etag known to the client for
4771 // the expected state of the flag revision. This is used with state-changing
4772 // methods to prevent accidental overwrites when multiple user agents might be
4773 // acting in parallel on the same resource. An etag wildcard provide optimistic
4774 // concurrency based on the expected existence of the flag revision. The Any
4775 // wildcard (`*`) requires that the resource must already exists, and the Not
4776 // Any wildcard (`!*`) requires that it must not.
4777 func (c *ProjectsLocationsFlagRevisionsDeleteCall) Etag(etag string) *ProjectsLocationsFlagRevisionsDeleteCall {
4778 c.urlParams_.Set("etag", etag)
4779 return c
4780 }
4781
4782 // RequestId sets the optional parameter "requestId": An optional request ID to
4783 // identify requests. Specify a unique request ID so that if you must retry
4784 // your request, the server will know to ignore the request if it has already
4785 // been completed. The server will guarantee that for at least 60 minutes since
4786 // the first request. For example, consider a situation where you make an
4787 // initial request and the request times out. If you make the request again
4788 // with the same request ID, the server can check if original operation with
4789 // the same request ID was received, and if so, will ignore the second request.
4790 // This prevents clients from accidentally creating duplicate commitments. The
4791 // request ID must be a valid UUID with the exception that zero UUID is not
4792 // supported (00000000-0000-0000-0000-000000000000).
4793 func (c *ProjectsLocationsFlagRevisionsDeleteCall) RequestId(requestId string) *ProjectsLocationsFlagRevisionsDeleteCall {
4794 c.urlParams_.Set("requestId", requestId)
4795 return c
4796 }
4797
4798 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
4799 // is set to true, the service will try to validate that this request would
4800 // succeed, but will not actually make changes.
4801 func (c *ProjectsLocationsFlagRevisionsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagRevisionsDeleteCall {
4802 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
4803 return c
4804 }
4805
4806 // Fields allows partial responses to be retrieved. See
4807 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4808 // details.
4809 func (c *ProjectsLocationsFlagRevisionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagRevisionsDeleteCall {
4810 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4811 return c
4812 }
4813
4814 // Context sets the context to be used in this call's Do method.
4815 func (c *ProjectsLocationsFlagRevisionsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFlagRevisionsDeleteCall {
4816 c.ctx_ = ctx
4817 return c
4818 }
4819
4820 // Header returns a http.Header that can be modified by the caller to add
4821 // headers to the request.
4822 func (c *ProjectsLocationsFlagRevisionsDeleteCall) Header() http.Header {
4823 if c.header_ == nil {
4824 c.header_ = make(http.Header)
4825 }
4826 return c.header_
4827 }
4828
4829 func (c *ProjectsLocationsFlagRevisionsDeleteCall) doRequest(alt string) (*http.Response, error) {
4830 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4831 c.urlParams_.Set("alt", alt)
4832 c.urlParams_.Set("prettyPrint", "false")
4833 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
4834 urls += "?" + c.urlParams_.Encode()
4835 req, err := http.NewRequest("DELETE", urls, nil)
4836 if err != nil {
4837 return nil, err
4838 }
4839 req.Header = reqHeaders
4840 googleapi.Expand(req.URL, map[string]string{
4841 "name": c.name,
4842 })
4843 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.delete", "request", internallog.HTTPRequest(req, nil))
4844 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4845 }
4846
4847 // Do executes the "saasservicemgmt.projects.locations.flagRevisions.delete" call.
4848 // Any non-2xx status code is an error. Response headers are in either
4849 // *Empty.ServerResponse.Header or (if a response was returned at all) in
4850 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4851 // whether the returned error was because http.StatusNotModified was returned.
4852 func (c *ProjectsLocationsFlagRevisionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4853 gensupport.SetOptions(c.urlParams_, opts...)
4854 res, err := c.doRequest("json")
4855 if res != nil && res.StatusCode == http.StatusNotModified {
4856 if res.Body != nil {
4857 res.Body.Close()
4858 }
4859 return nil, gensupport.WrapError(&googleapi.Error{
4860 Code: res.StatusCode,
4861 Header: res.Header,
4862 })
4863 }
4864 if err != nil {
4865 return nil, err
4866 }
4867 defer googleapi.CloseBody(res)
4868 if err := googleapi.CheckResponse(res); err != nil {
4869 return nil, gensupport.WrapError(err)
4870 }
4871 ret := &Empty{
4872 ServerResponse: googleapi.ServerResponse{
4873 Header: res.Header,
4874 HTTPStatusCode: res.StatusCode,
4875 },
4876 }
4877 target := &ret
4878 b, err := gensupport.DecodeResponseBytes(target, res)
4879 if err != nil {
4880 return nil, err
4881 }
4882 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.delete", "response", internallog.HTTPResponse(res, b))
4883 return ret, nil
4884 }
4885
4886 type ProjectsLocationsFlagRevisionsGetCall struct {
4887 s *Service
4888 name string
4889 urlParams_ gensupport.URLParams
4890 ifNoneMatch_ string
4891 ctx_ context.Context
4892 header_ http.Header
4893 }
4894
4895 // Get: Retrieve a single flag revision.
4896 //
4897 // - name: The resource name of the resource within a service.
4898 func (r *ProjectsLocationsFlagRevisionsService) Get(name string) *ProjectsLocationsFlagRevisionsGetCall {
4899 c := &ProjectsLocationsFlagRevisionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4900 c.name = name
4901 return c
4902 }
4903
4904 // Fields allows partial responses to be retrieved. See
4905 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4906 // details.
4907 func (c *ProjectsLocationsFlagRevisionsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagRevisionsGetCall {
4908 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4909 return c
4910 }
4911
4912 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4913 // object's ETag matches the given value. This is useful for getting updates
4914 // only after the object has changed since the last request.
4915 func (c *ProjectsLocationsFlagRevisionsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFlagRevisionsGetCall {
4916 c.ifNoneMatch_ = entityTag
4917 return c
4918 }
4919
4920 // Context sets the context to be used in this call's Do method.
4921 func (c *ProjectsLocationsFlagRevisionsGetCall) Context(ctx context.Context) *ProjectsLocationsFlagRevisionsGetCall {
4922 c.ctx_ = ctx
4923 return c
4924 }
4925
4926 // Header returns a http.Header that can be modified by the caller to add
4927 // headers to the request.
4928 func (c *ProjectsLocationsFlagRevisionsGetCall) Header() http.Header {
4929 if c.header_ == nil {
4930 c.header_ = make(http.Header)
4931 }
4932 return c.header_
4933 }
4934
4935 func (c *ProjectsLocationsFlagRevisionsGetCall) doRequest(alt string) (*http.Response, error) {
4936 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4937 if c.ifNoneMatch_ != "" {
4938 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4939 }
4940 c.urlParams_.Set("alt", alt)
4941 c.urlParams_.Set("prettyPrint", "false")
4942 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
4943 urls += "?" + c.urlParams_.Encode()
4944 req, err := http.NewRequest("GET", urls, nil)
4945 if err != nil {
4946 return nil, err
4947 }
4948 req.Header = reqHeaders
4949 googleapi.Expand(req.URL, map[string]string{
4950 "name": c.name,
4951 })
4952 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.get", "request", internallog.HTTPRequest(req, nil))
4953 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4954 }
4955
4956 // Do executes the "saasservicemgmt.projects.locations.flagRevisions.get" call.
4957 // Any non-2xx status code is an error. Response headers are in either
4958 // *FlagRevision.ServerResponse.Header or (if a response was returned at all)
4959 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4960 // whether the returned error was because http.StatusNotModified was returned.
4961 func (c *ProjectsLocationsFlagRevisionsGetCall) Do(opts ...googleapi.CallOption) (*FlagRevision, error) {
4962 gensupport.SetOptions(c.urlParams_, opts...)
4963 res, err := c.doRequest("json")
4964 if res != nil && res.StatusCode == http.StatusNotModified {
4965 if res.Body != nil {
4966 res.Body.Close()
4967 }
4968 return nil, gensupport.WrapError(&googleapi.Error{
4969 Code: res.StatusCode,
4970 Header: res.Header,
4971 })
4972 }
4973 if err != nil {
4974 return nil, err
4975 }
4976 defer googleapi.CloseBody(res)
4977 if err := googleapi.CheckResponse(res); err != nil {
4978 return nil, gensupport.WrapError(err)
4979 }
4980 ret := &FlagRevision{
4981 ServerResponse: googleapi.ServerResponse{
4982 Header: res.Header,
4983 HTTPStatusCode: res.StatusCode,
4984 },
4985 }
4986 target := &ret
4987 b, err := gensupport.DecodeResponseBytes(target, res)
4988 if err != nil {
4989 return nil, err
4990 }
4991 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.get", "response", internallog.HTTPResponse(res, b))
4992 return ret, nil
4993 }
4994
4995 type ProjectsLocationsFlagRevisionsListCall struct {
4996 s *Service
4997 parent string
4998 urlParams_ gensupport.URLParams
4999 ifNoneMatch_ string
5000 ctx_ context.Context
5001 header_ http.Header
5002 }
5003
5004 // List: Retrieve a collection of flag revisions.
5005 //
5006 // - parent: The parent of the flag revision.
5007 func (r *ProjectsLocationsFlagRevisionsService) List(parent string) *ProjectsLocationsFlagRevisionsListCall {
5008 c := &ProjectsLocationsFlagRevisionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5009 c.parent = parent
5010 return c
5011 }
5012
5013 // Filter sets the optional parameter "filter": Filter the list as specified in
5014 // https://google.aip.dev/160.
5015 func (c *ProjectsLocationsFlagRevisionsListCall) Filter(filter string) *ProjectsLocationsFlagRevisionsListCall {
5016 c.urlParams_.Set("filter", filter)
5017 return c
5018 }
5019
5020 // OrderBy sets the optional parameter "orderBy": Order results as specified in
5021 // https://google.aip.dev/132.
5022 func (c *ProjectsLocationsFlagRevisionsListCall) OrderBy(orderBy string) *ProjectsLocationsFlagRevisionsListCall {
5023 c.urlParams_.Set("orderBy", orderBy)
5024 return c
5025 }
5026
5027 // PageSize sets the optional parameter "pageSize": The maximum number of flag
5028 // revisions to send per page.
5029 func (c *ProjectsLocationsFlagRevisionsListCall) PageSize(pageSize int64) *ProjectsLocationsFlagRevisionsListCall {
5030 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5031 return c
5032 }
5033
5034 // PageToken sets the optional parameter "pageToken": The page token: If the
5035 // next_page_token from a previous response is provided, this request will send
5036 // the subsequent page.
5037 func (c *ProjectsLocationsFlagRevisionsListCall) PageToken(pageToken string) *ProjectsLocationsFlagRevisionsListCall {
5038 c.urlParams_.Set("pageToken", pageToken)
5039 return c
5040 }
5041
5042 // Fields allows partial responses to be retrieved. See
5043 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5044 // details.
5045 func (c *ProjectsLocationsFlagRevisionsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagRevisionsListCall {
5046 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5047 return c
5048 }
5049
5050 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5051 // object's ETag matches the given value. This is useful for getting updates
5052 // only after the object has changed since the last request.
5053 func (c *ProjectsLocationsFlagRevisionsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFlagRevisionsListCall {
5054 c.ifNoneMatch_ = entityTag
5055 return c
5056 }
5057
5058 // Context sets the context to be used in this call's Do method.
5059 func (c *ProjectsLocationsFlagRevisionsListCall) Context(ctx context.Context) *ProjectsLocationsFlagRevisionsListCall {
5060 c.ctx_ = ctx
5061 return c
5062 }
5063
5064 // Header returns a http.Header that can be modified by the caller to add
5065 // headers to the request.
5066 func (c *ProjectsLocationsFlagRevisionsListCall) Header() http.Header {
5067 if c.header_ == nil {
5068 c.header_ = make(http.Header)
5069 }
5070 return c.header_
5071 }
5072
5073 func (c *ProjectsLocationsFlagRevisionsListCall) doRequest(alt string) (*http.Response, error) {
5074 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5075 if c.ifNoneMatch_ != "" {
5076 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5077 }
5078 c.urlParams_.Set("alt", alt)
5079 c.urlParams_.Set("prettyPrint", "false")
5080 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/flagRevisions")
5081 urls += "?" + c.urlParams_.Encode()
5082 req, err := http.NewRequest("GET", urls, nil)
5083 if err != nil {
5084 return nil, err
5085 }
5086 req.Header = reqHeaders
5087 googleapi.Expand(req.URL, map[string]string{
5088 "parent": c.parent,
5089 })
5090 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.list", "request", internallog.HTTPRequest(req, nil))
5091 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5092 }
5093
5094 // Do executes the "saasservicemgmt.projects.locations.flagRevisions.list" call.
5095 // Any non-2xx status code is an error. Response headers are in either
5096 // *ListFlagRevisionsResponse.ServerResponse.Header or (if a response was
5097 // returned at all) in error.(*googleapi.Error).Header. Use
5098 // googleapi.IsNotModified to check whether the returned error was because
5099 // http.StatusNotModified was returned.
5100 func (c *ProjectsLocationsFlagRevisionsListCall) Do(opts ...googleapi.CallOption) (*ListFlagRevisionsResponse, error) {
5101 gensupport.SetOptions(c.urlParams_, opts...)
5102 res, err := c.doRequest("json")
5103 if res != nil && res.StatusCode == http.StatusNotModified {
5104 if res.Body != nil {
5105 res.Body.Close()
5106 }
5107 return nil, gensupport.WrapError(&googleapi.Error{
5108 Code: res.StatusCode,
5109 Header: res.Header,
5110 })
5111 }
5112 if err != nil {
5113 return nil, err
5114 }
5115 defer googleapi.CloseBody(res)
5116 if err := googleapi.CheckResponse(res); err != nil {
5117 return nil, gensupport.WrapError(err)
5118 }
5119 ret := &ListFlagRevisionsResponse{
5120 ServerResponse: googleapi.ServerResponse{
5121 Header: res.Header,
5122 HTTPStatusCode: res.StatusCode,
5123 },
5124 }
5125 target := &ret
5126 b, err := gensupport.DecodeResponseBytes(target, res)
5127 if err != nil {
5128 return nil, err
5129 }
5130 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.list", "response", internallog.HTTPResponse(res, b))
5131 return ret, nil
5132 }
5133
5134 // Pages invokes f for each page of results.
5135 // A non-nil error returned from f will halt the iteration.
5136 // The provided context supersedes any context provided to the Context method.
5137 func (c *ProjectsLocationsFlagRevisionsListCall) Pages(ctx context.Context, f func(*ListFlagRevisionsResponse) error) error {
5138 c.ctx_ = ctx
5139 defer c.PageToken(c.urlParams_.Get("pageToken"))
5140 for {
5141 x, err := c.Do()
5142 if err != nil {
5143 return err
5144 }
5145 if err := f(x); err != nil {
5146 return err
5147 }
5148 if x.NextPageToken == "" {
5149 return nil
5150 }
5151 c.PageToken(x.NextPageToken)
5152 }
5153 }
5154
5155 type ProjectsLocationsFlagRevisionsPatchCall struct {
5156 s *Service
5157 name string
5158 flagrevision *FlagRevision
5159 urlParams_ gensupport.URLParams
5160 ctx_ context.Context
5161 header_ http.Header
5162 }
5163
5164 // Patch: Update a single flag revision.
5165 //
5166 // - name: Identifier. The resource name (full URI of the resource) following
5167 // the standard naming scheme:
5168 // "projects/{project}/locations/{location}/flagRevisions/{flag_revision_id}".
5169 func (r *ProjectsLocationsFlagRevisionsService) Patch(name string, flagrevision *FlagRevision) *ProjectsLocationsFlagRevisionsPatchCall {
5170 c := &ProjectsLocationsFlagRevisionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5171 c.name = name
5172 c.flagrevision = flagrevision
5173 return c
5174 }
5175
5176 // RequestId sets the optional parameter "requestId": An optional request ID to
5177 // identify requests. Specify a unique request ID so that if you must retry
5178 // your request, the server will know to ignore the request if it has already
5179 // been completed. The server will guarantee that for at least 60 minutes since
5180 // the first request. For example, consider a situation where you make an
5181 // initial request and the request times out. If you make the request again
5182 // with the same request ID, the server can check if original operation with
5183 // the same request ID was received, and if so, will ignore the second request.
5184 // This prevents clients from accidentally creating duplicate commitments. The
5185 // request ID must be a valid UUID with the exception that zero UUID is not
5186 // supported (00000000-0000-0000-0000-000000000000).
5187 func (c *ProjectsLocationsFlagRevisionsPatchCall) RequestId(requestId string) *ProjectsLocationsFlagRevisionsPatchCall {
5188 c.urlParams_.Set("requestId", requestId)
5189 return c
5190 }
5191
5192 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
5193 // specify the fields to be overwritten in the FlagRevision resource by the
5194 // update. The fields specified in the update_mask are relative to the
5195 // resource, not the full request. A field will be overwritten if it is in the
5196 // mask. If the user does not provide a mask then all fields in the
5197 // FlagRevision will be overwritten.
5198 func (c *ProjectsLocationsFlagRevisionsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFlagRevisionsPatchCall {
5199 c.urlParams_.Set("updateMask", updateMask)
5200 return c
5201 }
5202
5203 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5204 // is set to true, the service will try to validate that this request would
5205 // succeed, but will not actually make changes.
5206 func (c *ProjectsLocationsFlagRevisionsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagRevisionsPatchCall {
5207 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5208 return c
5209 }
5210
5211 // Fields allows partial responses to be retrieved. See
5212 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5213 // details.
5214 func (c *ProjectsLocationsFlagRevisionsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagRevisionsPatchCall {
5215 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5216 return c
5217 }
5218
5219 // Context sets the context to be used in this call's Do method.
5220 func (c *ProjectsLocationsFlagRevisionsPatchCall) Context(ctx context.Context) *ProjectsLocationsFlagRevisionsPatchCall {
5221 c.ctx_ = ctx
5222 return c
5223 }
5224
5225 // Header returns a http.Header that can be modified by the caller to add
5226 // headers to the request.
5227 func (c *ProjectsLocationsFlagRevisionsPatchCall) Header() http.Header {
5228 if c.header_ == nil {
5229 c.header_ = make(http.Header)
5230 }
5231 return c.header_
5232 }
5233
5234 func (c *ProjectsLocationsFlagRevisionsPatchCall) doRequest(alt string) (*http.Response, error) {
5235 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5236 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flagrevision)
5237 if err != nil {
5238 return nil, err
5239 }
5240 c.urlParams_.Set("alt", alt)
5241 c.urlParams_.Set("prettyPrint", "false")
5242 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5243 urls += "?" + c.urlParams_.Encode()
5244 req, err := http.NewRequest("PATCH", urls, body)
5245 if err != nil {
5246 return nil, err
5247 }
5248 req.Header = reqHeaders
5249 googleapi.Expand(req.URL, map[string]string{
5250 "name": c.name,
5251 })
5252 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
5253 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5254 }
5255
5256 // Do executes the "saasservicemgmt.projects.locations.flagRevisions.patch" call.
5257 // Any non-2xx status code is an error. Response headers are in either
5258 // *FlagRevision.ServerResponse.Header or (if a response was returned at all)
5259 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5260 // whether the returned error was because http.StatusNotModified was returned.
5261 func (c *ProjectsLocationsFlagRevisionsPatchCall) Do(opts ...googleapi.CallOption) (*FlagRevision, error) {
5262 gensupport.SetOptions(c.urlParams_, opts...)
5263 res, err := c.doRequest("json")
5264 if res != nil && res.StatusCode == http.StatusNotModified {
5265 if res.Body != nil {
5266 res.Body.Close()
5267 }
5268 return nil, gensupport.WrapError(&googleapi.Error{
5269 Code: res.StatusCode,
5270 Header: res.Header,
5271 })
5272 }
5273 if err != nil {
5274 return nil, err
5275 }
5276 defer googleapi.CloseBody(res)
5277 if err := googleapi.CheckResponse(res); err != nil {
5278 return nil, gensupport.WrapError(err)
5279 }
5280 ret := &FlagRevision{
5281 ServerResponse: googleapi.ServerResponse{
5282 Header: res.Header,
5283 HTTPStatusCode: res.StatusCode,
5284 },
5285 }
5286 target := &ret
5287 b, err := gensupport.DecodeResponseBytes(target, res)
5288 if err != nil {
5289 return nil, err
5290 }
5291 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flagRevisions.patch", "response", internallog.HTTPResponse(res, b))
5292 return ret, nil
5293 }
5294
5295 type ProjectsLocationsFlagsCreateCall struct {
5296 s *Service
5297 parent string
5298 flag *Flag
5299 urlParams_ gensupport.URLParams
5300 ctx_ context.Context
5301 header_ http.Header
5302 }
5303
5304 // Create: Create a new flag.
5305 //
5306 // - parent: The parent of the flag.
5307 func (r *ProjectsLocationsFlagsService) Create(parent string, flag *Flag) *ProjectsLocationsFlagsCreateCall {
5308 c := &ProjectsLocationsFlagsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5309 c.parent = parent
5310 c.flag = flag
5311 return c
5312 }
5313
5314 // FlagId sets the optional parameter "flagId": Required. The ID value for the
5315 // new flag.
5316 func (c *ProjectsLocationsFlagsCreateCall) FlagId(flagId string) *ProjectsLocationsFlagsCreateCall {
5317 c.urlParams_.Set("flagId", flagId)
5318 return c
5319 }
5320
5321 // RequestId sets the optional parameter "requestId": An optional request ID to
5322 // identify requests. Specify a unique request ID so that if you must retry
5323 // your request, the server will know to ignore the request if it has already
5324 // been completed. The server will guarantee that for at least 60 minutes since
5325 // the first request. For example, consider a situation where you make an
5326 // initial request and the request times out. If you make the request again
5327 // with the same request ID, the server can check if original operation with
5328 // the same request ID was received, and if so, will ignore the second request.
5329 // This prevents clients from accidentally creating duplicate commitments. The
5330 // request ID must be a valid UUID with the exception that zero UUID is not
5331 // supported (00000000-0000-0000-0000-000000000000).
5332 func (c *ProjectsLocationsFlagsCreateCall) RequestId(requestId string) *ProjectsLocationsFlagsCreateCall {
5333 c.urlParams_.Set("requestId", requestId)
5334 return c
5335 }
5336
5337 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5338 // is set to true, the service will try to validate that this request would
5339 // succeed, but will not actually make changes.
5340 func (c *ProjectsLocationsFlagsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagsCreateCall {
5341 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5342 return c
5343 }
5344
5345 // Fields allows partial responses to be retrieved. See
5346 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5347 // details.
5348 func (c *ProjectsLocationsFlagsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagsCreateCall {
5349 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5350 return c
5351 }
5352
5353 // Context sets the context to be used in this call's Do method.
5354 func (c *ProjectsLocationsFlagsCreateCall) Context(ctx context.Context) *ProjectsLocationsFlagsCreateCall {
5355 c.ctx_ = ctx
5356 return c
5357 }
5358
5359 // Header returns a http.Header that can be modified by the caller to add
5360 // headers to the request.
5361 func (c *ProjectsLocationsFlagsCreateCall) Header() http.Header {
5362 if c.header_ == nil {
5363 c.header_ = make(http.Header)
5364 }
5365 return c.header_
5366 }
5367
5368 func (c *ProjectsLocationsFlagsCreateCall) doRequest(alt string) (*http.Response, error) {
5369 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5370 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flag)
5371 if err != nil {
5372 return nil, err
5373 }
5374 c.urlParams_.Set("alt", alt)
5375 c.urlParams_.Set("prettyPrint", "false")
5376 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/flags")
5377 urls += "?" + c.urlParams_.Encode()
5378 req, err := http.NewRequest("POST", urls, body)
5379 if err != nil {
5380 return nil, err
5381 }
5382 req.Header = reqHeaders
5383 googleapi.Expand(req.URL, map[string]string{
5384 "parent": c.parent,
5385 })
5386 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5387 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5388 }
5389
5390 // Do executes the "saasservicemgmt.projects.locations.flags.create" call.
5391 // Any non-2xx status code is an error. Response headers are in either
5392 // *Flag.ServerResponse.Header or (if a response was returned at all) in
5393 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5394 // whether the returned error was because http.StatusNotModified was returned.
5395 func (c *ProjectsLocationsFlagsCreateCall) Do(opts ...googleapi.CallOption) (*Flag, error) {
5396 gensupport.SetOptions(c.urlParams_, opts...)
5397 res, err := c.doRequest("json")
5398 if res != nil && res.StatusCode == http.StatusNotModified {
5399 if res.Body != nil {
5400 res.Body.Close()
5401 }
5402 return nil, gensupport.WrapError(&googleapi.Error{
5403 Code: res.StatusCode,
5404 Header: res.Header,
5405 })
5406 }
5407 if err != nil {
5408 return nil, err
5409 }
5410 defer googleapi.CloseBody(res)
5411 if err := googleapi.CheckResponse(res); err != nil {
5412 return nil, gensupport.WrapError(err)
5413 }
5414 ret := &Flag{
5415 ServerResponse: googleapi.ServerResponse{
5416 Header: res.Header,
5417 HTTPStatusCode: res.StatusCode,
5418 },
5419 }
5420 target := &ret
5421 b, err := gensupport.DecodeResponseBytes(target, res)
5422 if err != nil {
5423 return nil, err
5424 }
5425 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.create", "response", internallog.HTTPResponse(res, b))
5426 return ret, nil
5427 }
5428
5429 type ProjectsLocationsFlagsDeleteCall struct {
5430 s *Service
5431 name string
5432 urlParams_ gensupport.URLParams
5433 ctx_ context.Context
5434 header_ http.Header
5435 }
5436
5437 // Delete: Delete a single flag.
5438 //
5439 // - name: The resource name of the resource within a service.
5440 func (r *ProjectsLocationsFlagsService) Delete(name string) *ProjectsLocationsFlagsDeleteCall {
5441 c := &ProjectsLocationsFlagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5442 c.name = name
5443 return c
5444 }
5445
5446 // Etag sets the optional parameter "etag": The etag known to the client for
5447 // the expected state of the flag. This is used with state-changing methods to
5448 // prevent accidental overwrites when multiple user agents might be acting in
5449 // parallel on the same resource. An etag wildcard provide optimistic
5450 // concurrency based on the expected existence of the flag. The Any wildcard
5451 // (`*`) requires that the resource must already exists, and the Not Any
5452 // wildcard (`!*`) requires that it must not.
5453 func (c *ProjectsLocationsFlagsDeleteCall) Etag(etag string) *ProjectsLocationsFlagsDeleteCall {
5454 c.urlParams_.Set("etag", etag)
5455 return c
5456 }
5457
5458 // RequestId sets the optional parameter "requestId": An optional request ID to
5459 // identify requests. Specify a unique request ID so that if you must retry
5460 // your request, the server will know to ignore the request if it has already
5461 // been completed. The server will guarantee that for at least 60 minutes since
5462 // the first request. For example, consider a situation where you make an
5463 // initial request and the request times out. If you make the request again
5464 // with the same request ID, the server can check if original operation with
5465 // the same request ID was received, and if so, will ignore the second request.
5466 // This prevents clients from accidentally creating duplicate commitments. The
5467 // request ID must be a valid UUID with the exception that zero UUID is not
5468 // supported (00000000-0000-0000-0000-000000000000).
5469 func (c *ProjectsLocationsFlagsDeleteCall) RequestId(requestId string) *ProjectsLocationsFlagsDeleteCall {
5470 c.urlParams_.Set("requestId", requestId)
5471 return c
5472 }
5473
5474 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5475 // is set to true, the service will try to validate that this request would
5476 // succeed, but will not actually make changes.
5477 func (c *ProjectsLocationsFlagsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagsDeleteCall {
5478 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5479 return c
5480 }
5481
5482 // Fields allows partial responses to be retrieved. See
5483 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5484 // details.
5485 func (c *ProjectsLocationsFlagsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagsDeleteCall {
5486 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5487 return c
5488 }
5489
5490 // Context sets the context to be used in this call's Do method.
5491 func (c *ProjectsLocationsFlagsDeleteCall) Context(ctx context.Context) *ProjectsLocationsFlagsDeleteCall {
5492 c.ctx_ = ctx
5493 return c
5494 }
5495
5496 // Header returns a http.Header that can be modified by the caller to add
5497 // headers to the request.
5498 func (c *ProjectsLocationsFlagsDeleteCall) Header() http.Header {
5499 if c.header_ == nil {
5500 c.header_ = make(http.Header)
5501 }
5502 return c.header_
5503 }
5504
5505 func (c *ProjectsLocationsFlagsDeleteCall) doRequest(alt string) (*http.Response, error) {
5506 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5507 c.urlParams_.Set("alt", alt)
5508 c.urlParams_.Set("prettyPrint", "false")
5509 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5510 urls += "?" + c.urlParams_.Encode()
5511 req, err := http.NewRequest("DELETE", urls, nil)
5512 if err != nil {
5513 return nil, err
5514 }
5515 req.Header = reqHeaders
5516 googleapi.Expand(req.URL, map[string]string{
5517 "name": c.name,
5518 })
5519 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.delete", "request", internallog.HTTPRequest(req, nil))
5520 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5521 }
5522
5523 // Do executes the "saasservicemgmt.projects.locations.flags.delete" call.
5524 // Any non-2xx status code is an error. Response headers are in either
5525 // *Empty.ServerResponse.Header or (if a response was returned at all) in
5526 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5527 // whether the returned error was because http.StatusNotModified was returned.
5528 func (c *ProjectsLocationsFlagsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5529 gensupport.SetOptions(c.urlParams_, opts...)
5530 res, err := c.doRequest("json")
5531 if res != nil && res.StatusCode == http.StatusNotModified {
5532 if res.Body != nil {
5533 res.Body.Close()
5534 }
5535 return nil, gensupport.WrapError(&googleapi.Error{
5536 Code: res.StatusCode,
5537 Header: res.Header,
5538 })
5539 }
5540 if err != nil {
5541 return nil, err
5542 }
5543 defer googleapi.CloseBody(res)
5544 if err := googleapi.CheckResponse(res); err != nil {
5545 return nil, gensupport.WrapError(err)
5546 }
5547 ret := &Empty{
5548 ServerResponse: googleapi.ServerResponse{
5549 Header: res.Header,
5550 HTTPStatusCode: res.StatusCode,
5551 },
5552 }
5553 target := &ret
5554 b, err := gensupport.DecodeResponseBytes(target, res)
5555 if err != nil {
5556 return nil, err
5557 }
5558 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.delete", "response", internallog.HTTPResponse(res, b))
5559 return ret, nil
5560 }
5561
5562 type ProjectsLocationsFlagsGetCall struct {
5563 s *Service
5564 name string
5565 urlParams_ gensupport.URLParams
5566 ifNoneMatch_ string
5567 ctx_ context.Context
5568 header_ http.Header
5569 }
5570
5571 // Get: Retrieve a single flag.
5572 //
5573 // - name: The resource name of the resource within a service.
5574 func (r *ProjectsLocationsFlagsService) Get(name string) *ProjectsLocationsFlagsGetCall {
5575 c := &ProjectsLocationsFlagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5576 c.name = name
5577 return c
5578 }
5579
5580 // Fields allows partial responses to be retrieved. See
5581 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5582 // details.
5583 func (c *ProjectsLocationsFlagsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagsGetCall {
5584 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5585 return c
5586 }
5587
5588 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5589 // object's ETag matches the given value. This is useful for getting updates
5590 // only after the object has changed since the last request.
5591 func (c *ProjectsLocationsFlagsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsFlagsGetCall {
5592 c.ifNoneMatch_ = entityTag
5593 return c
5594 }
5595
5596 // Context sets the context to be used in this call's Do method.
5597 func (c *ProjectsLocationsFlagsGetCall) Context(ctx context.Context) *ProjectsLocationsFlagsGetCall {
5598 c.ctx_ = ctx
5599 return c
5600 }
5601
5602 // Header returns a http.Header that can be modified by the caller to add
5603 // headers to the request.
5604 func (c *ProjectsLocationsFlagsGetCall) Header() http.Header {
5605 if c.header_ == nil {
5606 c.header_ = make(http.Header)
5607 }
5608 return c.header_
5609 }
5610
5611 func (c *ProjectsLocationsFlagsGetCall) doRequest(alt string) (*http.Response, error) {
5612 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5613 if c.ifNoneMatch_ != "" {
5614 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5615 }
5616 c.urlParams_.Set("alt", alt)
5617 c.urlParams_.Set("prettyPrint", "false")
5618 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5619 urls += "?" + c.urlParams_.Encode()
5620 req, err := http.NewRequest("GET", urls, nil)
5621 if err != nil {
5622 return nil, err
5623 }
5624 req.Header = reqHeaders
5625 googleapi.Expand(req.URL, map[string]string{
5626 "name": c.name,
5627 })
5628 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.get", "request", internallog.HTTPRequest(req, nil))
5629 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5630 }
5631
5632 // Do executes the "saasservicemgmt.projects.locations.flags.get" call.
5633 // Any non-2xx status code is an error. Response headers are in either
5634 // *Flag.ServerResponse.Header or (if a response was returned at all) in
5635 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5636 // whether the returned error was because http.StatusNotModified was returned.
5637 func (c *ProjectsLocationsFlagsGetCall) Do(opts ...googleapi.CallOption) (*Flag, error) {
5638 gensupport.SetOptions(c.urlParams_, opts...)
5639 res, err := c.doRequest("json")
5640 if res != nil && res.StatusCode == http.StatusNotModified {
5641 if res.Body != nil {
5642 res.Body.Close()
5643 }
5644 return nil, gensupport.WrapError(&googleapi.Error{
5645 Code: res.StatusCode,
5646 Header: res.Header,
5647 })
5648 }
5649 if err != nil {
5650 return nil, err
5651 }
5652 defer googleapi.CloseBody(res)
5653 if err := googleapi.CheckResponse(res); err != nil {
5654 return nil, gensupport.WrapError(err)
5655 }
5656 ret := &Flag{
5657 ServerResponse: googleapi.ServerResponse{
5658 Header: res.Header,
5659 HTTPStatusCode: res.StatusCode,
5660 },
5661 }
5662 target := &ret
5663 b, err := gensupport.DecodeResponseBytes(target, res)
5664 if err != nil {
5665 return nil, err
5666 }
5667 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.get", "response", internallog.HTTPResponse(res, b))
5668 return ret, nil
5669 }
5670
5671 type ProjectsLocationsFlagsListCall struct {
5672 s *Service
5673 parent string
5674 urlParams_ gensupport.URLParams
5675 ifNoneMatch_ string
5676 ctx_ context.Context
5677 header_ http.Header
5678 }
5679
5680 // List: Retrieve a collection of flags.
5681 //
5682 // - parent: The parent of the flag.
5683 func (r *ProjectsLocationsFlagsService) List(parent string) *ProjectsLocationsFlagsListCall {
5684 c := &ProjectsLocationsFlagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5685 c.parent = parent
5686 return c
5687 }
5688
5689 // Filter sets the optional parameter "filter": Filter the list as specified in
5690 // https://google.aip.dev/160.
5691 func (c *ProjectsLocationsFlagsListCall) Filter(filter string) *ProjectsLocationsFlagsListCall {
5692 c.urlParams_.Set("filter", filter)
5693 return c
5694 }
5695
5696 // OrderBy sets the optional parameter "orderBy": Order results as specified in
5697 // https://google.aip.dev/132.
5698 func (c *ProjectsLocationsFlagsListCall) OrderBy(orderBy string) *ProjectsLocationsFlagsListCall {
5699 c.urlParams_.Set("orderBy", orderBy)
5700 return c
5701 }
5702
5703 // PageSize sets the optional parameter "pageSize": The maximum number of flags
5704 // to send per page.
5705 func (c *ProjectsLocationsFlagsListCall) PageSize(pageSize int64) *ProjectsLocationsFlagsListCall {
5706 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5707 return c
5708 }
5709
5710 // PageToken sets the optional parameter "pageToken": The page token: If the
5711 // next_page_token from a previous response is provided, this request will send
5712 // the subsequent page.
5713 func (c *ProjectsLocationsFlagsListCall) PageToken(pageToken string) *ProjectsLocationsFlagsListCall {
5714 c.urlParams_.Set("pageToken", pageToken)
5715 return c
5716 }
5717
5718 // Fields allows partial responses to be retrieved. See
5719 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5720 // details.
5721 func (c *ProjectsLocationsFlagsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagsListCall {
5722 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5723 return c
5724 }
5725
5726 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5727 // object's ETag matches the given value. This is useful for getting updates
5728 // only after the object has changed since the last request.
5729 func (c *ProjectsLocationsFlagsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsFlagsListCall {
5730 c.ifNoneMatch_ = entityTag
5731 return c
5732 }
5733
5734 // Context sets the context to be used in this call's Do method.
5735 func (c *ProjectsLocationsFlagsListCall) Context(ctx context.Context) *ProjectsLocationsFlagsListCall {
5736 c.ctx_ = ctx
5737 return c
5738 }
5739
5740 // Header returns a http.Header that can be modified by the caller to add
5741 // headers to the request.
5742 func (c *ProjectsLocationsFlagsListCall) Header() http.Header {
5743 if c.header_ == nil {
5744 c.header_ = make(http.Header)
5745 }
5746 return c.header_
5747 }
5748
5749 func (c *ProjectsLocationsFlagsListCall) doRequest(alt string) (*http.Response, error) {
5750 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5751 if c.ifNoneMatch_ != "" {
5752 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5753 }
5754 c.urlParams_.Set("alt", alt)
5755 c.urlParams_.Set("prettyPrint", "false")
5756 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/flags")
5757 urls += "?" + c.urlParams_.Encode()
5758 req, err := http.NewRequest("GET", urls, nil)
5759 if err != nil {
5760 return nil, err
5761 }
5762 req.Header = reqHeaders
5763 googleapi.Expand(req.URL, map[string]string{
5764 "parent": c.parent,
5765 })
5766 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.list", "request", internallog.HTTPRequest(req, nil))
5767 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5768 }
5769
5770 // Do executes the "saasservicemgmt.projects.locations.flags.list" call.
5771 // Any non-2xx status code is an error. Response headers are in either
5772 // *ListFlagsResponse.ServerResponse.Header or (if a response was returned at
5773 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5774 // check whether the returned error was because http.StatusNotModified was
5775 // returned.
5776 func (c *ProjectsLocationsFlagsListCall) Do(opts ...googleapi.CallOption) (*ListFlagsResponse, error) {
5777 gensupport.SetOptions(c.urlParams_, opts...)
5778 res, err := c.doRequest("json")
5779 if res != nil && res.StatusCode == http.StatusNotModified {
5780 if res.Body != nil {
5781 res.Body.Close()
5782 }
5783 return nil, gensupport.WrapError(&googleapi.Error{
5784 Code: res.StatusCode,
5785 Header: res.Header,
5786 })
5787 }
5788 if err != nil {
5789 return nil, err
5790 }
5791 defer googleapi.CloseBody(res)
5792 if err := googleapi.CheckResponse(res); err != nil {
5793 return nil, gensupport.WrapError(err)
5794 }
5795 ret := &ListFlagsResponse{
5796 ServerResponse: googleapi.ServerResponse{
5797 Header: res.Header,
5798 HTTPStatusCode: res.StatusCode,
5799 },
5800 }
5801 target := &ret
5802 b, err := gensupport.DecodeResponseBytes(target, res)
5803 if err != nil {
5804 return nil, err
5805 }
5806 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.list", "response", internallog.HTTPResponse(res, b))
5807 return ret, nil
5808 }
5809
5810 // Pages invokes f for each page of results.
5811 // A non-nil error returned from f will halt the iteration.
5812 // The provided context supersedes any context provided to the Context method.
5813 func (c *ProjectsLocationsFlagsListCall) Pages(ctx context.Context, f func(*ListFlagsResponse) error) error {
5814 c.ctx_ = ctx
5815 defer c.PageToken(c.urlParams_.Get("pageToken"))
5816 for {
5817 x, err := c.Do()
5818 if err != nil {
5819 return err
5820 }
5821 if err := f(x); err != nil {
5822 return err
5823 }
5824 if x.NextPageToken == "" {
5825 return nil
5826 }
5827 c.PageToken(x.NextPageToken)
5828 }
5829 }
5830
5831 type ProjectsLocationsFlagsPatchCall struct {
5832 s *Service
5833 name string
5834 flag *Flag
5835 urlParams_ gensupport.URLParams
5836 ctx_ context.Context
5837 header_ http.Header
5838 }
5839
5840 // Patch: Update a single flag.
5841 //
5842 // - name: Identifier. The resource name (full URI of the resource) following
5843 // the standard naming scheme:
5844 // "projects/{project}/locations/{location}/flags/{flag_id}".
5845 func (r *ProjectsLocationsFlagsService) Patch(name string, flag *Flag) *ProjectsLocationsFlagsPatchCall {
5846 c := &ProjectsLocationsFlagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5847 c.name = name
5848 c.flag = flag
5849 return c
5850 }
5851
5852 // RequestId sets the optional parameter "requestId": An optional request ID to
5853 // identify requests. Specify a unique request ID so that if you must retry
5854 // your request, the server will know to ignore the request if it has already
5855 // been completed. The server will guarantee that for at least 60 minutes since
5856 // the first request. For example, consider a situation where you make an
5857 // initial request and the request times out. If you make the request again
5858 // with the same request ID, the server can check if original operation with
5859 // the same request ID was received, and if so, will ignore the second request.
5860 // This prevents clients from accidentally creating duplicate commitments. The
5861 // request ID must be a valid UUID with the exception that zero UUID is not
5862 // supported (00000000-0000-0000-0000-000000000000).
5863 func (c *ProjectsLocationsFlagsPatchCall) RequestId(requestId string) *ProjectsLocationsFlagsPatchCall {
5864 c.urlParams_.Set("requestId", requestId)
5865 return c
5866 }
5867
5868 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
5869 // specify the fields to be overwritten in the Flag resource by the update. The
5870 // fields specified in the update_mask are relative to the resource, not the
5871 // full request. A field will be overwritten if it is in the mask. If the user
5872 // does not provide a mask then all fields in the Flag will be overwritten.
5873 func (c *ProjectsLocationsFlagsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsFlagsPatchCall {
5874 c.urlParams_.Set("updateMask", updateMask)
5875 return c
5876 }
5877
5878 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
5879 // is set to true, the service will try to validate that this request would
5880 // succeed, but will not actually make changes.
5881 func (c *ProjectsLocationsFlagsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsFlagsPatchCall {
5882 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
5883 return c
5884 }
5885
5886 // Fields allows partial responses to be retrieved. See
5887 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5888 // details.
5889 func (c *ProjectsLocationsFlagsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsFlagsPatchCall {
5890 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5891 return c
5892 }
5893
5894 // Context sets the context to be used in this call's Do method.
5895 func (c *ProjectsLocationsFlagsPatchCall) Context(ctx context.Context) *ProjectsLocationsFlagsPatchCall {
5896 c.ctx_ = ctx
5897 return c
5898 }
5899
5900 // Header returns a http.Header that can be modified by the caller to add
5901 // headers to the request.
5902 func (c *ProjectsLocationsFlagsPatchCall) Header() http.Header {
5903 if c.header_ == nil {
5904 c.header_ = make(http.Header)
5905 }
5906 return c.header_
5907 }
5908
5909 func (c *ProjectsLocationsFlagsPatchCall) doRequest(alt string) (*http.Response, error) {
5910 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5911 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.flag)
5912 if err != nil {
5913 return nil, err
5914 }
5915 c.urlParams_.Set("alt", alt)
5916 c.urlParams_.Set("prettyPrint", "false")
5917 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
5918 urls += "?" + c.urlParams_.Encode()
5919 req, err := http.NewRequest("PATCH", urls, body)
5920 if err != nil {
5921 return nil, err
5922 }
5923 req.Header = reqHeaders
5924 googleapi.Expand(req.URL, map[string]string{
5925 "name": c.name,
5926 })
5927 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
5928 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5929 }
5930
5931 // Do executes the "saasservicemgmt.projects.locations.flags.patch" call.
5932 // Any non-2xx status code is an error. Response headers are in either
5933 // *Flag.ServerResponse.Header or (if a response was returned at all) in
5934 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5935 // whether the returned error was because http.StatusNotModified was returned.
5936 func (c *ProjectsLocationsFlagsPatchCall) Do(opts ...googleapi.CallOption) (*Flag, error) {
5937 gensupport.SetOptions(c.urlParams_, opts...)
5938 res, err := c.doRequest("json")
5939 if res != nil && res.StatusCode == http.StatusNotModified {
5940 if res.Body != nil {
5941 res.Body.Close()
5942 }
5943 return nil, gensupport.WrapError(&googleapi.Error{
5944 Code: res.StatusCode,
5945 Header: res.Header,
5946 })
5947 }
5948 if err != nil {
5949 return nil, err
5950 }
5951 defer googleapi.CloseBody(res)
5952 if err := googleapi.CheckResponse(res); err != nil {
5953 return nil, gensupport.WrapError(err)
5954 }
5955 ret := &Flag{
5956 ServerResponse: googleapi.ServerResponse{
5957 Header: res.Header,
5958 HTTPStatusCode: res.StatusCode,
5959 },
5960 }
5961 target := &ret
5962 b, err := gensupport.DecodeResponseBytes(target, res)
5963 if err != nil {
5964 return nil, err
5965 }
5966 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.flags.patch", "response", internallog.HTTPResponse(res, b))
5967 return ret, nil
5968 }
5969
5970 type ProjectsLocationsReleasesCreateCall struct {
5971 s *Service
5972 parent string
5973 release *Release
5974 urlParams_ gensupport.URLParams
5975 ctx_ context.Context
5976 header_ http.Header
5977 }
5978
5979 // Create: Create a new release.
5980 //
5981 // - parent: The parent of the release.
5982 func (r *ProjectsLocationsReleasesService) Create(parent string, release *Release) *ProjectsLocationsReleasesCreateCall {
5983 c := &ProjectsLocationsReleasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5984 c.parent = parent
5985 c.release = release
5986 return c
5987 }
5988
5989 // ReleaseId sets the optional parameter "releaseId": Required. The ID value
5990 // for the new release.
5991 func (c *ProjectsLocationsReleasesCreateCall) ReleaseId(releaseId string) *ProjectsLocationsReleasesCreateCall {
5992 c.urlParams_.Set("releaseId", releaseId)
5993 return c
5994 }
5995
5996 // RequestId sets the optional parameter "requestId": An optional request ID to
5997 // identify requests. Specify a unique request ID so that if you must retry
5998 // your request, the server will know to ignore the request if it has already
5999 // been completed. The server will guarantee that for at least 60 minutes since
6000 // the first request. For example, consider a situation where you make an
6001 // initial request and the request times out. If you make the request again
6002 // with the same request ID, the server can check if original operation with
6003 // the same request ID was received, and if so, will ignore the second request.
6004 // This prevents clients from accidentally creating duplicate commitments. The
6005 // request ID must be a valid UUID with the exception that zero UUID is not
6006 // supported (00000000-0000-0000-0000-000000000000).
6007 func (c *ProjectsLocationsReleasesCreateCall) RequestId(requestId string) *ProjectsLocationsReleasesCreateCall {
6008 c.urlParams_.Set("requestId", requestId)
6009 return c
6010 }
6011
6012 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
6013 // is set to true, the service will try to validate that this request would
6014 // succeed, but will not actually make changes.
6015 func (c *ProjectsLocationsReleasesCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsReleasesCreateCall {
6016 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
6017 return c
6018 }
6019
6020 // Fields allows partial responses to be retrieved. See
6021 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6022 // details.
6023 func (c *ProjectsLocationsReleasesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesCreateCall {
6024 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6025 return c
6026 }
6027
6028 // Context sets the context to be used in this call's Do method.
6029 func (c *ProjectsLocationsReleasesCreateCall) Context(ctx context.Context) *ProjectsLocationsReleasesCreateCall {
6030 c.ctx_ = ctx
6031 return c
6032 }
6033
6034 // Header returns a http.Header that can be modified by the caller to add
6035 // headers to the request.
6036 func (c *ProjectsLocationsReleasesCreateCall) Header() http.Header {
6037 if c.header_ == nil {
6038 c.header_ = make(http.Header)
6039 }
6040 return c.header_
6041 }
6042
6043 func (c *ProjectsLocationsReleasesCreateCall) doRequest(alt string) (*http.Response, error) {
6044 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6045 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release)
6046 if err != nil {
6047 return nil, err
6048 }
6049 c.urlParams_.Set("alt", alt)
6050 c.urlParams_.Set("prettyPrint", "false")
6051 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releases")
6052 urls += "?" + c.urlParams_.Encode()
6053 req, err := http.NewRequest("POST", urls, body)
6054 if err != nil {
6055 return nil, err
6056 }
6057 req.Header = reqHeaders
6058 googleapi.Expand(req.URL, map[string]string{
6059 "parent": c.parent,
6060 })
6061 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.create", "request", internallog.HTTPRequest(req, body.Bytes()))
6062 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6063 }
6064
6065 // Do executes the "saasservicemgmt.projects.locations.releases.create" call.
6066 // Any non-2xx status code is an error. Response headers are in either
6067 // *Release.ServerResponse.Header or (if a response was returned at all) in
6068 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6069 // whether the returned error was because http.StatusNotModified was returned.
6070 func (c *ProjectsLocationsReleasesCreateCall) Do(opts ...googleapi.CallOption) (*Release, error) {
6071 gensupport.SetOptions(c.urlParams_, opts...)
6072 res, err := c.doRequest("json")
6073 if res != nil && res.StatusCode == http.StatusNotModified {
6074 if res.Body != nil {
6075 res.Body.Close()
6076 }
6077 return nil, gensupport.WrapError(&googleapi.Error{
6078 Code: res.StatusCode,
6079 Header: res.Header,
6080 })
6081 }
6082 if err != nil {
6083 return nil, err
6084 }
6085 defer googleapi.CloseBody(res)
6086 if err := googleapi.CheckResponse(res); err != nil {
6087 return nil, gensupport.WrapError(err)
6088 }
6089 ret := &Release{
6090 ServerResponse: googleapi.ServerResponse{
6091 Header: res.Header,
6092 HTTPStatusCode: res.StatusCode,
6093 },
6094 }
6095 target := &ret
6096 b, err := gensupport.DecodeResponseBytes(target, res)
6097 if err != nil {
6098 return nil, err
6099 }
6100 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.create", "response", internallog.HTTPResponse(res, b))
6101 return ret, nil
6102 }
6103
6104 type ProjectsLocationsReleasesDeleteCall struct {
6105 s *Service
6106 name string
6107 urlParams_ gensupport.URLParams
6108 ctx_ context.Context
6109 header_ http.Header
6110 }
6111
6112 // Delete: Delete a single release.
6113 //
6114 // - name: The resource name of the resource within a service.
6115 func (r *ProjectsLocationsReleasesService) Delete(name string) *ProjectsLocationsReleasesDeleteCall {
6116 c := &ProjectsLocationsReleasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6117 c.name = name
6118 return c
6119 }
6120
6121 // Etag sets the optional parameter "etag": The etag known to the client for
6122 // the expected state of the release. This is used with state-changing methods
6123 // to prevent accidental overwrites when multiple user agents might be acting
6124 // in parallel on the same resource. An etag wildcard provide optimistic
6125 // concurrency based on the expected existence of the release. The Any wildcard
6126 // (`*`) requires that the resource must already exists, and the Not Any
6127 // wildcard (`!*`) requires that it must not.
6128 func (c *ProjectsLocationsReleasesDeleteCall) Etag(etag string) *ProjectsLocationsReleasesDeleteCall {
6129 c.urlParams_.Set("etag", etag)
6130 return c
6131 }
6132
6133 // RequestId sets the optional parameter "requestId": An optional request ID to
6134 // identify requests. Specify a unique request ID so that if you must retry
6135 // your request, the server will know to ignore the request if it has already
6136 // been completed. The server will guarantee that for at least 60 minutes since
6137 // the first request. For example, consider a situation where you make an
6138 // initial request and the request times out. If you make the request again
6139 // with the same request ID, the server can check if original operation with
6140 // the same request ID was received, and if so, will ignore the second request.
6141 // This prevents clients from accidentally creating duplicate commitments. The
6142 // request ID must be a valid UUID with the exception that zero UUID is not
6143 // supported (00000000-0000-0000-0000-000000000000).
6144 func (c *ProjectsLocationsReleasesDeleteCall) RequestId(requestId string) *ProjectsLocationsReleasesDeleteCall {
6145 c.urlParams_.Set("requestId", requestId)
6146 return c
6147 }
6148
6149 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
6150 // is set to true, the service will try to validate that this request would
6151 // succeed, but will not actually make changes.
6152 func (c *ProjectsLocationsReleasesDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsReleasesDeleteCall {
6153 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
6154 return c
6155 }
6156
6157 // Fields allows partial responses to be retrieved. See
6158 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6159 // details.
6160 func (c *ProjectsLocationsReleasesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesDeleteCall {
6161 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6162 return c
6163 }
6164
6165 // Context sets the context to be used in this call's Do method.
6166 func (c *ProjectsLocationsReleasesDeleteCall) Context(ctx context.Context) *ProjectsLocationsReleasesDeleteCall {
6167 c.ctx_ = ctx
6168 return c
6169 }
6170
6171 // Header returns a http.Header that can be modified by the caller to add
6172 // headers to the request.
6173 func (c *ProjectsLocationsReleasesDeleteCall) Header() http.Header {
6174 if c.header_ == nil {
6175 c.header_ = make(http.Header)
6176 }
6177 return c.header_
6178 }
6179
6180 func (c *ProjectsLocationsReleasesDeleteCall) doRequest(alt string) (*http.Response, error) {
6181 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6182 c.urlParams_.Set("alt", alt)
6183 c.urlParams_.Set("prettyPrint", "false")
6184 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6185 urls += "?" + c.urlParams_.Encode()
6186 req, err := http.NewRequest("DELETE", urls, nil)
6187 if err != nil {
6188 return nil, err
6189 }
6190 req.Header = reqHeaders
6191 googleapi.Expand(req.URL, map[string]string{
6192 "name": c.name,
6193 })
6194 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.delete", "request", internallog.HTTPRequest(req, nil))
6195 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6196 }
6197
6198 // Do executes the "saasservicemgmt.projects.locations.releases.delete" call.
6199 // Any non-2xx status code is an error. Response headers are in either
6200 // *Empty.ServerResponse.Header or (if a response was returned at all) in
6201 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6202 // whether the returned error was because http.StatusNotModified was returned.
6203 func (c *ProjectsLocationsReleasesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6204 gensupport.SetOptions(c.urlParams_, opts...)
6205 res, err := c.doRequest("json")
6206 if res != nil && res.StatusCode == http.StatusNotModified {
6207 if res.Body != nil {
6208 res.Body.Close()
6209 }
6210 return nil, gensupport.WrapError(&googleapi.Error{
6211 Code: res.StatusCode,
6212 Header: res.Header,
6213 })
6214 }
6215 if err != nil {
6216 return nil, err
6217 }
6218 defer googleapi.CloseBody(res)
6219 if err := googleapi.CheckResponse(res); err != nil {
6220 return nil, gensupport.WrapError(err)
6221 }
6222 ret := &Empty{
6223 ServerResponse: googleapi.ServerResponse{
6224 Header: res.Header,
6225 HTTPStatusCode: res.StatusCode,
6226 },
6227 }
6228 target := &ret
6229 b, err := gensupport.DecodeResponseBytes(target, res)
6230 if err != nil {
6231 return nil, err
6232 }
6233 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.delete", "response", internallog.HTTPResponse(res, b))
6234 return ret, nil
6235 }
6236
6237 type ProjectsLocationsReleasesGetCall struct {
6238 s *Service
6239 name string
6240 urlParams_ gensupport.URLParams
6241 ifNoneMatch_ string
6242 ctx_ context.Context
6243 header_ http.Header
6244 }
6245
6246 // Get: Retrieve a single release.
6247 //
6248 // - name: The resource name of the resource within a service.
6249 func (r *ProjectsLocationsReleasesService) Get(name string) *ProjectsLocationsReleasesGetCall {
6250 c := &ProjectsLocationsReleasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6251 c.name = name
6252 return c
6253 }
6254
6255 // Fields allows partial responses to be retrieved. See
6256 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6257 // details.
6258 func (c *ProjectsLocationsReleasesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesGetCall {
6259 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6260 return c
6261 }
6262
6263 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6264 // object's ETag matches the given value. This is useful for getting updates
6265 // only after the object has changed since the last request.
6266 func (c *ProjectsLocationsReleasesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReleasesGetCall {
6267 c.ifNoneMatch_ = entityTag
6268 return c
6269 }
6270
6271 // Context sets the context to be used in this call's Do method.
6272 func (c *ProjectsLocationsReleasesGetCall) Context(ctx context.Context) *ProjectsLocationsReleasesGetCall {
6273 c.ctx_ = ctx
6274 return c
6275 }
6276
6277 // Header returns a http.Header that can be modified by the caller to add
6278 // headers to the request.
6279 func (c *ProjectsLocationsReleasesGetCall) Header() http.Header {
6280 if c.header_ == nil {
6281 c.header_ = make(http.Header)
6282 }
6283 return c.header_
6284 }
6285
6286 func (c *ProjectsLocationsReleasesGetCall) doRequest(alt string) (*http.Response, error) {
6287 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6288 if c.ifNoneMatch_ != "" {
6289 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6290 }
6291 c.urlParams_.Set("alt", alt)
6292 c.urlParams_.Set("prettyPrint", "false")
6293 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6294 urls += "?" + c.urlParams_.Encode()
6295 req, err := http.NewRequest("GET", urls, nil)
6296 if err != nil {
6297 return nil, err
6298 }
6299 req.Header = reqHeaders
6300 googleapi.Expand(req.URL, map[string]string{
6301 "name": c.name,
6302 })
6303 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.get", "request", internallog.HTTPRequest(req, nil))
6304 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6305 }
6306
6307 // Do executes the "saasservicemgmt.projects.locations.releases.get" call.
6308 // Any non-2xx status code is an error. Response headers are in either
6309 // *Release.ServerResponse.Header or (if a response was returned at all) in
6310 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6311 // whether the returned error was because http.StatusNotModified was returned.
6312 func (c *ProjectsLocationsReleasesGetCall) Do(opts ...googleapi.CallOption) (*Release, error) {
6313 gensupport.SetOptions(c.urlParams_, opts...)
6314 res, err := c.doRequest("json")
6315 if res != nil && res.StatusCode == http.StatusNotModified {
6316 if res.Body != nil {
6317 res.Body.Close()
6318 }
6319 return nil, gensupport.WrapError(&googleapi.Error{
6320 Code: res.StatusCode,
6321 Header: res.Header,
6322 })
6323 }
6324 if err != nil {
6325 return nil, err
6326 }
6327 defer googleapi.CloseBody(res)
6328 if err := googleapi.CheckResponse(res); err != nil {
6329 return nil, gensupport.WrapError(err)
6330 }
6331 ret := &Release{
6332 ServerResponse: googleapi.ServerResponse{
6333 Header: res.Header,
6334 HTTPStatusCode: res.StatusCode,
6335 },
6336 }
6337 target := &ret
6338 b, err := gensupport.DecodeResponseBytes(target, res)
6339 if err != nil {
6340 return nil, err
6341 }
6342 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.get", "response", internallog.HTTPResponse(res, b))
6343 return ret, nil
6344 }
6345
6346 type ProjectsLocationsReleasesListCall struct {
6347 s *Service
6348 parent string
6349 urlParams_ gensupport.URLParams
6350 ifNoneMatch_ string
6351 ctx_ context.Context
6352 header_ http.Header
6353 }
6354
6355 // List: Retrieve a collection of releases.
6356 //
6357 // - parent: The parent of the release.
6358 func (r *ProjectsLocationsReleasesService) List(parent string) *ProjectsLocationsReleasesListCall {
6359 c := &ProjectsLocationsReleasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6360 c.parent = parent
6361 return c
6362 }
6363
6364 // Filter sets the optional parameter "filter": Filter the list as specified in
6365 // https://google.aip.dev/160.
6366 func (c *ProjectsLocationsReleasesListCall) Filter(filter string) *ProjectsLocationsReleasesListCall {
6367 c.urlParams_.Set("filter", filter)
6368 return c
6369 }
6370
6371 // OrderBy sets the optional parameter "orderBy": Order results as specified in
6372 // https://google.aip.dev/132.
6373 func (c *ProjectsLocationsReleasesListCall) OrderBy(orderBy string) *ProjectsLocationsReleasesListCall {
6374 c.urlParams_.Set("orderBy", orderBy)
6375 return c
6376 }
6377
6378 // PageSize sets the optional parameter "pageSize": The maximum number of
6379 // releases to send per page.
6380 func (c *ProjectsLocationsReleasesListCall) PageSize(pageSize int64) *ProjectsLocationsReleasesListCall {
6381 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6382 return c
6383 }
6384
6385 // PageToken sets the optional parameter "pageToken": The page token: If the
6386 // next_page_token from a previous response is provided, this request will send
6387 // the subsequent page.
6388 func (c *ProjectsLocationsReleasesListCall) PageToken(pageToken string) *ProjectsLocationsReleasesListCall {
6389 c.urlParams_.Set("pageToken", pageToken)
6390 return c
6391 }
6392
6393 // Fields allows partial responses to be retrieved. See
6394 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6395 // details.
6396 func (c *ProjectsLocationsReleasesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesListCall {
6397 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6398 return c
6399 }
6400
6401 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6402 // object's ETag matches the given value. This is useful for getting updates
6403 // only after the object has changed since the last request.
6404 func (c *ProjectsLocationsReleasesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReleasesListCall {
6405 c.ifNoneMatch_ = entityTag
6406 return c
6407 }
6408
6409 // Context sets the context to be used in this call's Do method.
6410 func (c *ProjectsLocationsReleasesListCall) Context(ctx context.Context) *ProjectsLocationsReleasesListCall {
6411 c.ctx_ = ctx
6412 return c
6413 }
6414
6415 // Header returns a http.Header that can be modified by the caller to add
6416 // headers to the request.
6417 func (c *ProjectsLocationsReleasesListCall) Header() http.Header {
6418 if c.header_ == nil {
6419 c.header_ = make(http.Header)
6420 }
6421 return c.header_
6422 }
6423
6424 func (c *ProjectsLocationsReleasesListCall) doRequest(alt string) (*http.Response, error) {
6425 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6426 if c.ifNoneMatch_ != "" {
6427 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6428 }
6429 c.urlParams_.Set("alt", alt)
6430 c.urlParams_.Set("prettyPrint", "false")
6431 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/releases")
6432 urls += "?" + c.urlParams_.Encode()
6433 req, err := http.NewRequest("GET", urls, nil)
6434 if err != nil {
6435 return nil, err
6436 }
6437 req.Header = reqHeaders
6438 googleapi.Expand(req.URL, map[string]string{
6439 "parent": c.parent,
6440 })
6441 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.list", "request", internallog.HTTPRequest(req, nil))
6442 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6443 }
6444
6445 // Do executes the "saasservicemgmt.projects.locations.releases.list" call.
6446 // Any non-2xx status code is an error. Response headers are in either
6447 // *ListReleasesResponse.ServerResponse.Header or (if a response was returned
6448 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6449 // check whether the returned error was because http.StatusNotModified was
6450 // returned.
6451 func (c *ProjectsLocationsReleasesListCall) Do(opts ...googleapi.CallOption) (*ListReleasesResponse, error) {
6452 gensupport.SetOptions(c.urlParams_, opts...)
6453 res, err := c.doRequest("json")
6454 if res != nil && res.StatusCode == http.StatusNotModified {
6455 if res.Body != nil {
6456 res.Body.Close()
6457 }
6458 return nil, gensupport.WrapError(&googleapi.Error{
6459 Code: res.StatusCode,
6460 Header: res.Header,
6461 })
6462 }
6463 if err != nil {
6464 return nil, err
6465 }
6466 defer googleapi.CloseBody(res)
6467 if err := googleapi.CheckResponse(res); err != nil {
6468 return nil, gensupport.WrapError(err)
6469 }
6470 ret := &ListReleasesResponse{
6471 ServerResponse: googleapi.ServerResponse{
6472 Header: res.Header,
6473 HTTPStatusCode: res.StatusCode,
6474 },
6475 }
6476 target := &ret
6477 b, err := gensupport.DecodeResponseBytes(target, res)
6478 if err != nil {
6479 return nil, err
6480 }
6481 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.list", "response", internallog.HTTPResponse(res, b))
6482 return ret, nil
6483 }
6484
6485 // Pages invokes f for each page of results.
6486 // A non-nil error returned from f will halt the iteration.
6487 // The provided context supersedes any context provided to the Context method.
6488 func (c *ProjectsLocationsReleasesListCall) Pages(ctx context.Context, f func(*ListReleasesResponse) error) error {
6489 c.ctx_ = ctx
6490 defer c.PageToken(c.urlParams_.Get("pageToken"))
6491 for {
6492 x, err := c.Do()
6493 if err != nil {
6494 return err
6495 }
6496 if err := f(x); err != nil {
6497 return err
6498 }
6499 if x.NextPageToken == "" {
6500 return nil
6501 }
6502 c.PageToken(x.NextPageToken)
6503 }
6504 }
6505
6506 type ProjectsLocationsReleasesPatchCall struct {
6507 s *Service
6508 name string
6509 release *Release
6510 urlParams_ gensupport.URLParams
6511 ctx_ context.Context
6512 header_ http.Header
6513 }
6514
6515 // Patch: Update a single release.
6516 //
6517 // - name: Identifier. The resource name (full URI of the resource) following
6518 // the standard naming scheme:
6519 // "projects/{project}/locations/{location}/releases/{release}".
6520 func (r *ProjectsLocationsReleasesService) Patch(name string, release *Release) *ProjectsLocationsReleasesPatchCall {
6521 c := &ProjectsLocationsReleasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6522 c.name = name
6523 c.release = release
6524 return c
6525 }
6526
6527 // RequestId sets the optional parameter "requestId": An optional request ID to
6528 // identify requests. Specify a unique request ID so that if you must retry
6529 // your request, the server will know to ignore the request if it has already
6530 // been completed. The server will guarantee that for at least 60 minutes since
6531 // the first request. For example, consider a situation where you make an
6532 // initial request and the request times out. If you make the request again
6533 // with the same request ID, the server can check if original operation with
6534 // the same request ID was received, and if so, will ignore the second request.
6535 // This prevents clients from accidentally creating duplicate commitments. The
6536 // request ID must be a valid UUID with the exception that zero UUID is not
6537 // supported (00000000-0000-0000-0000-000000000000).
6538 func (c *ProjectsLocationsReleasesPatchCall) RequestId(requestId string) *ProjectsLocationsReleasesPatchCall {
6539 c.urlParams_.Set("requestId", requestId)
6540 return c
6541 }
6542
6543 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
6544 // specify the fields to be overwritten in the Release resource by the update.
6545 // The fields specified in the update_mask are relative to the resource, not
6546 // the full request. A field will be overwritten if it is in the mask. If the
6547 // user does not provide a mask then all fields in the Release will be
6548 // overwritten.
6549 func (c *ProjectsLocationsReleasesPatchCall) UpdateMask(updateMask string) *ProjectsLocationsReleasesPatchCall {
6550 c.urlParams_.Set("updateMask", updateMask)
6551 return c
6552 }
6553
6554 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
6555 // is set to true, the service will try to validate that this request would
6556 // succeed, but will not actually make changes.
6557 func (c *ProjectsLocationsReleasesPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsReleasesPatchCall {
6558 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
6559 return c
6560 }
6561
6562 // Fields allows partial responses to be retrieved. See
6563 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6564 // details.
6565 func (c *ProjectsLocationsReleasesPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsReleasesPatchCall {
6566 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6567 return c
6568 }
6569
6570 // Context sets the context to be used in this call's Do method.
6571 func (c *ProjectsLocationsReleasesPatchCall) Context(ctx context.Context) *ProjectsLocationsReleasesPatchCall {
6572 c.ctx_ = ctx
6573 return c
6574 }
6575
6576 // Header returns a http.Header that can be modified by the caller to add
6577 // headers to the request.
6578 func (c *ProjectsLocationsReleasesPatchCall) Header() http.Header {
6579 if c.header_ == nil {
6580 c.header_ = make(http.Header)
6581 }
6582 return c.header_
6583 }
6584
6585 func (c *ProjectsLocationsReleasesPatchCall) doRequest(alt string) (*http.Response, error) {
6586 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6587 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.release)
6588 if err != nil {
6589 return nil, err
6590 }
6591 c.urlParams_.Set("alt", alt)
6592 c.urlParams_.Set("prettyPrint", "false")
6593 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6594 urls += "?" + c.urlParams_.Encode()
6595 req, err := http.NewRequest("PATCH", urls, body)
6596 if err != nil {
6597 return nil, err
6598 }
6599 req.Header = reqHeaders
6600 googleapi.Expand(req.URL, map[string]string{
6601 "name": c.name,
6602 })
6603 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
6604 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6605 }
6606
6607 // Do executes the "saasservicemgmt.projects.locations.releases.patch" call.
6608 // Any non-2xx status code is an error. Response headers are in either
6609 // *Release.ServerResponse.Header or (if a response was returned at all) in
6610 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6611 // whether the returned error was because http.StatusNotModified was returned.
6612 func (c *ProjectsLocationsReleasesPatchCall) Do(opts ...googleapi.CallOption) (*Release, error) {
6613 gensupport.SetOptions(c.urlParams_, opts...)
6614 res, err := c.doRequest("json")
6615 if res != nil && res.StatusCode == http.StatusNotModified {
6616 if res.Body != nil {
6617 res.Body.Close()
6618 }
6619 return nil, gensupport.WrapError(&googleapi.Error{
6620 Code: res.StatusCode,
6621 Header: res.Header,
6622 })
6623 }
6624 if err != nil {
6625 return nil, err
6626 }
6627 defer googleapi.CloseBody(res)
6628 if err := googleapi.CheckResponse(res); err != nil {
6629 return nil, gensupport.WrapError(err)
6630 }
6631 ret := &Release{
6632 ServerResponse: googleapi.ServerResponse{
6633 Header: res.Header,
6634 HTTPStatusCode: res.StatusCode,
6635 },
6636 }
6637 target := &ret
6638 b, err := gensupport.DecodeResponseBytes(target, res)
6639 if err != nil {
6640 return nil, err
6641 }
6642 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.releases.patch", "response", internallog.HTTPResponse(res, b))
6643 return ret, nil
6644 }
6645
6646 type ProjectsLocationsRolloutKindsCreateCall struct {
6647 s *Service
6648 parent string
6649 rolloutkind *RolloutKind
6650 urlParams_ gensupport.URLParams
6651 ctx_ context.Context
6652 header_ http.Header
6653 }
6654
6655 // Create: Create a new rollout kind.
6656 //
6657 // - parent: The parent of the rollout kind.
6658 func (r *ProjectsLocationsRolloutKindsService) Create(parent string, rolloutkind *RolloutKind) *ProjectsLocationsRolloutKindsCreateCall {
6659 c := &ProjectsLocationsRolloutKindsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6660 c.parent = parent
6661 c.rolloutkind = rolloutkind
6662 return c
6663 }
6664
6665 // RequestId sets the optional parameter "requestId": An optional request ID to
6666 // identify requests. Specify a unique request ID so that if you must retry
6667 // your request, the server will know to ignore the request if it has already
6668 // been completed. The server will guarantee that for at least 60 minutes since
6669 // the first request. For example, consider a situation where you make an
6670 // initial request and the request times out. If you make the request again
6671 // with the same request ID, the server can check if original operation with
6672 // the same request ID was received, and if so, will ignore the second request.
6673 // This prevents clients from accidentally creating duplicate commitments. The
6674 // request ID must be a valid UUID with the exception that zero UUID is not
6675 // supported (00000000-0000-0000-0000-000000000000).
6676 func (c *ProjectsLocationsRolloutKindsCreateCall) RequestId(requestId string) *ProjectsLocationsRolloutKindsCreateCall {
6677 c.urlParams_.Set("requestId", requestId)
6678 return c
6679 }
6680
6681 // RolloutKindId sets the optional parameter "rolloutKindId": Required. The ID
6682 // value for the new rollout kind.
6683 func (c *ProjectsLocationsRolloutKindsCreateCall) RolloutKindId(rolloutKindId string) *ProjectsLocationsRolloutKindsCreateCall {
6684 c.urlParams_.Set("rolloutKindId", rolloutKindId)
6685 return c
6686 }
6687
6688 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
6689 // is set to true, the service will try to validate that this request would
6690 // succeed, but will not actually make changes.
6691 func (c *ProjectsLocationsRolloutKindsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutKindsCreateCall {
6692 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
6693 return c
6694 }
6695
6696 // Fields allows partial responses to be retrieved. See
6697 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6698 // details.
6699 func (c *ProjectsLocationsRolloutKindsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsCreateCall {
6700 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6701 return c
6702 }
6703
6704 // Context sets the context to be used in this call's Do method.
6705 func (c *ProjectsLocationsRolloutKindsCreateCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsCreateCall {
6706 c.ctx_ = ctx
6707 return c
6708 }
6709
6710 // Header returns a http.Header that can be modified by the caller to add
6711 // headers to the request.
6712 func (c *ProjectsLocationsRolloutKindsCreateCall) Header() http.Header {
6713 if c.header_ == nil {
6714 c.header_ = make(http.Header)
6715 }
6716 return c.header_
6717 }
6718
6719 func (c *ProjectsLocationsRolloutKindsCreateCall) doRequest(alt string) (*http.Response, error) {
6720 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
6721 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rolloutkind)
6722 if err != nil {
6723 return nil, err
6724 }
6725 c.urlParams_.Set("alt", alt)
6726 c.urlParams_.Set("prettyPrint", "false")
6727 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/rolloutKinds")
6728 urls += "?" + c.urlParams_.Encode()
6729 req, err := http.NewRequest("POST", urls, body)
6730 if err != nil {
6731 return nil, err
6732 }
6733 req.Header = reqHeaders
6734 googleapi.Expand(req.URL, map[string]string{
6735 "parent": c.parent,
6736 })
6737 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.create", "request", internallog.HTTPRequest(req, body.Bytes()))
6738 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6739 }
6740
6741 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.create" call.
6742 // Any non-2xx status code is an error. Response headers are in either
6743 // *RolloutKind.ServerResponse.Header or (if a response was returned at all) in
6744 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6745 // whether the returned error was because http.StatusNotModified was returned.
6746 func (c *ProjectsLocationsRolloutKindsCreateCall) Do(opts ...googleapi.CallOption) (*RolloutKind, error) {
6747 gensupport.SetOptions(c.urlParams_, opts...)
6748 res, err := c.doRequest("json")
6749 if res != nil && res.StatusCode == http.StatusNotModified {
6750 if res.Body != nil {
6751 res.Body.Close()
6752 }
6753 return nil, gensupport.WrapError(&googleapi.Error{
6754 Code: res.StatusCode,
6755 Header: res.Header,
6756 })
6757 }
6758 if err != nil {
6759 return nil, err
6760 }
6761 defer googleapi.CloseBody(res)
6762 if err := googleapi.CheckResponse(res); err != nil {
6763 return nil, gensupport.WrapError(err)
6764 }
6765 ret := &RolloutKind{
6766 ServerResponse: googleapi.ServerResponse{
6767 Header: res.Header,
6768 HTTPStatusCode: res.StatusCode,
6769 },
6770 }
6771 target := &ret
6772 b, err := gensupport.DecodeResponseBytes(target, res)
6773 if err != nil {
6774 return nil, err
6775 }
6776 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.create", "response", internallog.HTTPResponse(res, b))
6777 return ret, nil
6778 }
6779
6780 type ProjectsLocationsRolloutKindsDeleteCall struct {
6781 s *Service
6782 name string
6783 urlParams_ gensupport.URLParams
6784 ctx_ context.Context
6785 header_ http.Header
6786 }
6787
6788 // Delete: Delete a single rollout kind.
6789 //
6790 // - name: The resource name of the resource within a service.
6791 func (r *ProjectsLocationsRolloutKindsService) Delete(name string) *ProjectsLocationsRolloutKindsDeleteCall {
6792 c := &ProjectsLocationsRolloutKindsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6793 c.name = name
6794 return c
6795 }
6796
6797 // Etag sets the optional parameter "etag": The etag known to the client for
6798 // the expected state of the rollout kind. This is used with state-changing
6799 // methods to prevent accidental overwrites when multiple user agents might be
6800 // acting in parallel on the same resource. An etag wildcard provide optimistic
6801 // concurrency based on the expected existence of the rollout kind. The Any
6802 // wildcard (`*`) requires that the resource must already exists, and the Not
6803 // Any wildcard (`!*`) requires that it must not.
6804 func (c *ProjectsLocationsRolloutKindsDeleteCall) Etag(etag string) *ProjectsLocationsRolloutKindsDeleteCall {
6805 c.urlParams_.Set("etag", etag)
6806 return c
6807 }
6808
6809 // RequestId sets the optional parameter "requestId": An optional request ID to
6810 // identify requests. Specify a unique request ID so that if you must retry
6811 // your request, the server will know to ignore the request if it has already
6812 // been completed. The server will guarantee that for at least 60 minutes since
6813 // the first request. For example, consider a situation where you make an
6814 // initial request and the request times out. If you make the request again
6815 // with the same request ID, the server can check if original operation with
6816 // the same request ID was received, and if so, will ignore the second request.
6817 // This prevents clients from accidentally creating duplicate commitments. The
6818 // request ID must be a valid UUID with the exception that zero UUID is not
6819 // supported (00000000-0000-0000-0000-000000000000).
6820 func (c *ProjectsLocationsRolloutKindsDeleteCall) RequestId(requestId string) *ProjectsLocationsRolloutKindsDeleteCall {
6821 c.urlParams_.Set("requestId", requestId)
6822 return c
6823 }
6824
6825 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
6826 // is set to true, the service will try to validate that this request would
6827 // succeed, but will not actually make changes.
6828 func (c *ProjectsLocationsRolloutKindsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutKindsDeleteCall {
6829 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
6830 return c
6831 }
6832
6833 // Fields allows partial responses to be retrieved. See
6834 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6835 // details.
6836 func (c *ProjectsLocationsRolloutKindsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsDeleteCall {
6837 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6838 return c
6839 }
6840
6841 // Context sets the context to be used in this call's Do method.
6842 func (c *ProjectsLocationsRolloutKindsDeleteCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsDeleteCall {
6843 c.ctx_ = ctx
6844 return c
6845 }
6846
6847 // Header returns a http.Header that can be modified by the caller to add
6848 // headers to the request.
6849 func (c *ProjectsLocationsRolloutKindsDeleteCall) Header() http.Header {
6850 if c.header_ == nil {
6851 c.header_ = make(http.Header)
6852 }
6853 return c.header_
6854 }
6855
6856 func (c *ProjectsLocationsRolloutKindsDeleteCall) doRequest(alt string) (*http.Response, error) {
6857 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6858 c.urlParams_.Set("alt", alt)
6859 c.urlParams_.Set("prettyPrint", "false")
6860 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6861 urls += "?" + c.urlParams_.Encode()
6862 req, err := http.NewRequest("DELETE", urls, nil)
6863 if err != nil {
6864 return nil, err
6865 }
6866 req.Header = reqHeaders
6867 googleapi.Expand(req.URL, map[string]string{
6868 "name": c.name,
6869 })
6870 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.delete", "request", internallog.HTTPRequest(req, nil))
6871 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6872 }
6873
6874 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.delete" call.
6875 // Any non-2xx status code is an error. Response headers are in either
6876 // *Empty.ServerResponse.Header or (if a response was returned at all) in
6877 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6878 // whether the returned error was because http.StatusNotModified was returned.
6879 func (c *ProjectsLocationsRolloutKindsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6880 gensupport.SetOptions(c.urlParams_, opts...)
6881 res, err := c.doRequest("json")
6882 if res != nil && res.StatusCode == http.StatusNotModified {
6883 if res.Body != nil {
6884 res.Body.Close()
6885 }
6886 return nil, gensupport.WrapError(&googleapi.Error{
6887 Code: res.StatusCode,
6888 Header: res.Header,
6889 })
6890 }
6891 if err != nil {
6892 return nil, err
6893 }
6894 defer googleapi.CloseBody(res)
6895 if err := googleapi.CheckResponse(res); err != nil {
6896 return nil, gensupport.WrapError(err)
6897 }
6898 ret := &Empty{
6899 ServerResponse: googleapi.ServerResponse{
6900 Header: res.Header,
6901 HTTPStatusCode: res.StatusCode,
6902 },
6903 }
6904 target := &ret
6905 b, err := gensupport.DecodeResponseBytes(target, res)
6906 if err != nil {
6907 return nil, err
6908 }
6909 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.delete", "response", internallog.HTTPResponse(res, b))
6910 return ret, nil
6911 }
6912
6913 type ProjectsLocationsRolloutKindsGetCall struct {
6914 s *Service
6915 name string
6916 urlParams_ gensupport.URLParams
6917 ifNoneMatch_ string
6918 ctx_ context.Context
6919 header_ http.Header
6920 }
6921
6922 // Get: Retrieve a single rollout kind.
6923 //
6924 // - name: The resource name of the resource within a service.
6925 func (r *ProjectsLocationsRolloutKindsService) Get(name string) *ProjectsLocationsRolloutKindsGetCall {
6926 c := &ProjectsLocationsRolloutKindsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6927 c.name = name
6928 return c
6929 }
6930
6931 // Fields allows partial responses to be retrieved. See
6932 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6933 // details.
6934 func (c *ProjectsLocationsRolloutKindsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsGetCall {
6935 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6936 return c
6937 }
6938
6939 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6940 // object's ETag matches the given value. This is useful for getting updates
6941 // only after the object has changed since the last request.
6942 func (c *ProjectsLocationsRolloutKindsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRolloutKindsGetCall {
6943 c.ifNoneMatch_ = entityTag
6944 return c
6945 }
6946
6947 // Context sets the context to be used in this call's Do method.
6948 func (c *ProjectsLocationsRolloutKindsGetCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsGetCall {
6949 c.ctx_ = ctx
6950 return c
6951 }
6952
6953 // Header returns a http.Header that can be modified by the caller to add
6954 // headers to the request.
6955 func (c *ProjectsLocationsRolloutKindsGetCall) Header() http.Header {
6956 if c.header_ == nil {
6957 c.header_ = make(http.Header)
6958 }
6959 return c.header_
6960 }
6961
6962 func (c *ProjectsLocationsRolloutKindsGetCall) doRequest(alt string) (*http.Response, error) {
6963 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6964 if c.ifNoneMatch_ != "" {
6965 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6966 }
6967 c.urlParams_.Set("alt", alt)
6968 c.urlParams_.Set("prettyPrint", "false")
6969 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
6970 urls += "?" + c.urlParams_.Encode()
6971 req, err := http.NewRequest("GET", urls, nil)
6972 if err != nil {
6973 return nil, err
6974 }
6975 req.Header = reqHeaders
6976 googleapi.Expand(req.URL, map[string]string{
6977 "name": c.name,
6978 })
6979 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.get", "request", internallog.HTTPRequest(req, nil))
6980 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6981 }
6982
6983 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.get" call.
6984 // Any non-2xx status code is an error. Response headers are in either
6985 // *RolloutKind.ServerResponse.Header or (if a response was returned at all) in
6986 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6987 // whether the returned error was because http.StatusNotModified was returned.
6988 func (c *ProjectsLocationsRolloutKindsGetCall) Do(opts ...googleapi.CallOption) (*RolloutKind, error) {
6989 gensupport.SetOptions(c.urlParams_, opts...)
6990 res, err := c.doRequest("json")
6991 if res != nil && res.StatusCode == http.StatusNotModified {
6992 if res.Body != nil {
6993 res.Body.Close()
6994 }
6995 return nil, gensupport.WrapError(&googleapi.Error{
6996 Code: res.StatusCode,
6997 Header: res.Header,
6998 })
6999 }
7000 if err != nil {
7001 return nil, err
7002 }
7003 defer googleapi.CloseBody(res)
7004 if err := googleapi.CheckResponse(res); err != nil {
7005 return nil, gensupport.WrapError(err)
7006 }
7007 ret := &RolloutKind{
7008 ServerResponse: googleapi.ServerResponse{
7009 Header: res.Header,
7010 HTTPStatusCode: res.StatusCode,
7011 },
7012 }
7013 target := &ret
7014 b, err := gensupport.DecodeResponseBytes(target, res)
7015 if err != nil {
7016 return nil, err
7017 }
7018 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.get", "response", internallog.HTTPResponse(res, b))
7019 return ret, nil
7020 }
7021
7022 type ProjectsLocationsRolloutKindsListCall struct {
7023 s *Service
7024 parent string
7025 urlParams_ gensupport.URLParams
7026 ifNoneMatch_ string
7027 ctx_ context.Context
7028 header_ http.Header
7029 }
7030
7031 // List: Retrieve a collection of rollout kinds.
7032 //
7033 // - parent: The parent of the rollout kind.
7034 func (r *ProjectsLocationsRolloutKindsService) List(parent string) *ProjectsLocationsRolloutKindsListCall {
7035 c := &ProjectsLocationsRolloutKindsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7036 c.parent = parent
7037 return c
7038 }
7039
7040 // Filter sets the optional parameter "filter": Filter the list as specified in
7041 // https://google.aip.dev/160.
7042 func (c *ProjectsLocationsRolloutKindsListCall) Filter(filter string) *ProjectsLocationsRolloutKindsListCall {
7043 c.urlParams_.Set("filter", filter)
7044 return c
7045 }
7046
7047 // OrderBy sets the optional parameter "orderBy": Order results as specified in
7048 // https://google.aip.dev/132.
7049 func (c *ProjectsLocationsRolloutKindsListCall) OrderBy(orderBy string) *ProjectsLocationsRolloutKindsListCall {
7050 c.urlParams_.Set("orderBy", orderBy)
7051 return c
7052 }
7053
7054 // PageSize sets the optional parameter "pageSize": The maximum number of
7055 // rollout kinds to send per page.
7056 func (c *ProjectsLocationsRolloutKindsListCall) PageSize(pageSize int64) *ProjectsLocationsRolloutKindsListCall {
7057 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7058 return c
7059 }
7060
7061 // PageToken sets the optional parameter "pageToken": The page token: If the
7062 // next_page_token from a previous response is provided, this request will send
7063 // the subsequent page.
7064 func (c *ProjectsLocationsRolloutKindsListCall) PageToken(pageToken string) *ProjectsLocationsRolloutKindsListCall {
7065 c.urlParams_.Set("pageToken", pageToken)
7066 return c
7067 }
7068
7069 // Fields allows partial responses to be retrieved. See
7070 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7071 // details.
7072 func (c *ProjectsLocationsRolloutKindsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsListCall {
7073 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7074 return c
7075 }
7076
7077 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7078 // object's ETag matches the given value. This is useful for getting updates
7079 // only after the object has changed since the last request.
7080 func (c *ProjectsLocationsRolloutKindsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRolloutKindsListCall {
7081 c.ifNoneMatch_ = entityTag
7082 return c
7083 }
7084
7085 // Context sets the context to be used in this call's Do method.
7086 func (c *ProjectsLocationsRolloutKindsListCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsListCall {
7087 c.ctx_ = ctx
7088 return c
7089 }
7090
7091 // Header returns a http.Header that can be modified by the caller to add
7092 // headers to the request.
7093 func (c *ProjectsLocationsRolloutKindsListCall) Header() http.Header {
7094 if c.header_ == nil {
7095 c.header_ = make(http.Header)
7096 }
7097 return c.header_
7098 }
7099
7100 func (c *ProjectsLocationsRolloutKindsListCall) doRequest(alt string) (*http.Response, error) {
7101 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7102 if c.ifNoneMatch_ != "" {
7103 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7104 }
7105 c.urlParams_.Set("alt", alt)
7106 c.urlParams_.Set("prettyPrint", "false")
7107 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/rolloutKinds")
7108 urls += "?" + c.urlParams_.Encode()
7109 req, err := http.NewRequest("GET", urls, nil)
7110 if err != nil {
7111 return nil, err
7112 }
7113 req.Header = reqHeaders
7114 googleapi.Expand(req.URL, map[string]string{
7115 "parent": c.parent,
7116 })
7117 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.list", "request", internallog.HTTPRequest(req, nil))
7118 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7119 }
7120
7121 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.list" call.
7122 // Any non-2xx status code is an error. Response headers are in either
7123 // *ListRolloutKindsResponse.ServerResponse.Header or (if a response was
7124 // returned at all) in error.(*googleapi.Error).Header. Use
7125 // googleapi.IsNotModified to check whether the returned error was because
7126 // http.StatusNotModified was returned.
7127 func (c *ProjectsLocationsRolloutKindsListCall) Do(opts ...googleapi.CallOption) (*ListRolloutKindsResponse, error) {
7128 gensupport.SetOptions(c.urlParams_, opts...)
7129 res, err := c.doRequest("json")
7130 if res != nil && res.StatusCode == http.StatusNotModified {
7131 if res.Body != nil {
7132 res.Body.Close()
7133 }
7134 return nil, gensupport.WrapError(&googleapi.Error{
7135 Code: res.StatusCode,
7136 Header: res.Header,
7137 })
7138 }
7139 if err != nil {
7140 return nil, err
7141 }
7142 defer googleapi.CloseBody(res)
7143 if err := googleapi.CheckResponse(res); err != nil {
7144 return nil, gensupport.WrapError(err)
7145 }
7146 ret := &ListRolloutKindsResponse{
7147 ServerResponse: googleapi.ServerResponse{
7148 Header: res.Header,
7149 HTTPStatusCode: res.StatusCode,
7150 },
7151 }
7152 target := &ret
7153 b, err := gensupport.DecodeResponseBytes(target, res)
7154 if err != nil {
7155 return nil, err
7156 }
7157 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.list", "response", internallog.HTTPResponse(res, b))
7158 return ret, nil
7159 }
7160
7161 // Pages invokes f for each page of results.
7162 // A non-nil error returned from f will halt the iteration.
7163 // The provided context supersedes any context provided to the Context method.
7164 func (c *ProjectsLocationsRolloutKindsListCall) Pages(ctx context.Context, f func(*ListRolloutKindsResponse) error) error {
7165 c.ctx_ = ctx
7166 defer c.PageToken(c.urlParams_.Get("pageToken"))
7167 for {
7168 x, err := c.Do()
7169 if err != nil {
7170 return err
7171 }
7172 if err := f(x); err != nil {
7173 return err
7174 }
7175 if x.NextPageToken == "" {
7176 return nil
7177 }
7178 c.PageToken(x.NextPageToken)
7179 }
7180 }
7181
7182 type ProjectsLocationsRolloutKindsPatchCall struct {
7183 s *Service
7184 name string
7185 rolloutkind *RolloutKind
7186 urlParams_ gensupport.URLParams
7187 ctx_ context.Context
7188 header_ http.Header
7189 }
7190
7191 // Patch: Update a single rollout kind.
7192 //
7193 // - name: Identifier. The resource name (full URI of the resource) following
7194 // the standard naming scheme:
7195 // "projects/{project}/locations/{location}/rolloutKinds/{rollout_kind_id}".
7196 func (r *ProjectsLocationsRolloutKindsService) Patch(name string, rolloutkind *RolloutKind) *ProjectsLocationsRolloutKindsPatchCall {
7197 c := &ProjectsLocationsRolloutKindsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7198 c.name = name
7199 c.rolloutkind = rolloutkind
7200 return c
7201 }
7202
7203 // RequestId sets the optional parameter "requestId": An optional request ID to
7204 // identify requests. Specify a unique request ID so that if you must retry
7205 // your request, the server will know to ignore the request if it has already
7206 // been completed. The server will guarantee that for at least 60 minutes since
7207 // the first request. For example, consider a situation where you make an
7208 // initial request and the request times out. If you make the request again
7209 // with the same request ID, the server can check if original operation with
7210 // the same request ID was received, and if so, will ignore the second request.
7211 // This prevents clients from accidentally creating duplicate commitments. The
7212 // request ID must be a valid UUID with the exception that zero UUID is not
7213 // supported (00000000-0000-0000-0000-000000000000).
7214 func (c *ProjectsLocationsRolloutKindsPatchCall) RequestId(requestId string) *ProjectsLocationsRolloutKindsPatchCall {
7215 c.urlParams_.Set("requestId", requestId)
7216 return c
7217 }
7218
7219 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
7220 // specify the fields to be overwritten in the RolloutKind resource by the
7221 // update. The fields specified in the update_mask are relative to the
7222 // resource, not the full request. A field will be overwritten if it is in the
7223 // mask. If the user does not provide a mask then all fields in the RolloutKind
7224 // will be overwritten.
7225 func (c *ProjectsLocationsRolloutKindsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRolloutKindsPatchCall {
7226 c.urlParams_.Set("updateMask", updateMask)
7227 return c
7228 }
7229
7230 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
7231 // is set to true, the service will try to validate that this request would
7232 // succeed, but will not actually make changes.
7233 func (c *ProjectsLocationsRolloutKindsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutKindsPatchCall {
7234 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
7235 return c
7236 }
7237
7238 // Fields allows partial responses to be retrieved. See
7239 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7240 // details.
7241 func (c *ProjectsLocationsRolloutKindsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutKindsPatchCall {
7242 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7243 return c
7244 }
7245
7246 // Context sets the context to be used in this call's Do method.
7247 func (c *ProjectsLocationsRolloutKindsPatchCall) Context(ctx context.Context) *ProjectsLocationsRolloutKindsPatchCall {
7248 c.ctx_ = ctx
7249 return c
7250 }
7251
7252 // Header returns a http.Header that can be modified by the caller to add
7253 // headers to the request.
7254 func (c *ProjectsLocationsRolloutKindsPatchCall) Header() http.Header {
7255 if c.header_ == nil {
7256 c.header_ = make(http.Header)
7257 }
7258 return c.header_
7259 }
7260
7261 func (c *ProjectsLocationsRolloutKindsPatchCall) doRequest(alt string) (*http.Response, error) {
7262 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7263 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rolloutkind)
7264 if err != nil {
7265 return nil, err
7266 }
7267 c.urlParams_.Set("alt", alt)
7268 c.urlParams_.Set("prettyPrint", "false")
7269 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7270 urls += "?" + c.urlParams_.Encode()
7271 req, err := http.NewRequest("PATCH", urls, body)
7272 if err != nil {
7273 return nil, err
7274 }
7275 req.Header = reqHeaders
7276 googleapi.Expand(req.URL, map[string]string{
7277 "name": c.name,
7278 })
7279 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7280 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7281 }
7282
7283 // Do executes the "saasservicemgmt.projects.locations.rolloutKinds.patch" call.
7284 // Any non-2xx status code is an error. Response headers are in either
7285 // *RolloutKind.ServerResponse.Header or (if a response was returned at all) in
7286 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7287 // whether the returned error was because http.StatusNotModified was returned.
7288 func (c *ProjectsLocationsRolloutKindsPatchCall) Do(opts ...googleapi.CallOption) (*RolloutKind, error) {
7289 gensupport.SetOptions(c.urlParams_, opts...)
7290 res, err := c.doRequest("json")
7291 if res != nil && res.StatusCode == http.StatusNotModified {
7292 if res.Body != nil {
7293 res.Body.Close()
7294 }
7295 return nil, gensupport.WrapError(&googleapi.Error{
7296 Code: res.StatusCode,
7297 Header: res.Header,
7298 })
7299 }
7300 if err != nil {
7301 return nil, err
7302 }
7303 defer googleapi.CloseBody(res)
7304 if err := googleapi.CheckResponse(res); err != nil {
7305 return nil, gensupport.WrapError(err)
7306 }
7307 ret := &RolloutKind{
7308 ServerResponse: googleapi.ServerResponse{
7309 Header: res.Header,
7310 HTTPStatusCode: res.StatusCode,
7311 },
7312 }
7313 target := &ret
7314 b, err := gensupport.DecodeResponseBytes(target, res)
7315 if err != nil {
7316 return nil, err
7317 }
7318 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rolloutKinds.patch", "response", internallog.HTTPResponse(res, b))
7319 return ret, nil
7320 }
7321
7322 type ProjectsLocationsRolloutsCreateCall struct {
7323 s *Service
7324 parent string
7325 rollout *Rollout
7326 urlParams_ gensupport.URLParams
7327 ctx_ context.Context
7328 header_ http.Header
7329 }
7330
7331 // Create: Create a new rollout.
7332 //
7333 // - parent: The parent of the rollout.
7334 func (r *ProjectsLocationsRolloutsService) Create(parent string, rollout *Rollout) *ProjectsLocationsRolloutsCreateCall {
7335 c := &ProjectsLocationsRolloutsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7336 c.parent = parent
7337 c.rollout = rollout
7338 return c
7339 }
7340
7341 // RequestId sets the optional parameter "requestId": An optional request ID to
7342 // identify requests. Specify a unique request ID so that if you must retry
7343 // your request, the server will know to ignore the request if it has already
7344 // been completed. The server will guarantee that for at least 60 minutes since
7345 // the first request. For example, consider a situation where you make an
7346 // initial request and the request times out. If you make the request again
7347 // with the same request ID, the server can check if original operation with
7348 // the same request ID was received, and if so, will ignore the second request.
7349 // This prevents clients from accidentally creating duplicate commitments. The
7350 // request ID must be a valid UUID with the exception that zero UUID is not
7351 // supported (00000000-0000-0000-0000-000000000000).
7352 func (c *ProjectsLocationsRolloutsCreateCall) RequestId(requestId string) *ProjectsLocationsRolloutsCreateCall {
7353 c.urlParams_.Set("requestId", requestId)
7354 return c
7355 }
7356
7357 // RolloutId sets the optional parameter "rolloutId": Required. The ID value
7358 // for the new rollout.
7359 func (c *ProjectsLocationsRolloutsCreateCall) RolloutId(rolloutId string) *ProjectsLocationsRolloutsCreateCall {
7360 c.urlParams_.Set("rolloutId", rolloutId)
7361 return c
7362 }
7363
7364 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
7365 // is set to true, the service will try to validate that this request would
7366 // succeed, but will not actually make changes.
7367 func (c *ProjectsLocationsRolloutsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutsCreateCall {
7368 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
7369 return c
7370 }
7371
7372 // Fields allows partial responses to be retrieved. See
7373 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7374 // details.
7375 func (c *ProjectsLocationsRolloutsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsCreateCall {
7376 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7377 return c
7378 }
7379
7380 // Context sets the context to be used in this call's Do method.
7381 func (c *ProjectsLocationsRolloutsCreateCall) Context(ctx context.Context) *ProjectsLocationsRolloutsCreateCall {
7382 c.ctx_ = ctx
7383 return c
7384 }
7385
7386 // Header returns a http.Header that can be modified by the caller to add
7387 // headers to the request.
7388 func (c *ProjectsLocationsRolloutsCreateCall) Header() http.Header {
7389 if c.header_ == nil {
7390 c.header_ = make(http.Header)
7391 }
7392 return c.header_
7393 }
7394
7395 func (c *ProjectsLocationsRolloutsCreateCall) doRequest(alt string) (*http.Response, error) {
7396 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7397 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollout)
7398 if err != nil {
7399 return nil, err
7400 }
7401 c.urlParams_.Set("alt", alt)
7402 c.urlParams_.Set("prettyPrint", "false")
7403 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/rollouts")
7404 urls += "?" + c.urlParams_.Encode()
7405 req, err := http.NewRequest("POST", urls, body)
7406 if err != nil {
7407 return nil, err
7408 }
7409 req.Header = reqHeaders
7410 googleapi.Expand(req.URL, map[string]string{
7411 "parent": c.parent,
7412 })
7413 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.create", "request", internallog.HTTPRequest(req, body.Bytes()))
7414 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7415 }
7416
7417 // Do executes the "saasservicemgmt.projects.locations.rollouts.create" call.
7418 // Any non-2xx status code is an error. Response headers are in either
7419 // *Rollout.ServerResponse.Header or (if a response was returned at all) in
7420 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7421 // whether the returned error was because http.StatusNotModified was returned.
7422 func (c *ProjectsLocationsRolloutsCreateCall) Do(opts ...googleapi.CallOption) (*Rollout, error) {
7423 gensupport.SetOptions(c.urlParams_, opts...)
7424 res, err := c.doRequest("json")
7425 if res != nil && res.StatusCode == http.StatusNotModified {
7426 if res.Body != nil {
7427 res.Body.Close()
7428 }
7429 return nil, gensupport.WrapError(&googleapi.Error{
7430 Code: res.StatusCode,
7431 Header: res.Header,
7432 })
7433 }
7434 if err != nil {
7435 return nil, err
7436 }
7437 defer googleapi.CloseBody(res)
7438 if err := googleapi.CheckResponse(res); err != nil {
7439 return nil, gensupport.WrapError(err)
7440 }
7441 ret := &Rollout{
7442 ServerResponse: googleapi.ServerResponse{
7443 Header: res.Header,
7444 HTTPStatusCode: res.StatusCode,
7445 },
7446 }
7447 target := &ret
7448 b, err := gensupport.DecodeResponseBytes(target, res)
7449 if err != nil {
7450 return nil, err
7451 }
7452 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.create", "response", internallog.HTTPResponse(res, b))
7453 return ret, nil
7454 }
7455
7456 type ProjectsLocationsRolloutsDeleteCall struct {
7457 s *Service
7458 name string
7459 urlParams_ gensupport.URLParams
7460 ctx_ context.Context
7461 header_ http.Header
7462 }
7463
7464 // Delete: Delete a single rollout.
7465 //
7466 // - name: The resource name of the resource within a service.
7467 func (r *ProjectsLocationsRolloutsService) Delete(name string) *ProjectsLocationsRolloutsDeleteCall {
7468 c := &ProjectsLocationsRolloutsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7469 c.name = name
7470 return c
7471 }
7472
7473 // Etag sets the optional parameter "etag": The etag known to the client for
7474 // the expected state of the rollout. This is used with state-changing methods
7475 // to prevent accidental overwrites when multiple user agents might be acting
7476 // in parallel on the same resource. An etag wildcard provide optimistic
7477 // concurrency based on the expected existence of the rollout. The Any wildcard
7478 // (`*`) requires that the resource must already exists, and the Not Any
7479 // wildcard (`!*`) requires that it must not.
7480 func (c *ProjectsLocationsRolloutsDeleteCall) Etag(etag string) *ProjectsLocationsRolloutsDeleteCall {
7481 c.urlParams_.Set("etag", etag)
7482 return c
7483 }
7484
7485 // RequestId sets the optional parameter "requestId": An optional request ID to
7486 // identify requests. Specify a unique request ID so that if you must retry
7487 // your request, the server will know to ignore the request if it has already
7488 // been completed. The server will guarantee that for at least 60 minutes since
7489 // the first request. For example, consider a situation where you make an
7490 // initial request and the request times out. If you make the request again
7491 // with the same request ID, the server can check if original operation with
7492 // the same request ID was received, and if so, will ignore the second request.
7493 // This prevents clients from accidentally creating duplicate commitments. The
7494 // request ID must be a valid UUID with the exception that zero UUID is not
7495 // supported (00000000-0000-0000-0000-000000000000).
7496 func (c *ProjectsLocationsRolloutsDeleteCall) RequestId(requestId string) *ProjectsLocationsRolloutsDeleteCall {
7497 c.urlParams_.Set("requestId", requestId)
7498 return c
7499 }
7500
7501 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
7502 // is set to true, the service will try to validate that this request would
7503 // succeed, but will not actually make changes.
7504 func (c *ProjectsLocationsRolloutsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutsDeleteCall {
7505 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
7506 return c
7507 }
7508
7509 // Fields allows partial responses to be retrieved. See
7510 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7511 // details.
7512 func (c *ProjectsLocationsRolloutsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsDeleteCall {
7513 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7514 return c
7515 }
7516
7517 // Context sets the context to be used in this call's Do method.
7518 func (c *ProjectsLocationsRolloutsDeleteCall) Context(ctx context.Context) *ProjectsLocationsRolloutsDeleteCall {
7519 c.ctx_ = ctx
7520 return c
7521 }
7522
7523 // Header returns a http.Header that can be modified by the caller to add
7524 // headers to the request.
7525 func (c *ProjectsLocationsRolloutsDeleteCall) Header() http.Header {
7526 if c.header_ == nil {
7527 c.header_ = make(http.Header)
7528 }
7529 return c.header_
7530 }
7531
7532 func (c *ProjectsLocationsRolloutsDeleteCall) doRequest(alt string) (*http.Response, error) {
7533 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7534 c.urlParams_.Set("alt", alt)
7535 c.urlParams_.Set("prettyPrint", "false")
7536 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7537 urls += "?" + c.urlParams_.Encode()
7538 req, err := http.NewRequest("DELETE", urls, nil)
7539 if err != nil {
7540 return nil, err
7541 }
7542 req.Header = reqHeaders
7543 googleapi.Expand(req.URL, map[string]string{
7544 "name": c.name,
7545 })
7546 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.delete", "request", internallog.HTTPRequest(req, nil))
7547 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7548 }
7549
7550 // Do executes the "saasservicemgmt.projects.locations.rollouts.delete" call.
7551 // Any non-2xx status code is an error. Response headers are in either
7552 // *Empty.ServerResponse.Header or (if a response was returned at all) in
7553 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7554 // whether the returned error was because http.StatusNotModified was returned.
7555 func (c *ProjectsLocationsRolloutsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
7556 gensupport.SetOptions(c.urlParams_, opts...)
7557 res, err := c.doRequest("json")
7558 if res != nil && res.StatusCode == http.StatusNotModified {
7559 if res.Body != nil {
7560 res.Body.Close()
7561 }
7562 return nil, gensupport.WrapError(&googleapi.Error{
7563 Code: res.StatusCode,
7564 Header: res.Header,
7565 })
7566 }
7567 if err != nil {
7568 return nil, err
7569 }
7570 defer googleapi.CloseBody(res)
7571 if err := googleapi.CheckResponse(res); err != nil {
7572 return nil, gensupport.WrapError(err)
7573 }
7574 ret := &Empty{
7575 ServerResponse: googleapi.ServerResponse{
7576 Header: res.Header,
7577 HTTPStatusCode: res.StatusCode,
7578 },
7579 }
7580 target := &ret
7581 b, err := gensupport.DecodeResponseBytes(target, res)
7582 if err != nil {
7583 return nil, err
7584 }
7585 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.delete", "response", internallog.HTTPResponse(res, b))
7586 return ret, nil
7587 }
7588
7589 type ProjectsLocationsRolloutsGetCall struct {
7590 s *Service
7591 name string
7592 urlParams_ gensupport.URLParams
7593 ifNoneMatch_ string
7594 ctx_ context.Context
7595 header_ http.Header
7596 }
7597
7598 // Get: Retrieve a single rollout.
7599 //
7600 // - name: The resource name of the resource within a service.
7601 func (r *ProjectsLocationsRolloutsService) Get(name string) *ProjectsLocationsRolloutsGetCall {
7602 c := &ProjectsLocationsRolloutsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7603 c.name = name
7604 return c
7605 }
7606
7607 // Fields allows partial responses to be retrieved. See
7608 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7609 // details.
7610 func (c *ProjectsLocationsRolloutsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsGetCall {
7611 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7612 return c
7613 }
7614
7615 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7616 // object's ETag matches the given value. This is useful for getting updates
7617 // only after the object has changed since the last request.
7618 func (c *ProjectsLocationsRolloutsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsRolloutsGetCall {
7619 c.ifNoneMatch_ = entityTag
7620 return c
7621 }
7622
7623 // Context sets the context to be used in this call's Do method.
7624 func (c *ProjectsLocationsRolloutsGetCall) Context(ctx context.Context) *ProjectsLocationsRolloutsGetCall {
7625 c.ctx_ = ctx
7626 return c
7627 }
7628
7629 // Header returns a http.Header that can be modified by the caller to add
7630 // headers to the request.
7631 func (c *ProjectsLocationsRolloutsGetCall) Header() http.Header {
7632 if c.header_ == nil {
7633 c.header_ = make(http.Header)
7634 }
7635 return c.header_
7636 }
7637
7638 func (c *ProjectsLocationsRolloutsGetCall) doRequest(alt string) (*http.Response, error) {
7639 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7640 if c.ifNoneMatch_ != "" {
7641 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7642 }
7643 c.urlParams_.Set("alt", alt)
7644 c.urlParams_.Set("prettyPrint", "false")
7645 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7646 urls += "?" + c.urlParams_.Encode()
7647 req, err := http.NewRequest("GET", urls, nil)
7648 if err != nil {
7649 return nil, err
7650 }
7651 req.Header = reqHeaders
7652 googleapi.Expand(req.URL, map[string]string{
7653 "name": c.name,
7654 })
7655 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.get", "request", internallog.HTTPRequest(req, nil))
7656 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7657 }
7658
7659 // Do executes the "saasservicemgmt.projects.locations.rollouts.get" call.
7660 // Any non-2xx status code is an error. Response headers are in either
7661 // *Rollout.ServerResponse.Header or (if a response was returned at all) in
7662 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7663 // whether the returned error was because http.StatusNotModified was returned.
7664 func (c *ProjectsLocationsRolloutsGetCall) Do(opts ...googleapi.CallOption) (*Rollout, error) {
7665 gensupport.SetOptions(c.urlParams_, opts...)
7666 res, err := c.doRequest("json")
7667 if res != nil && res.StatusCode == http.StatusNotModified {
7668 if res.Body != nil {
7669 res.Body.Close()
7670 }
7671 return nil, gensupport.WrapError(&googleapi.Error{
7672 Code: res.StatusCode,
7673 Header: res.Header,
7674 })
7675 }
7676 if err != nil {
7677 return nil, err
7678 }
7679 defer googleapi.CloseBody(res)
7680 if err := googleapi.CheckResponse(res); err != nil {
7681 return nil, gensupport.WrapError(err)
7682 }
7683 ret := &Rollout{
7684 ServerResponse: googleapi.ServerResponse{
7685 Header: res.Header,
7686 HTTPStatusCode: res.StatusCode,
7687 },
7688 }
7689 target := &ret
7690 b, err := gensupport.DecodeResponseBytes(target, res)
7691 if err != nil {
7692 return nil, err
7693 }
7694 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.get", "response", internallog.HTTPResponse(res, b))
7695 return ret, nil
7696 }
7697
7698 type ProjectsLocationsRolloutsListCall struct {
7699 s *Service
7700 parent string
7701 urlParams_ gensupport.URLParams
7702 ifNoneMatch_ string
7703 ctx_ context.Context
7704 header_ http.Header
7705 }
7706
7707 // List: Retrieve a collection of rollouts.
7708 //
7709 // - parent: The parent of the rollout.
7710 func (r *ProjectsLocationsRolloutsService) List(parent string) *ProjectsLocationsRolloutsListCall {
7711 c := &ProjectsLocationsRolloutsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7712 c.parent = parent
7713 return c
7714 }
7715
7716 // Filter sets the optional parameter "filter": Filter the list as specified in
7717 // https://google.aip.dev/160.
7718 func (c *ProjectsLocationsRolloutsListCall) Filter(filter string) *ProjectsLocationsRolloutsListCall {
7719 c.urlParams_.Set("filter", filter)
7720 return c
7721 }
7722
7723 // OrderBy sets the optional parameter "orderBy": Order results as specified in
7724 // https://google.aip.dev/132.
7725 func (c *ProjectsLocationsRolloutsListCall) OrderBy(orderBy string) *ProjectsLocationsRolloutsListCall {
7726 c.urlParams_.Set("orderBy", orderBy)
7727 return c
7728 }
7729
7730 // PageSize sets the optional parameter "pageSize": The maximum number of
7731 // rollouts to send per page.
7732 func (c *ProjectsLocationsRolloutsListCall) PageSize(pageSize int64) *ProjectsLocationsRolloutsListCall {
7733 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7734 return c
7735 }
7736
7737 // PageToken sets the optional parameter "pageToken": The page token: If the
7738 // next_page_token from a previous response is provided, this request will send
7739 // the subsequent page.
7740 func (c *ProjectsLocationsRolloutsListCall) PageToken(pageToken string) *ProjectsLocationsRolloutsListCall {
7741 c.urlParams_.Set("pageToken", pageToken)
7742 return c
7743 }
7744
7745 // Fields allows partial responses to be retrieved. See
7746 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7747 // details.
7748 func (c *ProjectsLocationsRolloutsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsListCall {
7749 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7750 return c
7751 }
7752
7753 // IfNoneMatch sets an optional parameter which makes the operation fail if the
7754 // object's ETag matches the given value. This is useful for getting updates
7755 // only after the object has changed since the last request.
7756 func (c *ProjectsLocationsRolloutsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsRolloutsListCall {
7757 c.ifNoneMatch_ = entityTag
7758 return c
7759 }
7760
7761 // Context sets the context to be used in this call's Do method.
7762 func (c *ProjectsLocationsRolloutsListCall) Context(ctx context.Context) *ProjectsLocationsRolloutsListCall {
7763 c.ctx_ = ctx
7764 return c
7765 }
7766
7767 // Header returns a http.Header that can be modified by the caller to add
7768 // headers to the request.
7769 func (c *ProjectsLocationsRolloutsListCall) Header() http.Header {
7770 if c.header_ == nil {
7771 c.header_ = make(http.Header)
7772 }
7773 return c.header_
7774 }
7775
7776 func (c *ProjectsLocationsRolloutsListCall) doRequest(alt string) (*http.Response, error) {
7777 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
7778 if c.ifNoneMatch_ != "" {
7779 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7780 }
7781 c.urlParams_.Set("alt", alt)
7782 c.urlParams_.Set("prettyPrint", "false")
7783 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/rollouts")
7784 urls += "?" + c.urlParams_.Encode()
7785 req, err := http.NewRequest("GET", urls, nil)
7786 if err != nil {
7787 return nil, err
7788 }
7789 req.Header = reqHeaders
7790 googleapi.Expand(req.URL, map[string]string{
7791 "parent": c.parent,
7792 })
7793 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.list", "request", internallog.HTTPRequest(req, nil))
7794 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7795 }
7796
7797 // Do executes the "saasservicemgmt.projects.locations.rollouts.list" call.
7798 // Any non-2xx status code is an error. Response headers are in either
7799 // *ListRolloutsResponse.ServerResponse.Header or (if a response was returned
7800 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7801 // check whether the returned error was because http.StatusNotModified was
7802 // returned.
7803 func (c *ProjectsLocationsRolloutsListCall) Do(opts ...googleapi.CallOption) (*ListRolloutsResponse, error) {
7804 gensupport.SetOptions(c.urlParams_, opts...)
7805 res, err := c.doRequest("json")
7806 if res != nil && res.StatusCode == http.StatusNotModified {
7807 if res.Body != nil {
7808 res.Body.Close()
7809 }
7810 return nil, gensupport.WrapError(&googleapi.Error{
7811 Code: res.StatusCode,
7812 Header: res.Header,
7813 })
7814 }
7815 if err != nil {
7816 return nil, err
7817 }
7818 defer googleapi.CloseBody(res)
7819 if err := googleapi.CheckResponse(res); err != nil {
7820 return nil, gensupport.WrapError(err)
7821 }
7822 ret := &ListRolloutsResponse{
7823 ServerResponse: googleapi.ServerResponse{
7824 Header: res.Header,
7825 HTTPStatusCode: res.StatusCode,
7826 },
7827 }
7828 target := &ret
7829 b, err := gensupport.DecodeResponseBytes(target, res)
7830 if err != nil {
7831 return nil, err
7832 }
7833 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.list", "response", internallog.HTTPResponse(res, b))
7834 return ret, nil
7835 }
7836
7837 // Pages invokes f for each page of results.
7838 // A non-nil error returned from f will halt the iteration.
7839 // The provided context supersedes any context provided to the Context method.
7840 func (c *ProjectsLocationsRolloutsListCall) Pages(ctx context.Context, f func(*ListRolloutsResponse) error) error {
7841 c.ctx_ = ctx
7842 defer c.PageToken(c.urlParams_.Get("pageToken"))
7843 for {
7844 x, err := c.Do()
7845 if err != nil {
7846 return err
7847 }
7848 if err := f(x); err != nil {
7849 return err
7850 }
7851 if x.NextPageToken == "" {
7852 return nil
7853 }
7854 c.PageToken(x.NextPageToken)
7855 }
7856 }
7857
7858 type ProjectsLocationsRolloutsPatchCall struct {
7859 s *Service
7860 name string
7861 rollout *Rollout
7862 urlParams_ gensupport.URLParams
7863 ctx_ context.Context
7864 header_ http.Header
7865 }
7866
7867 // Patch: Update a single rollout.
7868 //
7869 // - name: Identifier. The resource name (full URI of the resource) following
7870 // the standard naming scheme:
7871 // "projects/{project}/locations/{location}/rollout/{rollout_id}".
7872 func (r *ProjectsLocationsRolloutsService) Patch(name string, rollout *Rollout) *ProjectsLocationsRolloutsPatchCall {
7873 c := &ProjectsLocationsRolloutsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7874 c.name = name
7875 c.rollout = rollout
7876 return c
7877 }
7878
7879 // RequestId sets the optional parameter "requestId": An optional request ID to
7880 // identify requests. Specify a unique request ID so that if you must retry
7881 // your request, the server will know to ignore the request if it has already
7882 // been completed. The server will guarantee that for at least 60 minutes since
7883 // the first request. For example, consider a situation where you make an
7884 // initial request and the request times out. If you make the request again
7885 // with the same request ID, the server can check if original operation with
7886 // the same request ID was received, and if so, will ignore the second request.
7887 // This prevents clients from accidentally creating duplicate commitments. The
7888 // request ID must be a valid UUID with the exception that zero UUID is not
7889 // supported (00000000-0000-0000-0000-000000000000).
7890 func (c *ProjectsLocationsRolloutsPatchCall) RequestId(requestId string) *ProjectsLocationsRolloutsPatchCall {
7891 c.urlParams_.Set("requestId", requestId)
7892 return c
7893 }
7894
7895 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
7896 // specify the fields to be overwritten in the Rollout resource by the update.
7897 // The fields specified in the update_mask are relative to the resource, not
7898 // the full request. A field will be overwritten if it is in the mask. If the
7899 // user does not provide a mask then all fields in the Rollout will be
7900 // overwritten.
7901 func (c *ProjectsLocationsRolloutsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsRolloutsPatchCall {
7902 c.urlParams_.Set("updateMask", updateMask)
7903 return c
7904 }
7905
7906 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
7907 // is set to true, the service will try to validate that this request would
7908 // succeed, but will not actually make changes.
7909 func (c *ProjectsLocationsRolloutsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsRolloutsPatchCall {
7910 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
7911 return c
7912 }
7913
7914 // Fields allows partial responses to be retrieved. See
7915 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
7916 // details.
7917 func (c *ProjectsLocationsRolloutsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsRolloutsPatchCall {
7918 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7919 return c
7920 }
7921
7922 // Context sets the context to be used in this call's Do method.
7923 func (c *ProjectsLocationsRolloutsPatchCall) Context(ctx context.Context) *ProjectsLocationsRolloutsPatchCall {
7924 c.ctx_ = ctx
7925 return c
7926 }
7927
7928 // Header returns a http.Header that can be modified by the caller to add
7929 // headers to the request.
7930 func (c *ProjectsLocationsRolloutsPatchCall) Header() http.Header {
7931 if c.header_ == nil {
7932 c.header_ = make(http.Header)
7933 }
7934 return c.header_
7935 }
7936
7937 func (c *ProjectsLocationsRolloutsPatchCall) doRequest(alt string) (*http.Response, error) {
7938 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
7939 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.rollout)
7940 if err != nil {
7941 return nil, err
7942 }
7943 c.urlParams_.Set("alt", alt)
7944 c.urlParams_.Set("prettyPrint", "false")
7945 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
7946 urls += "?" + c.urlParams_.Encode()
7947 req, err := http.NewRequest("PATCH", urls, body)
7948 if err != nil {
7949 return nil, err
7950 }
7951 req.Header = reqHeaders
7952 googleapi.Expand(req.URL, map[string]string{
7953 "name": c.name,
7954 })
7955 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
7956 return gensupport.SendRequest(c.ctx_, c.s.client, req)
7957 }
7958
7959 // Do executes the "saasservicemgmt.projects.locations.rollouts.patch" call.
7960 // Any non-2xx status code is an error. Response headers are in either
7961 // *Rollout.ServerResponse.Header or (if a response was returned at all) in
7962 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
7963 // whether the returned error was because http.StatusNotModified was returned.
7964 func (c *ProjectsLocationsRolloutsPatchCall) Do(opts ...googleapi.CallOption) (*Rollout, error) {
7965 gensupport.SetOptions(c.urlParams_, opts...)
7966 res, err := c.doRequest("json")
7967 if res != nil && res.StatusCode == http.StatusNotModified {
7968 if res.Body != nil {
7969 res.Body.Close()
7970 }
7971 return nil, gensupport.WrapError(&googleapi.Error{
7972 Code: res.StatusCode,
7973 Header: res.Header,
7974 })
7975 }
7976 if err != nil {
7977 return nil, err
7978 }
7979 defer googleapi.CloseBody(res)
7980 if err := googleapi.CheckResponse(res); err != nil {
7981 return nil, gensupport.WrapError(err)
7982 }
7983 ret := &Rollout{
7984 ServerResponse: googleapi.ServerResponse{
7985 Header: res.Header,
7986 HTTPStatusCode: res.StatusCode,
7987 },
7988 }
7989 target := &ret
7990 b, err := gensupport.DecodeResponseBytes(target, res)
7991 if err != nil {
7992 return nil, err
7993 }
7994 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.rollouts.patch", "response", internallog.HTTPResponse(res, b))
7995 return ret, nil
7996 }
7997
7998 type ProjectsLocationsSaasCreateCall struct {
7999 s *Service
8000 parent string
8001 saas *Saas
8002 urlParams_ gensupport.URLParams
8003 ctx_ context.Context
8004 header_ http.Header
8005 }
8006
8007 // Create: Create a new saas.
8008 //
8009 // - parent: The parent of the saas.
8010 func (r *ProjectsLocationsSaasService) Create(parent string, saas *Saas) *ProjectsLocationsSaasCreateCall {
8011 c := &ProjectsLocationsSaasCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8012 c.parent = parent
8013 c.saas = saas
8014 return c
8015 }
8016
8017 // RequestId sets the optional parameter "requestId": An optional request ID to
8018 // identify requests. Specify a unique request ID so that if you must retry
8019 // your request, the server will know to ignore the request if it has already
8020 // been completed. The server will guarantee that for at least 60 minutes since
8021 // the first request. For example, consider a situation where you make an
8022 // initial request and the request times out. If you make the request again
8023 // with the same request ID, the server can check if original operation with
8024 // the same request ID was received, and if so, will ignore the second request.
8025 // This prevents clients from accidentally creating duplicate commitments. The
8026 // request ID must be a valid UUID with the exception that zero UUID is not
8027 // supported (00000000-0000-0000-0000-000000000000).
8028 func (c *ProjectsLocationsSaasCreateCall) RequestId(requestId string) *ProjectsLocationsSaasCreateCall {
8029 c.urlParams_.Set("requestId", requestId)
8030 return c
8031 }
8032
8033 // SaasId sets the optional parameter "saasId": Required. The ID value for the
8034 // new saas.
8035 func (c *ProjectsLocationsSaasCreateCall) SaasId(saasId string) *ProjectsLocationsSaasCreateCall {
8036 c.urlParams_.Set("saasId", saasId)
8037 return c
8038 }
8039
8040 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
8041 // is set to true, the service will try to validate that this request would
8042 // succeed, but will not actually make changes.
8043 func (c *ProjectsLocationsSaasCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsSaasCreateCall {
8044 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
8045 return c
8046 }
8047
8048 // Fields allows partial responses to be retrieved. See
8049 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8050 // details.
8051 func (c *ProjectsLocationsSaasCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasCreateCall {
8052 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8053 return c
8054 }
8055
8056 // Context sets the context to be used in this call's Do method.
8057 func (c *ProjectsLocationsSaasCreateCall) Context(ctx context.Context) *ProjectsLocationsSaasCreateCall {
8058 c.ctx_ = ctx
8059 return c
8060 }
8061
8062 // Header returns a http.Header that can be modified by the caller to add
8063 // headers to the request.
8064 func (c *ProjectsLocationsSaasCreateCall) Header() http.Header {
8065 if c.header_ == nil {
8066 c.header_ = make(http.Header)
8067 }
8068 return c.header_
8069 }
8070
8071 func (c *ProjectsLocationsSaasCreateCall) doRequest(alt string) (*http.Response, error) {
8072 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8073 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.saas)
8074 if err != nil {
8075 return nil, err
8076 }
8077 c.urlParams_.Set("alt", alt)
8078 c.urlParams_.Set("prettyPrint", "false")
8079 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/saas")
8080 urls += "?" + c.urlParams_.Encode()
8081 req, err := http.NewRequest("POST", urls, body)
8082 if err != nil {
8083 return nil, err
8084 }
8085 req.Header = reqHeaders
8086 googleapi.Expand(req.URL, map[string]string{
8087 "parent": c.parent,
8088 })
8089 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8090 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8091 }
8092
8093 // Do executes the "saasservicemgmt.projects.locations.saas.create" call.
8094 // Any non-2xx status code is an error. Response headers are in either
8095 // *Saas.ServerResponse.Header or (if a response was returned at all) in
8096 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8097 // whether the returned error was because http.StatusNotModified was returned.
8098 func (c *ProjectsLocationsSaasCreateCall) Do(opts ...googleapi.CallOption) (*Saas, error) {
8099 gensupport.SetOptions(c.urlParams_, opts...)
8100 res, err := c.doRequest("json")
8101 if res != nil && res.StatusCode == http.StatusNotModified {
8102 if res.Body != nil {
8103 res.Body.Close()
8104 }
8105 return nil, gensupport.WrapError(&googleapi.Error{
8106 Code: res.StatusCode,
8107 Header: res.Header,
8108 })
8109 }
8110 if err != nil {
8111 return nil, err
8112 }
8113 defer googleapi.CloseBody(res)
8114 if err := googleapi.CheckResponse(res); err != nil {
8115 return nil, gensupport.WrapError(err)
8116 }
8117 ret := &Saas{
8118 ServerResponse: googleapi.ServerResponse{
8119 Header: res.Header,
8120 HTTPStatusCode: res.StatusCode,
8121 },
8122 }
8123 target := &ret
8124 b, err := gensupport.DecodeResponseBytes(target, res)
8125 if err != nil {
8126 return nil, err
8127 }
8128 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.create", "response", internallog.HTTPResponse(res, b))
8129 return ret, nil
8130 }
8131
8132 type ProjectsLocationsSaasDeleteCall struct {
8133 s *Service
8134 name string
8135 urlParams_ gensupport.URLParams
8136 ctx_ context.Context
8137 header_ http.Header
8138 }
8139
8140 // Delete: Delete a single saas.
8141 //
8142 // - name: The resource name of the resource within a service.
8143 func (r *ProjectsLocationsSaasService) Delete(name string) *ProjectsLocationsSaasDeleteCall {
8144 c := &ProjectsLocationsSaasDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8145 c.name = name
8146 return c
8147 }
8148
8149 // Etag sets the optional parameter "etag": The etag known to the client for
8150 // the expected state of the saas. This is used with state-changing methods to
8151 // prevent accidental overwrites when multiple user agents might be acting in
8152 // parallel on the same resource. An etag wildcard provide optimistic
8153 // concurrency based on the expected existence of the saas. The Any wildcard
8154 // (`*`) requires that the resource must already exists, and the Not Any
8155 // wildcard (`!*`) requires that it must not.
8156 func (c *ProjectsLocationsSaasDeleteCall) Etag(etag string) *ProjectsLocationsSaasDeleteCall {
8157 c.urlParams_.Set("etag", etag)
8158 return c
8159 }
8160
8161 // RequestId sets the optional parameter "requestId": An optional request ID to
8162 // identify requests. Specify a unique request ID so that if you must retry
8163 // your request, the server will know to ignore the request if it has already
8164 // been completed. The server will guarantee that for at least 60 minutes since
8165 // the first request. For example, consider a situation where you make an
8166 // initial request and the request times out. If you make the request again
8167 // with the same request ID, the server can check if original operation with
8168 // the same request ID was received, and if so, will ignore the second request.
8169 // This prevents clients from accidentally creating duplicate commitments. The
8170 // request ID must be a valid UUID with the exception that zero UUID is not
8171 // supported (00000000-0000-0000-0000-000000000000).
8172 func (c *ProjectsLocationsSaasDeleteCall) RequestId(requestId string) *ProjectsLocationsSaasDeleteCall {
8173 c.urlParams_.Set("requestId", requestId)
8174 return c
8175 }
8176
8177 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
8178 // is set to true, the service will try to validate that this request would
8179 // succeed, but will not actually make changes.
8180 func (c *ProjectsLocationsSaasDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsSaasDeleteCall {
8181 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
8182 return c
8183 }
8184
8185 // Fields allows partial responses to be retrieved. See
8186 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8187 // details.
8188 func (c *ProjectsLocationsSaasDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasDeleteCall {
8189 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8190 return c
8191 }
8192
8193 // Context sets the context to be used in this call's Do method.
8194 func (c *ProjectsLocationsSaasDeleteCall) Context(ctx context.Context) *ProjectsLocationsSaasDeleteCall {
8195 c.ctx_ = ctx
8196 return c
8197 }
8198
8199 // Header returns a http.Header that can be modified by the caller to add
8200 // headers to the request.
8201 func (c *ProjectsLocationsSaasDeleteCall) Header() http.Header {
8202 if c.header_ == nil {
8203 c.header_ = make(http.Header)
8204 }
8205 return c.header_
8206 }
8207
8208 func (c *ProjectsLocationsSaasDeleteCall) doRequest(alt string) (*http.Response, error) {
8209 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8210 c.urlParams_.Set("alt", alt)
8211 c.urlParams_.Set("prettyPrint", "false")
8212 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8213 urls += "?" + c.urlParams_.Encode()
8214 req, err := http.NewRequest("DELETE", urls, nil)
8215 if err != nil {
8216 return nil, err
8217 }
8218 req.Header = reqHeaders
8219 googleapi.Expand(req.URL, map[string]string{
8220 "name": c.name,
8221 })
8222 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.delete", "request", internallog.HTTPRequest(req, nil))
8223 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8224 }
8225
8226 // Do executes the "saasservicemgmt.projects.locations.saas.delete" call.
8227 // Any non-2xx status code is an error. Response headers are in either
8228 // *Empty.ServerResponse.Header or (if a response was returned at all) in
8229 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8230 // whether the returned error was because http.StatusNotModified was returned.
8231 func (c *ProjectsLocationsSaasDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
8232 gensupport.SetOptions(c.urlParams_, opts...)
8233 res, err := c.doRequest("json")
8234 if res != nil && res.StatusCode == http.StatusNotModified {
8235 if res.Body != nil {
8236 res.Body.Close()
8237 }
8238 return nil, gensupport.WrapError(&googleapi.Error{
8239 Code: res.StatusCode,
8240 Header: res.Header,
8241 })
8242 }
8243 if err != nil {
8244 return nil, err
8245 }
8246 defer googleapi.CloseBody(res)
8247 if err := googleapi.CheckResponse(res); err != nil {
8248 return nil, gensupport.WrapError(err)
8249 }
8250 ret := &Empty{
8251 ServerResponse: googleapi.ServerResponse{
8252 Header: res.Header,
8253 HTTPStatusCode: res.StatusCode,
8254 },
8255 }
8256 target := &ret
8257 b, err := gensupport.DecodeResponseBytes(target, res)
8258 if err != nil {
8259 return nil, err
8260 }
8261 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.delete", "response", internallog.HTTPResponse(res, b))
8262 return ret, nil
8263 }
8264
8265 type ProjectsLocationsSaasGetCall struct {
8266 s *Service
8267 name string
8268 urlParams_ gensupport.URLParams
8269 ifNoneMatch_ string
8270 ctx_ context.Context
8271 header_ http.Header
8272 }
8273
8274 // Get: Retrieve a single saas.
8275 //
8276 // - name: The resource name of the resource within a service.
8277 func (r *ProjectsLocationsSaasService) Get(name string) *ProjectsLocationsSaasGetCall {
8278 c := &ProjectsLocationsSaasGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8279 c.name = name
8280 return c
8281 }
8282
8283 // Fields allows partial responses to be retrieved. See
8284 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8285 // details.
8286 func (c *ProjectsLocationsSaasGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasGetCall {
8287 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8288 return c
8289 }
8290
8291 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8292 // object's ETag matches the given value. This is useful for getting updates
8293 // only after the object has changed since the last request.
8294 func (c *ProjectsLocationsSaasGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsSaasGetCall {
8295 c.ifNoneMatch_ = entityTag
8296 return c
8297 }
8298
8299 // Context sets the context to be used in this call's Do method.
8300 func (c *ProjectsLocationsSaasGetCall) Context(ctx context.Context) *ProjectsLocationsSaasGetCall {
8301 c.ctx_ = ctx
8302 return c
8303 }
8304
8305 // Header returns a http.Header that can be modified by the caller to add
8306 // headers to the request.
8307 func (c *ProjectsLocationsSaasGetCall) Header() http.Header {
8308 if c.header_ == nil {
8309 c.header_ = make(http.Header)
8310 }
8311 return c.header_
8312 }
8313
8314 func (c *ProjectsLocationsSaasGetCall) doRequest(alt string) (*http.Response, error) {
8315 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8316 if c.ifNoneMatch_ != "" {
8317 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8318 }
8319 c.urlParams_.Set("alt", alt)
8320 c.urlParams_.Set("prettyPrint", "false")
8321 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8322 urls += "?" + c.urlParams_.Encode()
8323 req, err := http.NewRequest("GET", urls, nil)
8324 if err != nil {
8325 return nil, err
8326 }
8327 req.Header = reqHeaders
8328 googleapi.Expand(req.URL, map[string]string{
8329 "name": c.name,
8330 })
8331 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.get", "request", internallog.HTTPRequest(req, nil))
8332 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8333 }
8334
8335 // Do executes the "saasservicemgmt.projects.locations.saas.get" call.
8336 // Any non-2xx status code is an error. Response headers are in either
8337 // *Saas.ServerResponse.Header or (if a response was returned at all) in
8338 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8339 // whether the returned error was because http.StatusNotModified was returned.
8340 func (c *ProjectsLocationsSaasGetCall) Do(opts ...googleapi.CallOption) (*Saas, error) {
8341 gensupport.SetOptions(c.urlParams_, opts...)
8342 res, err := c.doRequest("json")
8343 if res != nil && res.StatusCode == http.StatusNotModified {
8344 if res.Body != nil {
8345 res.Body.Close()
8346 }
8347 return nil, gensupport.WrapError(&googleapi.Error{
8348 Code: res.StatusCode,
8349 Header: res.Header,
8350 })
8351 }
8352 if err != nil {
8353 return nil, err
8354 }
8355 defer googleapi.CloseBody(res)
8356 if err := googleapi.CheckResponse(res); err != nil {
8357 return nil, gensupport.WrapError(err)
8358 }
8359 ret := &Saas{
8360 ServerResponse: googleapi.ServerResponse{
8361 Header: res.Header,
8362 HTTPStatusCode: res.StatusCode,
8363 },
8364 }
8365 target := &ret
8366 b, err := gensupport.DecodeResponseBytes(target, res)
8367 if err != nil {
8368 return nil, err
8369 }
8370 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.get", "response", internallog.HTTPResponse(res, b))
8371 return ret, nil
8372 }
8373
8374 type ProjectsLocationsSaasListCall struct {
8375 s *Service
8376 parent string
8377 urlParams_ gensupport.URLParams
8378 ifNoneMatch_ string
8379 ctx_ context.Context
8380 header_ http.Header
8381 }
8382
8383 // List: Retrieve a collection of saas.
8384 //
8385 // - parent: The parent of the saas.
8386 func (r *ProjectsLocationsSaasService) List(parent string) *ProjectsLocationsSaasListCall {
8387 c := &ProjectsLocationsSaasListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8388 c.parent = parent
8389 return c
8390 }
8391
8392 // Filter sets the optional parameter "filter": Filter the list as specified in
8393 // https://google.aip.dev/160.
8394 func (c *ProjectsLocationsSaasListCall) Filter(filter string) *ProjectsLocationsSaasListCall {
8395 c.urlParams_.Set("filter", filter)
8396 return c
8397 }
8398
8399 // OrderBy sets the optional parameter "orderBy": Order results as specified in
8400 // https://google.aip.dev/132.
8401 func (c *ProjectsLocationsSaasListCall) OrderBy(orderBy string) *ProjectsLocationsSaasListCall {
8402 c.urlParams_.Set("orderBy", orderBy)
8403 return c
8404 }
8405
8406 // PageSize sets the optional parameter "pageSize": The maximum number of saas
8407 // to send per page.
8408 func (c *ProjectsLocationsSaasListCall) PageSize(pageSize int64) *ProjectsLocationsSaasListCall {
8409 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8410 return c
8411 }
8412
8413 // PageToken sets the optional parameter "pageToken": The page token: If the
8414 // next_page_token from a previous response is provided, this request will send
8415 // the subsequent page.
8416 func (c *ProjectsLocationsSaasListCall) PageToken(pageToken string) *ProjectsLocationsSaasListCall {
8417 c.urlParams_.Set("pageToken", pageToken)
8418 return c
8419 }
8420
8421 // Fields allows partial responses to be retrieved. See
8422 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8423 // details.
8424 func (c *ProjectsLocationsSaasListCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasListCall {
8425 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8426 return c
8427 }
8428
8429 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8430 // object's ETag matches the given value. This is useful for getting updates
8431 // only after the object has changed since the last request.
8432 func (c *ProjectsLocationsSaasListCall) IfNoneMatch(entityTag string) *ProjectsLocationsSaasListCall {
8433 c.ifNoneMatch_ = entityTag
8434 return c
8435 }
8436
8437 // Context sets the context to be used in this call's Do method.
8438 func (c *ProjectsLocationsSaasListCall) Context(ctx context.Context) *ProjectsLocationsSaasListCall {
8439 c.ctx_ = ctx
8440 return c
8441 }
8442
8443 // Header returns a http.Header that can be modified by the caller to add
8444 // headers to the request.
8445 func (c *ProjectsLocationsSaasListCall) Header() http.Header {
8446 if c.header_ == nil {
8447 c.header_ = make(http.Header)
8448 }
8449 return c.header_
8450 }
8451
8452 func (c *ProjectsLocationsSaasListCall) doRequest(alt string) (*http.Response, error) {
8453 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8454 if c.ifNoneMatch_ != "" {
8455 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8456 }
8457 c.urlParams_.Set("alt", alt)
8458 c.urlParams_.Set("prettyPrint", "false")
8459 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/saas")
8460 urls += "?" + c.urlParams_.Encode()
8461 req, err := http.NewRequest("GET", urls, nil)
8462 if err != nil {
8463 return nil, err
8464 }
8465 req.Header = reqHeaders
8466 googleapi.Expand(req.URL, map[string]string{
8467 "parent": c.parent,
8468 })
8469 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.list", "request", internallog.HTTPRequest(req, nil))
8470 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8471 }
8472
8473 // Do executes the "saasservicemgmt.projects.locations.saas.list" call.
8474 // Any non-2xx status code is an error. Response headers are in either
8475 // *ListSaasResponse.ServerResponse.Header or (if a response was returned at
8476 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8477 // check whether the returned error was because http.StatusNotModified was
8478 // returned.
8479 func (c *ProjectsLocationsSaasListCall) Do(opts ...googleapi.CallOption) (*ListSaasResponse, error) {
8480 gensupport.SetOptions(c.urlParams_, opts...)
8481 res, err := c.doRequest("json")
8482 if res != nil && res.StatusCode == http.StatusNotModified {
8483 if res.Body != nil {
8484 res.Body.Close()
8485 }
8486 return nil, gensupport.WrapError(&googleapi.Error{
8487 Code: res.StatusCode,
8488 Header: res.Header,
8489 })
8490 }
8491 if err != nil {
8492 return nil, err
8493 }
8494 defer googleapi.CloseBody(res)
8495 if err := googleapi.CheckResponse(res); err != nil {
8496 return nil, gensupport.WrapError(err)
8497 }
8498 ret := &ListSaasResponse{
8499 ServerResponse: googleapi.ServerResponse{
8500 Header: res.Header,
8501 HTTPStatusCode: res.StatusCode,
8502 },
8503 }
8504 target := &ret
8505 b, err := gensupport.DecodeResponseBytes(target, res)
8506 if err != nil {
8507 return nil, err
8508 }
8509 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.list", "response", internallog.HTTPResponse(res, b))
8510 return ret, nil
8511 }
8512
8513 // Pages invokes f for each page of results.
8514 // A non-nil error returned from f will halt the iteration.
8515 // The provided context supersedes any context provided to the Context method.
8516 func (c *ProjectsLocationsSaasListCall) Pages(ctx context.Context, f func(*ListSaasResponse) error) error {
8517 c.ctx_ = ctx
8518 defer c.PageToken(c.urlParams_.Get("pageToken"))
8519 for {
8520 x, err := c.Do()
8521 if err != nil {
8522 return err
8523 }
8524 if err := f(x); err != nil {
8525 return err
8526 }
8527 if x.NextPageToken == "" {
8528 return nil
8529 }
8530 c.PageToken(x.NextPageToken)
8531 }
8532 }
8533
8534 type ProjectsLocationsSaasPatchCall struct {
8535 s *Service
8536 name string
8537 saas *Saas
8538 urlParams_ gensupport.URLParams
8539 ctx_ context.Context
8540 header_ http.Header
8541 }
8542
8543 // Patch: Update a single saas.
8544 //
8545 // - name: Identifier. The resource name (full URI of the resource) following
8546 // the standard naming scheme:
8547 // "projects/{project}/locations/{location}/saas/{saas}".
8548 func (r *ProjectsLocationsSaasService) Patch(name string, saas *Saas) *ProjectsLocationsSaasPatchCall {
8549 c := &ProjectsLocationsSaasPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8550 c.name = name
8551 c.saas = saas
8552 return c
8553 }
8554
8555 // RequestId sets the optional parameter "requestId": An optional request ID to
8556 // identify requests. Specify a unique request ID so that if you must retry
8557 // your request, the server will know to ignore the request if it has already
8558 // been completed. The server will guarantee that for at least 60 minutes since
8559 // the first request. For example, consider a situation where you make an
8560 // initial request and the request times out. If you make the request again
8561 // with the same request ID, the server can check if original operation with
8562 // the same request ID was received, and if so, will ignore the second request.
8563 // This prevents clients from accidentally creating duplicate commitments. The
8564 // request ID must be a valid UUID with the exception that zero UUID is not
8565 // supported (00000000-0000-0000-0000-000000000000).
8566 func (c *ProjectsLocationsSaasPatchCall) RequestId(requestId string) *ProjectsLocationsSaasPatchCall {
8567 c.urlParams_.Set("requestId", requestId)
8568 return c
8569 }
8570
8571 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
8572 // specify the fields to be overwritten in the Saas resource by the update. The
8573 // fields specified in the update_mask are relative to the resource, not the
8574 // full request. A field will be overwritten if it is in the mask. If the user
8575 // does not provide a mask then all fields in the Saas will be overwritten.
8576 func (c *ProjectsLocationsSaasPatchCall) UpdateMask(updateMask string) *ProjectsLocationsSaasPatchCall {
8577 c.urlParams_.Set("updateMask", updateMask)
8578 return c
8579 }
8580
8581 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
8582 // is set to true, the service will try to validate that this request would
8583 // succeed, but will not actually make changes.
8584 func (c *ProjectsLocationsSaasPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsSaasPatchCall {
8585 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
8586 return c
8587 }
8588
8589 // Fields allows partial responses to be retrieved. See
8590 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8591 // details.
8592 func (c *ProjectsLocationsSaasPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsSaasPatchCall {
8593 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8594 return c
8595 }
8596
8597 // Context sets the context to be used in this call's Do method.
8598 func (c *ProjectsLocationsSaasPatchCall) Context(ctx context.Context) *ProjectsLocationsSaasPatchCall {
8599 c.ctx_ = ctx
8600 return c
8601 }
8602
8603 // Header returns a http.Header that can be modified by the caller to add
8604 // headers to the request.
8605 func (c *ProjectsLocationsSaasPatchCall) Header() http.Header {
8606 if c.header_ == nil {
8607 c.header_ = make(http.Header)
8608 }
8609 return c.header_
8610 }
8611
8612 func (c *ProjectsLocationsSaasPatchCall) doRequest(alt string) (*http.Response, error) {
8613 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8614 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.saas)
8615 if err != nil {
8616 return nil, err
8617 }
8618 c.urlParams_.Set("alt", alt)
8619 c.urlParams_.Set("prettyPrint", "false")
8620 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8621 urls += "?" + c.urlParams_.Encode()
8622 req, err := http.NewRequest("PATCH", urls, body)
8623 if err != nil {
8624 return nil, err
8625 }
8626 req.Header = reqHeaders
8627 googleapi.Expand(req.URL, map[string]string{
8628 "name": c.name,
8629 })
8630 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
8631 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8632 }
8633
8634 // Do executes the "saasservicemgmt.projects.locations.saas.patch" call.
8635 // Any non-2xx status code is an error. Response headers are in either
8636 // *Saas.ServerResponse.Header or (if a response was returned at all) in
8637 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8638 // whether the returned error was because http.StatusNotModified was returned.
8639 func (c *ProjectsLocationsSaasPatchCall) Do(opts ...googleapi.CallOption) (*Saas, error) {
8640 gensupport.SetOptions(c.urlParams_, opts...)
8641 res, err := c.doRequest("json")
8642 if res != nil && res.StatusCode == http.StatusNotModified {
8643 if res.Body != nil {
8644 res.Body.Close()
8645 }
8646 return nil, gensupport.WrapError(&googleapi.Error{
8647 Code: res.StatusCode,
8648 Header: res.Header,
8649 })
8650 }
8651 if err != nil {
8652 return nil, err
8653 }
8654 defer googleapi.CloseBody(res)
8655 if err := googleapi.CheckResponse(res); err != nil {
8656 return nil, gensupport.WrapError(err)
8657 }
8658 ret := &Saas{
8659 ServerResponse: googleapi.ServerResponse{
8660 Header: res.Header,
8661 HTTPStatusCode: res.StatusCode,
8662 },
8663 }
8664 target := &ret
8665 b, err := gensupport.DecodeResponseBytes(target, res)
8666 if err != nil {
8667 return nil, err
8668 }
8669 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.saas.patch", "response", internallog.HTTPResponse(res, b))
8670 return ret, nil
8671 }
8672
8673 type ProjectsLocationsTenantsCreateCall struct {
8674 s *Service
8675 parent string
8676 tenant *Tenant
8677 urlParams_ gensupport.URLParams
8678 ctx_ context.Context
8679 header_ http.Header
8680 }
8681
8682 // Create: Create a new tenant.
8683 //
8684 // - parent: The parent of the tenant.
8685 func (r *ProjectsLocationsTenantsService) Create(parent string, tenant *Tenant) *ProjectsLocationsTenantsCreateCall {
8686 c := &ProjectsLocationsTenantsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8687 c.parent = parent
8688 c.tenant = tenant
8689 return c
8690 }
8691
8692 // RequestId sets the optional parameter "requestId": An optional request ID to
8693 // identify requests. Specify a unique request ID so that if you must retry
8694 // your request, the server will know to ignore the request if it has already
8695 // been completed. The server will guarantee that for at least 60 minutes since
8696 // the first request. For example, consider a situation where you make an
8697 // initial request and the request times out. If you make the request again
8698 // with the same request ID, the server can check if original operation with
8699 // the same request ID was received, and if so, will ignore the second request.
8700 // This prevents clients from accidentally creating duplicate commitments. The
8701 // request ID must be a valid UUID with the exception that zero UUID is not
8702 // supported (00000000-0000-0000-0000-000000000000).
8703 func (c *ProjectsLocationsTenantsCreateCall) RequestId(requestId string) *ProjectsLocationsTenantsCreateCall {
8704 c.urlParams_.Set("requestId", requestId)
8705 return c
8706 }
8707
8708 // TenantId sets the optional parameter "tenantId": Required. The ID value for
8709 // the new tenant.
8710 func (c *ProjectsLocationsTenantsCreateCall) TenantId(tenantId string) *ProjectsLocationsTenantsCreateCall {
8711 c.urlParams_.Set("tenantId", tenantId)
8712 return c
8713 }
8714
8715 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
8716 // is set to true, the service will try to validate that this request would
8717 // succeed, but will not actually make changes.
8718 func (c *ProjectsLocationsTenantsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTenantsCreateCall {
8719 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
8720 return c
8721 }
8722
8723 // Fields allows partial responses to be retrieved. See
8724 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8725 // details.
8726 func (c *ProjectsLocationsTenantsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsCreateCall {
8727 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8728 return c
8729 }
8730
8731 // Context sets the context to be used in this call's Do method.
8732 func (c *ProjectsLocationsTenantsCreateCall) Context(ctx context.Context) *ProjectsLocationsTenantsCreateCall {
8733 c.ctx_ = ctx
8734 return c
8735 }
8736
8737 // Header returns a http.Header that can be modified by the caller to add
8738 // headers to the request.
8739 func (c *ProjectsLocationsTenantsCreateCall) Header() http.Header {
8740 if c.header_ == nil {
8741 c.header_ = make(http.Header)
8742 }
8743 return c.header_
8744 }
8745
8746 func (c *ProjectsLocationsTenantsCreateCall) doRequest(alt string) (*http.Response, error) {
8747 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8748 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tenant)
8749 if err != nil {
8750 return nil, err
8751 }
8752 c.urlParams_.Set("alt", alt)
8753 c.urlParams_.Set("prettyPrint", "false")
8754 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tenants")
8755 urls += "?" + c.urlParams_.Encode()
8756 req, err := http.NewRequest("POST", urls, body)
8757 if err != nil {
8758 return nil, err
8759 }
8760 req.Header = reqHeaders
8761 googleapi.Expand(req.URL, map[string]string{
8762 "parent": c.parent,
8763 })
8764 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.create", "request", internallog.HTTPRequest(req, body.Bytes()))
8765 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8766 }
8767
8768 // Do executes the "saasservicemgmt.projects.locations.tenants.create" call.
8769 // Any non-2xx status code is an error. Response headers are in either
8770 // *Tenant.ServerResponse.Header or (if a response was returned at all) in
8771 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8772 // whether the returned error was because http.StatusNotModified was returned.
8773 func (c *ProjectsLocationsTenantsCreateCall) Do(opts ...googleapi.CallOption) (*Tenant, error) {
8774 gensupport.SetOptions(c.urlParams_, opts...)
8775 res, err := c.doRequest("json")
8776 if res != nil && res.StatusCode == http.StatusNotModified {
8777 if res.Body != nil {
8778 res.Body.Close()
8779 }
8780 return nil, gensupport.WrapError(&googleapi.Error{
8781 Code: res.StatusCode,
8782 Header: res.Header,
8783 })
8784 }
8785 if err != nil {
8786 return nil, err
8787 }
8788 defer googleapi.CloseBody(res)
8789 if err := googleapi.CheckResponse(res); err != nil {
8790 return nil, gensupport.WrapError(err)
8791 }
8792 ret := &Tenant{
8793 ServerResponse: googleapi.ServerResponse{
8794 Header: res.Header,
8795 HTTPStatusCode: res.StatusCode,
8796 },
8797 }
8798 target := &ret
8799 b, err := gensupport.DecodeResponseBytes(target, res)
8800 if err != nil {
8801 return nil, err
8802 }
8803 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.create", "response", internallog.HTTPResponse(res, b))
8804 return ret, nil
8805 }
8806
8807 type ProjectsLocationsTenantsDeleteCall struct {
8808 s *Service
8809 name string
8810 urlParams_ gensupport.URLParams
8811 ctx_ context.Context
8812 header_ http.Header
8813 }
8814
8815 // Delete: Delete a single tenant.
8816 //
8817 // - name: The resource name of the resource within a service.
8818 func (r *ProjectsLocationsTenantsService) Delete(name string) *ProjectsLocationsTenantsDeleteCall {
8819 c := &ProjectsLocationsTenantsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8820 c.name = name
8821 return c
8822 }
8823
8824 // Etag sets the optional parameter "etag": The etag known to the client for
8825 // the expected state of the tenant. This is used with state-changing methods
8826 // to prevent accidental overwrites when multiple user agents might be acting
8827 // in parallel on the same resource. An etag wildcard provide optimistic
8828 // concurrency based on the expected existence of the tenant. The Any wildcard
8829 // (`*`) requires that the resource must already exists, and the Not Any
8830 // wildcard (`!*`) requires that it must not.
8831 func (c *ProjectsLocationsTenantsDeleteCall) Etag(etag string) *ProjectsLocationsTenantsDeleteCall {
8832 c.urlParams_.Set("etag", etag)
8833 return c
8834 }
8835
8836 // RequestId sets the optional parameter "requestId": An optional request ID to
8837 // identify requests. Specify a unique request ID so that if you must retry
8838 // your request, the server will know to ignore the request if it has already
8839 // been completed. The server will guarantee that for at least 60 minutes since
8840 // the first request. For example, consider a situation where you make an
8841 // initial request and the request times out. If you make the request again
8842 // with the same request ID, the server can check if original operation with
8843 // the same request ID was received, and if so, will ignore the second request.
8844 // This prevents clients from accidentally creating duplicate commitments. The
8845 // request ID must be a valid UUID with the exception that zero UUID is not
8846 // supported (00000000-0000-0000-0000-000000000000).
8847 func (c *ProjectsLocationsTenantsDeleteCall) RequestId(requestId string) *ProjectsLocationsTenantsDeleteCall {
8848 c.urlParams_.Set("requestId", requestId)
8849 return c
8850 }
8851
8852 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
8853 // is set to true, the service will try to validate that this request would
8854 // succeed, but will not actually make changes.
8855 func (c *ProjectsLocationsTenantsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTenantsDeleteCall {
8856 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
8857 return c
8858 }
8859
8860 // Fields allows partial responses to be retrieved. See
8861 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8862 // details.
8863 func (c *ProjectsLocationsTenantsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsDeleteCall {
8864 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8865 return c
8866 }
8867
8868 // Context sets the context to be used in this call's Do method.
8869 func (c *ProjectsLocationsTenantsDeleteCall) Context(ctx context.Context) *ProjectsLocationsTenantsDeleteCall {
8870 c.ctx_ = ctx
8871 return c
8872 }
8873
8874 // Header returns a http.Header that can be modified by the caller to add
8875 // headers to the request.
8876 func (c *ProjectsLocationsTenantsDeleteCall) Header() http.Header {
8877 if c.header_ == nil {
8878 c.header_ = make(http.Header)
8879 }
8880 return c.header_
8881 }
8882
8883 func (c *ProjectsLocationsTenantsDeleteCall) doRequest(alt string) (*http.Response, error) {
8884 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8885 c.urlParams_.Set("alt", alt)
8886 c.urlParams_.Set("prettyPrint", "false")
8887 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8888 urls += "?" + c.urlParams_.Encode()
8889 req, err := http.NewRequest("DELETE", urls, nil)
8890 if err != nil {
8891 return nil, err
8892 }
8893 req.Header = reqHeaders
8894 googleapi.Expand(req.URL, map[string]string{
8895 "name": c.name,
8896 })
8897 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.delete", "request", internallog.HTTPRequest(req, nil))
8898 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8899 }
8900
8901 // Do executes the "saasservicemgmt.projects.locations.tenants.delete" call.
8902 // Any non-2xx status code is an error. Response headers are in either
8903 // *Empty.ServerResponse.Header or (if a response was returned at all) in
8904 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8905 // whether the returned error was because http.StatusNotModified was returned.
8906 func (c *ProjectsLocationsTenantsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
8907 gensupport.SetOptions(c.urlParams_, opts...)
8908 res, err := c.doRequest("json")
8909 if res != nil && res.StatusCode == http.StatusNotModified {
8910 if res.Body != nil {
8911 res.Body.Close()
8912 }
8913 return nil, gensupport.WrapError(&googleapi.Error{
8914 Code: res.StatusCode,
8915 Header: res.Header,
8916 })
8917 }
8918 if err != nil {
8919 return nil, err
8920 }
8921 defer googleapi.CloseBody(res)
8922 if err := googleapi.CheckResponse(res); err != nil {
8923 return nil, gensupport.WrapError(err)
8924 }
8925 ret := &Empty{
8926 ServerResponse: googleapi.ServerResponse{
8927 Header: res.Header,
8928 HTTPStatusCode: res.StatusCode,
8929 },
8930 }
8931 target := &ret
8932 b, err := gensupport.DecodeResponseBytes(target, res)
8933 if err != nil {
8934 return nil, err
8935 }
8936 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.delete", "response", internallog.HTTPResponse(res, b))
8937 return ret, nil
8938 }
8939
8940 type ProjectsLocationsTenantsGetCall struct {
8941 s *Service
8942 name string
8943 urlParams_ gensupport.URLParams
8944 ifNoneMatch_ string
8945 ctx_ context.Context
8946 header_ http.Header
8947 }
8948
8949 // Get: Retrieve a single tenant.
8950 //
8951 // - name: The resource name of the resource within a service.
8952 func (r *ProjectsLocationsTenantsService) Get(name string) *ProjectsLocationsTenantsGetCall {
8953 c := &ProjectsLocationsTenantsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8954 c.name = name
8955 return c
8956 }
8957
8958 // Fields allows partial responses to be retrieved. See
8959 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8960 // details.
8961 func (c *ProjectsLocationsTenantsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsGetCall {
8962 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8963 return c
8964 }
8965
8966 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8967 // object's ETag matches the given value. This is useful for getting updates
8968 // only after the object has changed since the last request.
8969 func (c *ProjectsLocationsTenantsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTenantsGetCall {
8970 c.ifNoneMatch_ = entityTag
8971 return c
8972 }
8973
8974 // Context sets the context to be used in this call's Do method.
8975 func (c *ProjectsLocationsTenantsGetCall) Context(ctx context.Context) *ProjectsLocationsTenantsGetCall {
8976 c.ctx_ = ctx
8977 return c
8978 }
8979
8980 // Header returns a http.Header that can be modified by the caller to add
8981 // headers to the request.
8982 func (c *ProjectsLocationsTenantsGetCall) Header() http.Header {
8983 if c.header_ == nil {
8984 c.header_ = make(http.Header)
8985 }
8986 return c.header_
8987 }
8988
8989 func (c *ProjectsLocationsTenantsGetCall) doRequest(alt string) (*http.Response, error) {
8990 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8991 if c.ifNoneMatch_ != "" {
8992 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8993 }
8994 c.urlParams_.Set("alt", alt)
8995 c.urlParams_.Set("prettyPrint", "false")
8996 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
8997 urls += "?" + c.urlParams_.Encode()
8998 req, err := http.NewRequest("GET", urls, nil)
8999 if err != nil {
9000 return nil, err
9001 }
9002 req.Header = reqHeaders
9003 googleapi.Expand(req.URL, map[string]string{
9004 "name": c.name,
9005 })
9006 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.get", "request", internallog.HTTPRequest(req, nil))
9007 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9008 }
9009
9010 // Do executes the "saasservicemgmt.projects.locations.tenants.get" call.
9011 // Any non-2xx status code is an error. Response headers are in either
9012 // *Tenant.ServerResponse.Header or (if a response was returned at all) in
9013 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9014 // whether the returned error was because http.StatusNotModified was returned.
9015 func (c *ProjectsLocationsTenantsGetCall) Do(opts ...googleapi.CallOption) (*Tenant, error) {
9016 gensupport.SetOptions(c.urlParams_, opts...)
9017 res, err := c.doRequest("json")
9018 if res != nil && res.StatusCode == http.StatusNotModified {
9019 if res.Body != nil {
9020 res.Body.Close()
9021 }
9022 return nil, gensupport.WrapError(&googleapi.Error{
9023 Code: res.StatusCode,
9024 Header: res.Header,
9025 })
9026 }
9027 if err != nil {
9028 return nil, err
9029 }
9030 defer googleapi.CloseBody(res)
9031 if err := googleapi.CheckResponse(res); err != nil {
9032 return nil, gensupport.WrapError(err)
9033 }
9034 ret := &Tenant{
9035 ServerResponse: googleapi.ServerResponse{
9036 Header: res.Header,
9037 HTTPStatusCode: res.StatusCode,
9038 },
9039 }
9040 target := &ret
9041 b, err := gensupport.DecodeResponseBytes(target, res)
9042 if err != nil {
9043 return nil, err
9044 }
9045 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.get", "response", internallog.HTTPResponse(res, b))
9046 return ret, nil
9047 }
9048
9049 type ProjectsLocationsTenantsListCall struct {
9050 s *Service
9051 parent string
9052 urlParams_ gensupport.URLParams
9053 ifNoneMatch_ string
9054 ctx_ context.Context
9055 header_ http.Header
9056 }
9057
9058 // List: Retrieve a collection of tenants.
9059 //
9060 // - parent: The parent of the tenant.
9061 func (r *ProjectsLocationsTenantsService) List(parent string) *ProjectsLocationsTenantsListCall {
9062 c := &ProjectsLocationsTenantsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9063 c.parent = parent
9064 return c
9065 }
9066
9067 // Filter sets the optional parameter "filter": Filter the list as specified in
9068 // https://google.aip.dev/160.
9069 func (c *ProjectsLocationsTenantsListCall) Filter(filter string) *ProjectsLocationsTenantsListCall {
9070 c.urlParams_.Set("filter", filter)
9071 return c
9072 }
9073
9074 // OrderBy sets the optional parameter "orderBy": Order results as specified in
9075 // https://google.aip.dev/132.
9076 func (c *ProjectsLocationsTenantsListCall) OrderBy(orderBy string) *ProjectsLocationsTenantsListCall {
9077 c.urlParams_.Set("orderBy", orderBy)
9078 return c
9079 }
9080
9081 // PageSize sets the optional parameter "pageSize": The maximum number of
9082 // tenants to send per page.
9083 func (c *ProjectsLocationsTenantsListCall) PageSize(pageSize int64) *ProjectsLocationsTenantsListCall {
9084 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9085 return c
9086 }
9087
9088 // PageToken sets the optional parameter "pageToken": The page token: If the
9089 // next_page_token from a previous response is provided, this request will send
9090 // the subsequent page.
9091 func (c *ProjectsLocationsTenantsListCall) PageToken(pageToken string) *ProjectsLocationsTenantsListCall {
9092 c.urlParams_.Set("pageToken", pageToken)
9093 return c
9094 }
9095
9096 // Fields allows partial responses to be retrieved. See
9097 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9098 // details.
9099 func (c *ProjectsLocationsTenantsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsListCall {
9100 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9101 return c
9102 }
9103
9104 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9105 // object's ETag matches the given value. This is useful for getting updates
9106 // only after the object has changed since the last request.
9107 func (c *ProjectsLocationsTenantsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTenantsListCall {
9108 c.ifNoneMatch_ = entityTag
9109 return c
9110 }
9111
9112 // Context sets the context to be used in this call's Do method.
9113 func (c *ProjectsLocationsTenantsListCall) Context(ctx context.Context) *ProjectsLocationsTenantsListCall {
9114 c.ctx_ = ctx
9115 return c
9116 }
9117
9118 // Header returns a http.Header that can be modified by the caller to add
9119 // headers to the request.
9120 func (c *ProjectsLocationsTenantsListCall) Header() http.Header {
9121 if c.header_ == nil {
9122 c.header_ = make(http.Header)
9123 }
9124 return c.header_
9125 }
9126
9127 func (c *ProjectsLocationsTenantsListCall) doRequest(alt string) (*http.Response, error) {
9128 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9129 if c.ifNoneMatch_ != "" {
9130 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9131 }
9132 c.urlParams_.Set("alt", alt)
9133 c.urlParams_.Set("prettyPrint", "false")
9134 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/tenants")
9135 urls += "?" + c.urlParams_.Encode()
9136 req, err := http.NewRequest("GET", urls, nil)
9137 if err != nil {
9138 return nil, err
9139 }
9140 req.Header = reqHeaders
9141 googleapi.Expand(req.URL, map[string]string{
9142 "parent": c.parent,
9143 })
9144 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.list", "request", internallog.HTTPRequest(req, nil))
9145 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9146 }
9147
9148 // Do executes the "saasservicemgmt.projects.locations.tenants.list" call.
9149 // Any non-2xx status code is an error. Response headers are in either
9150 // *ListTenantsResponse.ServerResponse.Header or (if a response was returned at
9151 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9152 // check whether the returned error was because http.StatusNotModified was
9153 // returned.
9154 func (c *ProjectsLocationsTenantsListCall) Do(opts ...googleapi.CallOption) (*ListTenantsResponse, error) {
9155 gensupport.SetOptions(c.urlParams_, opts...)
9156 res, err := c.doRequest("json")
9157 if res != nil && res.StatusCode == http.StatusNotModified {
9158 if res.Body != nil {
9159 res.Body.Close()
9160 }
9161 return nil, gensupport.WrapError(&googleapi.Error{
9162 Code: res.StatusCode,
9163 Header: res.Header,
9164 })
9165 }
9166 if err != nil {
9167 return nil, err
9168 }
9169 defer googleapi.CloseBody(res)
9170 if err := googleapi.CheckResponse(res); err != nil {
9171 return nil, gensupport.WrapError(err)
9172 }
9173 ret := &ListTenantsResponse{
9174 ServerResponse: googleapi.ServerResponse{
9175 Header: res.Header,
9176 HTTPStatusCode: res.StatusCode,
9177 },
9178 }
9179 target := &ret
9180 b, err := gensupport.DecodeResponseBytes(target, res)
9181 if err != nil {
9182 return nil, err
9183 }
9184 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.list", "response", internallog.HTTPResponse(res, b))
9185 return ret, nil
9186 }
9187
9188 // Pages invokes f for each page of results.
9189 // A non-nil error returned from f will halt the iteration.
9190 // The provided context supersedes any context provided to the Context method.
9191 func (c *ProjectsLocationsTenantsListCall) Pages(ctx context.Context, f func(*ListTenantsResponse) error) error {
9192 c.ctx_ = ctx
9193 defer c.PageToken(c.urlParams_.Get("pageToken"))
9194 for {
9195 x, err := c.Do()
9196 if err != nil {
9197 return err
9198 }
9199 if err := f(x); err != nil {
9200 return err
9201 }
9202 if x.NextPageToken == "" {
9203 return nil
9204 }
9205 c.PageToken(x.NextPageToken)
9206 }
9207 }
9208
9209 type ProjectsLocationsTenantsPatchCall struct {
9210 s *Service
9211 name string
9212 tenant *Tenant
9213 urlParams_ gensupport.URLParams
9214 ctx_ context.Context
9215 header_ http.Header
9216 }
9217
9218 // Patch: Update a single tenant.
9219 //
9220 // - name: Identifier. The resource name (full URI of the resource) following
9221 // the standard naming scheme:
9222 // "projects/{project}/locations/{location}/tenants/{tenant}".
9223 func (r *ProjectsLocationsTenantsService) Patch(name string, tenant *Tenant) *ProjectsLocationsTenantsPatchCall {
9224 c := &ProjectsLocationsTenantsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9225 c.name = name
9226 c.tenant = tenant
9227 return c
9228 }
9229
9230 // RequestId sets the optional parameter "requestId": An optional request ID to
9231 // identify requests. Specify a unique request ID so that if you must retry
9232 // your request, the server will know to ignore the request if it has already
9233 // been completed. The server will guarantee that for at least 60 minutes since
9234 // the first request. For example, consider a situation where you make an
9235 // initial request and the request times out. If you make the request again
9236 // with the same request ID, the server can check if original operation with
9237 // the same request ID was received, and if so, will ignore the second request.
9238 // This prevents clients from accidentally creating duplicate commitments. The
9239 // request ID must be a valid UUID with the exception that zero UUID is not
9240 // supported (00000000-0000-0000-0000-000000000000).
9241 func (c *ProjectsLocationsTenantsPatchCall) RequestId(requestId string) *ProjectsLocationsTenantsPatchCall {
9242 c.urlParams_.Set("requestId", requestId)
9243 return c
9244 }
9245
9246 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
9247 // specify the fields to be overwritten in the Tenant resource by the update.
9248 // The fields specified in the update_mask are relative to the resource, not
9249 // the full request. A field will be overwritten if it is in the mask. If the
9250 // user does not provide a mask then all fields in the Tenant will be
9251 // overwritten.
9252 func (c *ProjectsLocationsTenantsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsTenantsPatchCall {
9253 c.urlParams_.Set("updateMask", updateMask)
9254 return c
9255 }
9256
9257 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
9258 // is set to true, the service will try to validate that this request would
9259 // succeed, but will not actually make changes.
9260 func (c *ProjectsLocationsTenantsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsTenantsPatchCall {
9261 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
9262 return c
9263 }
9264
9265 // Fields allows partial responses to be retrieved. See
9266 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9267 // details.
9268 func (c *ProjectsLocationsTenantsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTenantsPatchCall {
9269 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9270 return c
9271 }
9272
9273 // Context sets the context to be used in this call's Do method.
9274 func (c *ProjectsLocationsTenantsPatchCall) Context(ctx context.Context) *ProjectsLocationsTenantsPatchCall {
9275 c.ctx_ = ctx
9276 return c
9277 }
9278
9279 // Header returns a http.Header that can be modified by the caller to add
9280 // headers to the request.
9281 func (c *ProjectsLocationsTenantsPatchCall) Header() http.Header {
9282 if c.header_ == nil {
9283 c.header_ = make(http.Header)
9284 }
9285 return c.header_
9286 }
9287
9288 func (c *ProjectsLocationsTenantsPatchCall) doRequest(alt string) (*http.Response, error) {
9289 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9290 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.tenant)
9291 if err != nil {
9292 return nil, err
9293 }
9294 c.urlParams_.Set("alt", alt)
9295 c.urlParams_.Set("prettyPrint", "false")
9296 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9297 urls += "?" + c.urlParams_.Encode()
9298 req, err := http.NewRequest("PATCH", urls, body)
9299 if err != nil {
9300 return nil, err
9301 }
9302 req.Header = reqHeaders
9303 googleapi.Expand(req.URL, map[string]string{
9304 "name": c.name,
9305 })
9306 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
9307 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9308 }
9309
9310 // Do executes the "saasservicemgmt.projects.locations.tenants.patch" call.
9311 // Any non-2xx status code is an error. Response headers are in either
9312 // *Tenant.ServerResponse.Header or (if a response was returned at all) in
9313 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9314 // whether the returned error was because http.StatusNotModified was returned.
9315 func (c *ProjectsLocationsTenantsPatchCall) Do(opts ...googleapi.CallOption) (*Tenant, error) {
9316 gensupport.SetOptions(c.urlParams_, opts...)
9317 res, err := c.doRequest("json")
9318 if res != nil && res.StatusCode == http.StatusNotModified {
9319 if res.Body != nil {
9320 res.Body.Close()
9321 }
9322 return nil, gensupport.WrapError(&googleapi.Error{
9323 Code: res.StatusCode,
9324 Header: res.Header,
9325 })
9326 }
9327 if err != nil {
9328 return nil, err
9329 }
9330 defer googleapi.CloseBody(res)
9331 if err := googleapi.CheckResponse(res); err != nil {
9332 return nil, gensupport.WrapError(err)
9333 }
9334 ret := &Tenant{
9335 ServerResponse: googleapi.ServerResponse{
9336 Header: res.Header,
9337 HTTPStatusCode: res.StatusCode,
9338 },
9339 }
9340 target := &ret
9341 b, err := gensupport.DecodeResponseBytes(target, res)
9342 if err != nil {
9343 return nil, err
9344 }
9345 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.tenants.patch", "response", internallog.HTTPResponse(res, b))
9346 return ret, nil
9347 }
9348
9349 type ProjectsLocationsUnitKindsCreateCall struct {
9350 s *Service
9351 parent string
9352 unitkind *UnitKind
9353 urlParams_ gensupport.URLParams
9354 ctx_ context.Context
9355 header_ http.Header
9356 }
9357
9358 // Create: Create a new unit kind.
9359 //
9360 // - parent: The parent of the unit kind.
9361 func (r *ProjectsLocationsUnitKindsService) Create(parent string, unitkind *UnitKind) *ProjectsLocationsUnitKindsCreateCall {
9362 c := &ProjectsLocationsUnitKindsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9363 c.parent = parent
9364 c.unitkind = unitkind
9365 return c
9366 }
9367
9368 // RequestId sets the optional parameter "requestId": An optional request ID to
9369 // identify requests. Specify a unique request ID so that if you must retry
9370 // your request, the server will know to ignore the request if it has already
9371 // been completed. The server will guarantee that for at least 60 minutes since
9372 // the first request. For example, consider a situation where you make an
9373 // initial request and the request times out. If you make the request again
9374 // with the same request ID, the server can check if original operation with
9375 // the same request ID was received, and if so, will ignore the second request.
9376 // This prevents clients from accidentally creating duplicate commitments. The
9377 // request ID must be a valid UUID with the exception that zero UUID is not
9378 // supported (00000000-0000-0000-0000-000000000000).
9379 func (c *ProjectsLocationsUnitKindsCreateCall) RequestId(requestId string) *ProjectsLocationsUnitKindsCreateCall {
9380 c.urlParams_.Set("requestId", requestId)
9381 return c
9382 }
9383
9384 // UnitKindId sets the optional parameter "unitKindId": Required. The ID value
9385 // for the new unit kind.
9386 func (c *ProjectsLocationsUnitKindsCreateCall) UnitKindId(unitKindId string) *ProjectsLocationsUnitKindsCreateCall {
9387 c.urlParams_.Set("unitKindId", unitKindId)
9388 return c
9389 }
9390
9391 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
9392 // is set to true, the service will try to validate that this request would
9393 // succeed, but will not actually make changes.
9394 func (c *ProjectsLocationsUnitKindsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitKindsCreateCall {
9395 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
9396 return c
9397 }
9398
9399 // Fields allows partial responses to be retrieved. See
9400 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9401 // details.
9402 func (c *ProjectsLocationsUnitKindsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsCreateCall {
9403 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9404 return c
9405 }
9406
9407 // Context sets the context to be used in this call's Do method.
9408 func (c *ProjectsLocationsUnitKindsCreateCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsCreateCall {
9409 c.ctx_ = ctx
9410 return c
9411 }
9412
9413 // Header returns a http.Header that can be modified by the caller to add
9414 // headers to the request.
9415 func (c *ProjectsLocationsUnitKindsCreateCall) Header() http.Header {
9416 if c.header_ == nil {
9417 c.header_ = make(http.Header)
9418 }
9419 return c.header_
9420 }
9421
9422 func (c *ProjectsLocationsUnitKindsCreateCall) doRequest(alt string) (*http.Response, error) {
9423 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9424 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unitkind)
9425 if err != nil {
9426 return nil, err
9427 }
9428 c.urlParams_.Set("alt", alt)
9429 c.urlParams_.Set("prettyPrint", "false")
9430 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/unitKinds")
9431 urls += "?" + c.urlParams_.Encode()
9432 req, err := http.NewRequest("POST", urls, body)
9433 if err != nil {
9434 return nil, err
9435 }
9436 req.Header = reqHeaders
9437 googleapi.Expand(req.URL, map[string]string{
9438 "parent": c.parent,
9439 })
9440 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.create", "request", internallog.HTTPRequest(req, body.Bytes()))
9441 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9442 }
9443
9444 // Do executes the "saasservicemgmt.projects.locations.unitKinds.create" call.
9445 // Any non-2xx status code is an error. Response headers are in either
9446 // *UnitKind.ServerResponse.Header or (if a response was returned at all) in
9447 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9448 // whether the returned error was because http.StatusNotModified was returned.
9449 func (c *ProjectsLocationsUnitKindsCreateCall) Do(opts ...googleapi.CallOption) (*UnitKind, error) {
9450 gensupport.SetOptions(c.urlParams_, opts...)
9451 res, err := c.doRequest("json")
9452 if res != nil && res.StatusCode == http.StatusNotModified {
9453 if res.Body != nil {
9454 res.Body.Close()
9455 }
9456 return nil, gensupport.WrapError(&googleapi.Error{
9457 Code: res.StatusCode,
9458 Header: res.Header,
9459 })
9460 }
9461 if err != nil {
9462 return nil, err
9463 }
9464 defer googleapi.CloseBody(res)
9465 if err := googleapi.CheckResponse(res); err != nil {
9466 return nil, gensupport.WrapError(err)
9467 }
9468 ret := &UnitKind{
9469 ServerResponse: googleapi.ServerResponse{
9470 Header: res.Header,
9471 HTTPStatusCode: res.StatusCode,
9472 },
9473 }
9474 target := &ret
9475 b, err := gensupport.DecodeResponseBytes(target, res)
9476 if err != nil {
9477 return nil, err
9478 }
9479 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.create", "response", internallog.HTTPResponse(res, b))
9480 return ret, nil
9481 }
9482
9483 type ProjectsLocationsUnitKindsDeleteCall struct {
9484 s *Service
9485 name string
9486 urlParams_ gensupport.URLParams
9487 ctx_ context.Context
9488 header_ http.Header
9489 }
9490
9491 // Delete: Delete a single unit kind.
9492 //
9493 // - name: The resource name of the resource within a service.
9494 func (r *ProjectsLocationsUnitKindsService) Delete(name string) *ProjectsLocationsUnitKindsDeleteCall {
9495 c := &ProjectsLocationsUnitKindsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9496 c.name = name
9497 return c
9498 }
9499
9500 // Etag sets the optional parameter "etag": The etag known to the client for
9501 // the expected state of the unit kind. This is used with state-changing
9502 // methods to prevent accidental overwrites when multiple user agents might be
9503 // acting in parallel on the same resource. An etag wildcard provide optimistic
9504 // concurrency based on the expected existence of the unit kind. The Any
9505 // wildcard (`*`) requires that the resource must already exists, and the Not
9506 // Any wildcard (`!*`) requires that it must not.
9507 func (c *ProjectsLocationsUnitKindsDeleteCall) Etag(etag string) *ProjectsLocationsUnitKindsDeleteCall {
9508 c.urlParams_.Set("etag", etag)
9509 return c
9510 }
9511
9512 // RequestId sets the optional parameter "requestId": An optional request ID to
9513 // identify requests. Specify a unique request ID so that if you must retry
9514 // your request, the server will know to ignore the request if it has already
9515 // been completed. The server will guarantee that for at least 60 minutes since
9516 // the first request. For example, consider a situation where you make an
9517 // initial request and the request times out. If you make the request again
9518 // with the same request ID, the server can check if original operation with
9519 // the same request ID was received, and if so, will ignore the second request.
9520 // This prevents clients from accidentally creating duplicate commitments. The
9521 // request ID must be a valid UUID with the exception that zero UUID is not
9522 // supported (00000000-0000-0000-0000-000000000000).
9523 func (c *ProjectsLocationsUnitKindsDeleteCall) RequestId(requestId string) *ProjectsLocationsUnitKindsDeleteCall {
9524 c.urlParams_.Set("requestId", requestId)
9525 return c
9526 }
9527
9528 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
9529 // is set to true, the service will try to validate that this request would
9530 // succeed, but will not actually make changes.
9531 func (c *ProjectsLocationsUnitKindsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitKindsDeleteCall {
9532 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
9533 return c
9534 }
9535
9536 // Fields allows partial responses to be retrieved. See
9537 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9538 // details.
9539 func (c *ProjectsLocationsUnitKindsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsDeleteCall {
9540 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9541 return c
9542 }
9543
9544 // Context sets the context to be used in this call's Do method.
9545 func (c *ProjectsLocationsUnitKindsDeleteCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsDeleteCall {
9546 c.ctx_ = ctx
9547 return c
9548 }
9549
9550 // Header returns a http.Header that can be modified by the caller to add
9551 // headers to the request.
9552 func (c *ProjectsLocationsUnitKindsDeleteCall) Header() http.Header {
9553 if c.header_ == nil {
9554 c.header_ = make(http.Header)
9555 }
9556 return c.header_
9557 }
9558
9559 func (c *ProjectsLocationsUnitKindsDeleteCall) doRequest(alt string) (*http.Response, error) {
9560 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9561 c.urlParams_.Set("alt", alt)
9562 c.urlParams_.Set("prettyPrint", "false")
9563 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9564 urls += "?" + c.urlParams_.Encode()
9565 req, err := http.NewRequest("DELETE", urls, nil)
9566 if err != nil {
9567 return nil, err
9568 }
9569 req.Header = reqHeaders
9570 googleapi.Expand(req.URL, map[string]string{
9571 "name": c.name,
9572 })
9573 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.delete", "request", internallog.HTTPRequest(req, nil))
9574 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9575 }
9576
9577 // Do executes the "saasservicemgmt.projects.locations.unitKinds.delete" call.
9578 // Any non-2xx status code is an error. Response headers are in either
9579 // *Empty.ServerResponse.Header or (if a response was returned at all) in
9580 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9581 // whether the returned error was because http.StatusNotModified was returned.
9582 func (c *ProjectsLocationsUnitKindsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
9583 gensupport.SetOptions(c.urlParams_, opts...)
9584 res, err := c.doRequest("json")
9585 if res != nil && res.StatusCode == http.StatusNotModified {
9586 if res.Body != nil {
9587 res.Body.Close()
9588 }
9589 return nil, gensupport.WrapError(&googleapi.Error{
9590 Code: res.StatusCode,
9591 Header: res.Header,
9592 })
9593 }
9594 if err != nil {
9595 return nil, err
9596 }
9597 defer googleapi.CloseBody(res)
9598 if err := googleapi.CheckResponse(res); err != nil {
9599 return nil, gensupport.WrapError(err)
9600 }
9601 ret := &Empty{
9602 ServerResponse: googleapi.ServerResponse{
9603 Header: res.Header,
9604 HTTPStatusCode: res.StatusCode,
9605 },
9606 }
9607 target := &ret
9608 b, err := gensupport.DecodeResponseBytes(target, res)
9609 if err != nil {
9610 return nil, err
9611 }
9612 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.delete", "response", internallog.HTTPResponse(res, b))
9613 return ret, nil
9614 }
9615
9616 type ProjectsLocationsUnitKindsGetCall struct {
9617 s *Service
9618 name string
9619 urlParams_ gensupport.URLParams
9620 ifNoneMatch_ string
9621 ctx_ context.Context
9622 header_ http.Header
9623 }
9624
9625 // Get: Retrieve a single unit kind.
9626 //
9627 // - name: The resource name of the resource within a service.
9628 func (r *ProjectsLocationsUnitKindsService) Get(name string) *ProjectsLocationsUnitKindsGetCall {
9629 c := &ProjectsLocationsUnitKindsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9630 c.name = name
9631 return c
9632 }
9633
9634 // Fields allows partial responses to be retrieved. See
9635 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9636 // details.
9637 func (c *ProjectsLocationsUnitKindsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsGetCall {
9638 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9639 return c
9640 }
9641
9642 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9643 // object's ETag matches the given value. This is useful for getting updates
9644 // only after the object has changed since the last request.
9645 func (c *ProjectsLocationsUnitKindsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitKindsGetCall {
9646 c.ifNoneMatch_ = entityTag
9647 return c
9648 }
9649
9650 // Context sets the context to be used in this call's Do method.
9651 func (c *ProjectsLocationsUnitKindsGetCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsGetCall {
9652 c.ctx_ = ctx
9653 return c
9654 }
9655
9656 // Header returns a http.Header that can be modified by the caller to add
9657 // headers to the request.
9658 func (c *ProjectsLocationsUnitKindsGetCall) Header() http.Header {
9659 if c.header_ == nil {
9660 c.header_ = make(http.Header)
9661 }
9662 return c.header_
9663 }
9664
9665 func (c *ProjectsLocationsUnitKindsGetCall) doRequest(alt string) (*http.Response, error) {
9666 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9667 if c.ifNoneMatch_ != "" {
9668 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9669 }
9670 c.urlParams_.Set("alt", alt)
9671 c.urlParams_.Set("prettyPrint", "false")
9672 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9673 urls += "?" + c.urlParams_.Encode()
9674 req, err := http.NewRequest("GET", urls, nil)
9675 if err != nil {
9676 return nil, err
9677 }
9678 req.Header = reqHeaders
9679 googleapi.Expand(req.URL, map[string]string{
9680 "name": c.name,
9681 })
9682 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.get", "request", internallog.HTTPRequest(req, nil))
9683 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9684 }
9685
9686 // Do executes the "saasservicemgmt.projects.locations.unitKinds.get" call.
9687 // Any non-2xx status code is an error. Response headers are in either
9688 // *UnitKind.ServerResponse.Header or (if a response was returned at all) in
9689 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9690 // whether the returned error was because http.StatusNotModified was returned.
9691 func (c *ProjectsLocationsUnitKindsGetCall) Do(opts ...googleapi.CallOption) (*UnitKind, error) {
9692 gensupport.SetOptions(c.urlParams_, opts...)
9693 res, err := c.doRequest("json")
9694 if res != nil && res.StatusCode == http.StatusNotModified {
9695 if res.Body != nil {
9696 res.Body.Close()
9697 }
9698 return nil, gensupport.WrapError(&googleapi.Error{
9699 Code: res.StatusCode,
9700 Header: res.Header,
9701 })
9702 }
9703 if err != nil {
9704 return nil, err
9705 }
9706 defer googleapi.CloseBody(res)
9707 if err := googleapi.CheckResponse(res); err != nil {
9708 return nil, gensupport.WrapError(err)
9709 }
9710 ret := &UnitKind{
9711 ServerResponse: googleapi.ServerResponse{
9712 Header: res.Header,
9713 HTTPStatusCode: res.StatusCode,
9714 },
9715 }
9716 target := &ret
9717 b, err := gensupport.DecodeResponseBytes(target, res)
9718 if err != nil {
9719 return nil, err
9720 }
9721 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.get", "response", internallog.HTTPResponse(res, b))
9722 return ret, nil
9723 }
9724
9725 type ProjectsLocationsUnitKindsListCall struct {
9726 s *Service
9727 parent string
9728 urlParams_ gensupport.URLParams
9729 ifNoneMatch_ string
9730 ctx_ context.Context
9731 header_ http.Header
9732 }
9733
9734 // List: Retrieve a collection of unit kinds.
9735 //
9736 // - parent: The parent of the unit kind.
9737 func (r *ProjectsLocationsUnitKindsService) List(parent string) *ProjectsLocationsUnitKindsListCall {
9738 c := &ProjectsLocationsUnitKindsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9739 c.parent = parent
9740 return c
9741 }
9742
9743 // Filter sets the optional parameter "filter": Filter the list as specified in
9744 // https://google.aip.dev/160.
9745 func (c *ProjectsLocationsUnitKindsListCall) Filter(filter string) *ProjectsLocationsUnitKindsListCall {
9746 c.urlParams_.Set("filter", filter)
9747 return c
9748 }
9749
9750 // OrderBy sets the optional parameter "orderBy": Order results as specified in
9751 // https://google.aip.dev/132.
9752 func (c *ProjectsLocationsUnitKindsListCall) OrderBy(orderBy string) *ProjectsLocationsUnitKindsListCall {
9753 c.urlParams_.Set("orderBy", orderBy)
9754 return c
9755 }
9756
9757 // PageSize sets the optional parameter "pageSize": The maximum number of unit
9758 // kinds to send per page.
9759 func (c *ProjectsLocationsUnitKindsListCall) PageSize(pageSize int64) *ProjectsLocationsUnitKindsListCall {
9760 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9761 return c
9762 }
9763
9764 // PageToken sets the optional parameter "pageToken": The page token: If the
9765 // next_page_token from a previous response is provided, this request will send
9766 // the subsequent page.
9767 func (c *ProjectsLocationsUnitKindsListCall) PageToken(pageToken string) *ProjectsLocationsUnitKindsListCall {
9768 c.urlParams_.Set("pageToken", pageToken)
9769 return c
9770 }
9771
9772 // Fields allows partial responses to be retrieved. See
9773 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9774 // details.
9775 func (c *ProjectsLocationsUnitKindsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsListCall {
9776 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9777 return c
9778 }
9779
9780 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9781 // object's ETag matches the given value. This is useful for getting updates
9782 // only after the object has changed since the last request.
9783 func (c *ProjectsLocationsUnitKindsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitKindsListCall {
9784 c.ifNoneMatch_ = entityTag
9785 return c
9786 }
9787
9788 // Context sets the context to be used in this call's Do method.
9789 func (c *ProjectsLocationsUnitKindsListCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsListCall {
9790 c.ctx_ = ctx
9791 return c
9792 }
9793
9794 // Header returns a http.Header that can be modified by the caller to add
9795 // headers to the request.
9796 func (c *ProjectsLocationsUnitKindsListCall) Header() http.Header {
9797 if c.header_ == nil {
9798 c.header_ = make(http.Header)
9799 }
9800 return c.header_
9801 }
9802
9803 func (c *ProjectsLocationsUnitKindsListCall) doRequest(alt string) (*http.Response, error) {
9804 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9805 if c.ifNoneMatch_ != "" {
9806 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9807 }
9808 c.urlParams_.Set("alt", alt)
9809 c.urlParams_.Set("prettyPrint", "false")
9810 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/unitKinds")
9811 urls += "?" + c.urlParams_.Encode()
9812 req, err := http.NewRequest("GET", urls, nil)
9813 if err != nil {
9814 return nil, err
9815 }
9816 req.Header = reqHeaders
9817 googleapi.Expand(req.URL, map[string]string{
9818 "parent": c.parent,
9819 })
9820 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.list", "request", internallog.HTTPRequest(req, nil))
9821 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9822 }
9823
9824 // Do executes the "saasservicemgmt.projects.locations.unitKinds.list" call.
9825 // Any non-2xx status code is an error. Response headers are in either
9826 // *ListUnitKindsResponse.ServerResponse.Header or (if a response was returned
9827 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9828 // check whether the returned error was because http.StatusNotModified was
9829 // returned.
9830 func (c *ProjectsLocationsUnitKindsListCall) Do(opts ...googleapi.CallOption) (*ListUnitKindsResponse, error) {
9831 gensupport.SetOptions(c.urlParams_, opts...)
9832 res, err := c.doRequest("json")
9833 if res != nil && res.StatusCode == http.StatusNotModified {
9834 if res.Body != nil {
9835 res.Body.Close()
9836 }
9837 return nil, gensupport.WrapError(&googleapi.Error{
9838 Code: res.StatusCode,
9839 Header: res.Header,
9840 })
9841 }
9842 if err != nil {
9843 return nil, err
9844 }
9845 defer googleapi.CloseBody(res)
9846 if err := googleapi.CheckResponse(res); err != nil {
9847 return nil, gensupport.WrapError(err)
9848 }
9849 ret := &ListUnitKindsResponse{
9850 ServerResponse: googleapi.ServerResponse{
9851 Header: res.Header,
9852 HTTPStatusCode: res.StatusCode,
9853 },
9854 }
9855 target := &ret
9856 b, err := gensupport.DecodeResponseBytes(target, res)
9857 if err != nil {
9858 return nil, err
9859 }
9860 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.list", "response", internallog.HTTPResponse(res, b))
9861 return ret, nil
9862 }
9863
9864 // Pages invokes f for each page of results.
9865 // A non-nil error returned from f will halt the iteration.
9866 // The provided context supersedes any context provided to the Context method.
9867 func (c *ProjectsLocationsUnitKindsListCall) Pages(ctx context.Context, f func(*ListUnitKindsResponse) error) error {
9868 c.ctx_ = ctx
9869 defer c.PageToken(c.urlParams_.Get("pageToken"))
9870 for {
9871 x, err := c.Do()
9872 if err != nil {
9873 return err
9874 }
9875 if err := f(x); err != nil {
9876 return err
9877 }
9878 if x.NextPageToken == "" {
9879 return nil
9880 }
9881 c.PageToken(x.NextPageToken)
9882 }
9883 }
9884
9885 type ProjectsLocationsUnitKindsPatchCall struct {
9886 s *Service
9887 name string
9888 unitkind *UnitKind
9889 urlParams_ gensupport.URLParams
9890 ctx_ context.Context
9891 header_ http.Header
9892 }
9893
9894 // Patch: Update a single unit kind.
9895 //
9896 // - name: Identifier. The resource name (full URI of the resource) following
9897 // the standard naming scheme:
9898 // "projects/{project}/locations/{location}/unitKinds/{unitKind}".
9899 func (r *ProjectsLocationsUnitKindsService) Patch(name string, unitkind *UnitKind) *ProjectsLocationsUnitKindsPatchCall {
9900 c := &ProjectsLocationsUnitKindsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9901 c.name = name
9902 c.unitkind = unitkind
9903 return c
9904 }
9905
9906 // RequestId sets the optional parameter "requestId": An optional request ID to
9907 // identify requests. Specify a unique request ID so that if you must retry
9908 // your request, the server will know to ignore the request if it has already
9909 // been completed. The server will guarantee that for at least 60 minutes since
9910 // the first request. For example, consider a situation where you make an
9911 // initial request and the request times out. If you make the request again
9912 // with the same request ID, the server can check if original operation with
9913 // the same request ID was received, and if so, will ignore the second request.
9914 // This prevents clients from accidentally creating duplicate commitments. The
9915 // request ID must be a valid UUID with the exception that zero UUID is not
9916 // supported (00000000-0000-0000-0000-000000000000).
9917 func (c *ProjectsLocationsUnitKindsPatchCall) RequestId(requestId string) *ProjectsLocationsUnitKindsPatchCall {
9918 c.urlParams_.Set("requestId", requestId)
9919 return c
9920 }
9921
9922 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
9923 // specify the fields to be overwritten in the UnitKind resource by the update.
9924 // The fields specified in the update_mask are relative to the resource, not
9925 // the full request. A field will be overwritten if it is in the mask. If the
9926 // user does not provide a mask then all fields in the UnitKind will be
9927 // overwritten.
9928 func (c *ProjectsLocationsUnitKindsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsUnitKindsPatchCall {
9929 c.urlParams_.Set("updateMask", updateMask)
9930 return c
9931 }
9932
9933 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
9934 // is set to true, the service will try to validate that this request would
9935 // succeed, but will not actually make changes.
9936 func (c *ProjectsLocationsUnitKindsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitKindsPatchCall {
9937 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
9938 return c
9939 }
9940
9941 // Fields allows partial responses to be retrieved. See
9942 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9943 // details.
9944 func (c *ProjectsLocationsUnitKindsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitKindsPatchCall {
9945 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9946 return c
9947 }
9948
9949 // Context sets the context to be used in this call's Do method.
9950 func (c *ProjectsLocationsUnitKindsPatchCall) Context(ctx context.Context) *ProjectsLocationsUnitKindsPatchCall {
9951 c.ctx_ = ctx
9952 return c
9953 }
9954
9955 // Header returns a http.Header that can be modified by the caller to add
9956 // headers to the request.
9957 func (c *ProjectsLocationsUnitKindsPatchCall) Header() http.Header {
9958 if c.header_ == nil {
9959 c.header_ = make(http.Header)
9960 }
9961 return c.header_
9962 }
9963
9964 func (c *ProjectsLocationsUnitKindsPatchCall) doRequest(alt string) (*http.Response, error) {
9965 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9966 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unitkind)
9967 if err != nil {
9968 return nil, err
9969 }
9970 c.urlParams_.Set("alt", alt)
9971 c.urlParams_.Set("prettyPrint", "false")
9972 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
9973 urls += "?" + c.urlParams_.Encode()
9974 req, err := http.NewRequest("PATCH", urls, body)
9975 if err != nil {
9976 return nil, err
9977 }
9978 req.Header = reqHeaders
9979 googleapi.Expand(req.URL, map[string]string{
9980 "name": c.name,
9981 })
9982 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
9983 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9984 }
9985
9986 // Do executes the "saasservicemgmt.projects.locations.unitKinds.patch" call.
9987 // Any non-2xx status code is an error. Response headers are in either
9988 // *UnitKind.ServerResponse.Header or (if a response was returned at all) in
9989 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9990 // whether the returned error was because http.StatusNotModified was returned.
9991 func (c *ProjectsLocationsUnitKindsPatchCall) Do(opts ...googleapi.CallOption) (*UnitKind, error) {
9992 gensupport.SetOptions(c.urlParams_, opts...)
9993 res, err := c.doRequest("json")
9994 if res != nil && res.StatusCode == http.StatusNotModified {
9995 if res.Body != nil {
9996 res.Body.Close()
9997 }
9998 return nil, gensupport.WrapError(&googleapi.Error{
9999 Code: res.StatusCode,
10000 Header: res.Header,
10001 })
10002 }
10003 if err != nil {
10004 return nil, err
10005 }
10006 defer googleapi.CloseBody(res)
10007 if err := googleapi.CheckResponse(res); err != nil {
10008 return nil, gensupport.WrapError(err)
10009 }
10010 ret := &UnitKind{
10011 ServerResponse: googleapi.ServerResponse{
10012 Header: res.Header,
10013 HTTPStatusCode: res.StatusCode,
10014 },
10015 }
10016 target := &ret
10017 b, err := gensupport.DecodeResponseBytes(target, res)
10018 if err != nil {
10019 return nil, err
10020 }
10021 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitKinds.patch", "response", internallog.HTTPResponse(res, b))
10022 return ret, nil
10023 }
10024
10025 type ProjectsLocationsUnitOperationsCreateCall struct {
10026 s *Service
10027 parent string
10028 unitoperation *UnitOperation
10029 urlParams_ gensupport.URLParams
10030 ctx_ context.Context
10031 header_ http.Header
10032 }
10033
10034 // Create: Create a new unit operation.
10035 //
10036 // - parent: The parent of the unit operation.
10037 func (r *ProjectsLocationsUnitOperationsService) Create(parent string, unitoperation *UnitOperation) *ProjectsLocationsUnitOperationsCreateCall {
10038 c := &ProjectsLocationsUnitOperationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10039 c.parent = parent
10040 c.unitoperation = unitoperation
10041 return c
10042 }
10043
10044 // RequestId sets the optional parameter "requestId": An optional request ID to
10045 // identify requests. Specify a unique request ID so that if you must retry
10046 // your request, the server will know to ignore the request if it has already
10047 // been completed. The server will guarantee that for at least 60 minutes since
10048 // the first request. For example, consider a situation where you make an
10049 // initial request and the request times out. If you make the request again
10050 // with the same request ID, the server can check if original operation with
10051 // the same request ID was received, and if so, will ignore the second request.
10052 // This prevents clients from accidentally creating duplicate commitments. The
10053 // request ID must be a valid UUID with the exception that zero UUID is not
10054 // supported (00000000-0000-0000-0000-000000000000).
10055 func (c *ProjectsLocationsUnitOperationsCreateCall) RequestId(requestId string) *ProjectsLocationsUnitOperationsCreateCall {
10056 c.urlParams_.Set("requestId", requestId)
10057 return c
10058 }
10059
10060 // UnitOperationId sets the optional parameter "unitOperationId": Required. The
10061 // ID value for the new unit operation.
10062 func (c *ProjectsLocationsUnitOperationsCreateCall) UnitOperationId(unitOperationId string) *ProjectsLocationsUnitOperationsCreateCall {
10063 c.urlParams_.Set("unitOperationId", unitOperationId)
10064 return c
10065 }
10066
10067 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
10068 // is set to true, the service will try to validate that this request would
10069 // succeed, but will not actually make changes.
10070 func (c *ProjectsLocationsUnitOperationsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitOperationsCreateCall {
10071 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
10072 return c
10073 }
10074
10075 // Fields allows partial responses to be retrieved. See
10076 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10077 // details.
10078 func (c *ProjectsLocationsUnitOperationsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsCreateCall {
10079 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10080 return c
10081 }
10082
10083 // Context sets the context to be used in this call's Do method.
10084 func (c *ProjectsLocationsUnitOperationsCreateCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsCreateCall {
10085 c.ctx_ = ctx
10086 return c
10087 }
10088
10089 // Header returns a http.Header that can be modified by the caller to add
10090 // headers to the request.
10091 func (c *ProjectsLocationsUnitOperationsCreateCall) Header() http.Header {
10092 if c.header_ == nil {
10093 c.header_ = make(http.Header)
10094 }
10095 return c.header_
10096 }
10097
10098 func (c *ProjectsLocationsUnitOperationsCreateCall) doRequest(alt string) (*http.Response, error) {
10099 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10100 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unitoperation)
10101 if err != nil {
10102 return nil, err
10103 }
10104 c.urlParams_.Set("alt", alt)
10105 c.urlParams_.Set("prettyPrint", "false")
10106 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/unitOperations")
10107 urls += "?" + c.urlParams_.Encode()
10108 req, err := http.NewRequest("POST", urls, body)
10109 if err != nil {
10110 return nil, err
10111 }
10112 req.Header = reqHeaders
10113 googleapi.Expand(req.URL, map[string]string{
10114 "parent": c.parent,
10115 })
10116 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10117 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10118 }
10119
10120 // Do executes the "saasservicemgmt.projects.locations.unitOperations.create" call.
10121 // Any non-2xx status code is an error. Response headers are in either
10122 // *UnitOperation.ServerResponse.Header or (if a response was returned at all)
10123 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10124 // whether the returned error was because http.StatusNotModified was returned.
10125 func (c *ProjectsLocationsUnitOperationsCreateCall) Do(opts ...googleapi.CallOption) (*UnitOperation, error) {
10126 gensupport.SetOptions(c.urlParams_, opts...)
10127 res, err := c.doRequest("json")
10128 if res != nil && res.StatusCode == http.StatusNotModified {
10129 if res.Body != nil {
10130 res.Body.Close()
10131 }
10132 return nil, gensupport.WrapError(&googleapi.Error{
10133 Code: res.StatusCode,
10134 Header: res.Header,
10135 })
10136 }
10137 if err != nil {
10138 return nil, err
10139 }
10140 defer googleapi.CloseBody(res)
10141 if err := googleapi.CheckResponse(res); err != nil {
10142 return nil, gensupport.WrapError(err)
10143 }
10144 ret := &UnitOperation{
10145 ServerResponse: googleapi.ServerResponse{
10146 Header: res.Header,
10147 HTTPStatusCode: res.StatusCode,
10148 },
10149 }
10150 target := &ret
10151 b, err := gensupport.DecodeResponseBytes(target, res)
10152 if err != nil {
10153 return nil, err
10154 }
10155 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.create", "response", internallog.HTTPResponse(res, b))
10156 return ret, nil
10157 }
10158
10159 type ProjectsLocationsUnitOperationsDeleteCall struct {
10160 s *Service
10161 name string
10162 urlParams_ gensupport.URLParams
10163 ctx_ context.Context
10164 header_ http.Header
10165 }
10166
10167 // Delete: Delete a single unit operation.
10168 //
10169 // - name: The resource name of the resource within a service.
10170 func (r *ProjectsLocationsUnitOperationsService) Delete(name string) *ProjectsLocationsUnitOperationsDeleteCall {
10171 c := &ProjectsLocationsUnitOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10172 c.name = name
10173 return c
10174 }
10175
10176 // Etag sets the optional parameter "etag": The etag known to the client for
10177 // the expected state of the unit operation. This is used with state-changing
10178 // methods to prevent accidental overwrites when multiple user agents might be
10179 // acting in parallel on the same resource. An etag wildcard provide optimistic
10180 // concurrency based on the expected existence of the unit operation. The Any
10181 // wildcard (`*`) requires that the resource must already exists, and the Not
10182 // Any wildcard (`!*`) requires that it must not.
10183 func (c *ProjectsLocationsUnitOperationsDeleteCall) Etag(etag string) *ProjectsLocationsUnitOperationsDeleteCall {
10184 c.urlParams_.Set("etag", etag)
10185 return c
10186 }
10187
10188 // RequestId sets the optional parameter "requestId": An optional request ID to
10189 // identify requests. Specify a unique request ID so that if you must retry
10190 // your request, the server will know to ignore the request if it has already
10191 // been completed. The server will guarantee that for at least 60 minutes since
10192 // the first request. For example, consider a situation where you make an
10193 // initial request and the request times out. If you make the request again
10194 // with the same request ID, the server can check if original operation with
10195 // the same request ID was received, and if so, will ignore the second request.
10196 // This prevents clients from accidentally creating duplicate commitments. The
10197 // request ID must be a valid UUID with the exception that zero UUID is not
10198 // supported (00000000-0000-0000-0000-000000000000).
10199 func (c *ProjectsLocationsUnitOperationsDeleteCall) RequestId(requestId string) *ProjectsLocationsUnitOperationsDeleteCall {
10200 c.urlParams_.Set("requestId", requestId)
10201 return c
10202 }
10203
10204 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
10205 // is set to true, the service will try to validate that this request would
10206 // succeed, but will not actually make changes.
10207 func (c *ProjectsLocationsUnitOperationsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitOperationsDeleteCall {
10208 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
10209 return c
10210 }
10211
10212 // Fields allows partial responses to be retrieved. See
10213 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10214 // details.
10215 func (c *ProjectsLocationsUnitOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsDeleteCall {
10216 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10217 return c
10218 }
10219
10220 // Context sets the context to be used in this call's Do method.
10221 func (c *ProjectsLocationsUnitOperationsDeleteCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsDeleteCall {
10222 c.ctx_ = ctx
10223 return c
10224 }
10225
10226 // Header returns a http.Header that can be modified by the caller to add
10227 // headers to the request.
10228 func (c *ProjectsLocationsUnitOperationsDeleteCall) Header() http.Header {
10229 if c.header_ == nil {
10230 c.header_ = make(http.Header)
10231 }
10232 return c.header_
10233 }
10234
10235 func (c *ProjectsLocationsUnitOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
10236 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10237 c.urlParams_.Set("alt", alt)
10238 c.urlParams_.Set("prettyPrint", "false")
10239 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
10240 urls += "?" + c.urlParams_.Encode()
10241 req, err := http.NewRequest("DELETE", urls, nil)
10242 if err != nil {
10243 return nil, err
10244 }
10245 req.Header = reqHeaders
10246 googleapi.Expand(req.URL, map[string]string{
10247 "name": c.name,
10248 })
10249 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.delete", "request", internallog.HTTPRequest(req, nil))
10250 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10251 }
10252
10253 // Do executes the "saasservicemgmt.projects.locations.unitOperations.delete" call.
10254 // Any non-2xx status code is an error. Response headers are in either
10255 // *Empty.ServerResponse.Header or (if a response was returned at all) in
10256 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10257 // whether the returned error was because http.StatusNotModified was returned.
10258 func (c *ProjectsLocationsUnitOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10259 gensupport.SetOptions(c.urlParams_, opts...)
10260 res, err := c.doRequest("json")
10261 if res != nil && res.StatusCode == http.StatusNotModified {
10262 if res.Body != nil {
10263 res.Body.Close()
10264 }
10265 return nil, gensupport.WrapError(&googleapi.Error{
10266 Code: res.StatusCode,
10267 Header: res.Header,
10268 })
10269 }
10270 if err != nil {
10271 return nil, err
10272 }
10273 defer googleapi.CloseBody(res)
10274 if err := googleapi.CheckResponse(res); err != nil {
10275 return nil, gensupport.WrapError(err)
10276 }
10277 ret := &Empty{
10278 ServerResponse: googleapi.ServerResponse{
10279 Header: res.Header,
10280 HTTPStatusCode: res.StatusCode,
10281 },
10282 }
10283 target := &ret
10284 b, err := gensupport.DecodeResponseBytes(target, res)
10285 if err != nil {
10286 return nil, err
10287 }
10288 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.delete", "response", internallog.HTTPResponse(res, b))
10289 return ret, nil
10290 }
10291
10292 type ProjectsLocationsUnitOperationsGetCall struct {
10293 s *Service
10294 name string
10295 urlParams_ gensupport.URLParams
10296 ifNoneMatch_ string
10297 ctx_ context.Context
10298 header_ http.Header
10299 }
10300
10301 // Get: Retrieve a single unit operation.
10302 //
10303 // - name: The resource name of the resource within a service.
10304 func (r *ProjectsLocationsUnitOperationsService) Get(name string) *ProjectsLocationsUnitOperationsGetCall {
10305 c := &ProjectsLocationsUnitOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10306 c.name = name
10307 return c
10308 }
10309
10310 // Fields allows partial responses to be retrieved. See
10311 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10312 // details.
10313 func (c *ProjectsLocationsUnitOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsGetCall {
10314 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10315 return c
10316 }
10317
10318 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10319 // object's ETag matches the given value. This is useful for getting updates
10320 // only after the object has changed since the last request.
10321 func (c *ProjectsLocationsUnitOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitOperationsGetCall {
10322 c.ifNoneMatch_ = entityTag
10323 return c
10324 }
10325
10326 // Context sets the context to be used in this call's Do method.
10327 func (c *ProjectsLocationsUnitOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsGetCall {
10328 c.ctx_ = ctx
10329 return c
10330 }
10331
10332 // Header returns a http.Header that can be modified by the caller to add
10333 // headers to the request.
10334 func (c *ProjectsLocationsUnitOperationsGetCall) Header() http.Header {
10335 if c.header_ == nil {
10336 c.header_ = make(http.Header)
10337 }
10338 return c.header_
10339 }
10340
10341 func (c *ProjectsLocationsUnitOperationsGetCall) doRequest(alt string) (*http.Response, error) {
10342 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10343 if c.ifNoneMatch_ != "" {
10344 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10345 }
10346 c.urlParams_.Set("alt", alt)
10347 c.urlParams_.Set("prettyPrint", "false")
10348 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
10349 urls += "?" + c.urlParams_.Encode()
10350 req, err := http.NewRequest("GET", urls, nil)
10351 if err != nil {
10352 return nil, err
10353 }
10354 req.Header = reqHeaders
10355 googleapi.Expand(req.URL, map[string]string{
10356 "name": c.name,
10357 })
10358 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.get", "request", internallog.HTTPRequest(req, nil))
10359 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10360 }
10361
10362 // Do executes the "saasservicemgmt.projects.locations.unitOperations.get" call.
10363 // Any non-2xx status code is an error. Response headers are in either
10364 // *UnitOperation.ServerResponse.Header or (if a response was returned at all)
10365 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10366 // whether the returned error was because http.StatusNotModified was returned.
10367 func (c *ProjectsLocationsUnitOperationsGetCall) Do(opts ...googleapi.CallOption) (*UnitOperation, error) {
10368 gensupport.SetOptions(c.urlParams_, opts...)
10369 res, err := c.doRequest("json")
10370 if res != nil && res.StatusCode == http.StatusNotModified {
10371 if res.Body != nil {
10372 res.Body.Close()
10373 }
10374 return nil, gensupport.WrapError(&googleapi.Error{
10375 Code: res.StatusCode,
10376 Header: res.Header,
10377 })
10378 }
10379 if err != nil {
10380 return nil, err
10381 }
10382 defer googleapi.CloseBody(res)
10383 if err := googleapi.CheckResponse(res); err != nil {
10384 return nil, gensupport.WrapError(err)
10385 }
10386 ret := &UnitOperation{
10387 ServerResponse: googleapi.ServerResponse{
10388 Header: res.Header,
10389 HTTPStatusCode: res.StatusCode,
10390 },
10391 }
10392 target := &ret
10393 b, err := gensupport.DecodeResponseBytes(target, res)
10394 if err != nil {
10395 return nil, err
10396 }
10397 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.get", "response", internallog.HTTPResponse(res, b))
10398 return ret, nil
10399 }
10400
10401 type ProjectsLocationsUnitOperationsListCall struct {
10402 s *Service
10403 parent string
10404 urlParams_ gensupport.URLParams
10405 ifNoneMatch_ string
10406 ctx_ context.Context
10407 header_ http.Header
10408 }
10409
10410 // List: Retrieve a collection of unit operations.
10411 //
10412 // - parent: The parent of the unit operation.
10413 func (r *ProjectsLocationsUnitOperationsService) List(parent string) *ProjectsLocationsUnitOperationsListCall {
10414 c := &ProjectsLocationsUnitOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10415 c.parent = parent
10416 return c
10417 }
10418
10419 // Filter sets the optional parameter "filter": Filter the list as specified in
10420 // https://google.aip.dev/160.
10421 func (c *ProjectsLocationsUnitOperationsListCall) Filter(filter string) *ProjectsLocationsUnitOperationsListCall {
10422 c.urlParams_.Set("filter", filter)
10423 return c
10424 }
10425
10426 // OrderBy sets the optional parameter "orderBy": Order results as specified in
10427 // https://google.aip.dev/132.
10428 func (c *ProjectsLocationsUnitOperationsListCall) OrderBy(orderBy string) *ProjectsLocationsUnitOperationsListCall {
10429 c.urlParams_.Set("orderBy", orderBy)
10430 return c
10431 }
10432
10433 // PageSize sets the optional parameter "pageSize": The maximum number of unit
10434 // operations to send per page.
10435 func (c *ProjectsLocationsUnitOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsUnitOperationsListCall {
10436 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10437 return c
10438 }
10439
10440 // PageToken sets the optional parameter "pageToken": The page token: If the
10441 // next_page_token from a previous response is provided, this request will send
10442 // the subsequent page.
10443 func (c *ProjectsLocationsUnitOperationsListCall) PageToken(pageToken string) *ProjectsLocationsUnitOperationsListCall {
10444 c.urlParams_.Set("pageToken", pageToken)
10445 return c
10446 }
10447
10448 // Fields allows partial responses to be retrieved. See
10449 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10450 // details.
10451 func (c *ProjectsLocationsUnitOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsListCall {
10452 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10453 return c
10454 }
10455
10456 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10457 // object's ETag matches the given value. This is useful for getting updates
10458 // only after the object has changed since the last request.
10459 func (c *ProjectsLocationsUnitOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitOperationsListCall {
10460 c.ifNoneMatch_ = entityTag
10461 return c
10462 }
10463
10464 // Context sets the context to be used in this call's Do method.
10465 func (c *ProjectsLocationsUnitOperationsListCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsListCall {
10466 c.ctx_ = ctx
10467 return c
10468 }
10469
10470 // Header returns a http.Header that can be modified by the caller to add
10471 // headers to the request.
10472 func (c *ProjectsLocationsUnitOperationsListCall) Header() http.Header {
10473 if c.header_ == nil {
10474 c.header_ = make(http.Header)
10475 }
10476 return c.header_
10477 }
10478
10479 func (c *ProjectsLocationsUnitOperationsListCall) doRequest(alt string) (*http.Response, error) {
10480 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10481 if c.ifNoneMatch_ != "" {
10482 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10483 }
10484 c.urlParams_.Set("alt", alt)
10485 c.urlParams_.Set("prettyPrint", "false")
10486 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/unitOperations")
10487 urls += "?" + c.urlParams_.Encode()
10488 req, err := http.NewRequest("GET", urls, nil)
10489 if err != nil {
10490 return nil, err
10491 }
10492 req.Header = reqHeaders
10493 googleapi.Expand(req.URL, map[string]string{
10494 "parent": c.parent,
10495 })
10496 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.list", "request", internallog.HTTPRequest(req, nil))
10497 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10498 }
10499
10500 // Do executes the "saasservicemgmt.projects.locations.unitOperations.list" call.
10501 // Any non-2xx status code is an error. Response headers are in either
10502 // *ListUnitOperationsResponse.ServerResponse.Header or (if a response was
10503 // returned at all) in error.(*googleapi.Error).Header. Use
10504 // googleapi.IsNotModified to check whether the returned error was because
10505 // http.StatusNotModified was returned.
10506 func (c *ProjectsLocationsUnitOperationsListCall) Do(opts ...googleapi.CallOption) (*ListUnitOperationsResponse, error) {
10507 gensupport.SetOptions(c.urlParams_, opts...)
10508 res, err := c.doRequest("json")
10509 if res != nil && res.StatusCode == http.StatusNotModified {
10510 if res.Body != nil {
10511 res.Body.Close()
10512 }
10513 return nil, gensupport.WrapError(&googleapi.Error{
10514 Code: res.StatusCode,
10515 Header: res.Header,
10516 })
10517 }
10518 if err != nil {
10519 return nil, err
10520 }
10521 defer googleapi.CloseBody(res)
10522 if err := googleapi.CheckResponse(res); err != nil {
10523 return nil, gensupport.WrapError(err)
10524 }
10525 ret := &ListUnitOperationsResponse{
10526 ServerResponse: googleapi.ServerResponse{
10527 Header: res.Header,
10528 HTTPStatusCode: res.StatusCode,
10529 },
10530 }
10531 target := &ret
10532 b, err := gensupport.DecodeResponseBytes(target, res)
10533 if err != nil {
10534 return nil, err
10535 }
10536 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.list", "response", internallog.HTTPResponse(res, b))
10537 return ret, nil
10538 }
10539
10540 // Pages invokes f for each page of results.
10541 // A non-nil error returned from f will halt the iteration.
10542 // The provided context supersedes any context provided to the Context method.
10543 func (c *ProjectsLocationsUnitOperationsListCall) Pages(ctx context.Context, f func(*ListUnitOperationsResponse) error) error {
10544 c.ctx_ = ctx
10545 defer c.PageToken(c.urlParams_.Get("pageToken"))
10546 for {
10547 x, err := c.Do()
10548 if err != nil {
10549 return err
10550 }
10551 if err := f(x); err != nil {
10552 return err
10553 }
10554 if x.NextPageToken == "" {
10555 return nil
10556 }
10557 c.PageToken(x.NextPageToken)
10558 }
10559 }
10560
10561 type ProjectsLocationsUnitOperationsPatchCall struct {
10562 s *Service
10563 name string
10564 unitoperation *UnitOperation
10565 urlParams_ gensupport.URLParams
10566 ctx_ context.Context
10567 header_ http.Header
10568 }
10569
10570 // Patch: Update a single unit operation.
10571 //
10572 // - name: Identifier. The resource name (full URI of the resource) following
10573 // the standard naming scheme:
10574 // "projects/{project}/locations/{location}/unitOperations/{unitOperation}".
10575 func (r *ProjectsLocationsUnitOperationsService) Patch(name string, unitoperation *UnitOperation) *ProjectsLocationsUnitOperationsPatchCall {
10576 c := &ProjectsLocationsUnitOperationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10577 c.name = name
10578 c.unitoperation = unitoperation
10579 return c
10580 }
10581
10582 // RequestId sets the optional parameter "requestId": An optional request ID to
10583 // identify requests. Specify a unique request ID so that if you must retry
10584 // your request, the server will know to ignore the request if it has already
10585 // been completed. The server will guarantee that for at least 60 minutes since
10586 // the first request. For example, consider a situation where you make an
10587 // initial request and the request times out. If you make the request again
10588 // with the same request ID, the server can check if original operation with
10589 // the same request ID was received, and if so, will ignore the second request.
10590 // This prevents clients from accidentally creating duplicate commitments. The
10591 // request ID must be a valid UUID with the exception that zero UUID is not
10592 // supported (00000000-0000-0000-0000-000000000000).
10593 func (c *ProjectsLocationsUnitOperationsPatchCall) RequestId(requestId string) *ProjectsLocationsUnitOperationsPatchCall {
10594 c.urlParams_.Set("requestId", requestId)
10595 return c
10596 }
10597
10598 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
10599 // specify the fields to be overwritten in the UnitOperation resource by the
10600 // update. The fields specified in the update_mask are relative to the
10601 // resource, not the full request. A field will be overwritten if it is in the
10602 // mask. If the user does not provide a mask then all fields in the
10603 // UnitOperation will be overwritten.
10604 func (c *ProjectsLocationsUnitOperationsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsUnitOperationsPatchCall {
10605 c.urlParams_.Set("updateMask", updateMask)
10606 return c
10607 }
10608
10609 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
10610 // is set to true, the service will try to validate that this request would
10611 // succeed, but will not actually make changes.
10612 func (c *ProjectsLocationsUnitOperationsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitOperationsPatchCall {
10613 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
10614 return c
10615 }
10616
10617 // Fields allows partial responses to be retrieved. See
10618 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10619 // details.
10620 func (c *ProjectsLocationsUnitOperationsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitOperationsPatchCall {
10621 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10622 return c
10623 }
10624
10625 // Context sets the context to be used in this call's Do method.
10626 func (c *ProjectsLocationsUnitOperationsPatchCall) Context(ctx context.Context) *ProjectsLocationsUnitOperationsPatchCall {
10627 c.ctx_ = ctx
10628 return c
10629 }
10630
10631 // Header returns a http.Header that can be modified by the caller to add
10632 // headers to the request.
10633 func (c *ProjectsLocationsUnitOperationsPatchCall) Header() http.Header {
10634 if c.header_ == nil {
10635 c.header_ = make(http.Header)
10636 }
10637 return c.header_
10638 }
10639
10640 func (c *ProjectsLocationsUnitOperationsPatchCall) doRequest(alt string) (*http.Response, error) {
10641 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10642 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unitoperation)
10643 if err != nil {
10644 return nil, err
10645 }
10646 c.urlParams_.Set("alt", alt)
10647 c.urlParams_.Set("prettyPrint", "false")
10648 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
10649 urls += "?" + c.urlParams_.Encode()
10650 req, err := http.NewRequest("PATCH", urls, body)
10651 if err != nil {
10652 return nil, err
10653 }
10654 req.Header = reqHeaders
10655 googleapi.Expand(req.URL, map[string]string{
10656 "name": c.name,
10657 })
10658 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
10659 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10660 }
10661
10662 // Do executes the "saasservicemgmt.projects.locations.unitOperations.patch" call.
10663 // Any non-2xx status code is an error. Response headers are in either
10664 // *UnitOperation.ServerResponse.Header or (if a response was returned at all)
10665 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10666 // whether the returned error was because http.StatusNotModified was returned.
10667 func (c *ProjectsLocationsUnitOperationsPatchCall) Do(opts ...googleapi.CallOption) (*UnitOperation, error) {
10668 gensupport.SetOptions(c.urlParams_, opts...)
10669 res, err := c.doRequest("json")
10670 if res != nil && res.StatusCode == http.StatusNotModified {
10671 if res.Body != nil {
10672 res.Body.Close()
10673 }
10674 return nil, gensupport.WrapError(&googleapi.Error{
10675 Code: res.StatusCode,
10676 Header: res.Header,
10677 })
10678 }
10679 if err != nil {
10680 return nil, err
10681 }
10682 defer googleapi.CloseBody(res)
10683 if err := googleapi.CheckResponse(res); err != nil {
10684 return nil, gensupport.WrapError(err)
10685 }
10686 ret := &UnitOperation{
10687 ServerResponse: googleapi.ServerResponse{
10688 Header: res.Header,
10689 HTTPStatusCode: res.StatusCode,
10690 },
10691 }
10692 target := &ret
10693 b, err := gensupport.DecodeResponseBytes(target, res)
10694 if err != nil {
10695 return nil, err
10696 }
10697 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.unitOperations.patch", "response", internallog.HTTPResponse(res, b))
10698 return ret, nil
10699 }
10700
10701 type ProjectsLocationsUnitsCreateCall struct {
10702 s *Service
10703 parent string
10704 unit *Unit
10705 urlParams_ gensupport.URLParams
10706 ctx_ context.Context
10707 header_ http.Header
10708 }
10709
10710 // Create: Create a new unit.
10711 //
10712 // - parent: The parent of the unit.
10713 func (r *ProjectsLocationsUnitsService) Create(parent string, unit *Unit) *ProjectsLocationsUnitsCreateCall {
10714 c := &ProjectsLocationsUnitsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10715 c.parent = parent
10716 c.unit = unit
10717 return c
10718 }
10719
10720 // RequestId sets the optional parameter "requestId": An optional request ID to
10721 // identify requests. Specify a unique request ID so that if you must retry
10722 // your request, the server will know to ignore the request if it has already
10723 // been completed. The server will guarantee that for at least 60 minutes since
10724 // the first request. For example, consider a situation where you make an
10725 // initial request and the request times out. If you make the request again
10726 // with the same request ID, the server can check if original operation with
10727 // the same request ID was received, and if so, will ignore the second request.
10728 // This prevents clients from accidentally creating duplicate commitments. The
10729 // request ID must be a valid UUID with the exception that zero UUID is not
10730 // supported (00000000-0000-0000-0000-000000000000).
10731 func (c *ProjectsLocationsUnitsCreateCall) RequestId(requestId string) *ProjectsLocationsUnitsCreateCall {
10732 c.urlParams_.Set("requestId", requestId)
10733 return c
10734 }
10735
10736 // UnitId sets the optional parameter "unitId": Required. The ID value for the
10737 // new unit.
10738 func (c *ProjectsLocationsUnitsCreateCall) UnitId(unitId string) *ProjectsLocationsUnitsCreateCall {
10739 c.urlParams_.Set("unitId", unitId)
10740 return c
10741 }
10742
10743 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
10744 // is set to true, the service will try to validate that this request would
10745 // succeed, but will not actually make changes.
10746 func (c *ProjectsLocationsUnitsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitsCreateCall {
10747 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
10748 return c
10749 }
10750
10751 // Fields allows partial responses to be retrieved. See
10752 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10753 // details.
10754 func (c *ProjectsLocationsUnitsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsCreateCall {
10755 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10756 return c
10757 }
10758
10759 // Context sets the context to be used in this call's Do method.
10760 func (c *ProjectsLocationsUnitsCreateCall) Context(ctx context.Context) *ProjectsLocationsUnitsCreateCall {
10761 c.ctx_ = ctx
10762 return c
10763 }
10764
10765 // Header returns a http.Header that can be modified by the caller to add
10766 // headers to the request.
10767 func (c *ProjectsLocationsUnitsCreateCall) Header() http.Header {
10768 if c.header_ == nil {
10769 c.header_ = make(http.Header)
10770 }
10771 return c.header_
10772 }
10773
10774 func (c *ProjectsLocationsUnitsCreateCall) doRequest(alt string) (*http.Response, error) {
10775 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10776 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unit)
10777 if err != nil {
10778 return nil, err
10779 }
10780 c.urlParams_.Set("alt", alt)
10781 c.urlParams_.Set("prettyPrint", "false")
10782 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/units")
10783 urls += "?" + c.urlParams_.Encode()
10784 req, err := http.NewRequest("POST", urls, body)
10785 if err != nil {
10786 return nil, err
10787 }
10788 req.Header = reqHeaders
10789 googleapi.Expand(req.URL, map[string]string{
10790 "parent": c.parent,
10791 })
10792 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.create", "request", internallog.HTTPRequest(req, body.Bytes()))
10793 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10794 }
10795
10796 // Do executes the "saasservicemgmt.projects.locations.units.create" call.
10797 // Any non-2xx status code is an error. Response headers are in either
10798 // *Unit.ServerResponse.Header or (if a response was returned at all) in
10799 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10800 // whether the returned error was because http.StatusNotModified was returned.
10801 func (c *ProjectsLocationsUnitsCreateCall) Do(opts ...googleapi.CallOption) (*Unit, error) {
10802 gensupport.SetOptions(c.urlParams_, opts...)
10803 res, err := c.doRequest("json")
10804 if res != nil && res.StatusCode == http.StatusNotModified {
10805 if res.Body != nil {
10806 res.Body.Close()
10807 }
10808 return nil, gensupport.WrapError(&googleapi.Error{
10809 Code: res.StatusCode,
10810 Header: res.Header,
10811 })
10812 }
10813 if err != nil {
10814 return nil, err
10815 }
10816 defer googleapi.CloseBody(res)
10817 if err := googleapi.CheckResponse(res); err != nil {
10818 return nil, gensupport.WrapError(err)
10819 }
10820 ret := &Unit{
10821 ServerResponse: googleapi.ServerResponse{
10822 Header: res.Header,
10823 HTTPStatusCode: res.StatusCode,
10824 },
10825 }
10826 target := &ret
10827 b, err := gensupport.DecodeResponseBytes(target, res)
10828 if err != nil {
10829 return nil, err
10830 }
10831 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.create", "response", internallog.HTTPResponse(res, b))
10832 return ret, nil
10833 }
10834
10835 type ProjectsLocationsUnitsDeleteCall struct {
10836 s *Service
10837 name string
10838 urlParams_ gensupport.URLParams
10839 ctx_ context.Context
10840 header_ http.Header
10841 }
10842
10843 // Delete: Delete a single unit.
10844 //
10845 // - name: The resource name of the resource within a service.
10846 func (r *ProjectsLocationsUnitsService) Delete(name string) *ProjectsLocationsUnitsDeleteCall {
10847 c := &ProjectsLocationsUnitsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10848 c.name = name
10849 return c
10850 }
10851
10852 // Etag sets the optional parameter "etag": The etag known to the client for
10853 // the expected state of the unit. This is used with state-changing methods to
10854 // prevent accidental overwrites when multiple user agents might be acting in
10855 // parallel on the same resource. An etag wildcard provide optimistic
10856 // concurrency based on the expected existence of the unit. The Any wildcard
10857 // (`*`) requires that the resource must already exists, and the Not Any
10858 // wildcard (`!*`) requires that it must not.
10859 func (c *ProjectsLocationsUnitsDeleteCall) Etag(etag string) *ProjectsLocationsUnitsDeleteCall {
10860 c.urlParams_.Set("etag", etag)
10861 return c
10862 }
10863
10864 // RequestId sets the optional parameter "requestId": An optional request ID to
10865 // identify requests. Specify a unique request ID so that if you must retry
10866 // your request, the server will know to ignore the request if it has already
10867 // been completed. The server will guarantee that for at least 60 minutes since
10868 // the first request. For example, consider a situation where you make an
10869 // initial request and the request times out. If you make the request again
10870 // with the same request ID, the server can check if original operation with
10871 // the same request ID was received, and if so, will ignore the second request.
10872 // This prevents clients from accidentally creating duplicate commitments. The
10873 // request ID must be a valid UUID with the exception that zero UUID is not
10874 // supported (00000000-0000-0000-0000-000000000000).
10875 func (c *ProjectsLocationsUnitsDeleteCall) RequestId(requestId string) *ProjectsLocationsUnitsDeleteCall {
10876 c.urlParams_.Set("requestId", requestId)
10877 return c
10878 }
10879
10880 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
10881 // is set to true, the service will try to validate that this request would
10882 // succeed, but will not actually make changes.
10883 func (c *ProjectsLocationsUnitsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitsDeleteCall {
10884 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
10885 return c
10886 }
10887
10888 // Fields allows partial responses to be retrieved. See
10889 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10890 // details.
10891 func (c *ProjectsLocationsUnitsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsDeleteCall {
10892 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10893 return c
10894 }
10895
10896 // Context sets the context to be used in this call's Do method.
10897 func (c *ProjectsLocationsUnitsDeleteCall) Context(ctx context.Context) *ProjectsLocationsUnitsDeleteCall {
10898 c.ctx_ = ctx
10899 return c
10900 }
10901
10902 // Header returns a http.Header that can be modified by the caller to add
10903 // headers to the request.
10904 func (c *ProjectsLocationsUnitsDeleteCall) Header() http.Header {
10905 if c.header_ == nil {
10906 c.header_ = make(http.Header)
10907 }
10908 return c.header_
10909 }
10910
10911 func (c *ProjectsLocationsUnitsDeleteCall) doRequest(alt string) (*http.Response, error) {
10912 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10913 c.urlParams_.Set("alt", alt)
10914 c.urlParams_.Set("prettyPrint", "false")
10915 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
10916 urls += "?" + c.urlParams_.Encode()
10917 req, err := http.NewRequest("DELETE", urls, nil)
10918 if err != nil {
10919 return nil, err
10920 }
10921 req.Header = reqHeaders
10922 googleapi.Expand(req.URL, map[string]string{
10923 "name": c.name,
10924 })
10925 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.delete", "request", internallog.HTTPRequest(req, nil))
10926 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10927 }
10928
10929 // Do executes the "saasservicemgmt.projects.locations.units.delete" call.
10930 // Any non-2xx status code is an error. Response headers are in either
10931 // *Empty.ServerResponse.Header or (if a response was returned at all) in
10932 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10933 // whether the returned error was because http.StatusNotModified was returned.
10934 func (c *ProjectsLocationsUnitsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10935 gensupport.SetOptions(c.urlParams_, opts...)
10936 res, err := c.doRequest("json")
10937 if res != nil && res.StatusCode == http.StatusNotModified {
10938 if res.Body != nil {
10939 res.Body.Close()
10940 }
10941 return nil, gensupport.WrapError(&googleapi.Error{
10942 Code: res.StatusCode,
10943 Header: res.Header,
10944 })
10945 }
10946 if err != nil {
10947 return nil, err
10948 }
10949 defer googleapi.CloseBody(res)
10950 if err := googleapi.CheckResponse(res); err != nil {
10951 return nil, gensupport.WrapError(err)
10952 }
10953 ret := &Empty{
10954 ServerResponse: googleapi.ServerResponse{
10955 Header: res.Header,
10956 HTTPStatusCode: res.StatusCode,
10957 },
10958 }
10959 target := &ret
10960 b, err := gensupport.DecodeResponseBytes(target, res)
10961 if err != nil {
10962 return nil, err
10963 }
10964 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.delete", "response", internallog.HTTPResponse(res, b))
10965 return ret, nil
10966 }
10967
10968 type ProjectsLocationsUnitsGetCall struct {
10969 s *Service
10970 name string
10971 urlParams_ gensupport.URLParams
10972 ifNoneMatch_ string
10973 ctx_ context.Context
10974 header_ http.Header
10975 }
10976
10977 // Get: Retrieve a single unit.
10978 //
10979 // - name: The resource name of the resource within a service.
10980 func (r *ProjectsLocationsUnitsService) Get(name string) *ProjectsLocationsUnitsGetCall {
10981 c := &ProjectsLocationsUnitsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10982 c.name = name
10983 return c
10984 }
10985
10986 // Fields allows partial responses to be retrieved. See
10987 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10988 // details.
10989 func (c *ProjectsLocationsUnitsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsGetCall {
10990 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10991 return c
10992 }
10993
10994 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10995 // object's ETag matches the given value. This is useful for getting updates
10996 // only after the object has changed since the last request.
10997 func (c *ProjectsLocationsUnitsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitsGetCall {
10998 c.ifNoneMatch_ = entityTag
10999 return c
11000 }
11001
11002 // Context sets the context to be used in this call's Do method.
11003 func (c *ProjectsLocationsUnitsGetCall) Context(ctx context.Context) *ProjectsLocationsUnitsGetCall {
11004 c.ctx_ = ctx
11005 return c
11006 }
11007
11008 // Header returns a http.Header that can be modified by the caller to add
11009 // headers to the request.
11010 func (c *ProjectsLocationsUnitsGetCall) Header() http.Header {
11011 if c.header_ == nil {
11012 c.header_ = make(http.Header)
11013 }
11014 return c.header_
11015 }
11016
11017 func (c *ProjectsLocationsUnitsGetCall) doRequest(alt string) (*http.Response, error) {
11018 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11019 if c.ifNoneMatch_ != "" {
11020 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11021 }
11022 c.urlParams_.Set("alt", alt)
11023 c.urlParams_.Set("prettyPrint", "false")
11024 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
11025 urls += "?" + c.urlParams_.Encode()
11026 req, err := http.NewRequest("GET", urls, nil)
11027 if err != nil {
11028 return nil, err
11029 }
11030 req.Header = reqHeaders
11031 googleapi.Expand(req.URL, map[string]string{
11032 "name": c.name,
11033 })
11034 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.get", "request", internallog.HTTPRequest(req, nil))
11035 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11036 }
11037
11038 // Do executes the "saasservicemgmt.projects.locations.units.get" call.
11039 // Any non-2xx status code is an error. Response headers are in either
11040 // *Unit.ServerResponse.Header or (if a response was returned at all) in
11041 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11042 // whether the returned error was because http.StatusNotModified was returned.
11043 func (c *ProjectsLocationsUnitsGetCall) Do(opts ...googleapi.CallOption) (*Unit, error) {
11044 gensupport.SetOptions(c.urlParams_, opts...)
11045 res, err := c.doRequest("json")
11046 if res != nil && res.StatusCode == http.StatusNotModified {
11047 if res.Body != nil {
11048 res.Body.Close()
11049 }
11050 return nil, gensupport.WrapError(&googleapi.Error{
11051 Code: res.StatusCode,
11052 Header: res.Header,
11053 })
11054 }
11055 if err != nil {
11056 return nil, err
11057 }
11058 defer googleapi.CloseBody(res)
11059 if err := googleapi.CheckResponse(res); err != nil {
11060 return nil, gensupport.WrapError(err)
11061 }
11062 ret := &Unit{
11063 ServerResponse: googleapi.ServerResponse{
11064 Header: res.Header,
11065 HTTPStatusCode: res.StatusCode,
11066 },
11067 }
11068 target := &ret
11069 b, err := gensupport.DecodeResponseBytes(target, res)
11070 if err != nil {
11071 return nil, err
11072 }
11073 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.get", "response", internallog.HTTPResponse(res, b))
11074 return ret, nil
11075 }
11076
11077 type ProjectsLocationsUnitsListCall struct {
11078 s *Service
11079 parent string
11080 urlParams_ gensupport.URLParams
11081 ifNoneMatch_ string
11082 ctx_ context.Context
11083 header_ http.Header
11084 }
11085
11086 // List: Retrieve a collection of units.
11087 //
11088 // - parent: The parent of the unit.
11089 func (r *ProjectsLocationsUnitsService) List(parent string) *ProjectsLocationsUnitsListCall {
11090 c := &ProjectsLocationsUnitsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11091 c.parent = parent
11092 return c
11093 }
11094
11095 // Filter sets the optional parameter "filter": Filter the list as specified in
11096 // https://google.aip.dev/160.
11097 func (c *ProjectsLocationsUnitsListCall) Filter(filter string) *ProjectsLocationsUnitsListCall {
11098 c.urlParams_.Set("filter", filter)
11099 return c
11100 }
11101
11102 // OrderBy sets the optional parameter "orderBy": Order results as specified in
11103 // https://google.aip.dev/132.
11104 func (c *ProjectsLocationsUnitsListCall) OrderBy(orderBy string) *ProjectsLocationsUnitsListCall {
11105 c.urlParams_.Set("orderBy", orderBy)
11106 return c
11107 }
11108
11109 // PageSize sets the optional parameter "pageSize": The maximum number of units
11110 // to send per page.
11111 func (c *ProjectsLocationsUnitsListCall) PageSize(pageSize int64) *ProjectsLocationsUnitsListCall {
11112 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11113 return c
11114 }
11115
11116 // PageToken sets the optional parameter "pageToken": The page token: If the
11117 // next_page_token from a previous response is provided, this request will send
11118 // the subsequent page.
11119 func (c *ProjectsLocationsUnitsListCall) PageToken(pageToken string) *ProjectsLocationsUnitsListCall {
11120 c.urlParams_.Set("pageToken", pageToken)
11121 return c
11122 }
11123
11124 // Fields allows partial responses to be retrieved. See
11125 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11126 // details.
11127 func (c *ProjectsLocationsUnitsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsListCall {
11128 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11129 return c
11130 }
11131
11132 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11133 // object's ETag matches the given value. This is useful for getting updates
11134 // only after the object has changed since the last request.
11135 func (c *ProjectsLocationsUnitsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsUnitsListCall {
11136 c.ifNoneMatch_ = entityTag
11137 return c
11138 }
11139
11140 // Context sets the context to be used in this call's Do method.
11141 func (c *ProjectsLocationsUnitsListCall) Context(ctx context.Context) *ProjectsLocationsUnitsListCall {
11142 c.ctx_ = ctx
11143 return c
11144 }
11145
11146 // Header returns a http.Header that can be modified by the caller to add
11147 // headers to the request.
11148 func (c *ProjectsLocationsUnitsListCall) Header() http.Header {
11149 if c.header_ == nil {
11150 c.header_ = make(http.Header)
11151 }
11152 return c.header_
11153 }
11154
11155 func (c *ProjectsLocationsUnitsListCall) doRequest(alt string) (*http.Response, error) {
11156 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11157 if c.ifNoneMatch_ != "" {
11158 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11159 }
11160 c.urlParams_.Set("alt", alt)
11161 c.urlParams_.Set("prettyPrint", "false")
11162 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/units")
11163 urls += "?" + c.urlParams_.Encode()
11164 req, err := http.NewRequest("GET", urls, nil)
11165 if err != nil {
11166 return nil, err
11167 }
11168 req.Header = reqHeaders
11169 googleapi.Expand(req.URL, map[string]string{
11170 "parent": c.parent,
11171 })
11172 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.list", "request", internallog.HTTPRequest(req, nil))
11173 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11174 }
11175
11176 // Do executes the "saasservicemgmt.projects.locations.units.list" call.
11177 // Any non-2xx status code is an error. Response headers are in either
11178 // *ListUnitsResponse.ServerResponse.Header or (if a response was returned at
11179 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11180 // check whether the returned error was because http.StatusNotModified was
11181 // returned.
11182 func (c *ProjectsLocationsUnitsListCall) Do(opts ...googleapi.CallOption) (*ListUnitsResponse, error) {
11183 gensupport.SetOptions(c.urlParams_, opts...)
11184 res, err := c.doRequest("json")
11185 if res != nil && res.StatusCode == http.StatusNotModified {
11186 if res.Body != nil {
11187 res.Body.Close()
11188 }
11189 return nil, gensupport.WrapError(&googleapi.Error{
11190 Code: res.StatusCode,
11191 Header: res.Header,
11192 })
11193 }
11194 if err != nil {
11195 return nil, err
11196 }
11197 defer googleapi.CloseBody(res)
11198 if err := googleapi.CheckResponse(res); err != nil {
11199 return nil, gensupport.WrapError(err)
11200 }
11201 ret := &ListUnitsResponse{
11202 ServerResponse: googleapi.ServerResponse{
11203 Header: res.Header,
11204 HTTPStatusCode: res.StatusCode,
11205 },
11206 }
11207 target := &ret
11208 b, err := gensupport.DecodeResponseBytes(target, res)
11209 if err != nil {
11210 return nil, err
11211 }
11212 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.list", "response", internallog.HTTPResponse(res, b))
11213 return ret, nil
11214 }
11215
11216 // Pages invokes f for each page of results.
11217 // A non-nil error returned from f will halt the iteration.
11218 // The provided context supersedes any context provided to the Context method.
11219 func (c *ProjectsLocationsUnitsListCall) Pages(ctx context.Context, f func(*ListUnitsResponse) error) error {
11220 c.ctx_ = ctx
11221 defer c.PageToken(c.urlParams_.Get("pageToken"))
11222 for {
11223 x, err := c.Do()
11224 if err != nil {
11225 return err
11226 }
11227 if err := f(x); err != nil {
11228 return err
11229 }
11230 if x.NextPageToken == "" {
11231 return nil
11232 }
11233 c.PageToken(x.NextPageToken)
11234 }
11235 }
11236
11237 type ProjectsLocationsUnitsPatchCall struct {
11238 s *Service
11239 name string
11240 unit *Unit
11241 urlParams_ gensupport.URLParams
11242 ctx_ context.Context
11243 header_ http.Header
11244 }
11245
11246 // Patch: Update a single unit.
11247 //
11248 // - name: Identifier. The resource name (full URI of the resource) following
11249 // the standard naming scheme:
11250 // "projects/{project}/locations/{location}/units/{unit}".
11251 func (r *ProjectsLocationsUnitsService) Patch(name string, unit *Unit) *ProjectsLocationsUnitsPatchCall {
11252 c := &ProjectsLocationsUnitsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11253 c.name = name
11254 c.unit = unit
11255 return c
11256 }
11257
11258 // RequestId sets the optional parameter "requestId": An optional request ID to
11259 // identify requests. Specify a unique request ID so that if you must retry
11260 // your request, the server will know to ignore the request if it has already
11261 // been completed. The server will guarantee that for at least 60 minutes since
11262 // the first request. For example, consider a situation where you make an
11263 // initial request and the request times out. If you make the request again
11264 // with the same request ID, the server can check if original operation with
11265 // the same request ID was received, and if so, will ignore the second request.
11266 // This prevents clients from accidentally creating duplicate commitments. The
11267 // request ID must be a valid UUID with the exception that zero UUID is not
11268 // supported (00000000-0000-0000-0000-000000000000).
11269 func (c *ProjectsLocationsUnitsPatchCall) RequestId(requestId string) *ProjectsLocationsUnitsPatchCall {
11270 c.urlParams_.Set("requestId", requestId)
11271 return c
11272 }
11273
11274 // UpdateMask sets the optional parameter "updateMask": Field mask is used to
11275 // specify the fields to be overwritten in the Unit resource by the update. The
11276 // fields specified in the update_mask are relative to the resource, not the
11277 // full request. A field will be overwritten if it is in the mask. If the user
11278 // does not provide a mask then all fields in the Unit will be overwritten.
11279 func (c *ProjectsLocationsUnitsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsUnitsPatchCall {
11280 c.urlParams_.Set("updateMask", updateMask)
11281 return c
11282 }
11283
11284 // ValidateOnly sets the optional parameter "validateOnly": If "validate_only"
11285 // is set to true, the service will try to validate that this request would
11286 // succeed, but will not actually make changes.
11287 func (c *ProjectsLocationsUnitsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsUnitsPatchCall {
11288 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly))
11289 return c
11290 }
11291
11292 // Fields allows partial responses to be retrieved. See
11293 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11294 // details.
11295 func (c *ProjectsLocationsUnitsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsUnitsPatchCall {
11296 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11297 return c
11298 }
11299
11300 // Context sets the context to be used in this call's Do method.
11301 func (c *ProjectsLocationsUnitsPatchCall) Context(ctx context.Context) *ProjectsLocationsUnitsPatchCall {
11302 c.ctx_ = ctx
11303 return c
11304 }
11305
11306 // Header returns a http.Header that can be modified by the caller to add
11307 // headers to the request.
11308 func (c *ProjectsLocationsUnitsPatchCall) Header() http.Header {
11309 if c.header_ == nil {
11310 c.header_ = make(http.Header)
11311 }
11312 return c.header_
11313 }
11314
11315 func (c *ProjectsLocationsUnitsPatchCall) doRequest(alt string) (*http.Response, error) {
11316 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11317 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.unit)
11318 if err != nil {
11319 return nil, err
11320 }
11321 c.urlParams_.Set("alt", alt)
11322 c.urlParams_.Set("prettyPrint", "false")
11323 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
11324 urls += "?" + c.urlParams_.Encode()
11325 req, err := http.NewRequest("PATCH", urls, body)
11326 if err != nil {
11327 return nil, err
11328 }
11329 req.Header = reqHeaders
11330 googleapi.Expand(req.URL, map[string]string{
11331 "name": c.name,
11332 })
11333 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
11334 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11335 }
11336
11337 // Do executes the "saasservicemgmt.projects.locations.units.patch" call.
11338 // Any non-2xx status code is an error. Response headers are in either
11339 // *Unit.ServerResponse.Header or (if a response was returned at all) in
11340 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11341 // whether the returned error was because http.StatusNotModified was returned.
11342 func (c *ProjectsLocationsUnitsPatchCall) Do(opts ...googleapi.CallOption) (*Unit, error) {
11343 gensupport.SetOptions(c.urlParams_, opts...)
11344 res, err := c.doRequest("json")
11345 if res != nil && res.StatusCode == http.StatusNotModified {
11346 if res.Body != nil {
11347 res.Body.Close()
11348 }
11349 return nil, gensupport.WrapError(&googleapi.Error{
11350 Code: res.StatusCode,
11351 Header: res.Header,
11352 })
11353 }
11354 if err != nil {
11355 return nil, err
11356 }
11357 defer googleapi.CloseBody(res)
11358 if err := googleapi.CheckResponse(res); err != nil {
11359 return nil, gensupport.WrapError(err)
11360 }
11361 ret := &Unit{
11362 ServerResponse: googleapi.ServerResponse{
11363 Header: res.Header,
11364 HTTPStatusCode: res.StatusCode,
11365 },
11366 }
11367 target := &ret
11368 b, err := gensupport.DecodeResponseBytes(target, res)
11369 if err != nil {
11370 return nil, err
11371 }
11372 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "saasservicemgmt.projects.locations.units.patch", "response", internallog.HTTPResponse(res, b))
11373 return ret, nil
11374 }