Debian Codegraph @

policysimulator/v1/policysimulator-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 policysimulator provides access to the Policy Simulator API.
8 //
9 // For product documentation, see: https://cloud.google.com/iam/docs/simulating-access
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/policysimulator/v1"
27 // ...
28 // ctx := context.Background()
29 // policysimulatorService, err := policysimulator.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 // policysimulatorService, err := policysimulator.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 // policysimulatorService, err := policysimulator.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
49 //
50 // See [google.golang.org/api/option.ClientOption] for details on options.
51 package policysimulator // import "google.golang.org/api/policysimulator/v1"
52
53 import (
54 "bytes"
55 "context"
56 "encoding/json"
57 "errors"
58 "fmt"
59 "io"
60 "log/slog"
61 "net/http"
62 "net/url"
63 "strconv"
64 "strings"
65
66 "github.com/googleapis/gax-go/v2/internallog"
67 googleapi "google.golang.org/api/googleapi"
68 internal "google.golang.org/api/internal"
69 gensupport "google.golang.org/api/internal/gensupport"
70 option "google.golang.org/api/option"
71 internaloption "google.golang.org/api/option/internaloption"
72 htransport "google.golang.org/api/transport/http"
73 )
74
75 // Always reference these packages, just in case the auto-generated code
76 // below doesn't.
77 var _ = bytes.NewBuffer
78 var _ = strconv.Itoa
79 var _ = fmt.Sprintf
80 var _ = json.NewDecoder
81 var _ = io.Copy
82 var _ = url.Parse
83 var _ = gensupport.MarshalJSON
84 var _ = googleapi.Version
85 var _ = errors.New
86 var _ = strings.Replace
87 var _ = context.Canceled
88 var _ = internaloption.WithDefaultEndpoint
89 var _ = internal.Version
90 var _ = internallog.New
91
92 const apiId = "policysimulator:v1"
93 const apiName = "policysimulator"
94 const apiVersion = "v1"
95 const basePath = "https://policysimulator.googleapis.com/"
96 const basePathTemplate = "https://policysimulator.UNIVERSE_DOMAIN/"
97 const mtlsBasePath = "https://policysimulator.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.Folders = NewFoldersService(s)
123 s.Operations = NewOperationsService(s)
124 s.Organizations = NewOrganizationsService(s)
125 s.Projects = NewProjectsService(s)
126 if endpoint != "" {
127 s.BasePath = endpoint
128 }
129 return s, nil
130 }
131
132 // New creates a new Service. It uses the provided http.Client for requests.
133 //
134 // Deprecated: please use NewService instead.
135 // To provide a custom HTTP client, use option.WithHTTPClient.
136 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
137 func New(client *http.Client) (*Service, error) {
138 if client == nil {
139 return nil, errors.New("client is nil")
140 }
141 return NewService(context.TODO(), option.WithHTTPClient(client))
142 }
143
144 type Service struct {
145 client *http.Client
146 logger *slog.Logger
147 BasePath string // API endpoint base URL
148 UserAgent string // optional additional User-Agent fragment
149
150 Folders *FoldersService
151
152 Operations *OperationsService
153
154 Organizations *OrganizationsService
155
156 Projects *ProjectsService
157 }
158
159 func (s *Service) userAgent() string {
160 if s.UserAgent == "" {
161 return googleapi.UserAgent
162 }
163 return googleapi.UserAgent + " " + s.UserAgent
164 }
165
166 func NewFoldersService(s *Service) *FoldersService {
167 rs := &FoldersService{s: s}
168 rs.Locations = NewFoldersLocationsService(s)
169 return rs
170 }
171
172 type FoldersService struct {
173 s *Service
174
175 Locations *FoldersLocationsService
176 }
177
178 func NewFoldersLocationsService(s *Service) *FoldersLocationsService {
179 rs := &FoldersLocationsService{s: s}
180 rs.AccessPolicySimulations = NewFoldersLocationsAccessPolicySimulationsService(s)
181 rs.OrgPolicyViolationsPreviews = NewFoldersLocationsOrgPolicyViolationsPreviewsService(s)
182 rs.Replays = NewFoldersLocationsReplaysService(s)
183 return rs
184 }
185
186 type FoldersLocationsService struct {
187 s *Service
188
189 AccessPolicySimulations *FoldersLocationsAccessPolicySimulationsService
190
191 OrgPolicyViolationsPreviews *FoldersLocationsOrgPolicyViolationsPreviewsService
192
193 Replays *FoldersLocationsReplaysService
194 }
195
196 func NewFoldersLocationsAccessPolicySimulationsService(s *Service) *FoldersLocationsAccessPolicySimulationsService {
197 rs := &FoldersLocationsAccessPolicySimulationsService{s: s}
198 rs.Operations = NewFoldersLocationsAccessPolicySimulationsOperationsService(s)
199 return rs
200 }
201
202 type FoldersLocationsAccessPolicySimulationsService struct {
203 s *Service
204
205 Operations *FoldersLocationsAccessPolicySimulationsOperationsService
206 }
207
208 func NewFoldersLocationsAccessPolicySimulationsOperationsService(s *Service) *FoldersLocationsAccessPolicySimulationsOperationsService {
209 rs := &FoldersLocationsAccessPolicySimulationsOperationsService{s: s}
210 return rs
211 }
212
213 type FoldersLocationsAccessPolicySimulationsOperationsService struct {
214 s *Service
215 }
216
217 func NewFoldersLocationsOrgPolicyViolationsPreviewsService(s *Service) *FoldersLocationsOrgPolicyViolationsPreviewsService {
218 rs := &FoldersLocationsOrgPolicyViolationsPreviewsService{s: s}
219 rs.Operations = NewFoldersLocationsOrgPolicyViolationsPreviewsOperationsService(s)
220 return rs
221 }
222
223 type FoldersLocationsOrgPolicyViolationsPreviewsService struct {
224 s *Service
225
226 Operations *FoldersLocationsOrgPolicyViolationsPreviewsOperationsService
227 }
228
229 func NewFoldersLocationsOrgPolicyViolationsPreviewsOperationsService(s *Service) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsService {
230 rs := &FoldersLocationsOrgPolicyViolationsPreviewsOperationsService{s: s}
231 return rs
232 }
233
234 type FoldersLocationsOrgPolicyViolationsPreviewsOperationsService struct {
235 s *Service
236 }
237
238 func NewFoldersLocationsReplaysService(s *Service) *FoldersLocationsReplaysService {
239 rs := &FoldersLocationsReplaysService{s: s}
240 rs.Operations = NewFoldersLocationsReplaysOperationsService(s)
241 rs.Results = NewFoldersLocationsReplaysResultsService(s)
242 return rs
243 }
244
245 type FoldersLocationsReplaysService struct {
246 s *Service
247
248 Operations *FoldersLocationsReplaysOperationsService
249
250 Results *FoldersLocationsReplaysResultsService
251 }
252
253 func NewFoldersLocationsReplaysOperationsService(s *Service) *FoldersLocationsReplaysOperationsService {
254 rs := &FoldersLocationsReplaysOperationsService{s: s}
255 return rs
256 }
257
258 type FoldersLocationsReplaysOperationsService struct {
259 s *Service
260 }
261
262 func NewFoldersLocationsReplaysResultsService(s *Service) *FoldersLocationsReplaysResultsService {
263 rs := &FoldersLocationsReplaysResultsService{s: s}
264 return rs
265 }
266
267 type FoldersLocationsReplaysResultsService struct {
268 s *Service
269 }
270
271 func NewOperationsService(s *Service) *OperationsService {
272 rs := &OperationsService{s: s}
273 return rs
274 }
275
276 type OperationsService struct {
277 s *Service
278 }
279
280 func NewOrganizationsService(s *Service) *OrganizationsService {
281 rs := &OrganizationsService{s: s}
282 rs.Locations = NewOrganizationsLocationsService(s)
283 return rs
284 }
285
286 type OrganizationsService struct {
287 s *Service
288
289 Locations *OrganizationsLocationsService
290 }
291
292 func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService {
293 rs := &OrganizationsLocationsService{s: s}
294 rs.AccessPolicySimulations = NewOrganizationsLocationsAccessPolicySimulationsService(s)
295 rs.OrgPolicyViolationsPreviews = NewOrganizationsLocationsOrgPolicyViolationsPreviewsService(s)
296 rs.Replays = NewOrganizationsLocationsReplaysService(s)
297 return rs
298 }
299
300 type OrganizationsLocationsService struct {
301 s *Service
302
303 AccessPolicySimulations *OrganizationsLocationsAccessPolicySimulationsService
304
305 OrgPolicyViolationsPreviews *OrganizationsLocationsOrgPolicyViolationsPreviewsService
306
307 Replays *OrganizationsLocationsReplaysService
308 }
309
310 func NewOrganizationsLocationsAccessPolicySimulationsService(s *Service) *OrganizationsLocationsAccessPolicySimulationsService {
311 rs := &OrganizationsLocationsAccessPolicySimulationsService{s: s}
312 rs.Operations = NewOrganizationsLocationsAccessPolicySimulationsOperationsService(s)
313 return rs
314 }
315
316 type OrganizationsLocationsAccessPolicySimulationsService struct {
317 s *Service
318
319 Operations *OrganizationsLocationsAccessPolicySimulationsOperationsService
320 }
321
322 func NewOrganizationsLocationsAccessPolicySimulationsOperationsService(s *Service) *OrganizationsLocationsAccessPolicySimulationsOperationsService {
323 rs := &OrganizationsLocationsAccessPolicySimulationsOperationsService{s: s}
324 return rs
325 }
326
327 type OrganizationsLocationsAccessPolicySimulationsOperationsService struct {
328 s *Service
329 }
330
331 func NewOrganizationsLocationsOrgPolicyViolationsPreviewsService(s *Service) *OrganizationsLocationsOrgPolicyViolationsPreviewsService {
332 rs := &OrganizationsLocationsOrgPolicyViolationsPreviewsService{s: s}
333 rs.Operations = NewOrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService(s)
334 rs.OrgPolicyViolations = NewOrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService(s)
335 return rs
336 }
337
338 type OrganizationsLocationsOrgPolicyViolationsPreviewsService struct {
339 s *Service
340
341 Operations *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService
342
343 OrgPolicyViolations *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService
344 }
345
346 func NewOrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService(s *Service) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService {
347 rs := &OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService{s: s}
348 return rs
349 }
350
351 type OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService struct {
352 s *Service
353 }
354
355 func NewOrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService(s *Service) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService {
356 rs := &OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService{s: s}
357 return rs
358 }
359
360 type OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService struct {
361 s *Service
362 }
363
364 func NewOrganizationsLocationsReplaysService(s *Service) *OrganizationsLocationsReplaysService {
365 rs := &OrganizationsLocationsReplaysService{s: s}
366 rs.Operations = NewOrganizationsLocationsReplaysOperationsService(s)
367 rs.Results = NewOrganizationsLocationsReplaysResultsService(s)
368 return rs
369 }
370
371 type OrganizationsLocationsReplaysService struct {
372 s *Service
373
374 Operations *OrganizationsLocationsReplaysOperationsService
375
376 Results *OrganizationsLocationsReplaysResultsService
377 }
378
379 func NewOrganizationsLocationsReplaysOperationsService(s *Service) *OrganizationsLocationsReplaysOperationsService {
380 rs := &OrganizationsLocationsReplaysOperationsService{s: s}
381 return rs
382 }
383
384 type OrganizationsLocationsReplaysOperationsService struct {
385 s *Service
386 }
387
388 func NewOrganizationsLocationsReplaysResultsService(s *Service) *OrganizationsLocationsReplaysResultsService {
389 rs := &OrganizationsLocationsReplaysResultsService{s: s}
390 return rs
391 }
392
393 type OrganizationsLocationsReplaysResultsService struct {
394 s *Service
395 }
396
397 func NewProjectsService(s *Service) *ProjectsService {
398 rs := &ProjectsService{s: s}
399 rs.Locations = NewProjectsLocationsService(s)
400 return rs
401 }
402
403 type ProjectsService struct {
404 s *Service
405
406 Locations *ProjectsLocationsService
407 }
408
409 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
410 rs := &ProjectsLocationsService{s: s}
411 rs.AccessPolicySimulations = NewProjectsLocationsAccessPolicySimulationsService(s)
412 rs.OrgPolicyViolationsPreviews = NewProjectsLocationsOrgPolicyViolationsPreviewsService(s)
413 rs.Replays = NewProjectsLocationsReplaysService(s)
414 return rs
415 }
416
417 type ProjectsLocationsService struct {
418 s *Service
419
420 AccessPolicySimulations *ProjectsLocationsAccessPolicySimulationsService
421
422 OrgPolicyViolationsPreviews *ProjectsLocationsOrgPolicyViolationsPreviewsService
423
424 Replays *ProjectsLocationsReplaysService
425 }
426
427 func NewProjectsLocationsAccessPolicySimulationsService(s *Service) *ProjectsLocationsAccessPolicySimulationsService {
428 rs := &ProjectsLocationsAccessPolicySimulationsService{s: s}
429 rs.Operations = NewProjectsLocationsAccessPolicySimulationsOperationsService(s)
430 return rs
431 }
432
433 type ProjectsLocationsAccessPolicySimulationsService struct {
434 s *Service
435
436 Operations *ProjectsLocationsAccessPolicySimulationsOperationsService
437 }
438
439 func NewProjectsLocationsAccessPolicySimulationsOperationsService(s *Service) *ProjectsLocationsAccessPolicySimulationsOperationsService {
440 rs := &ProjectsLocationsAccessPolicySimulationsOperationsService{s: s}
441 return rs
442 }
443
444 type ProjectsLocationsAccessPolicySimulationsOperationsService struct {
445 s *Service
446 }
447
448 func NewProjectsLocationsOrgPolicyViolationsPreviewsService(s *Service) *ProjectsLocationsOrgPolicyViolationsPreviewsService {
449 rs := &ProjectsLocationsOrgPolicyViolationsPreviewsService{s: s}
450 rs.Operations = NewProjectsLocationsOrgPolicyViolationsPreviewsOperationsService(s)
451 return rs
452 }
453
454 type ProjectsLocationsOrgPolicyViolationsPreviewsService struct {
455 s *Service
456
457 Operations *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService
458 }
459
460 func NewProjectsLocationsOrgPolicyViolationsPreviewsOperationsService(s *Service) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService {
461 rs := &ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService{s: s}
462 return rs
463 }
464
465 type ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService struct {
466 s *Service
467 }
468
469 func NewProjectsLocationsReplaysService(s *Service) *ProjectsLocationsReplaysService {
470 rs := &ProjectsLocationsReplaysService{s: s}
471 rs.Operations = NewProjectsLocationsReplaysOperationsService(s)
472 rs.Results = NewProjectsLocationsReplaysResultsService(s)
473 return rs
474 }
475
476 type ProjectsLocationsReplaysService struct {
477 s *Service
478
479 Operations *ProjectsLocationsReplaysOperationsService
480
481 Results *ProjectsLocationsReplaysResultsService
482 }
483
484 func NewProjectsLocationsReplaysOperationsService(s *Service) *ProjectsLocationsReplaysOperationsService {
485 rs := &ProjectsLocationsReplaysOperationsService{s: s}
486 return rs
487 }
488
489 type ProjectsLocationsReplaysOperationsService struct {
490 s *Service
491 }
492
493 func NewProjectsLocationsReplaysResultsService(s *Service) *ProjectsLocationsReplaysResultsService {
494 rs := &ProjectsLocationsReplaysResultsService{s: s}
495 return rs
496 }
497
498 type ProjectsLocationsReplaysResultsService struct {
499 s *Service
500 }
501
502 // GoogleCloudOrgpolicyV2AlternatePolicySpec: Similar to PolicySpec but with an
503 // extra 'launch' field for launch reference. The PolicySpec here is specific
504 // for dry-run.
505 type GoogleCloudOrgpolicyV2AlternatePolicySpec struct {
506 // Launch: Reference to the launch that will be used while audit logging and to
507 // control the launch. Should be set only in the alternate policy.
508 Launch string `json:"launch,omitempty"`
509 // Spec: Specify constraint for configurations of Google Cloud resources.
510 Spec *GoogleCloudOrgpolicyV2PolicySpec `json:"spec,omitempty"`
511 // ForceSendFields is a list of field names (e.g. "Launch") to unconditionally
512 // include in API requests. By default, fields with empty or default values are
513 // omitted from API requests. See
514 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
515 // details.
516 ForceSendFields []string `json:"-"`
517 // NullFields is a list of field names (e.g. "Launch") to include in API
518 // requests with the JSON null value. By default, fields with empty values are
519 // omitted from API requests. See
520 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
521 NullFields []string `json:"-"`
522 }
523
524 func (s GoogleCloudOrgpolicyV2AlternatePolicySpec) MarshalJSON() ([]byte, error) {
525 type NoMethod GoogleCloudOrgpolicyV2AlternatePolicySpec
526 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
527 }
528
529 // GoogleCloudOrgpolicyV2CustomConstraint: A custom constraint defined by
530 // customers which can *only* be applied to the given resource types and
531 // organization. By creating a custom constraint, customers can apply policies
532 // of this custom constraint. *Creating a custom constraint itself does NOT
533 // apply any policy enforcement*.
534 type GoogleCloudOrgpolicyV2CustomConstraint struct {
535 // ActionType: Allow or deny type.
536 //
537 // Possible values:
538 // "ACTION_TYPE_UNSPECIFIED" - This is only used for distinguishing unset
539 // values and should never be used. Results in an error.
540 // "ALLOW" - Allowed action type.
541 // "DENY" - Deny action type.
542 ActionType string `json:"actionType,omitempty"`
543 // Condition: A Common Expression Language (CEL) condition which is used in the
544 // evaluation of the constraint. For example:
545 // `resource.instanceName.matches("(production|test)_(.+_)?[\d]+")` or,
546 // `resource.management.auto_upgrade == true` The max length of the condition
547 // is 1000 characters.
548 Condition string `json:"condition,omitempty"`
549 // Description: Detailed information about this custom policy constraint. The
550 // max length of the description is 2000 characters.
551 Description string `json:"description,omitempty"`
552 // DisplayName: One line display name for the UI. The max length of the
553 // display_name is 200 characters.
554 DisplayName string `json:"displayName,omitempty"`
555 // MethodTypes: All the operations being applied for this constraint.
556 //
557 // Possible values:
558 // "METHOD_TYPE_UNSPECIFIED" - This is only used for distinguishing unset
559 // values and should never be used. Results in an error.
560 // "CREATE" - Constraint applied when creating the resource.
561 // "UPDATE" - Constraint applied when updating the resource.
562 // "DELETE" - Constraint applied when deleting the resource. Not currently
563 // supported.
564 // "REMOVE_GRANT" - Constraint applied when removing an IAM grant.
565 // "GOVERN_TAGS" - Constraint applied when enforcing forced tagging.
566 MethodTypes []string `json:"methodTypes,omitempty"`
567 // Name: Immutable. Name of the constraint. This is unique within the
568 // organization. Format of the name should be *
569 // `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
570 // Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
571 // The max length is 71 characters and the minimum length is 1. Note that the
572 // prefix `organizations/{organization_id}/customConstraints/custom.` is not
573 // counted.
574 Name string `json:"name,omitempty"`
575 // ResourceTypes: Immutable. The resource instance type on which this policy
576 // applies. Format will be of the form : `/` Example: *
577 // `compute.googleapis.com/Instance`.
578 ResourceTypes []string `json:"resourceTypes,omitempty"`
579 // UpdateTime: Output only. The last time this custom constraint was updated.
580 // This represents the last time that the `CreateCustomConstraint` or
581 // `UpdateCustomConstraint` methods were called.
582 UpdateTime string `json:"updateTime,omitempty"`
583 // ForceSendFields is a list of field names (e.g. "ActionType") to
584 // unconditionally include in API requests. By default, fields with empty or
585 // default values are omitted from API requests. See
586 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
587 // details.
588 ForceSendFields []string `json:"-"`
589 // NullFields is a list of field names (e.g. "ActionType") to include in API
590 // requests with the JSON null value. By default, fields with empty values are
591 // omitted from API requests. See
592 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
593 NullFields []string `json:"-"`
594 }
595
596 func (s GoogleCloudOrgpolicyV2CustomConstraint) MarshalJSON() ([]byte, error) {
597 type NoMethod GoogleCloudOrgpolicyV2CustomConstraint
598 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
599 }
600
601 // GoogleCloudOrgpolicyV2Policy: Defines an organization policy that is used to
602 // specify constraints for configurations of Google Cloud resources.
603 type GoogleCloudOrgpolicyV2Policy struct {
604 // Alternate: Deprecated.
605 Alternate *GoogleCloudOrgpolicyV2AlternatePolicySpec `json:"alternate,omitempty"`
606 // DryRunSpec: Dry-run policy. Audit-only policy, can be used to monitor how
607 // the policy would have impacted the existing and future resources if it's
608 // enforced.
609 DryRunSpec *GoogleCloudOrgpolicyV2PolicySpec `json:"dryRunSpec,omitempty"`
610 // Etag: Optional. An opaque tag indicating the current state of the policy,
611 // used for concurrency control. This entity tag (ETag) is computed by the
612 // server based on the value of other fields, and may be sent on update and
613 // delete requests to ensure the client has an up-to-date value before
614 // proceeding.
615 Etag string `json:"etag,omitempty"`
616 // Name: Immutable. The resource name of the policy. Must be one of the
617 // following forms, where `constraint_name` is the name of the constraint that
618 // this policy configures: *
619 // `projects/{project_number}/policies/{constraint_name}` *
620 // `folders/{folder_id}/policies/{constraint_name}` *
621 // `organizations/{organization_id}/policies/{constraint_name}` For example,
622 // `projects/123/policies/compute.disableSerialPortAccess`. Note:
623 // `projects/{project_id}/policies/{constraint_name}` is also an acceptable
624 // name for API requests, but responses will return the name using the
625 // equivalent project number.
626 Name string `json:"name,omitempty"`
627 // Spec: Basic information about the organization policy.
628 Spec *GoogleCloudOrgpolicyV2PolicySpec `json:"spec,omitempty"`
629 // ForceSendFields is a list of field names (e.g. "Alternate") to
630 // unconditionally include in API requests. By default, fields with empty or
631 // default values are omitted from API requests. See
632 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
633 // details.
634 ForceSendFields []string `json:"-"`
635 // NullFields is a list of field names (e.g. "Alternate") to include in API
636 // requests with the JSON null value. By default, fields with empty values are
637 // omitted from API requests. See
638 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
639 NullFields []string `json:"-"`
640 }
641
642 func (s GoogleCloudOrgpolicyV2Policy) MarshalJSON() ([]byte, error) {
643 type NoMethod GoogleCloudOrgpolicyV2Policy
644 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
645 }
646
647 // GoogleCloudOrgpolicyV2PolicySpec: Defines a Google Cloud policy
648 // specification that is used to specify constraints for configurations of
649 // Google Cloud resources.
650 type GoogleCloudOrgpolicyV2PolicySpec struct {
651 // Etag: An opaque tag indicating the current version of the policySpec, used
652 // for concurrency control. This field is ignored if used in a `CreatePolicy`
653 // request. When the policy is returned from either a `GetPolicy` or a
654 // `ListPolicies` request, this entity tag (ETag) indicates the version of the
655 // current policySpec to use when executing a read-modify-write loop. When the
656 // policy is returned from a `GetEffectivePolicy` request, the ETag will be
657 // unset.
658 Etag string `json:"etag,omitempty"`
659 // InheritFromParent: Determines the inheritance behavior for this policy. If
660 // `inherit_from_parent` is true, policy rules set higher up in the hierarchy
661 // (up to the closest root) are inherited and present in the effective policy.
662 // If it is false, then no rules are inherited, and this policy becomes the new
663 // root for evaluation. This field can be set only for policies that configure
664 // list constraints.
665 InheritFromParent bool `json:"inheritFromParent,omitempty"`
666 // Reset: Ignores policies set above this resource and restores the
667 // `constraint_default` enforcement behavior of the specific constraint at this
668 // resource. This field can be set in policies for either list or boolean
669 // constraints. If set, `rules` must be empty and `inherit_from_parent` must be
670 // set to false.
671 Reset bool `json:"reset,omitempty"`
672 // Rules: In policies for boolean constraints, the following requirements
673 // apply: - There must be exactly one policy rule where a condition is unset. -
674 // Boolean policy rules with conditions must set `enforced` to the opposite of
675 // the policy rule without a condition. - During policy evaluation, policy
676 // rules with conditions that are true for a target resource take precedence.
677 Rules []*GoogleCloudOrgpolicyV2PolicySpecPolicyRule `json:"rules,omitempty"`
678 // UpdateTime: Output only. The time stamp this was previously updated. This
679 // represents the last time a call to `CreatePolicy` or `UpdatePolicy` was made
680 // for that policy.
681 UpdateTime string `json:"updateTime,omitempty"`
682 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
683 // include in API requests. By default, fields with empty or default values are
684 // omitted from API requests. See
685 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
686 // details.
687 ForceSendFields []string `json:"-"`
688 // NullFields is a list of field names (e.g. "Etag") to include in API requests
689 // with the JSON null value. By default, fields with empty values are omitted
690 // from API requests. See
691 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
692 NullFields []string `json:"-"`
693 }
694
695 func (s GoogleCloudOrgpolicyV2PolicySpec) MarshalJSON() ([]byte, error) {
696 type NoMethod GoogleCloudOrgpolicyV2PolicySpec
697 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
698 }
699
700 // GoogleCloudOrgpolicyV2PolicySpecPolicyRule: A rule used to express this
701 // policy.
702 type GoogleCloudOrgpolicyV2PolicySpecPolicyRule struct {
703 // AllowAll: Setting this to true means that all values are allowed. This field
704 // can be set only in policies for list constraints.
705 AllowAll bool `json:"allowAll,omitempty"`
706 // Condition: A condition that determines whether this rule is used to evaluate
707 // the policy. When set, the google.type.Expr.expression field must contain 1
708 // to 10 subexpressions, joined by the `||` or `&&` operators. Each
709 // subexpression must use the `resource.matchTag()`, `resource.matchTagId()`,
710 // `resource.hasTagKey()`, or `resource.hasTagKeyId()` Common Expression
711 // Language (CEL) function. The `resource.matchTag()` function takes the
712 // following arguments: * `key_name`: the namespaced name of the tag key, with
713 // the organization ID and a slash (`/`) as a prefix; for example,
714 // `123456789012/environment` * `value_name`: the short name of the tag value
715 // For example: `resource.matchTag('123456789012/environment, 'prod')` The
716 // `resource.matchTagId()` function takes the following arguments: * `key_id`:
717 // the permanent ID of the tag key; for example, `tagKeys/123456789012` *
718 // `value_id`: the permanent ID of the tag value; for example,
719 // `tagValues/567890123456` For example:
720 // `resource.matchTagId('tagKeys/123456789012', 'tagValues/567890123456')` The
721 // `resource.hasTagKey()` function takes the following argument: * `key_name`:
722 // the namespaced name of the tag key, with the organization ID and a slash
723 // (`/`) as a prefix; for example, `123456789012/environment` For example:
724 // `resource.hasTagKey('123456789012/environment')` The
725 // `resource.hasTagKeyId()` function takes the following arguments: * `key_id`:
726 // the permanent ID of the tag key; for example, `tagKeys/123456789012` For
727 // example: `resource.hasTagKeyId('tagKeys/123456789012')`
728 Condition *GoogleTypeExpr `json:"condition,omitempty"`
729 // DenyAll: Setting this to true means that all values are denied. This field
730 // can be set only in policies for list constraints.
731 DenyAll bool `json:"denyAll,omitempty"`
732 // Enforce: If `true`, then the policy is enforced. If `false`, then any
733 // configuration is acceptable. This field can be set in policies for boolean
734 // constraints, custom constraints and managed constraints.
735 Enforce bool `json:"enforce,omitempty"`
736 // Parameters: Optional. Required for managed constraints if parameters are
737 // defined. Passes parameter values when policy enforcement is enabled. Ensure
738 // that parameter value types match those defined in the constraint definition.
739 // For example: ``` { "allowedLocations" : ["us-east1", "us-west1"], "allowAll"
740 // : true } ```
741 Parameters googleapi.RawMessage `json:"parameters,omitempty"`
742 // Values: List of values to be used for this policy rule. This field can be
743 // set only in policies for list constraints.
744 Values *GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues `json:"values,omitempty"`
745 // ForceSendFields is a list of field names (e.g. "AllowAll") to
746 // unconditionally include in API requests. By default, fields with empty or
747 // default values are omitted from API requests. See
748 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
749 // details.
750 ForceSendFields []string `json:"-"`
751 // NullFields is a list of field names (e.g. "AllowAll") to include in API
752 // requests with the JSON null value. By default, fields with empty values are
753 // omitted from API requests. See
754 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
755 NullFields []string `json:"-"`
756 }
757
758 func (s GoogleCloudOrgpolicyV2PolicySpecPolicyRule) MarshalJSON() ([]byte, error) {
759 type NoMethod GoogleCloudOrgpolicyV2PolicySpecPolicyRule
760 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
761 }
762
763 // GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues: A message that holds
764 // specific allowed and denied values. This message can define specific values
765 // and subtrees of the Resource Manager resource hierarchy (`Organizations`,
766 // `Folders`, `Projects`) that are allowed or denied. This is achieved by using
767 // the `under:` and optional `is:` prefixes. The `under:` prefix is used to
768 // denote resource subtree values. The `is:` prefix is used to denote specific
769 // values, and is required only if the value contains a ":". Values prefixed
770 // with "is:" are treated the same as values with no prefix. Ancestry subtrees
771 // must be in one of the following formats: - `projects/` (for example,
772 // `projects/tokyo-rain-123`) - `folders/` (for example, `folders/1234`) -
773 // `organizations/` (for example, `organizations/1234`) The `supports_under`
774 // field of the associated `Constraint` defines whether ancestry prefixes can
775 // be used.
776 type GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues struct {
777 // AllowedValues: List of values allowed at this resource.
778 AllowedValues []string `json:"allowedValues,omitempty"`
779 // DeniedValues: List of values denied at this resource.
780 DeniedValues []string `json:"deniedValues,omitempty"`
781 // ForceSendFields is a list of field names (e.g. "AllowedValues") to
782 // unconditionally include in API requests. By default, fields with empty or
783 // default values are omitted from API requests. See
784 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
785 // details.
786 ForceSendFields []string `json:"-"`
787 // NullFields is a list of field names (e.g. "AllowedValues") to include in API
788 // requests with the JSON null value. By default, fields with empty values are
789 // omitted from API requests. See
790 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
791 NullFields []string `json:"-"`
792 }
793
794 func (s GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues) MarshalJSON() ([]byte, error) {
795 type NoMethod GoogleCloudOrgpolicyV2PolicySpecPolicyRuleStringValues
796 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
797 }
798
799 // GoogleCloudPolicysimulatorV1AccessStateDiff: A summary and comparison of the
800 // principal's access under the current (baseline) policies and the proposed
801 // (simulated) policies for a single access tuple.
802 type GoogleCloudPolicysimulatorV1AccessStateDiff struct {
803 // AccessChange: How the principal's access, specified in the AccessState
804 // field, changed between the current (baseline) policies and proposed
805 // (simulated) policies.
806 //
807 // Possible values:
808 // "ACCESS_CHANGE_TYPE_UNSPECIFIED" - Default value. This value is unused.
809 // "NO_CHANGE" - The principal's access did not change. This includes the
810 // case where both baseline and simulated are UNKNOWN, but the unknown
811 // information is equivalent.
812 // "UNKNOWN_CHANGE" - The principal's access under both the current policies
813 // and the proposed policies is `UNKNOWN`, but the unknown information differs
814 // between them.
815 // "ACCESS_REVOKED" - The principal had access under the current policies
816 // (`GRANTED`), but will no longer have access after the proposed changes
817 // (`NOT_GRANTED`).
818 // "ACCESS_GAINED" - The principal did not have access under the current
819 // policies (`NOT_GRANTED`), but will have access after the proposed changes
820 // (`GRANTED`).
821 // "ACCESS_MAYBE_REVOKED" - This result can occur for the following reasons:
822 // * The principal had access under the current policies (`GRANTED`), but their
823 // access after the proposed changes is `UNKNOWN`. * The principal's access
824 // under the current policies is `UNKNOWN`, but they will not have access after
825 // the proposed changes (`NOT_GRANTED`).
826 // "ACCESS_MAYBE_GAINED" - This result can occur for the following reasons: *
827 // The principal did not have access under the current policies
828 // (`NOT_GRANTED`), but their access after the proposed changes is `UNKNOWN`. *
829 // The principal's access under the current policies is `UNKNOWN`, but they
830 // will have access after the proposed changes (`GRANTED`).
831 AccessChange string `json:"accessChange,omitempty"`
832 // Baseline: The results of evaluating the access tuple under the current
833 // (baseline) policies. If the AccessState couldn't be fully evaluated, this
834 // field explains why.
835 Baseline *GoogleCloudPolicysimulatorV1ExplainedAccess `json:"baseline,omitempty"`
836 // Simulated: The results of evaluating the access tuple under the proposed
837 // (simulated) policies. If the AccessState couldn't be fully evaluated, this
838 // field explains why.
839 Simulated *GoogleCloudPolicysimulatorV1ExplainedAccess `json:"simulated,omitempty"`
840 // ForceSendFields is a list of field names (e.g. "AccessChange") to
841 // unconditionally include in API requests. By default, fields with empty or
842 // default values are omitted from API requests. See
843 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
844 // details.
845 ForceSendFields []string `json:"-"`
846 // NullFields is a list of field names (e.g. "AccessChange") to include in API
847 // requests with the JSON null value. By default, fields with empty values are
848 // omitted from API requests. See
849 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
850 NullFields []string `json:"-"`
851 }
852
853 func (s GoogleCloudPolicysimulatorV1AccessStateDiff) MarshalJSON() ([]byte, error) {
854 type NoMethod GoogleCloudPolicysimulatorV1AccessStateDiff
855 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
856 }
857
858 // GoogleCloudPolicysimulatorV1AccessTuple: Information about the principal,
859 // resource, and permission to check.
860 type GoogleCloudPolicysimulatorV1AccessTuple struct {
861 // FullResourceName: Required. The full resource name that identifies the
862 // resource. For example,
863 // `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/m
864 // y-instance`. For examples of full resource names for Google Cloud services,
865 // see https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
866 FullResourceName string `json:"fullResourceName,omitempty"`
867 // Permission: Required. The IAM permission to check for the specified
868 // principal and resource. For a complete list of IAM permissions, see
869 // https://cloud.google.com/iam/help/permissions/reference. For a complete list
870 // of predefined IAM roles and the permissions in each role, see
871 // https://cloud.google.com/iam/help/roles/reference.
872 Permission string `json:"permission,omitempty"`
873 // Principal: Required. The principal whose access you want to check, in the
874 // form of the email address that represents that principal. For example,
875 // `[email protected]` or
876 // `[email protected]`. The principal must
877 // be a Google Account or a service account. Other types of principals are not
878 // supported.
879 Principal string `json:"principal,omitempty"`
880 // ForceSendFields is a list of field names (e.g. "FullResourceName") to
881 // unconditionally include in API requests. By default, fields with empty or
882 // default values are omitted from API requests. See
883 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
884 // details.
885 ForceSendFields []string `json:"-"`
886 // NullFields is a list of field names (e.g. "FullResourceName") to include in
887 // API requests with the JSON null value. By default, fields with empty values
888 // are omitted from API requests. See
889 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
890 NullFields []string `json:"-"`
891 }
892
893 func (s GoogleCloudPolicysimulatorV1AccessTuple) MarshalJSON() ([]byte, error) {
894 type NoMethod GoogleCloudPolicysimulatorV1AccessTuple
895 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
896 }
897
898 // GoogleCloudPolicysimulatorV1BindingExplanation: Details about how a binding
899 // in a policy affects a principal's ability to use a permission.
900 type GoogleCloudPolicysimulatorV1BindingExplanation struct {
901 // Access: Required. Indicates whether _this binding_ provides the specified
902 // permission to the specified principal for the specified resource. This field
903 // does _not_ indicate whether the principal actually has the permission for
904 // the resource. There might be another binding that overrides this binding. To
905 // determine whether the principal actually has the permission, use the
906 // `access` field in the TroubleshootIamPolicyResponse.
907 //
908 // Possible values:
909 // "ACCESS_STATE_UNSPECIFIED" - Default value. This value is unused.
910 // "GRANTED" - The principal has the permission.
911 // "NOT_GRANTED" - The principal does not have the permission.
912 // "UNKNOWN_CONDITIONAL" - The principal has the permission only if a
913 // condition expression evaluates to `true`.
914 // "UNKNOWN_INFO_DENIED" - The user who created the Replay does not have
915 // access to all of the policies that Policy Simulator needs to evaluate.
916 Access string `json:"access,omitempty"`
917 // Condition: A condition expression that prevents this binding from granting
918 // access unless the expression evaluates to `true`. To learn about IAM
919 // Conditions, see https://cloud.google.com/iam/docs/conditions-overview.
920 Condition *GoogleTypeExpr `json:"condition,omitempty"`
921 // Memberships: Indicates whether each principal in the binding includes the
922 // principal specified in the request, either directly or indirectly. Each key
923 // identifies a principal in the binding, and each value indicates whether the
924 // principal in the binding includes the principal in the request. For example,
925 // suppose that a binding includes the following principals: *
926 // `user:[email protected]` * `group:[email protected]` The principal in
927 // the replayed access tuple is `user:[email protected]`. This user is a
928 // principal of the group `group:[email protected]`. For the first
929 // principal in the binding, the key is `user:[email protected]`, and the
930 // `membership` field in the value is set to `MEMBERSHIP_NOT_INCLUDED`. For the
931 // second principal in the binding, the key is `group:[email protected]`,
932 // and the `membership` field in the value is set to `MEMBERSHIP_INCLUDED`.
933 Memberships map[string]GoogleCloudPolicysimulatorV1BindingExplanationAnnotatedMembership `json:"memberships,omitempty"`
934 // Relevance: The relevance of this binding to the overall determination for
935 // the entire policy.
936 //
937 // Possible values:
938 // "HEURISTIC_RELEVANCE_UNSPECIFIED" - Default value. This value is unused.
939 // "NORMAL" - The data point has a limited effect on the result. Changing the
940 // data point is unlikely to affect the overall determination.
941 // "HIGH" - The data point has a strong effect on the result. Changing the
942 // data point is likely to affect the overall determination.
943 Relevance string `json:"relevance,omitempty"`
944 // Role: The role that this binding grants. For example,
945 // `roles/compute.serviceAgent`. For a complete list of predefined IAM roles,
946 // as well as the permissions in each role, see
947 // https://cloud.google.com/iam/help/roles/reference.
948 Role string `json:"role,omitempty"`
949 // RolePermission: Indicates whether the role granted by this binding contains
950 // the specified permission.
951 //
952 // Possible values:
953 // "ROLE_PERMISSION_UNSPECIFIED" - Default value. This value is unused.
954 // "ROLE_PERMISSION_INCLUDED" - The permission is included in the role.
955 // "ROLE_PERMISSION_NOT_INCLUDED" - The permission is not included in the
956 // role.
957 // "ROLE_PERMISSION_UNKNOWN_INFO_DENIED" - The user who created the Replay is
958 // not allowed to access the binding.
959 RolePermission string `json:"rolePermission,omitempty"`
960 // RolePermissionRelevance: The relevance of the permission's existence, or
961 // nonexistence, in the role to the overall determination for the entire
962 // policy.
963 //
964 // Possible values:
965 // "HEURISTIC_RELEVANCE_UNSPECIFIED" - Default value. This value is unused.
966 // "NORMAL" - The data point has a limited effect on the result. Changing the
967 // data point is unlikely to affect the overall determination.
968 // "HIGH" - The data point has a strong effect on the result. Changing the
969 // data point is likely to affect the overall determination.
970 RolePermissionRelevance string `json:"rolePermissionRelevance,omitempty"`
971 // ForceSendFields is a list of field names (e.g. "Access") to unconditionally
972 // include in API requests. By default, fields with empty or default values are
973 // omitted from API requests. See
974 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
975 // details.
976 ForceSendFields []string `json:"-"`
977 // NullFields is a list of field names (e.g. "Access") to include in API
978 // requests with the JSON null value. By default, fields with empty values are
979 // omitted from API requests. See
980 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
981 NullFields []string `json:"-"`
982 }
983
984 func (s GoogleCloudPolicysimulatorV1BindingExplanation) MarshalJSON() ([]byte, error) {
985 type NoMethod GoogleCloudPolicysimulatorV1BindingExplanation
986 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
987 }
988
989 // GoogleCloudPolicysimulatorV1BindingExplanationAnnotatedMembership: Details
990 // about whether the binding includes the principal.
991 type GoogleCloudPolicysimulatorV1BindingExplanationAnnotatedMembership struct {
992 // Membership: Indicates whether the binding includes the principal.
993 //
994 // Possible values:
995 // "MEMBERSHIP_UNSPECIFIED" - Default value. This value is unused.
996 // "MEMBERSHIP_INCLUDED" - The binding includes the principal. The principal
997 // can be included directly or indirectly. For example: * A principal is
998 // included directly if that principal is listed in the binding. * A principal
999 // is included indirectly if that principal is in a Google group or Google
1000 // Workspace domain that is listed in the binding.
1001 // "MEMBERSHIP_NOT_INCLUDED" - The binding does not include the principal.
1002 // "MEMBERSHIP_UNKNOWN_INFO_DENIED" - The user who created the Replay is not
1003 // allowed to access the binding.
1004 // "MEMBERSHIP_UNKNOWN_UNSUPPORTED" - The principal is an unsupported type.
1005 // Only Google Accounts and service accounts are supported.
1006 Membership string `json:"membership,omitempty"`
1007 // Relevance: The relevance of the principal's status to the overall
1008 // determination for the binding.
1009 //
1010 // Possible values:
1011 // "HEURISTIC_RELEVANCE_UNSPECIFIED" - Default value. This value is unused.
1012 // "NORMAL" - The data point has a limited effect on the result. Changing the
1013 // data point is unlikely to affect the overall determination.
1014 // "HIGH" - The data point has a strong effect on the result. Changing the
1015 // data point is likely to affect the overall determination.
1016 Relevance string `json:"relevance,omitempty"`
1017 // ForceSendFields is a list of field names (e.g. "Membership") to
1018 // unconditionally include in API requests. By default, fields with empty or
1019 // default values are omitted from API requests. See
1020 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1021 // details.
1022 ForceSendFields []string `json:"-"`
1023 // NullFields is a list of field names (e.g. "Membership") to include in API
1024 // requests with the JSON null value. By default, fields with empty values are
1025 // omitted from API requests. See
1026 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1027 NullFields []string `json:"-"`
1028 }
1029
1030 func (s GoogleCloudPolicysimulatorV1BindingExplanationAnnotatedMembership) MarshalJSON() ([]byte, error) {
1031 type NoMethod GoogleCloudPolicysimulatorV1BindingExplanationAnnotatedMembership
1032 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1033 }
1034
1035 // GoogleCloudPolicysimulatorV1ExplainedAccess: Details about how a set of
1036 // policies, listed in ExplainedPolicy, resulted in a certain AccessState when
1037 // replaying an access tuple.
1038 type GoogleCloudPolicysimulatorV1ExplainedAccess struct {
1039 // AccessState: Whether the principal in the access tuple has permission to
1040 // access the resource in the access tuple under the given policies.
1041 //
1042 // Possible values:
1043 // "ACCESS_STATE_UNSPECIFIED" - Default value. This value is unused.
1044 // "GRANTED" - The principal has the permission.
1045 // "NOT_GRANTED" - The principal does not have the permission.
1046 // "UNKNOWN_CONDITIONAL" - The principal has the permission only if a
1047 // condition expression evaluates to `true`.
1048 // "UNKNOWN_INFO_DENIED" - The user who created the Replay does not have
1049 // access to all of the policies that Policy Simulator needs to evaluate.
1050 AccessState string `json:"accessState,omitempty"`
1051 // Errors: If the AccessState is `UNKNOWN`, this field contains a list of
1052 // errors explaining why the result is `UNKNOWN`. If the `AccessState` is
1053 // `GRANTED` or `NOT_GRANTED`, this field is omitted.
1054 Errors []*GoogleRpcStatus `json:"errors,omitempty"`
1055 // Policies: If the AccessState is `UNKNOWN`, this field contains the policies
1056 // that led to that result. If the `AccessState` is `GRANTED` or `NOT_GRANTED`,
1057 // this field is omitted.
1058 Policies []*GoogleCloudPolicysimulatorV1ExplainedPolicy `json:"policies,omitempty"`
1059 // ForceSendFields is a list of field names (e.g. "AccessState") to
1060 // unconditionally include in API requests. By default, fields with empty or
1061 // default values are omitted from API requests. See
1062 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1063 // details.
1064 ForceSendFields []string `json:"-"`
1065 // NullFields is a list of field names (e.g. "AccessState") to include in API
1066 // requests with the JSON null value. By default, fields with empty values are
1067 // omitted from API requests. See
1068 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1069 NullFields []string `json:"-"`
1070 }
1071
1072 func (s GoogleCloudPolicysimulatorV1ExplainedAccess) MarshalJSON() ([]byte, error) {
1073 type NoMethod GoogleCloudPolicysimulatorV1ExplainedAccess
1074 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1075 }
1076
1077 // GoogleCloudPolicysimulatorV1ExplainedPolicy: Details about how a specific
1078 // IAM Policy contributed to the access check.
1079 type GoogleCloudPolicysimulatorV1ExplainedPolicy struct {
1080 // Access: Indicates whether _this policy_ provides the specified permission to
1081 // the specified principal for the specified resource. This field does _not_
1082 // indicate whether the principal actually has the permission for the resource.
1083 // There might be another policy that overrides this policy. To determine
1084 // whether the principal actually has the permission, use the `access` field in
1085 // the TroubleshootIamPolicyResponse.
1086 //
1087 // Possible values:
1088 // "ACCESS_STATE_UNSPECIFIED" - Default value. This value is unused.
1089 // "GRANTED" - The principal has the permission.
1090 // "NOT_GRANTED" - The principal does not have the permission.
1091 // "UNKNOWN_CONDITIONAL" - The principal has the permission only if a
1092 // condition expression evaluates to `true`.
1093 // "UNKNOWN_INFO_DENIED" - The user who created the Replay does not have
1094 // access to all of the policies that Policy Simulator needs to evaluate.
1095 Access string `json:"access,omitempty"`
1096 // BindingExplanations: Details about how each binding in the policy affects
1097 // the principal's ability, or inability, to use the permission for the
1098 // resource. If the user who created the Replay does not have access to the
1099 // policy, this field is omitted.
1100 BindingExplanations []*GoogleCloudPolicysimulatorV1BindingExplanation `json:"bindingExplanations,omitempty"`
1101 // FullResourceName: The full resource name that identifies the resource. For
1102 // example,
1103 // `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/m
1104 // y-instance`. If the user who created the Replay does not have access to the
1105 // policy, this field is omitted. For examples of full resource names for
1106 // Google Cloud services, see
1107 // https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
1108 FullResourceName string `json:"fullResourceName,omitempty"`
1109 // Policy: The IAM policy attached to the resource. If the user who created the
1110 // Replay does not have access to the policy, this field is empty.
1111 Policy *GoogleIamV1Policy `json:"policy,omitempty"`
1112 // Relevance: The relevance of this policy to the overall determination in the
1113 // TroubleshootIamPolicyResponse. If the user who created the Replay does not
1114 // have access to the policy, this field is omitted.
1115 //
1116 // Possible values:
1117 // "HEURISTIC_RELEVANCE_UNSPECIFIED" - Default value. This value is unused.
1118 // "NORMAL" - The data point has a limited effect on the result. Changing the
1119 // data point is unlikely to affect the overall determination.
1120 // "HIGH" - The data point has a strong effect on the result. Changing the
1121 // data point is likely to affect the overall determination.
1122 Relevance string `json:"relevance,omitempty"`
1123 // ForceSendFields is a list of field names (e.g. "Access") to unconditionally
1124 // include in API requests. By default, fields with empty or default values are
1125 // omitted from API requests. See
1126 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1127 // details.
1128 ForceSendFields []string `json:"-"`
1129 // NullFields is a list of field names (e.g. "Access") to include in API
1130 // requests with the JSON null value. By default, fields with empty values are
1131 // omitted from API requests. See
1132 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1133 NullFields []string `json:"-"`
1134 }
1135
1136 func (s GoogleCloudPolicysimulatorV1ExplainedPolicy) MarshalJSON() ([]byte, error) {
1137 type NoMethod GoogleCloudPolicysimulatorV1ExplainedPolicy
1138 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1139 }
1140
1141 // GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse:
1142 // ListOrgPolicyViolationsPreviewsResponse is the response message for
1143 // OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews.
1144 type GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse struct {
1145 // NextPageToken: A token that you can use to retrieve the next page of
1146 // results. If this field is omitted, there are no subsequent pages.
1147 NextPageToken string `json:"nextPageToken,omitempty"`
1148 // OrgPolicyViolationsPreviews: The list of OrgPolicyViolationsPreview
1149 OrgPolicyViolationsPreviews []*GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview `json:"orgPolicyViolationsPreviews,omitempty"`
1150
1151 // ServerResponse contains the HTTP response code and headers from the server.
1152 googleapi.ServerResponse `json:"-"`
1153 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1154 // unconditionally include in API requests. By default, fields with empty or
1155 // default values are omitted from API requests. See
1156 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1157 // details.
1158 ForceSendFields []string `json:"-"`
1159 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1160 // requests with the JSON null value. By default, fields with empty values are
1161 // omitted from API requests. See
1162 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1163 NullFields []string `json:"-"`
1164 }
1165
1166 func (s GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse) MarshalJSON() ([]byte, error) {
1167 type NoMethod GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse
1168 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1169 }
1170
1171 // GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse:
1172 // ListOrgPolicyViolationsResponse is the response message for
1173 // OrgPolicyViolationsPreviewService.ListOrgPolicyViolations
1174 type GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse struct {
1175 // NextPageToken: A token that you can use to retrieve the next page of
1176 // results. If this field is omitted, there are no subsequent pages.
1177 NextPageToken string `json:"nextPageToken,omitempty"`
1178 // OrgPolicyViolations: The list of OrgPolicyViolations
1179 OrgPolicyViolations []*GoogleCloudPolicysimulatorV1OrgPolicyViolation `json:"orgPolicyViolations,omitempty"`
1180
1181 // ServerResponse contains the HTTP response code and headers from the server.
1182 googleapi.ServerResponse `json:"-"`
1183 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1184 // unconditionally include in API requests. By default, fields with empty or
1185 // default values are omitted from API requests. See
1186 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1187 // details.
1188 ForceSendFields []string `json:"-"`
1189 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1190 // requests with the JSON null value. By default, fields with empty values are
1191 // omitted from API requests. See
1192 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1193 NullFields []string `json:"-"`
1194 }
1195
1196 func (s GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse) MarshalJSON() ([]byte, error) {
1197 type NoMethod GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse
1198 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1199 }
1200
1201 // GoogleCloudPolicysimulatorV1ListReplayResultsResponse: Response message for
1202 // Simulator.ListReplayResults.
1203 type GoogleCloudPolicysimulatorV1ListReplayResultsResponse struct {
1204 // NextPageToken: A token that you can use to retrieve the next page of
1205 // ReplayResult objects. If this field is omitted, there are no subsequent
1206 // pages.
1207 NextPageToken string `json:"nextPageToken,omitempty"`
1208 // ReplayResults: The results of running a Replay.
1209 ReplayResults []*GoogleCloudPolicysimulatorV1ReplayResult `json:"replayResults,omitempty"`
1210
1211 // ServerResponse contains the HTTP response code and headers from the server.
1212 googleapi.ServerResponse `json:"-"`
1213 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1214 // unconditionally include in API requests. By default, fields with empty or
1215 // default values are omitted from API requests. See
1216 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1217 // details.
1218 ForceSendFields []string `json:"-"`
1219 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1220 // requests with the JSON null value. By default, fields with empty values are
1221 // omitted from API requests. See
1222 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1223 NullFields []string `json:"-"`
1224 }
1225
1226 func (s GoogleCloudPolicysimulatorV1ListReplayResultsResponse) MarshalJSON() ([]byte, error) {
1227 type NoMethod GoogleCloudPolicysimulatorV1ListReplayResultsResponse
1228 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1229 }
1230
1231 // GoogleCloudPolicysimulatorV1OrgPolicyOverlay: The proposed changes to
1232 // OrgPolicy.
1233 type GoogleCloudPolicysimulatorV1OrgPolicyOverlay struct {
1234 // CustomConstraints: Optional. The OrgPolicy CustomConstraint changes to
1235 // preview violations for. Any existing CustomConstraints with the same name
1236 // will be overridden in the simulation. That is, violations will be determined
1237 // as if all custom constraints in the overlay were instantiated. Only a single
1238 // custom_constraint is supported in the overlay at a time. For evaluating
1239 // multiple constraints, multiple `GenerateOrgPolicyViolationsPreview` requests
1240 // are made, where each request evaluates a single constraint.
1241 CustomConstraints []*GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay `json:"customConstraints,omitempty"`
1242 // Policies: Optional. The OrgPolicy changes to preview violations for. Any
1243 // existing OrgPolicies with the same name will be overridden in the
1244 // simulation. That is, violations will be determined as if all policies in the
1245 // overlay were created or updated.
1246 Policies []*GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay `json:"policies,omitempty"`
1247 // ForceSendFields is a list of field names (e.g. "CustomConstraints") to
1248 // unconditionally include in API requests. By default, fields with empty or
1249 // default values are omitted from API requests. See
1250 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1251 // details.
1252 ForceSendFields []string `json:"-"`
1253 // NullFields is a list of field names (e.g. "CustomConstraints") to include in
1254 // API requests with the JSON null value. By default, fields with empty values
1255 // are omitted from API requests. See
1256 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1257 NullFields []string `json:"-"`
1258 }
1259
1260 func (s GoogleCloudPolicysimulatorV1OrgPolicyOverlay) MarshalJSON() ([]byte, error) {
1261 type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyOverlay
1262 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1263 }
1264
1265 // GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay: A
1266 // change to an OrgPolicy custom constraint.
1267 type GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay struct {
1268 // CustomConstraint: Optional. The new or updated custom constraint.
1269 CustomConstraint *GoogleCloudOrgpolicyV2CustomConstraint `json:"customConstraint,omitempty"`
1270 // CustomConstraintParent: Optional. Resource the constraint is attached to.
1271 // Example: "organization/987654"
1272 CustomConstraintParent string `json:"customConstraintParent,omitempty"`
1273 // ForceSendFields is a list of field names (e.g. "CustomConstraint") to
1274 // unconditionally include in API requests. By default, fields with empty or
1275 // default values are omitted from API requests. See
1276 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1277 // details.
1278 ForceSendFields []string `json:"-"`
1279 // NullFields is a list of field names (e.g. "CustomConstraint") to include in
1280 // API requests with the JSON null value. By default, fields with empty values
1281 // are omitted from API requests. See
1282 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1283 NullFields []string `json:"-"`
1284 }
1285
1286 func (s GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay) MarshalJSON() ([]byte, error) {
1287 type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyOverlayCustomConstraintOverlay
1288 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1289 }
1290
1291 // GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay: A change to an
1292 // OrgPolicy.
1293 type GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay struct {
1294 // Policy: Optional. The new or updated OrgPolicy.
1295 Policy *GoogleCloudOrgpolicyV2Policy `json:"policy,omitempty"`
1296 // PolicyParent: Optional. The parent of the policy we are attaching to.
1297 // Example: "projects/123456"
1298 PolicyParent string `json:"policyParent,omitempty"`
1299 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
1300 // include in API requests. By default, fields with empty or default values are
1301 // omitted from API requests. See
1302 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1303 // details.
1304 ForceSendFields []string `json:"-"`
1305 // NullFields is a list of field names (e.g. "Policy") to include in API
1306 // requests with the JSON null value. By default, fields with empty values are
1307 // omitted from API requests. See
1308 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1309 NullFields []string `json:"-"`
1310 }
1311
1312 func (s GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay) MarshalJSON() ([]byte, error) {
1313 type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyOverlayPolicyOverlay
1314 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1315 }
1316
1317 // GoogleCloudPolicysimulatorV1OrgPolicyViolation: OrgPolicyViolation is a
1318 // resource representing a single resource violating a single OrgPolicy
1319 // constraint.
1320 type GoogleCloudPolicysimulatorV1OrgPolicyViolation struct {
1321 // CustomConstraint: The custom constraint being violated.
1322 CustomConstraint *GoogleCloudOrgpolicyV2CustomConstraint `json:"customConstraint,omitempty"`
1323 // Error: Any error encountered during the evaluation.
1324 Error *GoogleRpcStatus `json:"error,omitempty"`
1325 // Name: The name of the `OrgPolicyViolation`. Example:
1326 // organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506
1327 // a5f7f/orgPolicyViolations/38ce`
1328 Name string `json:"name,omitempty"`
1329 // Resource: The resource violating the constraint.
1330 Resource *GoogleCloudPolicysimulatorV1ResourceContext `json:"resource,omitempty"`
1331 // ForceSendFields is a list of field names (e.g. "CustomConstraint") to
1332 // unconditionally include in API requests. By default, fields with empty or
1333 // default values are omitted from API requests. See
1334 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1335 // details.
1336 ForceSendFields []string `json:"-"`
1337 // NullFields is a list of field names (e.g. "CustomConstraint") to include in
1338 // API requests with the JSON null value. By default, fields with empty values
1339 // are omitted from API requests. See
1340 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1341 NullFields []string `json:"-"`
1342 }
1343
1344 func (s GoogleCloudPolicysimulatorV1OrgPolicyViolation) MarshalJSON() ([]byte, error) {
1345 type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyViolation
1346 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1347 }
1348
1349 // GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview:
1350 // OrgPolicyViolationsPreview is a resource providing a preview of the
1351 // violations that will exist if an OrgPolicy change is made. The list of
1352 // violations are modeled as child resources and retrieved via a
1353 // ListOrgPolicyViolations API call. There are potentially more
1354 // OrgPolicyViolations than could fit in an embedded field. Thus, the use of a
1355 // child resource instead of a field.
1356 type GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview struct {
1357 // CreateTime: Output only. Time when this `OrgPolicyViolationsPreview` was
1358 // created.
1359 CreateTime string `json:"createTime,omitempty"`
1360 // CustomConstraints: Output only. The names of the constraints against which
1361 // all `OrgPolicyViolations` were evaluated. If `OrgPolicyOverlay` only
1362 // contains `PolicyOverlay` then it contains the name of the configured custom
1363 // constraint, applicable to the specified policies. Otherwise it contains the
1364 // name of the constraint specified in `CustomConstraintOverlay`. Format:
1365 // `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
1366 // Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
1367 CustomConstraints []string `json:"customConstraints,omitempty"`
1368 // Name: Output only. The resource name of the `OrgPolicyViolationsPreview`. It
1369 // has the following format:
1370 // `organizations/{organization}/locations/{location}/orgPolicyViolationsPreview
1371 // s/{orgPolicyViolationsPreview}` Example:
1372 // `organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/50
1373 // 6a5f7f`
1374 Name string `json:"name,omitempty"`
1375 // Overlay: Required. The proposed changes we are previewing violations for.
1376 Overlay *GoogleCloudPolicysimulatorV1OrgPolicyOverlay `json:"overlay,omitempty"`
1377 // ResourceCounts: Output only. A summary of the state of all resources scanned
1378 // for compliance with the changed OrgPolicy.
1379 ResourceCounts *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts `json:"resourceCounts,omitempty"`
1380 // State: Output only. The state of the `OrgPolicyViolationsPreview`.
1381 //
1382 // Possible values:
1383 // "PREVIEW_STATE_UNSPECIFIED" - The state is unspecified.
1384 // "PREVIEW_PENDING" - The OrgPolicyViolationsPreview has not been created
1385 // yet.
1386 // "PREVIEW_RUNNING" - The OrgPolicyViolationsPreview is currently being
1387 // created.
1388 // "PREVIEW_SUCCEEDED" - The OrgPolicyViolationsPreview creation finished
1389 // successfully.
1390 // "PREVIEW_FAILED" - The OrgPolicyViolationsPreview creation failed with an
1391 // error.
1392 State string `json:"state,omitempty"`
1393 // ViolationsCount: Output only. The number of OrgPolicyViolations in this
1394 // `OrgPolicyViolationsPreview`. This count may differ from
1395 // `resource_summary.noncompliant_count` because each OrgPolicyViolation is
1396 // specific to a resource **and** constraint. If there are multiple constraints
1397 // being evaluated (i.e. multiple policies in the overlay), a single resource
1398 // may violate multiple constraints.
1399 ViolationsCount int64 `json:"violationsCount,omitempty"`
1400
1401 // ServerResponse contains the HTTP response code and headers from the server.
1402 googleapi.ServerResponse `json:"-"`
1403 // ForceSendFields is a list of field names (e.g. "CreateTime") to
1404 // unconditionally include in API requests. By default, fields with empty or
1405 // default values are omitted from API requests. See
1406 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1407 // details.
1408 ForceSendFields []string `json:"-"`
1409 // NullFields is a list of field names (e.g. "CreateTime") to include in API
1410 // requests with the JSON null value. By default, fields with empty values are
1411 // omitted from API requests. See
1412 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1413 NullFields []string `json:"-"`
1414 }
1415
1416 func (s GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview) MarshalJSON() ([]byte, error) {
1417 type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview
1418 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1419 }
1420
1421 // GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts: A
1422 // summary of the state of all resources scanned for compliance with the
1423 // changed OrgPolicy.
1424 type GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts struct {
1425 // Compliant: Output only. Number of scanned resources with zero violations.
1426 Compliant int64 `json:"compliant,omitempty"`
1427 // Errors: Output only. Number of resources that returned an error when
1428 // scanned.
1429 Errors int64 `json:"errors,omitempty"`
1430 // Noncompliant: Output only. Number of scanned resources with at least one
1431 // violation.
1432 Noncompliant int64 `json:"noncompliant,omitempty"`
1433 // Scanned: Output only. Number of resources checked for compliance. Must
1434 // equal: unenforced + noncompliant + compliant + error
1435 Scanned int64 `json:"scanned,omitempty"`
1436 // Unenforced: Output only. Number of resources where the constraint was not
1437 // enforced, i.e. the Policy set `enforced: false` for that resource.
1438 Unenforced int64 `json:"unenforced,omitempty"`
1439 // ForceSendFields is a list of field names (e.g. "Compliant") to
1440 // unconditionally include in API requests. By default, fields with empty or
1441 // default values are omitted from API requests. See
1442 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1443 // details.
1444 ForceSendFields []string `json:"-"`
1445 // NullFields is a list of field names (e.g. "Compliant") to include in API
1446 // requests with the JSON null value. By default, fields with empty values are
1447 // omitted from API requests. See
1448 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1449 NullFields []string `json:"-"`
1450 }
1451
1452 func (s GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts) MarshalJSON() ([]byte, error) {
1453 type NoMethod GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreviewResourceCounts
1454 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1455 }
1456
1457 // GoogleCloudPolicysimulatorV1Replay: A resource describing a `Replay`, or
1458 // simulation.
1459 type GoogleCloudPolicysimulatorV1Replay struct {
1460 // Config: Required. The configuration used for the `Replay`.
1461 Config *GoogleCloudPolicysimulatorV1ReplayConfig `json:"config,omitempty"`
1462 // Name: Output only. The resource name of the `Replay`, which has the
1463 // following format:
1464 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{rep
1465 // lay-id}`, where `{resource-id}` is the ID of the project, folder, or
1466 // organization that owns the Replay. Example:
1467 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03
1468 // -479ce1833c36`
1469 Name string `json:"name,omitempty"`
1470 // ResultsSummary: Output only. Summary statistics about the replayed log
1471 // entries.
1472 ResultsSummary *GoogleCloudPolicysimulatorV1ReplayResultsSummary `json:"resultsSummary,omitempty"`
1473 // State: Output only. The current state of the `Replay`.
1474 //
1475 // Possible values:
1476 // "STATE_UNSPECIFIED" - Default value. This value is unused.
1477 // "PENDING" - The `Replay` has not started yet.
1478 // "RUNNING" - The `Replay` is currently running.
1479 // "SUCCEEDED" - The `Replay` has successfully completed.
1480 // "FAILED" - The `Replay` has finished with an error.
1481 State string `json:"state,omitempty"`
1482
1483 // ServerResponse contains the HTTP response code and headers from the server.
1484 googleapi.ServerResponse `json:"-"`
1485 // ForceSendFields is a list of field names (e.g. "Config") to unconditionally
1486 // include in API requests. By default, fields with empty or default values are
1487 // omitted from API requests. See
1488 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1489 // details.
1490 ForceSendFields []string `json:"-"`
1491 // NullFields is a list of field names (e.g. "Config") to include in API
1492 // requests with the JSON null value. By default, fields with empty values are
1493 // omitted from API requests. See
1494 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1495 NullFields []string `json:"-"`
1496 }
1497
1498 func (s GoogleCloudPolicysimulatorV1Replay) MarshalJSON() ([]byte, error) {
1499 type NoMethod GoogleCloudPolicysimulatorV1Replay
1500 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1501 }
1502
1503 // GoogleCloudPolicysimulatorV1ReplayConfig: The configuration used for a
1504 // Replay.
1505 type GoogleCloudPolicysimulatorV1ReplayConfig struct {
1506 // LogSource: The logs to use as input for the Replay.
1507 //
1508 // Possible values:
1509 // "LOG_SOURCE_UNSPECIFIED" - An unspecified log source. If the log source is
1510 // unspecified, the Replay defaults to using `RECENT_ACCESSES`.
1511 // "RECENT_ACCESSES" - All access logs from the last 90 days. These logs may
1512 // not include logs from the most recent 7 days.
1513 LogSource string `json:"logSource,omitempty"`
1514 // PolicyOverlay: A mapping of the resources that you want to simulate policies
1515 // for and the policies that you want to simulate. Keys are the full resource
1516 // names for the resources. For example,
1517 // `//cloudresourcemanager.googleapis.com/projects/my-project`. For examples of
1518 // full resource names for Google Cloud services, see
1519 // https://cloud.google.com/iam/help/troubleshooter/full-resource-names. Values
1520 // are Policy objects representing the policies that you want to simulate.
1521 // Replays automatically take into account any IAM policies inherited through
1522 // the resource hierarchy, and any policies set on descendant resources. You do
1523 // not need to include these policies in the policy overlay.
1524 PolicyOverlay map[string]GoogleIamV1Policy `json:"policyOverlay,omitempty"`
1525 // ForceSendFields is a list of field names (e.g. "LogSource") to
1526 // unconditionally include in API requests. By default, fields with empty or
1527 // default values are omitted from API requests. See
1528 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1529 // details.
1530 ForceSendFields []string `json:"-"`
1531 // NullFields is a list of field names (e.g. "LogSource") to include in API
1532 // requests with the JSON null value. By default, fields with empty values are
1533 // omitted from API requests. See
1534 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1535 NullFields []string `json:"-"`
1536 }
1537
1538 func (s GoogleCloudPolicysimulatorV1ReplayConfig) MarshalJSON() ([]byte, error) {
1539 type NoMethod GoogleCloudPolicysimulatorV1ReplayConfig
1540 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1541 }
1542
1543 // GoogleCloudPolicysimulatorV1ReplayDiff: The difference between the results
1544 // of evaluating an access tuple under the current (baseline) policies and
1545 // under the proposed (simulated) policies. This difference explains how a
1546 // principal's access could change if the proposed policies were applied.
1547 type GoogleCloudPolicysimulatorV1ReplayDiff struct {
1548 // AccessDiff: A summary and comparison of the principal's access under the
1549 // current (baseline) policies and the proposed (simulated) policies for a
1550 // single access tuple. The evaluation of the principal's access is reported in
1551 // the AccessState field.
1552 AccessDiff *GoogleCloudPolicysimulatorV1AccessStateDiff `json:"accessDiff,omitempty"`
1553 // ForceSendFields is a list of field names (e.g. "AccessDiff") to
1554 // unconditionally include in API requests. By default, fields with empty or
1555 // default values are omitted from API requests. See
1556 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1557 // details.
1558 ForceSendFields []string `json:"-"`
1559 // NullFields is a list of field names (e.g. "AccessDiff") to include in API
1560 // requests with the JSON null value. By default, fields with empty values are
1561 // omitted from API requests. See
1562 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1563 NullFields []string `json:"-"`
1564 }
1565
1566 func (s GoogleCloudPolicysimulatorV1ReplayDiff) MarshalJSON() ([]byte, error) {
1567 type NoMethod GoogleCloudPolicysimulatorV1ReplayDiff
1568 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1569 }
1570
1571 // GoogleCloudPolicysimulatorV1ReplayOperationMetadata: Metadata about a Replay
1572 // operation.
1573 type GoogleCloudPolicysimulatorV1ReplayOperationMetadata struct {
1574 // StartTime: Time when the request was received.
1575 StartTime string `json:"startTime,omitempty"`
1576 // ForceSendFields is a list of field names (e.g. "StartTime") to
1577 // unconditionally include in API requests. By default, fields with empty or
1578 // default values are omitted from API requests. See
1579 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1580 // details.
1581 ForceSendFields []string `json:"-"`
1582 // NullFields is a list of field names (e.g. "StartTime") to include in API
1583 // requests with the JSON null value. By default, fields with empty values are
1584 // omitted from API requests. See
1585 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1586 NullFields []string `json:"-"`
1587 }
1588
1589 func (s GoogleCloudPolicysimulatorV1ReplayOperationMetadata) MarshalJSON() ([]byte, error) {
1590 type NoMethod GoogleCloudPolicysimulatorV1ReplayOperationMetadata
1591 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1592 }
1593
1594 // GoogleCloudPolicysimulatorV1ReplayResult: The result of replaying a single
1595 // access tuple against a simulated state.
1596 type GoogleCloudPolicysimulatorV1ReplayResult struct {
1597 // AccessTuple: The access tuple that was replayed. This field includes
1598 // information about the principal, resource, and permission that were involved
1599 // in the access attempt.
1600 AccessTuple *GoogleCloudPolicysimulatorV1AccessTuple `json:"accessTuple,omitempty"`
1601 // Diff: The difference between the principal's access under the current
1602 // (baseline) policies and the principal's access under the proposed
1603 // (simulated) policies. This field is only included for access tuples that
1604 // were successfully replayed and had different results under the current
1605 // policies and the proposed policies.
1606 Diff *GoogleCloudPolicysimulatorV1ReplayDiff `json:"diff,omitempty"`
1607 // Error: The error that caused the access tuple replay to fail. This field is
1608 // only included for access tuples that were not replayed successfully.
1609 Error *GoogleRpcStatus `json:"error,omitempty"`
1610 // LastSeenDate: The latest date this access tuple was seen in the logs.
1611 LastSeenDate *GoogleTypeDate `json:"lastSeenDate,omitempty"`
1612 // Name: The resource name of the `ReplayResult`, in the following format:
1613 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{rep
1614 // lay-id}/results/{replay-result-id}`, where `{resource-id}` is the ID of the
1615 // project, folder, or organization that owns the Replay. Example:
1616 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03
1617 // -479ce1833c36/results/1234`
1618 Name string `json:"name,omitempty"`
1619 // Parent: The Replay that the access tuple was included in.
1620 Parent string `json:"parent,omitempty"`
1621 // ForceSendFields is a list of field names (e.g. "AccessTuple") to
1622 // unconditionally include in API requests. By default, fields with empty or
1623 // default values are omitted from API requests. See
1624 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1625 // details.
1626 ForceSendFields []string `json:"-"`
1627 // NullFields is a list of field names (e.g. "AccessTuple") to include in API
1628 // requests with the JSON null value. By default, fields with empty values are
1629 // omitted from API requests. See
1630 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1631 NullFields []string `json:"-"`
1632 }
1633
1634 func (s GoogleCloudPolicysimulatorV1ReplayResult) MarshalJSON() ([]byte, error) {
1635 type NoMethod GoogleCloudPolicysimulatorV1ReplayResult
1636 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1637 }
1638
1639 // GoogleCloudPolicysimulatorV1ReplayResultsSummary: Summary statistics about
1640 // the replayed log entries.
1641 type GoogleCloudPolicysimulatorV1ReplayResultsSummary struct {
1642 // DifferenceCount: The number of replayed log entries with a difference
1643 // between baseline and simulated policies.
1644 DifferenceCount int64 `json:"differenceCount,omitempty"`
1645 // ErrorCount: The number of log entries that could not be replayed.
1646 ErrorCount int64 `json:"errorCount,omitempty"`
1647 // LogCount: The total number of log entries replayed.
1648 LogCount int64 `json:"logCount,omitempty"`
1649 // NewestDate: The date of the newest log entry replayed.
1650 NewestDate *GoogleTypeDate `json:"newestDate,omitempty"`
1651 // OldestDate: The date of the oldest log entry replayed.
1652 OldestDate *GoogleTypeDate `json:"oldestDate,omitempty"`
1653 // UnchangedCount: The number of replayed log entries with no difference
1654 // between baseline and simulated policies.
1655 UnchangedCount int64 `json:"unchangedCount,omitempty"`
1656 // ForceSendFields is a list of field names (e.g. "DifferenceCount") to
1657 // unconditionally include in API requests. By default, fields with empty or
1658 // default values are omitted from API requests. See
1659 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1660 // details.
1661 ForceSendFields []string `json:"-"`
1662 // NullFields is a list of field names (e.g. "DifferenceCount") to include in
1663 // API requests with the JSON null value. By default, fields with empty values
1664 // are omitted from API requests. See
1665 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1666 NullFields []string `json:"-"`
1667 }
1668
1669 func (s GoogleCloudPolicysimulatorV1ReplayResultsSummary) MarshalJSON() ([]byte, error) {
1670 type NoMethod GoogleCloudPolicysimulatorV1ReplayResultsSummary
1671 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1672 }
1673
1674 // GoogleCloudPolicysimulatorV1ResourceContext: ResourceContext provides the
1675 // context we know about a resource. It is similar in concept to
1676 // google.cloud.asset.v1.Resource, but focuses on the information specifically
1677 // used by Simulator.
1678 type GoogleCloudPolicysimulatorV1ResourceContext struct {
1679 // Ancestors: The ancestry path of the resource in Google Cloud resource
1680 // hierarchy
1681 // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
1682 // represented as a list of relative resource names. An ancestry path starts
1683 // with the closest ancestor in the hierarchy and ends at root. If the resource
1684 // is a project, folder, or organization, the ancestry path starts from the
1685 // resource itself. Example: `["projects/123456789", "folders/5432",
1686 // "organizations/1234"]`
1687 Ancestors []string `json:"ancestors,omitempty"`
1688 // AssetType: The asset type of the resource as defined by CAIS. Example:
1689 // `compute.googleapis.com/Firewall` See Supported asset types
1690 // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) for
1691 // more information.
1692 AssetType string `json:"assetType,omitempty"`
1693 // Resource: The full name of the resource. Example:
1694 // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/insta
1695 // nce1` See Resource names
1696 // (https://cloud.google.com/apis/design/resource_names#full_resource_name) for
1697 // more information.
1698 Resource string `json:"resource,omitempty"`
1699 // ForceSendFields is a list of field names (e.g. "Ancestors") to
1700 // unconditionally include in API requests. By default, fields with empty or
1701 // default values are omitted from API requests. See
1702 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1703 // details.
1704 ForceSendFields []string `json:"-"`
1705 // NullFields is a list of field names (e.g. "Ancestors") to include in API
1706 // requests with the JSON null value. By default, fields with empty values are
1707 // omitted from API requests. See
1708 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1709 NullFields []string `json:"-"`
1710 }
1711
1712 func (s GoogleCloudPolicysimulatorV1ResourceContext) MarshalJSON() ([]byte, error) {
1713 type NoMethod GoogleCloudPolicysimulatorV1ResourceContext
1714 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1715 }
1716
1717 // GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMeta
1718 // data: CreateOrgPolicyViolationsPreviewOperationMetadata is metadata about an
1719 // OrgPolicyViolationsPreview generations operation.
1720 type GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata struct {
1721 // RequestTime: Time when the request was received.
1722 RequestTime string `json:"requestTime,omitempty"`
1723 // ResourcesFound: Total number of resources that need scanning. Should equal
1724 // resource_scanned + resources_pending
1725 ResourcesFound int64 `json:"resourcesFound,omitempty"`
1726 // ResourcesPending: Number of resources still to scan.
1727 ResourcesPending int64 `json:"resourcesPending,omitempty"`
1728 // ResourcesScanned: Number of resources already scanned.
1729 ResourcesScanned int64 `json:"resourcesScanned,omitempty"`
1730 // StartTime: Time when the request started processing, i.e., when the state
1731 // was set to RUNNING.
1732 StartTime string `json:"startTime,omitempty"`
1733 // State: Output only. The current state of the operation.
1734 //
1735 // Possible values:
1736 // "PREVIEW_STATE_UNSPECIFIED" - The state is unspecified.
1737 // "PREVIEW_PENDING" - The OrgPolicyViolationsPreview has not been created
1738 // yet.
1739 // "PREVIEW_RUNNING" - The OrgPolicyViolationsPreview is currently being
1740 // created.
1741 // "PREVIEW_SUCCEEDED" - The OrgPolicyViolationsPreview creation finished
1742 // successfully.
1743 // "PREVIEW_FAILED" - The OrgPolicyViolationsPreview creation failed with an
1744 // error.
1745 State string `json:"state,omitempty"`
1746 // ForceSendFields is a list of field names (e.g. "RequestTime") to
1747 // unconditionally include in API requests. By default, fields with empty or
1748 // default values are omitted from API requests. See
1749 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1750 // details.
1751 ForceSendFields []string `json:"-"`
1752 // NullFields is a list of field names (e.g. "RequestTime") to include in API
1753 // requests with the JSON null value. By default, fields with empty values are
1754 // omitted from API requests. See
1755 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1756 NullFields []string `json:"-"`
1757 }
1758
1759 func (s GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata) MarshalJSON() ([]byte, error) {
1760 type NoMethod GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata
1761 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1762 }
1763
1764 // GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMe
1765 // tadata: GenerateOrgPolicyViolationsPreviewOperationMetadata is metadata
1766 // about an OrgPolicyViolationsPreview generations operation.
1767 type GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata struct {
1768 // RequestTime: Time when the request was received.
1769 RequestTime string `json:"requestTime,omitempty"`
1770 // ResourcesFound: Total number of resources that need scanning. Should equal
1771 // resource_scanned + resources_pending
1772 ResourcesFound int64 `json:"resourcesFound,omitempty"`
1773 // ResourcesPending: Number of resources still to scan.
1774 ResourcesPending int64 `json:"resourcesPending,omitempty"`
1775 // ResourcesScanned: Number of resources already scanned.
1776 ResourcesScanned int64 `json:"resourcesScanned,omitempty"`
1777 // StartTime: Time when the request started processing, i.e. when the state was
1778 // set to RUNNING.
1779 StartTime string `json:"startTime,omitempty"`
1780 // State: The current state of the operation.
1781 //
1782 // Possible values:
1783 // "PREVIEW_STATE_UNSPECIFIED" - The state is unspecified.
1784 // "PREVIEW_PENDING" - The OrgPolicyViolationsPreview has not been created
1785 // yet.
1786 // "PREVIEW_RUNNING" - The OrgPolicyViolationsPreview is currently being
1787 // created.
1788 // "PREVIEW_SUCCEEDED" - The OrgPolicyViolationsPreview creation finished
1789 // successfully.
1790 // "PREVIEW_FAILED" - The OrgPolicyViolationsPreview creation failed with an
1791 // error.
1792 State string `json:"state,omitempty"`
1793 // ForceSendFields is a list of field names (e.g. "RequestTime") to
1794 // unconditionally include in API requests. By default, fields with empty or
1795 // default values are omitted from API requests. See
1796 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1797 // details.
1798 ForceSendFields []string `json:"-"`
1799 // NullFields is a list of field names (e.g. "RequestTime") to include in API
1800 // requests with the JSON null value. By default, fields with empty values are
1801 // omitted from API requests. See
1802 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1803 NullFields []string `json:"-"`
1804 }
1805
1806 func (s GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata) MarshalJSON() ([]byte, error) {
1807 type NoMethod GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata
1808 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1809 }
1810
1811 // GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay: The proposed changes to
1812 // OrgPolicy.
1813 type GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay struct {
1814 // CustomConstraints: Optional. The OrgPolicy CustomConstraint changes to
1815 // preview violations for. Any existing CustomConstraints with the same name
1816 // will be overridden in the simulation. That is, violations will be determined
1817 // as if all custom constraints in the overlay were instantiated. Only a single
1818 // custom_constraint is supported in the overlay at a time. For evaluating
1819 // multiple constraints, multiple `GenerateOrgPolicyViolationsPreview` requests
1820 // are made, where each request evaluates a single constraint.
1821 CustomConstraints []*GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay `json:"customConstraints,omitempty"`
1822 // Policies: Optional. The OrgPolicy changes to preview violations for. Any
1823 // existing OrgPolicies with the same name will be overridden in the
1824 // simulation. That is, violations will be determined as if all policies in the
1825 // overlay were created or updated.
1826 Policies []*GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay `json:"policies,omitempty"`
1827 // ForceSendFields is a list of field names (e.g. "CustomConstraints") to
1828 // unconditionally include in API requests. By default, fields with empty or
1829 // default values are omitted from API requests. See
1830 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1831 // details.
1832 ForceSendFields []string `json:"-"`
1833 // NullFields is a list of field names (e.g. "CustomConstraints") to include in
1834 // API requests with the JSON null value. By default, fields with empty values
1835 // are omitted from API requests. See
1836 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1837 NullFields []string `json:"-"`
1838 }
1839
1840 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay) MarshalJSON() ([]byte, error) {
1841 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay
1842 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1843 }
1844
1845 // GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay: A
1846 // change to an OrgPolicy custom constraint.
1847 type GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay struct {
1848 // CustomConstraint: Optional. The new or updated custom constraint.
1849 CustomConstraint *GoogleCloudOrgpolicyV2CustomConstraint `json:"customConstraint,omitempty"`
1850 // CustomConstraintParent: Optional. Resource the constraint is attached to.
1851 // Example: "organization/987654"
1852 CustomConstraintParent string `json:"customConstraintParent,omitempty"`
1853 // ForceSendFields is a list of field names (e.g. "CustomConstraint") to
1854 // unconditionally include in API requests. By default, fields with empty or
1855 // default values are omitted from API requests. See
1856 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1857 // details.
1858 ForceSendFields []string `json:"-"`
1859 // NullFields is a list of field names (e.g. "CustomConstraint") to include in
1860 // API requests with the JSON null value. By default, fields with empty values
1861 // are omitted from API requests. See
1862 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1863 NullFields []string `json:"-"`
1864 }
1865
1866 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay) MarshalJSON() ([]byte, error) {
1867 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay
1868 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1869 }
1870
1871 // GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay: A change to
1872 // an OrgPolicy.
1873 type GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay struct {
1874 // Policy: Optional. The new or updated OrgPolicy.
1875 Policy *GoogleCloudOrgpolicyV2Policy `json:"policy,omitempty"`
1876 // PolicyParent: Optional. The parent of the policy we are attaching to.
1877 // Example: "projects/123456"
1878 PolicyParent string `json:"policyParent,omitempty"`
1879 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
1880 // include in API requests. By default, fields with empty or default values are
1881 // omitted from API requests. See
1882 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1883 // details.
1884 ForceSendFields []string `json:"-"`
1885 // NullFields is a list of field names (e.g. "Policy") to include in API
1886 // requests with the JSON null value. By default, fields with empty values are
1887 // omitted from API requests. See
1888 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1889 NullFields []string `json:"-"`
1890 }
1891
1892 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay) MarshalJSON() ([]byte, error) {
1893 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay
1894 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1895 }
1896
1897 // GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview:
1898 // OrgPolicyViolationsPreview is a resource providing a preview of the
1899 // violations that will exist if an OrgPolicy change is made. The list of
1900 // violations are modeled as child resources and retrieved via a
1901 // ListOrgPolicyViolations API call. There are potentially more
1902 // OrgPolicyViolations than could fit in an embedded field. Thus, the use of a
1903 // child resource instead of a field.
1904 type GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview struct {
1905 // CreateTime: Output only. Time when this `OrgPolicyViolationsPreview` was
1906 // created.
1907 CreateTime string `json:"createTime,omitempty"`
1908 // CustomConstraints: Output only. The names of the constraints against which
1909 // all `OrgPolicyViolations` were evaluated. If `OrgPolicyOverlay` only
1910 // contains `PolicyOverlay` then it contains the name of the configured custom
1911 // constraint, applicable to the specified policies. Otherwise it contains the
1912 // name of the constraint specified in `CustomConstraintOverlay`. Format:
1913 // `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
1914 // Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
1915 CustomConstraints []string `json:"customConstraints,omitempty"`
1916 // Name: Output only. The resource name of the `OrgPolicyViolationsPreview`. It
1917 // has the following format:
1918 // `organizations/{organization}/locations/{location}/orgPolicyViolationsPreview
1919 // s/{orgPolicyViolationsPreview}` Example:
1920 // `organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/50
1921 // 6a5f7f`
1922 Name string `json:"name,omitempty"`
1923 // Overlay: Required. The proposed changes we are previewing violations for.
1924 Overlay *GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay `json:"overlay,omitempty"`
1925 // ResourceCounts: Output only. A summary of the state of all resources scanned
1926 // for compliance with the changed OrgPolicy.
1927 ResourceCounts *GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts `json:"resourceCounts,omitempty"`
1928 // State: Output only. The state of the `OrgPolicyViolationsPreview`.
1929 //
1930 // Possible values:
1931 // "PREVIEW_STATE_UNSPECIFIED" - The state is unspecified.
1932 // "PREVIEW_PENDING" - The OrgPolicyViolationsPreview has not been created
1933 // yet.
1934 // "PREVIEW_RUNNING" - The OrgPolicyViolationsPreview is currently being
1935 // created.
1936 // "PREVIEW_SUCCEEDED" - The OrgPolicyViolationsPreview creation finished
1937 // successfully.
1938 // "PREVIEW_FAILED" - The OrgPolicyViolationsPreview creation failed with an
1939 // error.
1940 State string `json:"state,omitempty"`
1941 // ViolationsCount: Output only. The number of OrgPolicyViolations in this
1942 // `OrgPolicyViolationsPreview`. This count may differ from
1943 // `resource_summary.noncompliant_count` because each OrgPolicyViolation is
1944 // specific to a resource **and** constraint. If there are multiple constraints
1945 // being evaluated (i.e. multiple policies in the overlay), a single resource
1946 // may violate multiple constraints.
1947 ViolationsCount int64 `json:"violationsCount,omitempty"`
1948 // ForceSendFields is a list of field names (e.g. "CreateTime") to
1949 // unconditionally include in API requests. By default, fields with empty or
1950 // default values are omitted from API requests. See
1951 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1952 // details.
1953 ForceSendFields []string `json:"-"`
1954 // NullFields is a list of field names (e.g. "CreateTime") to include in API
1955 // requests with the JSON null value. By default, fields with empty values are
1956 // omitted from API requests. See
1957 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1958 NullFields []string `json:"-"`
1959 }
1960
1961 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview) MarshalJSON() ([]byte, error) {
1962 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview
1963 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1964 }
1965
1966 // GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts: A
1967 // summary of the state of all resources scanned for compliance with the
1968 // changed OrgPolicy.
1969 type GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts struct {
1970 // Compliant: Output only. Number of scanned resources with zero violations.
1971 Compliant int64 `json:"compliant,omitempty"`
1972 // Errors: Output only. Number of resources that returned an error when
1973 // scanned.
1974 Errors int64 `json:"errors,omitempty"`
1975 // Noncompliant: Output only. Number of scanned resources with at least one
1976 // violation.
1977 Noncompliant int64 `json:"noncompliant,omitempty"`
1978 // Scanned: Output only. Number of resources checked for compliance. Must
1979 // equal: unenforced + noncompliant + compliant + error
1980 Scanned int64 `json:"scanned,omitempty"`
1981 // Unenforced: Output only. Number of resources where the constraint was not
1982 // enforced, i.e. the Policy set `enforced: false` for that resource.
1983 Unenforced int64 `json:"unenforced,omitempty"`
1984 // ForceSendFields is a list of field names (e.g. "Compliant") to
1985 // unconditionally include in API requests. By default, fields with empty or
1986 // default values are omitted from API requests. See
1987 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1988 // details.
1989 ForceSendFields []string `json:"-"`
1990 // NullFields is a list of field names (e.g. "Compliant") to include in API
1991 // requests with the JSON null value. By default, fields with empty values are
1992 // omitted from API requests. See
1993 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1994 NullFields []string `json:"-"`
1995 }
1996
1997 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts) MarshalJSON() ([]byte, error) {
1998 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts
1999 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2000 }
2001
2002 // GoogleIamV1AuditConfig: Specifies the audit configuration for a service. The
2003 // configuration determines which permission types are logged, and what
2004 // identities, if any, are exempted from logging. An AuditConfig must have one
2005 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
2006 // and a specific service, the union of the two AuditConfigs is used for that
2007 // service: the log_types specified in each AuditConfig are enabled, and the
2008 // exempted_members in each AuditLogConfig are exempted. Example Policy with
2009 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
2010 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
2011 // "user:[email protected]" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
2012 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
2013 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
2014 // "DATA_WRITE", "exempted_members": [ "user:[email protected]" ] } ] } ] } For
2015 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
2016 // logging. It also exempts `[email protected]` from DATA_READ logging, and
2017 // `[email protected]` from DATA_WRITE logging.
2018 type GoogleIamV1AuditConfig struct {
2019 // AuditLogConfigs: The configuration for logging of each type of permission.
2020 AuditLogConfigs []*GoogleIamV1AuditLogConfig `json:"auditLogConfigs,omitempty"`
2021 // Service: Specifies a service that will be enabled for audit logging. For
2022 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
2023 // is a special value that covers all services.
2024 Service string `json:"service,omitempty"`
2025 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
2026 // unconditionally include in API requests. By default, fields with empty or
2027 // default values are omitted from API requests. See
2028 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2029 // details.
2030 ForceSendFields []string `json:"-"`
2031 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
2032 // API requests with the JSON null value. By default, fields with empty values
2033 // are omitted from API requests. See
2034 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2035 NullFields []string `json:"-"`
2036 }
2037
2038 func (s GoogleIamV1AuditConfig) MarshalJSON() ([]byte, error) {
2039 type NoMethod GoogleIamV1AuditConfig
2040 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2041 }
2042
2043 // GoogleIamV1AuditLogConfig: Provides the configuration for logging a type of
2044 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
2045 // "exempted_members": [ "user:[email protected]" ] }, { "log_type":
2046 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
2047 // exempting [email protected] from DATA_READ logging.
2048 type GoogleIamV1AuditLogConfig struct {
2049 // ExemptedMembers: Specifies the identities that do not cause logging for this
2050 // type of permission. Follows the same format of Binding.members.
2051 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
2052 // LogType: The log type that this config enables.
2053 //
2054 // Possible values:
2055 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
2056 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
2057 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
2058 // "DATA_READ" - Data reads. Example: CloudSQL Users list
2059 LogType string `json:"logType,omitempty"`
2060 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
2061 // unconditionally include in API requests. By default, fields with empty or
2062 // default values are omitted from API requests. See
2063 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2064 // details.
2065 ForceSendFields []string `json:"-"`
2066 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in
2067 // API requests with the JSON null value. By default, fields with empty values
2068 // are omitted from API requests. See
2069 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2070 NullFields []string `json:"-"`
2071 }
2072
2073 func (s GoogleIamV1AuditLogConfig) MarshalJSON() ([]byte, error) {
2074 type NoMethod GoogleIamV1AuditLogConfig
2075 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2076 }
2077
2078 // GoogleIamV1Binding: Associates `members`, or principals, with a `role`.
2079 type GoogleIamV1Binding struct {
2080 // Condition: The condition that is associated with this binding. If the
2081 // condition evaluates to `true`, then this binding applies to the current
2082 // request. If the condition evaluates to `false`, then this binding does not
2083 // apply to the current request. However, a different role binding might grant
2084 // the same role to one or more of the principals in this binding. To learn
2085 // which resources support conditions in their IAM policies, see the IAM
2086 // documentation
2087 // (https://cloud.google.com/iam/help/conditions/resource-policies).
2088 Condition *GoogleTypeExpr `json:"condition,omitempty"`
2089 // Members: Specifies the principals requesting access for a Google Cloud
2090 // resource. `members` can have the following values: * `allUsers`: A special
2091 // identifier that represents anyone who is on the internet; with or without a
2092 // Google account. * `allAuthenticatedUsers`: A special identifier that
2093 // represents anyone who is authenticated with a Google account or a service
2094 // account. Does not include identities that come from external identity
2095 // providers (IdPs) through identity federation. * `user:{emailid}`: An email
2096 // address that represents a specific Google account. For example,
2097 // `[email protected]` . * `serviceAccount:{emailid}`: An email address that
2098 // represents a Google service account. For example,
2099 // `[email protected]`. *
2100 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
2101 // identifier for a Kubernetes service account
2102 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
2103 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
2104 // `group:{emailid}`: An email address that represents a Google group. For
2105 // example, `[email protected]`. * `domain:{domain}`: The G Suite domain
2106 // (primary) that represents all the users of that domain. For example,
2107 // `google.com` or `example.com`. *
2108 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
2109 // ject/{subject_attribute_value}`: A single identity in a workforce identity
2110 // pool. *
2111 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
2112 // group/{group_id}`: All workforce identities in a group. *
2113 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
2114 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with
2115 // a specific attribute value. *
2116 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
2117 // *`: All identities in a workforce identity pool. *
2118 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
2119 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
2120 // identity in a workload identity pool. *
2121 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
2122 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
2123 // group. *
2124 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
2125 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
2126 // `: All identities in a workload identity pool with a certain attribute. *
2127 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
2128 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
2129 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
2130 // unique identifier) representing a user that has been recently deleted. For
2131 // example, `[email protected]?uid=123456789012345678901`. If the user is
2132 // recovered, this value reverts to `user:{emailid}` and the recovered user
2133 // retains the role in the binding. *
2134 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
2135 // unique identifier) representing a service account that has been recently
2136 // deleted. For example,
2137 // `[email protected]?uid=123456789012345678901`. If the
2138 // service account is undeleted, this value reverts to
2139 // `serviceAccount:{emailid}` and the undeleted service account retains the
2140 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
2141 // address (plus unique identifier) representing a Google group that has been
2142 // recently deleted. For example,
2143 // `[email protected]?uid=123456789012345678901`. If the group is recovered,
2144 // this value reverts to `group:{emailid}` and the recovered group retains the
2145 // role in the binding. *
2146 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
2147 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a
2148 // workforce identity pool. For example,
2149 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
2150 // ol-id/subject/my-subject-attribute-value`.
2151 Members []string `json:"members,omitempty"`
2152 // Role: Role that is assigned to the list of `members`, or principals. For
2153 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
2154 // of the IAM roles and permissions, see the IAM documentation
2155 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the
2156 // available pre-defined roles, see here
2157 // (https://cloud.google.com/iam/docs/understanding-roles).
2158 Role string `json:"role,omitempty"`
2159 // ForceSendFields is a list of field names (e.g. "Condition") to
2160 // unconditionally include in API requests. By default, fields with empty or
2161 // default values are omitted from API requests. See
2162 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2163 // details.
2164 ForceSendFields []string `json:"-"`
2165 // NullFields is a list of field names (e.g. "Condition") to include in API
2166 // requests with the JSON null value. By default, fields with empty values are
2167 // omitted from API requests. See
2168 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2169 NullFields []string `json:"-"`
2170 }
2171
2172 func (s GoogleIamV1Binding) MarshalJSON() ([]byte, error) {
2173 type NoMethod GoogleIamV1Binding
2174 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2175 }
2176
2177 // GoogleIamV1Policy: An Identity and Access Management (IAM) policy, which
2178 // specifies access controls for Google Cloud resources. A `Policy` is a
2179 // collection of `bindings`. A `binding` binds one or more `members`, or
2180 // principals, to a single `role`. Principals can be user accounts, service
2181 // accounts, Google groups, and domains (such as G Suite). A `role` is a named
2182 // list of permissions; each `role` can be an IAM predefined role or a
2183 // user-created custom role. For some types of Google Cloud resources, a
2184 // `binding` can also specify a `condition`, which is a logical expression that
2185 // allows access to a resource only if the expression evaluates to `true`. A
2186 // condition can add constraints based on attributes of the request, the
2187 // resource, or both. To learn which resources support conditions in their IAM
2188 // policies, see the IAM documentation
2189 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
2190 // example:** ``` { "bindings": [ { "role":
2191 // "roles/resourcemanager.organizationAdmin", "members": [
2192 // "user:[email protected]", "group:[email protected]", "domain:google.com",
2193 // "serviceAccount:[email protected]" ] }, { "role":
2194 // "roles/resourcemanager.organizationViewer", "members": [
2195 // "user:[email protected]" ], "condition": { "title": "expirable access",
2196 // "description": "Does not grant access after Sep 2020", "expression":
2197 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
2198 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
2199 // members: - user:[email protected] - group:[email protected] -
2200 // domain:google.com - serviceAccount:[email protected]
2201 // role: roles/resourcemanager.organizationAdmin - members: -
2202 // user:[email protected] role: roles/resourcemanager.organizationViewer
2203 // condition: title: expirable access description: Does not grant access after
2204 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
2205 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
2206 // see the IAM documentation (https://cloud.google.com/iam/docs/).
2207 type GoogleIamV1Policy struct {
2208 // AuditConfigs: Specifies cloud audit logging configuration for this policy.
2209 AuditConfigs []*GoogleIamV1AuditConfig `json:"auditConfigs,omitempty"`
2210 // Bindings: Associates a list of `members`, or principals, with a `role`.
2211 // Optionally, may specify a `condition` that determines how and when the
2212 // `bindings` are applied. Each of the `bindings` must contain at least one
2213 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
2214 // up to 250 of these principals can be Google groups. Each occurrence of a
2215 // principal counts towards these limits. For example, if the `bindings` grant
2216 // 50 different roles to `user:[email protected]`, and not to any other
2217 // principal, then you can add another 1,450 principals to the `bindings` in
2218 // the `Policy`.
2219 Bindings []*GoogleIamV1Binding `json:"bindings,omitempty"`
2220 // Etag: `etag` is used for optimistic concurrency control as a way to help
2221 // prevent simultaneous updates of a policy from overwriting each other. It is
2222 // strongly suggested that systems make use of the `etag` in the
2223 // read-modify-write cycle to perform policy updates in order to avoid race
2224 // conditions: An `etag` is returned in the response to `getIamPolicy`, and
2225 // systems are expected to put that etag in the request to `setIamPolicy` to
2226 // ensure that their change will be applied to the same version of the policy.
2227 // **Important:** If you use IAM Conditions, you must include the `etag` field
2228 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
2229 // you to overwrite a version `3` policy with a version `1` policy, and all of
2230 // the conditions in the version `3` policy are lost.
2231 Etag string `json:"etag,omitempty"`
2232 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and
2233 // `3`. Requests that specify an invalid value are rejected. Any operation that
2234 // affects conditional role bindings must specify version `3`. This requirement
2235 // applies to the following operations: * Getting a policy that includes a
2236 // conditional role binding * Adding a conditional role binding to a policy *
2237 // Changing a conditional role binding in a policy * Removing any role binding,
2238 // with or without a condition, from a policy that includes conditions
2239 // **Important:** If you use IAM Conditions, you must include the `etag` field
2240 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
2241 // you to overwrite a version `3` policy with a version `1` policy, and all of
2242 // the conditions in the version `3` policy are lost. If a policy does not
2243 // include any conditions, operations on that policy may specify any valid
2244 // version or leave the field unset. To learn which resources support
2245 // conditions in their IAM policies, see the IAM documentation
2246 // (https://cloud.google.com/iam/help/conditions/resource-policies).
2247 Version int64 `json:"version,omitempty"`
2248 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
2249 // unconditionally include in API requests. By default, fields with empty or
2250 // default values are omitted from API requests. See
2251 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2252 // details.
2253 ForceSendFields []string `json:"-"`
2254 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API
2255 // requests with the JSON null value. By default, fields with empty values are
2256 // omitted from API requests. See
2257 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2258 NullFields []string `json:"-"`
2259 }
2260
2261 func (s GoogleIamV1Policy) MarshalJSON() ([]byte, error) {
2262 type NoMethod GoogleIamV1Policy
2263 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2264 }
2265
2266 // GoogleLongrunningListOperationsResponse: The response message for
2267 // Operations.ListOperations.
2268 type GoogleLongrunningListOperationsResponse struct {
2269 // NextPageToken: The standard List next-page token.
2270 NextPageToken string `json:"nextPageToken,omitempty"`
2271 // Operations: A list of operations that matches the specified filter in the
2272 // request.
2273 Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
2274 // Unreachable: Unordered list. Unreachable resources. Populated when the
2275 // request sets `ListOperationsRequest.return_partial_success` and reads across
2276 // collections. For example, when attempting to list all resources across all
2277 // supported locations.
2278 Unreachable []string `json:"unreachable,omitempty"`
2279
2280 // ServerResponse contains the HTTP response code and headers from the server.
2281 googleapi.ServerResponse `json:"-"`
2282 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
2283 // unconditionally include in API requests. By default, fields with empty or
2284 // default values are omitted from API requests. See
2285 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2286 // details.
2287 ForceSendFields []string `json:"-"`
2288 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
2289 // requests with the JSON null value. By default, fields with empty values are
2290 // omitted from API requests. See
2291 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2292 NullFields []string `json:"-"`
2293 }
2294
2295 func (s GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
2296 type NoMethod GoogleLongrunningListOperationsResponse
2297 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2298 }
2299
2300 // GoogleLongrunningOperation: This resource represents a long-running
2301 // operation that is the result of a network API call.
2302 type GoogleLongrunningOperation struct {
2303 // Done: If the value is `false`, it means the operation is still in progress.
2304 // If `true`, the operation is completed, and either `error` or `response` is
2305 // available.
2306 Done bool `json:"done,omitempty"`
2307 // Error: The error result of the operation in case of failure or cancellation.
2308 Error *GoogleRpcStatus `json:"error,omitempty"`
2309 // Metadata: Service-specific metadata associated with the operation. It
2310 // typically contains progress information and common metadata such as create
2311 // time. Some services might not provide such metadata. Any method that returns
2312 // a long-running operation should document the metadata type, if any.
2313 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
2314 // Name: The server-assigned name, which is only unique within the same service
2315 // that originally returns it. If you use the default HTTP mapping, the `name`
2316 // should be a resource name ending with `operations/{unique_id}`.
2317 Name string `json:"name,omitempty"`
2318 // Response: The normal, successful response of the operation. If the original
2319 // method returns no data on success, such as `Delete`, the response is
2320 // `google.protobuf.Empty`. If the original method is standard
2321 // `Get`/`Create`/`Update`, the response should be the resource. For other
2322 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
2323 // original method name. For example, if the original method name is
2324 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
2325 Response googleapi.RawMessage `json:"response,omitempty"`
2326
2327 // ServerResponse contains the HTTP response code and headers from the server.
2328 googleapi.ServerResponse `json:"-"`
2329 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
2330 // include in API requests. By default, fields with empty or default values are
2331 // omitted from API requests. See
2332 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2333 // details.
2334 ForceSendFields []string `json:"-"`
2335 // NullFields is a list of field names (e.g. "Done") to include in API requests
2336 // with the JSON null value. By default, fields with empty values are omitted
2337 // from API requests. See
2338 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2339 NullFields []string `json:"-"`
2340 }
2341
2342 func (s GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
2343 type NoMethod GoogleLongrunningOperation
2344 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2345 }
2346
2347 // GoogleRpcStatus: The `Status` type defines a logical error model that is
2348 // suitable for different programming environments, including REST APIs and RPC
2349 // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message
2350 // contains three pieces of data: error code, error message, and error details.
2351 // You can find out more about this error model and how to work with it in the
2352 // API Design Guide (https://cloud.google.com/apis/design/errors).
2353 type GoogleRpcStatus struct {
2354 // Code: The status code, which should be an enum value of google.rpc.Code.
2355 Code int64 `json:"code,omitempty"`
2356 // Details: A list of messages that carry the error details. There is a common
2357 // set of message types for APIs to use.
2358 Details []googleapi.RawMessage `json:"details,omitempty"`
2359 // Message: A developer-facing error message, which should be in English. Any
2360 // user-facing error message should be localized and sent in the
2361 // google.rpc.Status.details field, or localized by the client.
2362 Message string `json:"message,omitempty"`
2363 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
2364 // include in API requests. By default, fields with empty or default values are
2365 // omitted from API requests. See
2366 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2367 // details.
2368 ForceSendFields []string `json:"-"`
2369 // NullFields is a list of field names (e.g. "Code") to include in API requests
2370 // with the JSON null value. By default, fields with empty values are omitted
2371 // from API requests. See
2372 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2373 NullFields []string `json:"-"`
2374 }
2375
2376 func (s GoogleRpcStatus) MarshalJSON() ([]byte, error) {
2377 type NoMethod GoogleRpcStatus
2378 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2379 }
2380
2381 // GoogleTypeDate: Represents a whole or partial calendar date, such as a
2382 // birthday. The time of day and time zone are either specified elsewhere or
2383 // are insignificant. The date is relative to the Gregorian Calendar. This can
2384 // represent one of the following: * A full date, with non-zero year, month,
2385 // and day values. * A month and day, with a zero year (for example, an
2386 // anniversary). * A year on its own, with a zero month and a zero day. * A
2387 // year and month, with a zero day (for example, a credit card expiration
2388 // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
2389 // google.protobuf.Timestamp
2390 type GoogleTypeDate struct {
2391 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
2392 // or 0 to specify a year by itself or a year and month where the day isn't
2393 // significant.
2394 Day int64 `json:"day,omitempty"`
2395 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
2396 // a month and day.
2397 Month int64 `json:"month,omitempty"`
2398 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
2399 // without a year.
2400 Year int64 `json:"year,omitempty"`
2401 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally
2402 // include in API requests. By default, fields with empty or default values are
2403 // omitted from API requests. See
2404 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2405 // details.
2406 ForceSendFields []string `json:"-"`
2407 // NullFields is a list of field names (e.g. "Day") to include in API requests
2408 // with the JSON null value. By default, fields with empty values are omitted
2409 // from API requests. See
2410 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2411 NullFields []string `json:"-"`
2412 }
2413
2414 func (s GoogleTypeDate) MarshalJSON() ([]byte, error) {
2415 type NoMethod GoogleTypeDate
2416 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2417 }
2418
2419 // GoogleTypeExpr: Represents a textual expression in the Common Expression
2420 // Language (CEL) syntax. CEL is a C-like expression language. The syntax and
2421 // semantics of CEL are documented at https://github.com/google/cel-spec.
2422 // Example (Comparison): title: "Summary size limit" description: "Determines
2423 // if a summary is less than 100 chars" expression: "document.summary.size() <
2424 // 100" Example (Equality): title: "Requestor is owner" description:
2425 // "Determines if requestor is the document owner" expression: "document.owner
2426 // == request.auth.claims.email" Example (Logic): title: "Public documents"
2427 // description: "Determine whether the document should be publicly visible"
2428 // expression: "document.type != 'private' && document.type != 'internal'"
2429 // Example (Data Manipulation): title: "Notification string" description:
2430 // "Create a notification string with a timestamp." expression: "'New message
2431 // received at ' + string(document.create_time)" The exact variables and
2432 // functions that may be referenced within an expression are determined by the
2433 // service that evaluates it. See the service documentation for additional
2434 // information.
2435 type GoogleTypeExpr struct {
2436 // Description: Optional. Description of the expression. This is a longer text
2437 // which describes the expression, e.g. when hovered over it in a UI.
2438 Description string `json:"description,omitempty"`
2439 // Expression: Textual representation of an expression in Common Expression
2440 // Language syntax.
2441 Expression string `json:"expression,omitempty"`
2442 // Location: Optional. String indicating the location of the expression for
2443 // error reporting, e.g. a file name and a position in the file.
2444 Location string `json:"location,omitempty"`
2445 // Title: Optional. Title for the expression, i.e. a short string describing
2446 // its purpose. This can be used e.g. in UIs which allow to enter the
2447 // expression.
2448 Title string `json:"title,omitempty"`
2449 // ForceSendFields is a list of field names (e.g. "Description") to
2450 // unconditionally include in API requests. By default, fields with empty or
2451 // default values are omitted from API requests. See
2452 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2453 // details.
2454 ForceSendFields []string `json:"-"`
2455 // NullFields is a list of field names (e.g. "Description") to include in API
2456 // requests with the JSON null value. By default, fields with empty values are
2457 // omitted from API requests. See
2458 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2459 NullFields []string `json:"-"`
2460 }
2461
2462 func (s GoogleTypeExpr) MarshalJSON() ([]byte, error) {
2463 type NoMethod GoogleTypeExpr
2464 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2465 }
2466
2467 type FoldersLocationsAccessPolicySimulationsOperationsGetCall struct {
2468 s *Service
2469 name string
2470 urlParams_ gensupport.URLParams
2471 ifNoneMatch_ string
2472 ctx_ context.Context
2473 header_ http.Header
2474 }
2475
2476 // Get: Gets the latest state of a long-running operation. Clients can use this
2477 // method to poll the operation result at intervals as recommended by the API
2478 // service.
2479 //
2480 // - name: The name of the operation resource.
2481 func (r *FoldersLocationsAccessPolicySimulationsOperationsService) Get(name string) *FoldersLocationsAccessPolicySimulationsOperationsGetCall {
2482 c := &FoldersLocationsAccessPolicySimulationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2483 c.name = name
2484 return c
2485 }
2486
2487 // Fields allows partial responses to be retrieved. See
2488 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2489 // details.
2490 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsAccessPolicySimulationsOperationsGetCall {
2491 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2492 return c
2493 }
2494
2495 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2496 // object's ETag matches the given value. This is useful for getting updates
2497 // only after the object has changed since the last request.
2498 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsAccessPolicySimulationsOperationsGetCall {
2499 c.ifNoneMatch_ = entityTag
2500 return c
2501 }
2502
2503 // Context sets the context to be used in this call's Do method.
2504 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) Context(ctx context.Context) *FoldersLocationsAccessPolicySimulationsOperationsGetCall {
2505 c.ctx_ = ctx
2506 return c
2507 }
2508
2509 // Header returns a http.Header that can be modified by the caller to add
2510 // headers to the request.
2511 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) Header() http.Header {
2512 if c.header_ == nil {
2513 c.header_ = make(http.Header)
2514 }
2515 return c.header_
2516 }
2517
2518 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2519 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2520 if c.ifNoneMatch_ != "" {
2521 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2522 }
2523 c.urlParams_.Set("alt", alt)
2524 c.urlParams_.Set("prettyPrint", "false")
2525 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2526 urls += "?" + c.urlParams_.Encode()
2527 req, err := http.NewRequest("GET", urls, nil)
2528 if err != nil {
2529 return nil, err
2530 }
2531 req.Header = reqHeaders
2532 googleapi.Expand(req.URL, map[string]string{
2533 "name": c.name,
2534 })
2535 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.accessPolicySimulations.operations.get", "request", internallog.HTTPRequest(req, nil))
2536 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2537 }
2538
2539 // Do executes the "policysimulator.folders.locations.accessPolicySimulations.operations.get" call.
2540 // Any non-2xx status code is an error. Response headers are in either
2541 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
2542 // returned at all) in error.(*googleapi.Error).Header. Use
2543 // googleapi.IsNotModified to check whether the returned error was because
2544 // http.StatusNotModified was returned.
2545 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2546 gensupport.SetOptions(c.urlParams_, opts...)
2547 res, err := c.doRequest("json")
2548 if res != nil && res.StatusCode == http.StatusNotModified {
2549 if res.Body != nil {
2550 res.Body.Close()
2551 }
2552 return nil, gensupport.WrapError(&googleapi.Error{
2553 Code: res.StatusCode,
2554 Header: res.Header,
2555 })
2556 }
2557 if err != nil {
2558 return nil, err
2559 }
2560 defer googleapi.CloseBody(res)
2561 if err := googleapi.CheckResponse(res); err != nil {
2562 return nil, gensupport.WrapError(err)
2563 }
2564 ret := &GoogleLongrunningOperation{
2565 ServerResponse: googleapi.ServerResponse{
2566 Header: res.Header,
2567 HTTPStatusCode: res.StatusCode,
2568 },
2569 }
2570 target := &ret
2571 b, err := gensupport.DecodeResponseBytes(target, res)
2572 if err != nil {
2573 return nil, err
2574 }
2575 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.accessPolicySimulations.operations.get", "response", internallog.HTTPResponse(res, b))
2576 return ret, nil
2577 }
2578
2579 type FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
2580 s *Service
2581 name string
2582 urlParams_ gensupport.URLParams
2583 ifNoneMatch_ string
2584 ctx_ context.Context
2585 header_ http.Header
2586 }
2587
2588 // Get: Gets the latest state of a long-running operation. Clients can use this
2589 // method to poll the operation result at intervals as recommended by the API
2590 // service.
2591 //
2592 // - name: The name of the operation resource.
2593 func (r *FoldersLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2594 c := &FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2595 c.name = name
2596 return c
2597 }
2598
2599 // Fields allows partial responses to be retrieved. See
2600 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2601 // details.
2602 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2603 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2604 return c
2605 }
2606
2607 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2608 // object's ETag matches the given value. This is useful for getting updates
2609 // only after the object has changed since the last request.
2610 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2611 c.ifNoneMatch_ = entityTag
2612 return c
2613 }
2614
2615 // Context sets the context to be used in this call's Do method.
2616 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2617 c.ctx_ = ctx
2618 return c
2619 }
2620
2621 // Header returns a http.Header that can be modified by the caller to add
2622 // headers to the request.
2623 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
2624 if c.header_ == nil {
2625 c.header_ = make(http.Header)
2626 }
2627 return c.header_
2628 }
2629
2630 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2631 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2632 if c.ifNoneMatch_ != "" {
2633 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2634 }
2635 c.urlParams_.Set("alt", alt)
2636 c.urlParams_.Set("prettyPrint", "false")
2637 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2638 urls += "?" + c.urlParams_.Encode()
2639 req, err := http.NewRequest("GET", urls, nil)
2640 if err != nil {
2641 return nil, err
2642 }
2643 req.Header = reqHeaders
2644 googleapi.Expand(req.URL, map[string]string{
2645 "name": c.name,
2646 })
2647 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get", "request", internallog.HTTPRequest(req, nil))
2648 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2649 }
2650
2651 // Do executes the "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get" call.
2652 // Any non-2xx status code is an error. Response headers are in either
2653 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
2654 // returned at all) in error.(*googleapi.Error).Header. Use
2655 // googleapi.IsNotModified to check whether the returned error was because
2656 // http.StatusNotModified was returned.
2657 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2658 gensupport.SetOptions(c.urlParams_, opts...)
2659 res, err := c.doRequest("json")
2660 if res != nil && res.StatusCode == http.StatusNotModified {
2661 if res.Body != nil {
2662 res.Body.Close()
2663 }
2664 return nil, gensupport.WrapError(&googleapi.Error{
2665 Code: res.StatusCode,
2666 Header: res.Header,
2667 })
2668 }
2669 if err != nil {
2670 return nil, err
2671 }
2672 defer googleapi.CloseBody(res)
2673 if err := googleapi.CheckResponse(res); err != nil {
2674 return nil, gensupport.WrapError(err)
2675 }
2676 ret := &GoogleLongrunningOperation{
2677 ServerResponse: googleapi.ServerResponse{
2678 Header: res.Header,
2679 HTTPStatusCode: res.StatusCode,
2680 },
2681 }
2682 target := &ret
2683 b, err := gensupport.DecodeResponseBytes(target, res)
2684 if err != nil {
2685 return nil, err
2686 }
2687 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get", "response", internallog.HTTPResponse(res, b))
2688 return ret, nil
2689 }
2690
2691 type FoldersLocationsReplaysCreateCall struct {
2692 s *Service
2693 parent string
2694 googlecloudpolicysimulatorv1replay *GoogleCloudPolicysimulatorV1Replay
2695 urlParams_ gensupport.URLParams
2696 ctx_ context.Context
2697 header_ http.Header
2698 }
2699
2700 // Create: Creates and starts a Replay using the given ReplayConfig.
2701 //
2702 // - parent: The parent resource where this Replay will be created. This
2703 // resource must be a project, folder, or organization with a location.
2704 // Example: `projects/my-example-project/locations/global`.
2705 func (r *FoldersLocationsReplaysService) Create(parent string, googlecloudpolicysimulatorv1replay *GoogleCloudPolicysimulatorV1Replay) *FoldersLocationsReplaysCreateCall {
2706 c := &FoldersLocationsReplaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2707 c.parent = parent
2708 c.googlecloudpolicysimulatorv1replay = googlecloudpolicysimulatorv1replay
2709 return c
2710 }
2711
2712 // Fields allows partial responses to be retrieved. See
2713 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2714 // details.
2715 func (c *FoldersLocationsReplaysCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysCreateCall {
2716 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2717 return c
2718 }
2719
2720 // Context sets the context to be used in this call's Do method.
2721 func (c *FoldersLocationsReplaysCreateCall) Context(ctx context.Context) *FoldersLocationsReplaysCreateCall {
2722 c.ctx_ = ctx
2723 return c
2724 }
2725
2726 // Header returns a http.Header that can be modified by the caller to add
2727 // headers to the request.
2728 func (c *FoldersLocationsReplaysCreateCall) Header() http.Header {
2729 if c.header_ == nil {
2730 c.header_ = make(http.Header)
2731 }
2732 return c.header_
2733 }
2734
2735 func (c *FoldersLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) {
2736 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2737 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1replay)
2738 if err != nil {
2739 return nil, err
2740 }
2741 c.urlParams_.Set("alt", alt)
2742 c.urlParams_.Set("prettyPrint", "false")
2743 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/replays")
2744 urls += "?" + c.urlParams_.Encode()
2745 req, err := http.NewRequest("POST", urls, body)
2746 if err != nil {
2747 return nil, err
2748 }
2749 req.Header = reqHeaders
2750 googleapi.Expand(req.URL, map[string]string{
2751 "parent": c.parent,
2752 })
2753 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2754 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2755 }
2756
2757 // Do executes the "policysimulator.folders.locations.replays.create" call.
2758 // Any non-2xx status code is an error. Response headers are in either
2759 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
2760 // returned at all) in error.(*googleapi.Error).Header. Use
2761 // googleapi.IsNotModified to check whether the returned error was because
2762 // http.StatusNotModified was returned.
2763 func (c *FoldersLocationsReplaysCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2764 gensupport.SetOptions(c.urlParams_, opts...)
2765 res, err := c.doRequest("json")
2766 if res != nil && res.StatusCode == http.StatusNotModified {
2767 if res.Body != nil {
2768 res.Body.Close()
2769 }
2770 return nil, gensupport.WrapError(&googleapi.Error{
2771 Code: res.StatusCode,
2772 Header: res.Header,
2773 })
2774 }
2775 if err != nil {
2776 return nil, err
2777 }
2778 defer googleapi.CloseBody(res)
2779 if err := googleapi.CheckResponse(res); err != nil {
2780 return nil, gensupport.WrapError(err)
2781 }
2782 ret := &GoogleLongrunningOperation{
2783 ServerResponse: googleapi.ServerResponse{
2784 Header: res.Header,
2785 HTTPStatusCode: res.StatusCode,
2786 },
2787 }
2788 target := &ret
2789 b, err := gensupport.DecodeResponseBytes(target, res)
2790 if err != nil {
2791 return nil, err
2792 }
2793 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.create", "response", internallog.HTTPResponse(res, b))
2794 return ret, nil
2795 }
2796
2797 type FoldersLocationsReplaysGetCall struct {
2798 s *Service
2799 name string
2800 urlParams_ gensupport.URLParams
2801 ifNoneMatch_ string
2802 ctx_ context.Context
2803 header_ http.Header
2804 }
2805
2806 // Get: Gets the specified Replay. Each `Replay` is available for at least 7
2807 // days.
2808 //
2809 // - name: The name of the Replay to retrieve, in the following format:
2810 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
2811 // eplay-id}`, where `{resource-id}` is the ID of the project, folder, or
2812 // organization that owns the `Replay`. Example:
2813 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e
2814 // 03-479ce1833c36`.
2815 func (r *FoldersLocationsReplaysService) Get(name string) *FoldersLocationsReplaysGetCall {
2816 c := &FoldersLocationsReplaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2817 c.name = name
2818 return c
2819 }
2820
2821 // Fields allows partial responses to be retrieved. See
2822 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2823 // details.
2824 func (c *FoldersLocationsReplaysGetCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysGetCall {
2825 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2826 return c
2827 }
2828
2829 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2830 // object's ETag matches the given value. This is useful for getting updates
2831 // only after the object has changed since the last request.
2832 func (c *FoldersLocationsReplaysGetCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysGetCall {
2833 c.ifNoneMatch_ = entityTag
2834 return c
2835 }
2836
2837 // Context sets the context to be used in this call's Do method.
2838 func (c *FoldersLocationsReplaysGetCall) Context(ctx context.Context) *FoldersLocationsReplaysGetCall {
2839 c.ctx_ = ctx
2840 return c
2841 }
2842
2843 // Header returns a http.Header that can be modified by the caller to add
2844 // headers to the request.
2845 func (c *FoldersLocationsReplaysGetCall) Header() http.Header {
2846 if c.header_ == nil {
2847 c.header_ = make(http.Header)
2848 }
2849 return c.header_
2850 }
2851
2852 func (c *FoldersLocationsReplaysGetCall) doRequest(alt string) (*http.Response, error) {
2853 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2854 if c.ifNoneMatch_ != "" {
2855 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2856 }
2857 c.urlParams_.Set("alt", alt)
2858 c.urlParams_.Set("prettyPrint", "false")
2859 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2860 urls += "?" + c.urlParams_.Encode()
2861 req, err := http.NewRequest("GET", urls, nil)
2862 if err != nil {
2863 return nil, err
2864 }
2865 req.Header = reqHeaders
2866 googleapi.Expand(req.URL, map[string]string{
2867 "name": c.name,
2868 })
2869 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.get", "request", internallog.HTTPRequest(req, nil))
2870 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2871 }
2872
2873 // Do executes the "policysimulator.folders.locations.replays.get" call.
2874 // Any non-2xx status code is an error. Response headers are in either
2875 // *GoogleCloudPolicysimulatorV1Replay.ServerResponse.Header or (if a response
2876 // was returned at all) in error.(*googleapi.Error).Header. Use
2877 // googleapi.IsNotModified to check whether the returned error was because
2878 // http.StatusNotModified was returned.
2879 func (c *FoldersLocationsReplaysGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1Replay, error) {
2880 gensupport.SetOptions(c.urlParams_, opts...)
2881 res, err := c.doRequest("json")
2882 if res != nil && res.StatusCode == http.StatusNotModified {
2883 if res.Body != nil {
2884 res.Body.Close()
2885 }
2886 return nil, gensupport.WrapError(&googleapi.Error{
2887 Code: res.StatusCode,
2888 Header: res.Header,
2889 })
2890 }
2891 if err != nil {
2892 return nil, err
2893 }
2894 defer googleapi.CloseBody(res)
2895 if err := googleapi.CheckResponse(res); err != nil {
2896 return nil, gensupport.WrapError(err)
2897 }
2898 ret := &GoogleCloudPolicysimulatorV1Replay{
2899 ServerResponse: googleapi.ServerResponse{
2900 Header: res.Header,
2901 HTTPStatusCode: res.StatusCode,
2902 },
2903 }
2904 target := &ret
2905 b, err := gensupport.DecodeResponseBytes(target, res)
2906 if err != nil {
2907 return nil, err
2908 }
2909 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.get", "response", internallog.HTTPResponse(res, b))
2910 return ret, nil
2911 }
2912
2913 type FoldersLocationsReplaysOperationsGetCall struct {
2914 s *Service
2915 name string
2916 urlParams_ gensupport.URLParams
2917 ifNoneMatch_ string
2918 ctx_ context.Context
2919 header_ http.Header
2920 }
2921
2922 // Get: Gets the latest state of a long-running operation. Clients can use this
2923 // method to poll the operation result at intervals as recommended by the API
2924 // service.
2925 //
2926 // - name: The name of the operation resource.
2927 func (r *FoldersLocationsReplaysOperationsService) Get(name string) *FoldersLocationsReplaysOperationsGetCall {
2928 c := &FoldersLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2929 c.name = name
2930 return c
2931 }
2932
2933 // Fields allows partial responses to be retrieved. See
2934 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2935 // details.
2936 func (c *FoldersLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysOperationsGetCall {
2937 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2938 return c
2939 }
2940
2941 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2942 // object's ETag matches the given value. This is useful for getting updates
2943 // only after the object has changed since the last request.
2944 func (c *FoldersLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysOperationsGetCall {
2945 c.ifNoneMatch_ = entityTag
2946 return c
2947 }
2948
2949 // Context sets the context to be used in this call's Do method.
2950 func (c *FoldersLocationsReplaysOperationsGetCall) Context(ctx context.Context) *FoldersLocationsReplaysOperationsGetCall {
2951 c.ctx_ = ctx
2952 return c
2953 }
2954
2955 // Header returns a http.Header that can be modified by the caller to add
2956 // headers to the request.
2957 func (c *FoldersLocationsReplaysOperationsGetCall) Header() http.Header {
2958 if c.header_ == nil {
2959 c.header_ = make(http.Header)
2960 }
2961 return c.header_
2962 }
2963
2964 func (c *FoldersLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2965 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2966 if c.ifNoneMatch_ != "" {
2967 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2968 }
2969 c.urlParams_.Set("alt", alt)
2970 c.urlParams_.Set("prettyPrint", "false")
2971 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
2972 urls += "?" + c.urlParams_.Encode()
2973 req, err := http.NewRequest("GET", urls, nil)
2974 if err != nil {
2975 return nil, err
2976 }
2977 req.Header = reqHeaders
2978 googleapi.Expand(req.URL, map[string]string{
2979 "name": c.name,
2980 })
2981 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.operations.get", "request", internallog.HTTPRequest(req, nil))
2982 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2983 }
2984
2985 // Do executes the "policysimulator.folders.locations.replays.operations.get" call.
2986 // Any non-2xx status code is an error. Response headers are in either
2987 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
2988 // returned at all) in error.(*googleapi.Error).Header. Use
2989 // googleapi.IsNotModified to check whether the returned error was because
2990 // http.StatusNotModified was returned.
2991 func (c *FoldersLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2992 gensupport.SetOptions(c.urlParams_, opts...)
2993 res, err := c.doRequest("json")
2994 if res != nil && res.StatusCode == http.StatusNotModified {
2995 if res.Body != nil {
2996 res.Body.Close()
2997 }
2998 return nil, gensupport.WrapError(&googleapi.Error{
2999 Code: res.StatusCode,
3000 Header: res.Header,
3001 })
3002 }
3003 if err != nil {
3004 return nil, err
3005 }
3006 defer googleapi.CloseBody(res)
3007 if err := googleapi.CheckResponse(res); err != nil {
3008 return nil, gensupport.WrapError(err)
3009 }
3010 ret := &GoogleLongrunningOperation{
3011 ServerResponse: googleapi.ServerResponse{
3012 Header: res.Header,
3013 HTTPStatusCode: res.StatusCode,
3014 },
3015 }
3016 target := &ret
3017 b, err := gensupport.DecodeResponseBytes(target, res)
3018 if err != nil {
3019 return nil, err
3020 }
3021 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.operations.get", "response", internallog.HTTPResponse(res, b))
3022 return ret, nil
3023 }
3024
3025 type FoldersLocationsReplaysOperationsListCall struct {
3026 s *Service
3027 name string
3028 urlParams_ gensupport.URLParams
3029 ifNoneMatch_ string
3030 ctx_ context.Context
3031 header_ http.Header
3032 }
3033
3034 // List: Lists operations that match the specified filter in the request. If
3035 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
3036 //
3037 // - name: The name of the operation's parent resource.
3038 func (r *FoldersLocationsReplaysOperationsService) List(name string) *FoldersLocationsReplaysOperationsListCall {
3039 c := &FoldersLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3040 c.name = name
3041 return c
3042 }
3043
3044 // Filter sets the optional parameter "filter": The standard list filter.
3045 func (c *FoldersLocationsReplaysOperationsListCall) Filter(filter string) *FoldersLocationsReplaysOperationsListCall {
3046 c.urlParams_.Set("filter", filter)
3047 return c
3048 }
3049
3050 // PageSize sets the optional parameter "pageSize": The standard list page
3051 // size.
3052 func (c *FoldersLocationsReplaysOperationsListCall) PageSize(pageSize int64) *FoldersLocationsReplaysOperationsListCall {
3053 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3054 return c
3055 }
3056
3057 // PageToken sets the optional parameter "pageToken": The standard list page
3058 // token.
3059 func (c *FoldersLocationsReplaysOperationsListCall) PageToken(pageToken string) *FoldersLocationsReplaysOperationsListCall {
3060 c.urlParams_.Set("pageToken", pageToken)
3061 return c
3062 }
3063
3064 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
3065 // When set to `true`, operations that are reachable are returned as normal,
3066 // and those that are unreachable are returned in the
3067 // ListOperationsResponse.unreachable field. This can only be `true` when
3068 // reading across collections. For example, when `parent` is set to
3069 // "projects/example/locations/-". This field is not supported by default and
3070 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
3071 // otherwise in service or product specific documentation.
3072 func (c *FoldersLocationsReplaysOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *FoldersLocationsReplaysOperationsListCall {
3073 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
3074 return c
3075 }
3076
3077 // Fields allows partial responses to be retrieved. See
3078 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3079 // details.
3080 func (c *FoldersLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysOperationsListCall {
3081 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3082 return c
3083 }
3084
3085 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3086 // object's ETag matches the given value. This is useful for getting updates
3087 // only after the object has changed since the last request.
3088 func (c *FoldersLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysOperationsListCall {
3089 c.ifNoneMatch_ = entityTag
3090 return c
3091 }
3092
3093 // Context sets the context to be used in this call's Do method.
3094 func (c *FoldersLocationsReplaysOperationsListCall) Context(ctx context.Context) *FoldersLocationsReplaysOperationsListCall {
3095 c.ctx_ = ctx
3096 return c
3097 }
3098
3099 // Header returns a http.Header that can be modified by the caller to add
3100 // headers to the request.
3101 func (c *FoldersLocationsReplaysOperationsListCall) Header() http.Header {
3102 if c.header_ == nil {
3103 c.header_ = make(http.Header)
3104 }
3105 return c.header_
3106 }
3107
3108 func (c *FoldersLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
3109 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3110 if c.ifNoneMatch_ != "" {
3111 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3112 }
3113 c.urlParams_.Set("alt", alt)
3114 c.urlParams_.Set("prettyPrint", "false")
3115 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3116 urls += "?" + c.urlParams_.Encode()
3117 req, err := http.NewRequest("GET", urls, nil)
3118 if err != nil {
3119 return nil, err
3120 }
3121 req.Header = reqHeaders
3122 googleapi.Expand(req.URL, map[string]string{
3123 "name": c.name,
3124 })
3125 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.operations.list", "request", internallog.HTTPRequest(req, nil))
3126 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3127 }
3128
3129 // Do executes the "policysimulator.folders.locations.replays.operations.list" call.
3130 // Any non-2xx status code is an error. Response headers are in either
3131 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
3132 // response was returned at all) in error.(*googleapi.Error).Header. Use
3133 // googleapi.IsNotModified to check whether the returned error was because
3134 // http.StatusNotModified was returned.
3135 func (c *FoldersLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
3136 gensupport.SetOptions(c.urlParams_, opts...)
3137 res, err := c.doRequest("json")
3138 if res != nil && res.StatusCode == http.StatusNotModified {
3139 if res.Body != nil {
3140 res.Body.Close()
3141 }
3142 return nil, gensupport.WrapError(&googleapi.Error{
3143 Code: res.StatusCode,
3144 Header: res.Header,
3145 })
3146 }
3147 if err != nil {
3148 return nil, err
3149 }
3150 defer googleapi.CloseBody(res)
3151 if err := googleapi.CheckResponse(res); err != nil {
3152 return nil, gensupport.WrapError(err)
3153 }
3154 ret := &GoogleLongrunningListOperationsResponse{
3155 ServerResponse: googleapi.ServerResponse{
3156 Header: res.Header,
3157 HTTPStatusCode: res.StatusCode,
3158 },
3159 }
3160 target := &ret
3161 b, err := gensupport.DecodeResponseBytes(target, res)
3162 if err != nil {
3163 return nil, err
3164 }
3165 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.operations.list", "response", internallog.HTTPResponse(res, b))
3166 return ret, nil
3167 }
3168
3169 // Pages invokes f for each page of results.
3170 // A non-nil error returned from f will halt the iteration.
3171 // The provided context supersedes any context provided to the Context method.
3172 func (c *FoldersLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
3173 c.ctx_ = ctx
3174 defer c.PageToken(c.urlParams_.Get("pageToken"))
3175 for {
3176 x, err := c.Do()
3177 if err != nil {
3178 return err
3179 }
3180 if err := f(x); err != nil {
3181 return err
3182 }
3183 if x.NextPageToken == "" {
3184 return nil
3185 }
3186 c.PageToken(x.NextPageToken)
3187 }
3188 }
3189
3190 type FoldersLocationsReplaysResultsListCall struct {
3191 s *Service
3192 parent string
3193 urlParams_ gensupport.URLParams
3194 ifNoneMatch_ string
3195 ctx_ context.Context
3196 header_ http.Header
3197 }
3198
3199 // List: Lists the results of running a Replay.
3200 //
3201 // - parent: The Replay whose results are listed, in the following format:
3202 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
3203 // eplay-id}` Example:
3204 // `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce
3205 // 1833c36`.
3206 func (r *FoldersLocationsReplaysResultsService) List(parent string) *FoldersLocationsReplaysResultsListCall {
3207 c := &FoldersLocationsReplaysResultsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3208 c.parent = parent
3209 return c
3210 }
3211
3212 // PageSize sets the optional parameter "pageSize": The maximum number of
3213 // ReplayResult objects to return. Defaults to 5000. The maximum value is 5000;
3214 // values above 5000 are rounded down to 5000.
3215 func (c *FoldersLocationsReplaysResultsListCall) PageSize(pageSize int64) *FoldersLocationsReplaysResultsListCall {
3216 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3217 return c
3218 }
3219
3220 // PageToken sets the optional parameter "pageToken": A page token, received
3221 // from a previous Simulator.ListReplayResults call. Provide this token to
3222 // retrieve the next page of results. When paginating, all other parameters
3223 // provided to [Simulator.ListReplayResults[] must match the call that provided
3224 // the page token.
3225 func (c *FoldersLocationsReplaysResultsListCall) PageToken(pageToken string) *FoldersLocationsReplaysResultsListCall {
3226 c.urlParams_.Set("pageToken", pageToken)
3227 return c
3228 }
3229
3230 // Fields allows partial responses to be retrieved. See
3231 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3232 // details.
3233 func (c *FoldersLocationsReplaysResultsListCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysResultsListCall {
3234 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3235 return c
3236 }
3237
3238 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3239 // object's ETag matches the given value. This is useful for getting updates
3240 // only after the object has changed since the last request.
3241 func (c *FoldersLocationsReplaysResultsListCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysResultsListCall {
3242 c.ifNoneMatch_ = entityTag
3243 return c
3244 }
3245
3246 // Context sets the context to be used in this call's Do method.
3247 func (c *FoldersLocationsReplaysResultsListCall) Context(ctx context.Context) *FoldersLocationsReplaysResultsListCall {
3248 c.ctx_ = ctx
3249 return c
3250 }
3251
3252 // Header returns a http.Header that can be modified by the caller to add
3253 // headers to the request.
3254 func (c *FoldersLocationsReplaysResultsListCall) Header() http.Header {
3255 if c.header_ == nil {
3256 c.header_ = make(http.Header)
3257 }
3258 return c.header_
3259 }
3260
3261 func (c *FoldersLocationsReplaysResultsListCall) doRequest(alt string) (*http.Response, error) {
3262 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3263 if c.ifNoneMatch_ != "" {
3264 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3265 }
3266 c.urlParams_.Set("alt", alt)
3267 c.urlParams_.Set("prettyPrint", "false")
3268 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/results")
3269 urls += "?" + c.urlParams_.Encode()
3270 req, err := http.NewRequest("GET", urls, nil)
3271 if err != nil {
3272 return nil, err
3273 }
3274 req.Header = reqHeaders
3275 googleapi.Expand(req.URL, map[string]string{
3276 "parent": c.parent,
3277 })
3278 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.results.list", "request", internallog.HTTPRequest(req, nil))
3279 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3280 }
3281
3282 // Do executes the "policysimulator.folders.locations.replays.results.list" call.
3283 // Any non-2xx status code is an error. Response headers are in either
3284 // *GoogleCloudPolicysimulatorV1ListReplayResultsResponse.ServerResponse.Header
3285 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
3286 // Use googleapi.IsNotModified to check whether the returned error was because
3287 // http.StatusNotModified was returned.
3288 func (c *FoldersLocationsReplaysResultsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1ListReplayResultsResponse, error) {
3289 gensupport.SetOptions(c.urlParams_, opts...)
3290 res, err := c.doRequest("json")
3291 if res != nil && res.StatusCode == http.StatusNotModified {
3292 if res.Body != nil {
3293 res.Body.Close()
3294 }
3295 return nil, gensupport.WrapError(&googleapi.Error{
3296 Code: res.StatusCode,
3297 Header: res.Header,
3298 })
3299 }
3300 if err != nil {
3301 return nil, err
3302 }
3303 defer googleapi.CloseBody(res)
3304 if err := googleapi.CheckResponse(res); err != nil {
3305 return nil, gensupport.WrapError(err)
3306 }
3307 ret := &GoogleCloudPolicysimulatorV1ListReplayResultsResponse{
3308 ServerResponse: googleapi.ServerResponse{
3309 Header: res.Header,
3310 HTTPStatusCode: res.StatusCode,
3311 },
3312 }
3313 target := &ret
3314 b, err := gensupport.DecodeResponseBytes(target, res)
3315 if err != nil {
3316 return nil, err
3317 }
3318 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.results.list", "response", internallog.HTTPResponse(res, b))
3319 return ret, nil
3320 }
3321
3322 // Pages invokes f for each page of results.
3323 // A non-nil error returned from f will halt the iteration.
3324 // The provided context supersedes any context provided to the Context method.
3325 func (c *FoldersLocationsReplaysResultsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1ListReplayResultsResponse) error) error {
3326 c.ctx_ = ctx
3327 defer c.PageToken(c.urlParams_.Get("pageToken"))
3328 for {
3329 x, err := c.Do()
3330 if err != nil {
3331 return err
3332 }
3333 if err := f(x); err != nil {
3334 return err
3335 }
3336 if x.NextPageToken == "" {
3337 return nil
3338 }
3339 c.PageToken(x.NextPageToken)
3340 }
3341 }
3342
3343 type OperationsGetCall struct {
3344 s *Service
3345 name string
3346 urlParams_ gensupport.URLParams
3347 ifNoneMatch_ string
3348 ctx_ context.Context
3349 header_ http.Header
3350 }
3351
3352 // Get: Gets the latest state of a long-running operation. Clients can use this
3353 // method to poll the operation result at intervals as recommended by the API
3354 // service.
3355 //
3356 // - name: The name of the operation resource.
3357 func (r *OperationsService) Get(name string) *OperationsGetCall {
3358 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3359 c.name = name
3360 return c
3361 }
3362
3363 // Fields allows partial responses to be retrieved. See
3364 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3365 // details.
3366 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
3367 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3368 return c
3369 }
3370
3371 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3372 // object's ETag matches the given value. This is useful for getting updates
3373 // only after the object has changed since the last request.
3374 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
3375 c.ifNoneMatch_ = entityTag
3376 return c
3377 }
3378
3379 // Context sets the context to be used in this call's Do method.
3380 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
3381 c.ctx_ = ctx
3382 return c
3383 }
3384
3385 // Header returns a http.Header that can be modified by the caller to add
3386 // headers to the request.
3387 func (c *OperationsGetCall) Header() http.Header {
3388 if c.header_ == nil {
3389 c.header_ = make(http.Header)
3390 }
3391 return c.header_
3392 }
3393
3394 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
3395 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3396 if c.ifNoneMatch_ != "" {
3397 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3398 }
3399 c.urlParams_.Set("alt", alt)
3400 c.urlParams_.Set("prettyPrint", "false")
3401 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3402 urls += "?" + c.urlParams_.Encode()
3403 req, err := http.NewRequest("GET", urls, nil)
3404 if err != nil {
3405 return nil, err
3406 }
3407 req.Header = reqHeaders
3408 googleapi.Expand(req.URL, map[string]string{
3409 "name": c.name,
3410 })
3411 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.operations.get", "request", internallog.HTTPRequest(req, nil))
3412 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3413 }
3414
3415 // Do executes the "policysimulator.operations.get" call.
3416 // Any non-2xx status code is an error. Response headers are in either
3417 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
3418 // returned at all) in error.(*googleapi.Error).Header. Use
3419 // googleapi.IsNotModified to check whether the returned error was because
3420 // http.StatusNotModified was returned.
3421 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3422 gensupport.SetOptions(c.urlParams_, opts...)
3423 res, err := c.doRequest("json")
3424 if res != nil && res.StatusCode == http.StatusNotModified {
3425 if res.Body != nil {
3426 res.Body.Close()
3427 }
3428 return nil, gensupport.WrapError(&googleapi.Error{
3429 Code: res.StatusCode,
3430 Header: res.Header,
3431 })
3432 }
3433 if err != nil {
3434 return nil, err
3435 }
3436 defer googleapi.CloseBody(res)
3437 if err := googleapi.CheckResponse(res); err != nil {
3438 return nil, gensupport.WrapError(err)
3439 }
3440 ret := &GoogleLongrunningOperation{
3441 ServerResponse: googleapi.ServerResponse{
3442 Header: res.Header,
3443 HTTPStatusCode: res.StatusCode,
3444 },
3445 }
3446 target := &ret
3447 b, err := gensupport.DecodeResponseBytes(target, res)
3448 if err != nil {
3449 return nil, err
3450 }
3451 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.operations.get", "response", internallog.HTTPResponse(res, b))
3452 return ret, nil
3453 }
3454
3455 type OperationsListCall struct {
3456 s *Service
3457 name string
3458 urlParams_ gensupport.URLParams
3459 ifNoneMatch_ string
3460 ctx_ context.Context
3461 header_ http.Header
3462 }
3463
3464 // List: Lists operations that match the specified filter in the request. If
3465 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
3466 //
3467 // - name: The name of the operation's parent resource.
3468 func (r *OperationsService) List(name string) *OperationsListCall {
3469 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3470 c.name = name
3471 return c
3472 }
3473
3474 // Filter sets the optional parameter "filter": The standard list filter.
3475 func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
3476 c.urlParams_.Set("filter", filter)
3477 return c
3478 }
3479
3480 // PageSize sets the optional parameter "pageSize": The standard list page
3481 // size.
3482 func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
3483 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3484 return c
3485 }
3486
3487 // PageToken sets the optional parameter "pageToken": The standard list page
3488 // token.
3489 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
3490 c.urlParams_.Set("pageToken", pageToken)
3491 return c
3492 }
3493
3494 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
3495 // When set to `true`, operations that are reachable are returned as normal,
3496 // and those that are unreachable are returned in the
3497 // ListOperationsResponse.unreachable field. This can only be `true` when
3498 // reading across collections. For example, when `parent` is set to
3499 // "projects/example/locations/-". This field is not supported by default and
3500 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
3501 // otherwise in service or product specific documentation.
3502 func (c *OperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *OperationsListCall {
3503 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
3504 return c
3505 }
3506
3507 // Fields allows partial responses to be retrieved. See
3508 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3509 // details.
3510 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
3511 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3512 return c
3513 }
3514
3515 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3516 // object's ETag matches the given value. This is useful for getting updates
3517 // only after the object has changed since the last request.
3518 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
3519 c.ifNoneMatch_ = entityTag
3520 return c
3521 }
3522
3523 // Context sets the context to be used in this call's Do method.
3524 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
3525 c.ctx_ = ctx
3526 return c
3527 }
3528
3529 // Header returns a http.Header that can be modified by the caller to add
3530 // headers to the request.
3531 func (c *OperationsListCall) Header() http.Header {
3532 if c.header_ == nil {
3533 c.header_ = make(http.Header)
3534 }
3535 return c.header_
3536 }
3537
3538 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
3539 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3540 if c.ifNoneMatch_ != "" {
3541 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3542 }
3543 c.urlParams_.Set("alt", alt)
3544 c.urlParams_.Set("prettyPrint", "false")
3545 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3546 urls += "?" + c.urlParams_.Encode()
3547 req, err := http.NewRequest("GET", urls, nil)
3548 if err != nil {
3549 return nil, err
3550 }
3551 req.Header = reqHeaders
3552 googleapi.Expand(req.URL, map[string]string{
3553 "name": c.name,
3554 })
3555 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.operations.list", "request", internallog.HTTPRequest(req, nil))
3556 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3557 }
3558
3559 // Do executes the "policysimulator.operations.list" call.
3560 // Any non-2xx status code is an error. Response headers are in either
3561 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
3562 // response was returned at all) in error.(*googleapi.Error).Header. Use
3563 // googleapi.IsNotModified to check whether the returned error was because
3564 // http.StatusNotModified was returned.
3565 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
3566 gensupport.SetOptions(c.urlParams_, opts...)
3567 res, err := c.doRequest("json")
3568 if res != nil && res.StatusCode == http.StatusNotModified {
3569 if res.Body != nil {
3570 res.Body.Close()
3571 }
3572 return nil, gensupport.WrapError(&googleapi.Error{
3573 Code: res.StatusCode,
3574 Header: res.Header,
3575 })
3576 }
3577 if err != nil {
3578 return nil, err
3579 }
3580 defer googleapi.CloseBody(res)
3581 if err := googleapi.CheckResponse(res); err != nil {
3582 return nil, gensupport.WrapError(err)
3583 }
3584 ret := &GoogleLongrunningListOperationsResponse{
3585 ServerResponse: googleapi.ServerResponse{
3586 Header: res.Header,
3587 HTTPStatusCode: res.StatusCode,
3588 },
3589 }
3590 target := &ret
3591 b, err := gensupport.DecodeResponseBytes(target, res)
3592 if err != nil {
3593 return nil, err
3594 }
3595 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.operations.list", "response", internallog.HTTPResponse(res, b))
3596 return ret, nil
3597 }
3598
3599 // Pages invokes f for each page of results.
3600 // A non-nil error returned from f will halt the iteration.
3601 // The provided context supersedes any context provided to the Context method.
3602 func (c *OperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
3603 c.ctx_ = ctx
3604 defer c.PageToken(c.urlParams_.Get("pageToken"))
3605 for {
3606 x, err := c.Do()
3607 if err != nil {
3608 return err
3609 }
3610 if err := f(x); err != nil {
3611 return err
3612 }
3613 if x.NextPageToken == "" {
3614 return nil
3615 }
3616 c.PageToken(x.NextPageToken)
3617 }
3618 }
3619
3620 type OrganizationsLocationsAccessPolicySimulationsOperationsGetCall struct {
3621 s *Service
3622 name string
3623 urlParams_ gensupport.URLParams
3624 ifNoneMatch_ string
3625 ctx_ context.Context
3626 header_ http.Header
3627 }
3628
3629 // Get: Gets the latest state of a long-running operation. Clients can use this
3630 // method to poll the operation result at intervals as recommended by the API
3631 // service.
3632 //
3633 // - name: The name of the operation resource.
3634 func (r *OrganizationsLocationsAccessPolicySimulationsOperationsService) Get(name string) *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall {
3635 c := &OrganizationsLocationsAccessPolicySimulationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3636 c.name = name
3637 return c
3638 }
3639
3640 // Fields allows partial responses to be retrieved. See
3641 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3642 // details.
3643 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall {
3644 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3645 return c
3646 }
3647
3648 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3649 // object's ETag matches the given value. This is useful for getting updates
3650 // only after the object has changed since the last request.
3651 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall {
3652 c.ifNoneMatch_ = entityTag
3653 return c
3654 }
3655
3656 // Context sets the context to be used in this call's Do method.
3657 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall {
3658 c.ctx_ = ctx
3659 return c
3660 }
3661
3662 // Header returns a http.Header that can be modified by the caller to add
3663 // headers to the request.
3664 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) Header() http.Header {
3665 if c.header_ == nil {
3666 c.header_ = make(http.Header)
3667 }
3668 return c.header_
3669 }
3670
3671 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
3672 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3673 if c.ifNoneMatch_ != "" {
3674 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3675 }
3676 c.urlParams_.Set("alt", alt)
3677 c.urlParams_.Set("prettyPrint", "false")
3678 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3679 urls += "?" + c.urlParams_.Encode()
3680 req, err := http.NewRequest("GET", urls, nil)
3681 if err != nil {
3682 return nil, err
3683 }
3684 req.Header = reqHeaders
3685 googleapi.Expand(req.URL, map[string]string{
3686 "name": c.name,
3687 })
3688 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.accessPolicySimulations.operations.get", "request", internallog.HTTPRequest(req, nil))
3689 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3690 }
3691
3692 // Do executes the "policysimulator.organizations.locations.accessPolicySimulations.operations.get" call.
3693 // Any non-2xx status code is an error. Response headers are in either
3694 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
3695 // returned at all) in error.(*googleapi.Error).Header. Use
3696 // googleapi.IsNotModified to check whether the returned error was because
3697 // http.StatusNotModified was returned.
3698 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3699 gensupport.SetOptions(c.urlParams_, opts...)
3700 res, err := c.doRequest("json")
3701 if res != nil && res.StatusCode == http.StatusNotModified {
3702 if res.Body != nil {
3703 res.Body.Close()
3704 }
3705 return nil, gensupport.WrapError(&googleapi.Error{
3706 Code: res.StatusCode,
3707 Header: res.Header,
3708 })
3709 }
3710 if err != nil {
3711 return nil, err
3712 }
3713 defer googleapi.CloseBody(res)
3714 if err := googleapi.CheckResponse(res); err != nil {
3715 return nil, gensupport.WrapError(err)
3716 }
3717 ret := &GoogleLongrunningOperation{
3718 ServerResponse: googleapi.ServerResponse{
3719 Header: res.Header,
3720 HTTPStatusCode: res.StatusCode,
3721 },
3722 }
3723 target := &ret
3724 b, err := gensupport.DecodeResponseBytes(target, res)
3725 if err != nil {
3726 return nil, err
3727 }
3728 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.accessPolicySimulations.operations.get", "response", internallog.HTTPResponse(res, b))
3729 return ret, nil
3730 }
3731
3732 type OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall struct {
3733 s *Service
3734 parent string
3735 googlecloudpolicysimulatorv1orgpolicyviolationspreview *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview
3736 urlParams_ gensupport.URLParams
3737 ctx_ context.Context
3738 header_ http.Header
3739 }
3740
3741 // Create: CreateOrgPolicyViolationsPreview creates an
3742 // OrgPolicyViolationsPreview for the proposed changes in the provided
3743 // OrgPolicyViolationsPreview.OrgPolicyOverlay. The changes to OrgPolicy are
3744 // specified by this `OrgPolicyOverlay`. The resources to scan are inferred
3745 // from these specified changes.
3746 //
3747 // - parent: The organization under which this OrgPolicyViolationsPreview will
3748 // be created. Example: `organizations/my-example-org/locations/global`.
3749 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) Create(parent string, googlecloudpolicysimulatorv1orgpolicyviolationspreview *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall {
3750 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3751 c.parent = parent
3752 c.googlecloudpolicysimulatorv1orgpolicyviolationspreview = googlecloudpolicysimulatorv1orgpolicyviolationspreview
3753 return c
3754 }
3755
3756 // OrgPolicyViolationsPreviewId sets the optional parameter
3757 // "orgPolicyViolationsPreviewId": An optional user-specified ID for the
3758 // OrgPolicyViolationsPreview. If not provided, a random ID will be generated.
3759 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) OrgPolicyViolationsPreviewId(orgPolicyViolationsPreviewId string) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall {
3760 c.urlParams_.Set("orgPolicyViolationsPreviewId", orgPolicyViolationsPreviewId)
3761 return c
3762 }
3763
3764 // Fields allows partial responses to be retrieved. See
3765 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3766 // details.
3767 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall {
3768 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3769 return c
3770 }
3771
3772 // Context sets the context to be used in this call's Do method.
3773 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall {
3774 c.ctx_ = ctx
3775 return c
3776 }
3777
3778 // Header returns a http.Header that can be modified by the caller to add
3779 // headers to the request.
3780 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Header() http.Header {
3781 if c.header_ == nil {
3782 c.header_ = make(http.Header)
3783 }
3784 return c.header_
3785 }
3786
3787 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) doRequest(alt string) (*http.Response, error) {
3788 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3789 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1orgpolicyviolationspreview)
3790 if err != nil {
3791 return nil, err
3792 }
3793 c.urlParams_.Set("alt", alt)
3794 c.urlParams_.Set("prettyPrint", "false")
3795 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/orgPolicyViolationsPreviews")
3796 urls += "?" + c.urlParams_.Encode()
3797 req, err := http.NewRequest("POST", urls, body)
3798 if err != nil {
3799 return nil, err
3800 }
3801 req.Header = reqHeaders
3802 googleapi.Expand(req.URL, map[string]string{
3803 "parent": c.parent,
3804 })
3805 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3806 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3807 }
3808
3809 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.create" call.
3810 // Any non-2xx status code is an error. Response headers are in either
3811 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
3812 // returned at all) in error.(*googleapi.Error).Header. Use
3813 // googleapi.IsNotModified to check whether the returned error was because
3814 // http.StatusNotModified was returned.
3815 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3816 gensupport.SetOptions(c.urlParams_, opts...)
3817 res, err := c.doRequest("json")
3818 if res != nil && res.StatusCode == http.StatusNotModified {
3819 if res.Body != nil {
3820 res.Body.Close()
3821 }
3822 return nil, gensupport.WrapError(&googleapi.Error{
3823 Code: res.StatusCode,
3824 Header: res.Header,
3825 })
3826 }
3827 if err != nil {
3828 return nil, err
3829 }
3830 defer googleapi.CloseBody(res)
3831 if err := googleapi.CheckResponse(res); err != nil {
3832 return nil, gensupport.WrapError(err)
3833 }
3834 ret := &GoogleLongrunningOperation{
3835 ServerResponse: googleapi.ServerResponse{
3836 Header: res.Header,
3837 HTTPStatusCode: res.StatusCode,
3838 },
3839 }
3840 target := &ret
3841 b, err := gensupport.DecodeResponseBytes(target, res)
3842 if err != nil {
3843 return nil, err
3844 }
3845 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.create", "response", internallog.HTTPResponse(res, b))
3846 return ret, nil
3847 }
3848
3849 type OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall struct {
3850 s *Service
3851 name string
3852 urlParams_ gensupport.URLParams
3853 ifNoneMatch_ string
3854 ctx_ context.Context
3855 header_ http.Header
3856 }
3857
3858 // Get: GetOrgPolicyViolationsPreview gets the specified
3859 // OrgPolicyViolationsPreview. Each OrgPolicyViolationsPreview is available for
3860 // at least 7 days.
3861 //
3862 // - name: The name of the OrgPolicyViolationsPreview to get.
3863 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) Get(name string) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall {
3864 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3865 c.name = name
3866 return c
3867 }
3868
3869 // Fields allows partial responses to be retrieved. See
3870 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3871 // details.
3872 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall {
3873 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3874 return c
3875 }
3876
3877 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3878 // object's ETag matches the given value. This is useful for getting updates
3879 // only after the object has changed since the last request.
3880 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall {
3881 c.ifNoneMatch_ = entityTag
3882 return c
3883 }
3884
3885 // Context sets the context to be used in this call's Do method.
3886 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall {
3887 c.ctx_ = ctx
3888 return c
3889 }
3890
3891 // Header returns a http.Header that can be modified by the caller to add
3892 // headers to the request.
3893 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Header() http.Header {
3894 if c.header_ == nil {
3895 c.header_ = make(http.Header)
3896 }
3897 return c.header_
3898 }
3899
3900 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) doRequest(alt string) (*http.Response, error) {
3901 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3902 if c.ifNoneMatch_ != "" {
3903 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3904 }
3905 c.urlParams_.Set("alt", alt)
3906 c.urlParams_.Set("prettyPrint", "false")
3907 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
3908 urls += "?" + c.urlParams_.Encode()
3909 req, err := http.NewRequest("GET", urls, nil)
3910 if err != nil {
3911 return nil, err
3912 }
3913 req.Header = reqHeaders
3914 googleapi.Expand(req.URL, map[string]string{
3915 "name": c.name,
3916 })
3917 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.get", "request", internallog.HTTPRequest(req, nil))
3918 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3919 }
3920
3921 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.get" call.
3922 // Any non-2xx status code is an error. Response headers are in either
3923 // *GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview.ServerResponse.Header
3924 //
3925 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
3926 //
3927 // Use googleapi.IsNotModified to check whether the returned error was because
3928 // http.StatusNotModified was returned.
3929 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview, error) {
3930 gensupport.SetOptions(c.urlParams_, opts...)
3931 res, err := c.doRequest("json")
3932 if res != nil && res.StatusCode == http.StatusNotModified {
3933 if res.Body != nil {
3934 res.Body.Close()
3935 }
3936 return nil, gensupport.WrapError(&googleapi.Error{
3937 Code: res.StatusCode,
3938 Header: res.Header,
3939 })
3940 }
3941 if err != nil {
3942 return nil, err
3943 }
3944 defer googleapi.CloseBody(res)
3945 if err := googleapi.CheckResponse(res); err != nil {
3946 return nil, gensupport.WrapError(err)
3947 }
3948 ret := &GoogleCloudPolicysimulatorV1OrgPolicyViolationsPreview{
3949 ServerResponse: googleapi.ServerResponse{
3950 Header: res.Header,
3951 HTTPStatusCode: res.StatusCode,
3952 },
3953 }
3954 target := &ret
3955 b, err := gensupport.DecodeResponseBytes(target, res)
3956 if err != nil {
3957 return nil, err
3958 }
3959 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.get", "response", internallog.HTTPResponse(res, b))
3960 return ret, nil
3961 }
3962
3963 type OrganizationsLocationsOrgPolicyViolationsPreviewsListCall struct {
3964 s *Service
3965 parent string
3966 urlParams_ gensupport.URLParams
3967 ifNoneMatch_ string
3968 ctx_ context.Context
3969 header_ http.Header
3970 }
3971
3972 // List: ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview
3973 // in an organization. Each OrgPolicyViolationsPreview is available for at
3974 // least 7 days.
3975 //
3976 // - parent: The parent the violations are scoped to. Format:
3977 // `organizations/{organization}/locations/{location}` Example:
3978 // `organizations/my-example-org/locations/global`.
3979 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) List(parent string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
3980 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3981 c.parent = parent
3982 return c
3983 }
3984
3985 // PageSize sets the optional parameter "pageSize": The maximum number of items
3986 // to return. The service may return fewer than this value. If unspecified, at
3987 // most 5 items will be returned. The maximum value is 10; values above 10 will
3988 // be coerced to 10.
3989 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) PageSize(pageSize int64) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
3990 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3991 return c
3992 }
3993
3994 // PageToken sets the optional parameter "pageToken": A page token, received
3995 // from a previous call. Provide this to retrieve the subsequent page. When
3996 // paginating, all other parameters must match the call that provided the page
3997 // token.
3998 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) PageToken(pageToken string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
3999 c.urlParams_.Set("pageToken", pageToken)
4000 return c
4001 }
4002
4003 // Fields allows partial responses to be retrieved. See
4004 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4005 // details.
4006 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4007 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4008 return c
4009 }
4010
4011 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4012 // object's ETag matches the given value. This is useful for getting updates
4013 // only after the object has changed since the last request.
4014 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4015 c.ifNoneMatch_ = entityTag
4016 return c
4017 }
4018
4019 // Context sets the context to be used in this call's Do method.
4020 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4021 c.ctx_ = ctx
4022 return c
4023 }
4024
4025 // Header returns a http.Header that can be modified by the caller to add
4026 // headers to the request.
4027 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Header() http.Header {
4028 if c.header_ == nil {
4029 c.header_ = make(http.Header)
4030 }
4031 return c.header_
4032 }
4033
4034 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) doRequest(alt string) (*http.Response, error) {
4035 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4036 if c.ifNoneMatch_ != "" {
4037 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4038 }
4039 c.urlParams_.Set("alt", alt)
4040 c.urlParams_.Set("prettyPrint", "false")
4041 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/orgPolicyViolationsPreviews")
4042 urls += "?" + c.urlParams_.Encode()
4043 req, err := http.NewRequest("GET", urls, nil)
4044 if err != nil {
4045 return nil, err
4046 }
4047 req.Header = reqHeaders
4048 googleapi.Expand(req.URL, map[string]string{
4049 "parent": c.parent,
4050 })
4051 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.list", "request", internallog.HTTPRequest(req, nil))
4052 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4053 }
4054
4055 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.list" call.
4056 // Any non-2xx status code is an error. Response headers are in either
4057 // *GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse.ServerRe
4058 // sponse.Header or (if a response was returned at all) in
4059 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4060 // whether the returned error was because http.StatusNotModified was returned.
4061 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse, error) {
4062 gensupport.SetOptions(c.urlParams_, opts...)
4063 res, err := c.doRequest("json")
4064 if res != nil && res.StatusCode == http.StatusNotModified {
4065 if res.Body != nil {
4066 res.Body.Close()
4067 }
4068 return nil, gensupport.WrapError(&googleapi.Error{
4069 Code: res.StatusCode,
4070 Header: res.Header,
4071 })
4072 }
4073 if err != nil {
4074 return nil, err
4075 }
4076 defer googleapi.CloseBody(res)
4077 if err := googleapi.CheckResponse(res); err != nil {
4078 return nil, gensupport.WrapError(err)
4079 }
4080 ret := &GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse{
4081 ServerResponse: googleapi.ServerResponse{
4082 Header: res.Header,
4083 HTTPStatusCode: res.StatusCode,
4084 },
4085 }
4086 target := &ret
4087 b, err := gensupport.DecodeResponseBytes(target, res)
4088 if err != nil {
4089 return nil, err
4090 }
4091 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.list", "response", internallog.HTTPResponse(res, b))
4092 return ret, nil
4093 }
4094
4095 // Pages invokes f for each page of results.
4096 // A non-nil error returned from f will halt the iteration.
4097 // The provided context supersedes any context provided to the Context method.
4098 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsPreviewsResponse) error) error {
4099 c.ctx_ = ctx
4100 defer c.PageToken(c.urlParams_.Get("pageToken"))
4101 for {
4102 x, err := c.Do()
4103 if err != nil {
4104 return err
4105 }
4106 if err := f(x); err != nil {
4107 return err
4108 }
4109 if x.NextPageToken == "" {
4110 return nil
4111 }
4112 c.PageToken(x.NextPageToken)
4113 }
4114 }
4115
4116 type OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
4117 s *Service
4118 name string
4119 urlParams_ gensupport.URLParams
4120 ifNoneMatch_ string
4121 ctx_ context.Context
4122 header_ http.Header
4123 }
4124
4125 // Get: Gets the latest state of a long-running operation. Clients can use this
4126 // method to poll the operation result at intervals as recommended by the API
4127 // service.
4128 //
4129 // - name: The name of the operation resource.
4130 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
4131 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4132 c.name = name
4133 return c
4134 }
4135
4136 // Fields allows partial responses to be retrieved. See
4137 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4138 // details.
4139 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
4140 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4141 return c
4142 }
4143
4144 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4145 // object's ETag matches the given value. This is useful for getting updates
4146 // only after the object has changed since the last request.
4147 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
4148 c.ifNoneMatch_ = entityTag
4149 return c
4150 }
4151
4152 // Context sets the context to be used in this call's Do method.
4153 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
4154 c.ctx_ = ctx
4155 return c
4156 }
4157
4158 // Header returns a http.Header that can be modified by the caller to add
4159 // headers to the request.
4160 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
4161 if c.header_ == nil {
4162 c.header_ = make(http.Header)
4163 }
4164 return c.header_
4165 }
4166
4167 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
4168 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4169 if c.ifNoneMatch_ != "" {
4170 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4171 }
4172 c.urlParams_.Set("alt", alt)
4173 c.urlParams_.Set("prettyPrint", "false")
4174 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4175 urls += "?" + c.urlParams_.Encode()
4176 req, err := http.NewRequest("GET", urls, nil)
4177 if err != nil {
4178 return nil, err
4179 }
4180 req.Header = reqHeaders
4181 googleapi.Expand(req.URL, map[string]string{
4182 "name": c.name,
4183 })
4184 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get", "request", internallog.HTTPRequest(req, nil))
4185 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4186 }
4187
4188 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get" call.
4189 // Any non-2xx status code is an error. Response headers are in either
4190 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
4191 // returned at all) in error.(*googleapi.Error).Header. Use
4192 // googleapi.IsNotModified to check whether the returned error was because
4193 // http.StatusNotModified was returned.
4194 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
4195 gensupport.SetOptions(c.urlParams_, opts...)
4196 res, err := c.doRequest("json")
4197 if res != nil && res.StatusCode == http.StatusNotModified {
4198 if res.Body != nil {
4199 res.Body.Close()
4200 }
4201 return nil, gensupport.WrapError(&googleapi.Error{
4202 Code: res.StatusCode,
4203 Header: res.Header,
4204 })
4205 }
4206 if err != nil {
4207 return nil, err
4208 }
4209 defer googleapi.CloseBody(res)
4210 if err := googleapi.CheckResponse(res); err != nil {
4211 return nil, gensupport.WrapError(err)
4212 }
4213 ret := &GoogleLongrunningOperation{
4214 ServerResponse: googleapi.ServerResponse{
4215 Header: res.Header,
4216 HTTPStatusCode: res.StatusCode,
4217 },
4218 }
4219 target := &ret
4220 b, err := gensupport.DecodeResponseBytes(target, res)
4221 if err != nil {
4222 return nil, err
4223 }
4224 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get", "response", internallog.HTTPResponse(res, b))
4225 return ret, nil
4226 }
4227
4228 type OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall struct {
4229 s *Service
4230 parent string
4231 urlParams_ gensupport.URLParams
4232 ifNoneMatch_ string
4233 ctx_ context.Context
4234 header_ http.Header
4235 }
4236
4237 // List: ListOrgPolicyViolations lists the OrgPolicyViolations that are present
4238 // in an OrgPolicyViolationsPreview.
4239 //
4240 // - parent: The OrgPolicyViolationsPreview to get OrgPolicyViolations from.
4241 // Format:
4242 // organizations/{organization}/locations/{location}/orgPolicyViolationsPrevie
4243 // ws/{orgPolicyViolationsPreview}.
4244 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService) List(parent string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4245 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4246 c.parent = parent
4247 return c
4248 }
4249
4250 // PageSize sets the optional parameter "pageSize": The maximum number of items
4251 // to return. The service may return fewer than this value. If unspecified, at
4252 // most 1000 items will be returned. The maximum value is 1000; values above
4253 // 1000 will be coerced to 1000.
4254 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4255 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4256 return c
4257 }
4258
4259 // PageToken sets the optional parameter "pageToken": A page token, received
4260 // from a previous call. Provide this to retrieve the subsequent page. When
4261 // paginating, all other parameters must match the call that provided the page
4262 // token.
4263 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) PageToken(pageToken string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4264 c.urlParams_.Set("pageToken", pageToken)
4265 return c
4266 }
4267
4268 // Fields allows partial responses to be retrieved. See
4269 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4270 // details.
4271 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4272 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4273 return c
4274 }
4275
4276 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4277 // object's ETag matches the given value. This is useful for getting updates
4278 // only after the object has changed since the last request.
4279 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4280 c.ifNoneMatch_ = entityTag
4281 return c
4282 }
4283
4284 // Context sets the context to be used in this call's Do method.
4285 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4286 c.ctx_ = ctx
4287 return c
4288 }
4289
4290 // Header returns a http.Header that can be modified by the caller to add
4291 // headers to the request.
4292 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Header() http.Header {
4293 if c.header_ == nil {
4294 c.header_ = make(http.Header)
4295 }
4296 return c.header_
4297 }
4298
4299 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) doRequest(alt string) (*http.Response, error) {
4300 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4301 if c.ifNoneMatch_ != "" {
4302 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4303 }
4304 c.urlParams_.Set("alt", alt)
4305 c.urlParams_.Set("prettyPrint", "false")
4306 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/orgPolicyViolations")
4307 urls += "?" + c.urlParams_.Encode()
4308 req, err := http.NewRequest("GET", urls, nil)
4309 if err != nil {
4310 return nil, err
4311 }
4312 req.Header = reqHeaders
4313 googleapi.Expand(req.URL, map[string]string{
4314 "parent": c.parent,
4315 })
4316 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.orgPolicyViolations.list", "request", internallog.HTTPRequest(req, nil))
4317 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4318 }
4319
4320 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.orgPolicyViolations.list" call.
4321 // Any non-2xx status code is an error. Response headers are in either
4322 // *GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse.ServerResponse.H
4323 // eader or (if a response was returned at all) in
4324 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4325 // whether the returned error was because http.StatusNotModified was returned.
4326 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse, error) {
4327 gensupport.SetOptions(c.urlParams_, opts...)
4328 res, err := c.doRequest("json")
4329 if res != nil && res.StatusCode == http.StatusNotModified {
4330 if res.Body != nil {
4331 res.Body.Close()
4332 }
4333 return nil, gensupport.WrapError(&googleapi.Error{
4334 Code: res.StatusCode,
4335 Header: res.Header,
4336 })
4337 }
4338 if err != nil {
4339 return nil, err
4340 }
4341 defer googleapi.CloseBody(res)
4342 if err := googleapi.CheckResponse(res); err != nil {
4343 return nil, gensupport.WrapError(err)
4344 }
4345 ret := &GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse{
4346 ServerResponse: googleapi.ServerResponse{
4347 Header: res.Header,
4348 HTTPStatusCode: res.StatusCode,
4349 },
4350 }
4351 target := &ret
4352 b, err := gensupport.DecodeResponseBytes(target, res)
4353 if err != nil {
4354 return nil, err
4355 }
4356 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.orgPolicyViolations.list", "response", internallog.HTTPResponse(res, b))
4357 return ret, nil
4358 }
4359
4360 // Pages invokes f for each page of results.
4361 // A non-nil error returned from f will halt the iteration.
4362 // The provided context supersedes any context provided to the Context method.
4363 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1ListOrgPolicyViolationsResponse) error) error {
4364 c.ctx_ = ctx
4365 defer c.PageToken(c.urlParams_.Get("pageToken"))
4366 for {
4367 x, err := c.Do()
4368 if err != nil {
4369 return err
4370 }
4371 if err := f(x); err != nil {
4372 return err
4373 }
4374 if x.NextPageToken == "" {
4375 return nil
4376 }
4377 c.PageToken(x.NextPageToken)
4378 }
4379 }
4380
4381 type OrganizationsLocationsReplaysCreateCall struct {
4382 s *Service
4383 parent string
4384 googlecloudpolicysimulatorv1replay *GoogleCloudPolicysimulatorV1Replay
4385 urlParams_ gensupport.URLParams
4386 ctx_ context.Context
4387 header_ http.Header
4388 }
4389
4390 // Create: Creates and starts a Replay using the given ReplayConfig.
4391 //
4392 // - parent: The parent resource where this Replay will be created. This
4393 // resource must be a project, folder, or organization with a location.
4394 // Example: `projects/my-example-project/locations/global`.
4395 func (r *OrganizationsLocationsReplaysService) Create(parent string, googlecloudpolicysimulatorv1replay *GoogleCloudPolicysimulatorV1Replay) *OrganizationsLocationsReplaysCreateCall {
4396 c := &OrganizationsLocationsReplaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4397 c.parent = parent
4398 c.googlecloudpolicysimulatorv1replay = googlecloudpolicysimulatorv1replay
4399 return c
4400 }
4401
4402 // Fields allows partial responses to be retrieved. See
4403 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4404 // details.
4405 func (c *OrganizationsLocationsReplaysCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysCreateCall {
4406 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4407 return c
4408 }
4409
4410 // Context sets the context to be used in this call's Do method.
4411 func (c *OrganizationsLocationsReplaysCreateCall) Context(ctx context.Context) *OrganizationsLocationsReplaysCreateCall {
4412 c.ctx_ = ctx
4413 return c
4414 }
4415
4416 // Header returns a http.Header that can be modified by the caller to add
4417 // headers to the request.
4418 func (c *OrganizationsLocationsReplaysCreateCall) Header() http.Header {
4419 if c.header_ == nil {
4420 c.header_ = make(http.Header)
4421 }
4422 return c.header_
4423 }
4424
4425 func (c *OrganizationsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) {
4426 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4427 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1replay)
4428 if err != nil {
4429 return nil, err
4430 }
4431 c.urlParams_.Set("alt", alt)
4432 c.urlParams_.Set("prettyPrint", "false")
4433 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/replays")
4434 urls += "?" + c.urlParams_.Encode()
4435 req, err := http.NewRequest("POST", urls, body)
4436 if err != nil {
4437 return nil, err
4438 }
4439 req.Header = reqHeaders
4440 googleapi.Expand(req.URL, map[string]string{
4441 "parent": c.parent,
4442 })
4443 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.create", "request", internallog.HTTPRequest(req, body.Bytes()))
4444 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4445 }
4446
4447 // Do executes the "policysimulator.organizations.locations.replays.create" call.
4448 // Any non-2xx status code is an error. Response headers are in either
4449 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
4450 // returned at all) in error.(*googleapi.Error).Header. Use
4451 // googleapi.IsNotModified to check whether the returned error was because
4452 // http.StatusNotModified was returned.
4453 func (c *OrganizationsLocationsReplaysCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
4454 gensupport.SetOptions(c.urlParams_, opts...)
4455 res, err := c.doRequest("json")
4456 if res != nil && res.StatusCode == http.StatusNotModified {
4457 if res.Body != nil {
4458 res.Body.Close()
4459 }
4460 return nil, gensupport.WrapError(&googleapi.Error{
4461 Code: res.StatusCode,
4462 Header: res.Header,
4463 })
4464 }
4465 if err != nil {
4466 return nil, err
4467 }
4468 defer googleapi.CloseBody(res)
4469 if err := googleapi.CheckResponse(res); err != nil {
4470 return nil, gensupport.WrapError(err)
4471 }
4472 ret := &GoogleLongrunningOperation{
4473 ServerResponse: googleapi.ServerResponse{
4474 Header: res.Header,
4475 HTTPStatusCode: res.StatusCode,
4476 },
4477 }
4478 target := &ret
4479 b, err := gensupport.DecodeResponseBytes(target, res)
4480 if err != nil {
4481 return nil, err
4482 }
4483 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.create", "response", internallog.HTTPResponse(res, b))
4484 return ret, nil
4485 }
4486
4487 type OrganizationsLocationsReplaysGetCall struct {
4488 s *Service
4489 name string
4490 urlParams_ gensupport.URLParams
4491 ifNoneMatch_ string
4492 ctx_ context.Context
4493 header_ http.Header
4494 }
4495
4496 // Get: Gets the specified Replay. Each `Replay` is available for at least 7
4497 // days.
4498 //
4499 // - name: The name of the Replay to retrieve, in the following format:
4500 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
4501 // eplay-id}`, where `{resource-id}` is the ID of the project, folder, or
4502 // organization that owns the `Replay`. Example:
4503 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e
4504 // 03-479ce1833c36`.
4505 func (r *OrganizationsLocationsReplaysService) Get(name string) *OrganizationsLocationsReplaysGetCall {
4506 c := &OrganizationsLocationsReplaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4507 c.name = name
4508 return c
4509 }
4510
4511 // Fields allows partial responses to be retrieved. See
4512 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4513 // details.
4514 func (c *OrganizationsLocationsReplaysGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysGetCall {
4515 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4516 return c
4517 }
4518
4519 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4520 // object's ETag matches the given value. This is useful for getting updates
4521 // only after the object has changed since the last request.
4522 func (c *OrganizationsLocationsReplaysGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysGetCall {
4523 c.ifNoneMatch_ = entityTag
4524 return c
4525 }
4526
4527 // Context sets the context to be used in this call's Do method.
4528 func (c *OrganizationsLocationsReplaysGetCall) Context(ctx context.Context) *OrganizationsLocationsReplaysGetCall {
4529 c.ctx_ = ctx
4530 return c
4531 }
4532
4533 // Header returns a http.Header that can be modified by the caller to add
4534 // headers to the request.
4535 func (c *OrganizationsLocationsReplaysGetCall) Header() http.Header {
4536 if c.header_ == nil {
4537 c.header_ = make(http.Header)
4538 }
4539 return c.header_
4540 }
4541
4542 func (c *OrganizationsLocationsReplaysGetCall) doRequest(alt string) (*http.Response, error) {
4543 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4544 if c.ifNoneMatch_ != "" {
4545 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4546 }
4547 c.urlParams_.Set("alt", alt)
4548 c.urlParams_.Set("prettyPrint", "false")
4549 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4550 urls += "?" + c.urlParams_.Encode()
4551 req, err := http.NewRequest("GET", urls, nil)
4552 if err != nil {
4553 return nil, err
4554 }
4555 req.Header = reqHeaders
4556 googleapi.Expand(req.URL, map[string]string{
4557 "name": c.name,
4558 })
4559 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.get", "request", internallog.HTTPRequest(req, nil))
4560 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4561 }
4562
4563 // Do executes the "policysimulator.organizations.locations.replays.get" call.
4564 // Any non-2xx status code is an error. Response headers are in either
4565 // *GoogleCloudPolicysimulatorV1Replay.ServerResponse.Header or (if a response
4566 // was returned at all) in error.(*googleapi.Error).Header. Use
4567 // googleapi.IsNotModified to check whether the returned error was because
4568 // http.StatusNotModified was returned.
4569 func (c *OrganizationsLocationsReplaysGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1Replay, error) {
4570 gensupport.SetOptions(c.urlParams_, opts...)
4571 res, err := c.doRequest("json")
4572 if res != nil && res.StatusCode == http.StatusNotModified {
4573 if res.Body != nil {
4574 res.Body.Close()
4575 }
4576 return nil, gensupport.WrapError(&googleapi.Error{
4577 Code: res.StatusCode,
4578 Header: res.Header,
4579 })
4580 }
4581 if err != nil {
4582 return nil, err
4583 }
4584 defer googleapi.CloseBody(res)
4585 if err := googleapi.CheckResponse(res); err != nil {
4586 return nil, gensupport.WrapError(err)
4587 }
4588 ret := &GoogleCloudPolicysimulatorV1Replay{
4589 ServerResponse: googleapi.ServerResponse{
4590 Header: res.Header,
4591 HTTPStatusCode: res.StatusCode,
4592 },
4593 }
4594 target := &ret
4595 b, err := gensupport.DecodeResponseBytes(target, res)
4596 if err != nil {
4597 return nil, err
4598 }
4599 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.get", "response", internallog.HTTPResponse(res, b))
4600 return ret, nil
4601 }
4602
4603 type OrganizationsLocationsReplaysOperationsGetCall struct {
4604 s *Service
4605 name string
4606 urlParams_ gensupport.URLParams
4607 ifNoneMatch_ string
4608 ctx_ context.Context
4609 header_ http.Header
4610 }
4611
4612 // Get: Gets the latest state of a long-running operation. Clients can use this
4613 // method to poll the operation result at intervals as recommended by the API
4614 // service.
4615 //
4616 // - name: The name of the operation resource.
4617 func (r *OrganizationsLocationsReplaysOperationsService) Get(name string) *OrganizationsLocationsReplaysOperationsGetCall {
4618 c := &OrganizationsLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4619 c.name = name
4620 return c
4621 }
4622
4623 // Fields allows partial responses to be retrieved. See
4624 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4625 // details.
4626 func (c *OrganizationsLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysOperationsGetCall {
4627 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4628 return c
4629 }
4630
4631 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4632 // object's ETag matches the given value. This is useful for getting updates
4633 // only after the object has changed since the last request.
4634 func (c *OrganizationsLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysOperationsGetCall {
4635 c.ifNoneMatch_ = entityTag
4636 return c
4637 }
4638
4639 // Context sets the context to be used in this call's Do method.
4640 func (c *OrganizationsLocationsReplaysOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsReplaysOperationsGetCall {
4641 c.ctx_ = ctx
4642 return c
4643 }
4644
4645 // Header returns a http.Header that can be modified by the caller to add
4646 // headers to the request.
4647 func (c *OrganizationsLocationsReplaysOperationsGetCall) Header() http.Header {
4648 if c.header_ == nil {
4649 c.header_ = make(http.Header)
4650 }
4651 return c.header_
4652 }
4653
4654 func (c *OrganizationsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
4655 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4656 if c.ifNoneMatch_ != "" {
4657 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4658 }
4659 c.urlParams_.Set("alt", alt)
4660 c.urlParams_.Set("prettyPrint", "false")
4661 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4662 urls += "?" + c.urlParams_.Encode()
4663 req, err := http.NewRequest("GET", urls, nil)
4664 if err != nil {
4665 return nil, err
4666 }
4667 req.Header = reqHeaders
4668 googleapi.Expand(req.URL, map[string]string{
4669 "name": c.name,
4670 })
4671 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.operations.get", "request", internallog.HTTPRequest(req, nil))
4672 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4673 }
4674
4675 // Do executes the "policysimulator.organizations.locations.replays.operations.get" call.
4676 // Any non-2xx status code is an error. Response headers are in either
4677 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
4678 // returned at all) in error.(*googleapi.Error).Header. Use
4679 // googleapi.IsNotModified to check whether the returned error was because
4680 // http.StatusNotModified was returned.
4681 func (c *OrganizationsLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
4682 gensupport.SetOptions(c.urlParams_, opts...)
4683 res, err := c.doRequest("json")
4684 if res != nil && res.StatusCode == http.StatusNotModified {
4685 if res.Body != nil {
4686 res.Body.Close()
4687 }
4688 return nil, gensupport.WrapError(&googleapi.Error{
4689 Code: res.StatusCode,
4690 Header: res.Header,
4691 })
4692 }
4693 if err != nil {
4694 return nil, err
4695 }
4696 defer googleapi.CloseBody(res)
4697 if err := googleapi.CheckResponse(res); err != nil {
4698 return nil, gensupport.WrapError(err)
4699 }
4700 ret := &GoogleLongrunningOperation{
4701 ServerResponse: googleapi.ServerResponse{
4702 Header: res.Header,
4703 HTTPStatusCode: res.StatusCode,
4704 },
4705 }
4706 target := &ret
4707 b, err := gensupport.DecodeResponseBytes(target, res)
4708 if err != nil {
4709 return nil, err
4710 }
4711 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.operations.get", "response", internallog.HTTPResponse(res, b))
4712 return ret, nil
4713 }
4714
4715 type OrganizationsLocationsReplaysOperationsListCall struct {
4716 s *Service
4717 name string
4718 urlParams_ gensupport.URLParams
4719 ifNoneMatch_ string
4720 ctx_ context.Context
4721 header_ http.Header
4722 }
4723
4724 // List: Lists operations that match the specified filter in the request. If
4725 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
4726 //
4727 // - name: The name of the operation's parent resource.
4728 func (r *OrganizationsLocationsReplaysOperationsService) List(name string) *OrganizationsLocationsReplaysOperationsListCall {
4729 c := &OrganizationsLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4730 c.name = name
4731 return c
4732 }
4733
4734 // Filter sets the optional parameter "filter": The standard list filter.
4735 func (c *OrganizationsLocationsReplaysOperationsListCall) Filter(filter string) *OrganizationsLocationsReplaysOperationsListCall {
4736 c.urlParams_.Set("filter", filter)
4737 return c
4738 }
4739
4740 // PageSize sets the optional parameter "pageSize": The standard list page
4741 // size.
4742 func (c *OrganizationsLocationsReplaysOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsReplaysOperationsListCall {
4743 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4744 return c
4745 }
4746
4747 // PageToken sets the optional parameter "pageToken": The standard list page
4748 // token.
4749 func (c *OrganizationsLocationsReplaysOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsReplaysOperationsListCall {
4750 c.urlParams_.Set("pageToken", pageToken)
4751 return c
4752 }
4753
4754 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
4755 // When set to `true`, operations that are reachable are returned as normal,
4756 // and those that are unreachable are returned in the
4757 // ListOperationsResponse.unreachable field. This can only be `true` when
4758 // reading across collections. For example, when `parent` is set to
4759 // "projects/example/locations/-". This field is not supported by default and
4760 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
4761 // otherwise in service or product specific documentation.
4762 func (c *OrganizationsLocationsReplaysOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *OrganizationsLocationsReplaysOperationsListCall {
4763 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
4764 return c
4765 }
4766
4767 // Fields allows partial responses to be retrieved. See
4768 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4769 // details.
4770 func (c *OrganizationsLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysOperationsListCall {
4771 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4772 return c
4773 }
4774
4775 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4776 // object's ETag matches the given value. This is useful for getting updates
4777 // only after the object has changed since the last request.
4778 func (c *OrganizationsLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysOperationsListCall {
4779 c.ifNoneMatch_ = entityTag
4780 return c
4781 }
4782
4783 // Context sets the context to be used in this call's Do method.
4784 func (c *OrganizationsLocationsReplaysOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsReplaysOperationsListCall {
4785 c.ctx_ = ctx
4786 return c
4787 }
4788
4789 // Header returns a http.Header that can be modified by the caller to add
4790 // headers to the request.
4791 func (c *OrganizationsLocationsReplaysOperationsListCall) Header() http.Header {
4792 if c.header_ == nil {
4793 c.header_ = make(http.Header)
4794 }
4795 return c.header_
4796 }
4797
4798 func (c *OrganizationsLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
4799 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4800 if c.ifNoneMatch_ != "" {
4801 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4802 }
4803 c.urlParams_.Set("alt", alt)
4804 c.urlParams_.Set("prettyPrint", "false")
4805 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
4806 urls += "?" + c.urlParams_.Encode()
4807 req, err := http.NewRequest("GET", urls, nil)
4808 if err != nil {
4809 return nil, err
4810 }
4811 req.Header = reqHeaders
4812 googleapi.Expand(req.URL, map[string]string{
4813 "name": c.name,
4814 })
4815 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.operations.list", "request", internallog.HTTPRequest(req, nil))
4816 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4817 }
4818
4819 // Do executes the "policysimulator.organizations.locations.replays.operations.list" call.
4820 // Any non-2xx status code is an error. Response headers are in either
4821 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
4822 // response was returned at all) in error.(*googleapi.Error).Header. Use
4823 // googleapi.IsNotModified to check whether the returned error was because
4824 // http.StatusNotModified was returned.
4825 func (c *OrganizationsLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
4826 gensupport.SetOptions(c.urlParams_, opts...)
4827 res, err := c.doRequest("json")
4828 if res != nil && res.StatusCode == http.StatusNotModified {
4829 if res.Body != nil {
4830 res.Body.Close()
4831 }
4832 return nil, gensupport.WrapError(&googleapi.Error{
4833 Code: res.StatusCode,
4834 Header: res.Header,
4835 })
4836 }
4837 if err != nil {
4838 return nil, err
4839 }
4840 defer googleapi.CloseBody(res)
4841 if err := googleapi.CheckResponse(res); err != nil {
4842 return nil, gensupport.WrapError(err)
4843 }
4844 ret := &GoogleLongrunningListOperationsResponse{
4845 ServerResponse: googleapi.ServerResponse{
4846 Header: res.Header,
4847 HTTPStatusCode: res.StatusCode,
4848 },
4849 }
4850 target := &ret
4851 b, err := gensupport.DecodeResponseBytes(target, res)
4852 if err != nil {
4853 return nil, err
4854 }
4855 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.operations.list", "response", internallog.HTTPResponse(res, b))
4856 return ret, nil
4857 }
4858
4859 // Pages invokes f for each page of results.
4860 // A non-nil error returned from f will halt the iteration.
4861 // The provided context supersedes any context provided to the Context method.
4862 func (c *OrganizationsLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
4863 c.ctx_ = ctx
4864 defer c.PageToken(c.urlParams_.Get("pageToken"))
4865 for {
4866 x, err := c.Do()
4867 if err != nil {
4868 return err
4869 }
4870 if err := f(x); err != nil {
4871 return err
4872 }
4873 if x.NextPageToken == "" {
4874 return nil
4875 }
4876 c.PageToken(x.NextPageToken)
4877 }
4878 }
4879
4880 type OrganizationsLocationsReplaysResultsListCall struct {
4881 s *Service
4882 parent string
4883 urlParams_ gensupport.URLParams
4884 ifNoneMatch_ string
4885 ctx_ context.Context
4886 header_ http.Header
4887 }
4888
4889 // List: Lists the results of running a Replay.
4890 //
4891 // - parent: The Replay whose results are listed, in the following format:
4892 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
4893 // eplay-id}` Example:
4894 // `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce
4895 // 1833c36`.
4896 func (r *OrganizationsLocationsReplaysResultsService) List(parent string) *OrganizationsLocationsReplaysResultsListCall {
4897 c := &OrganizationsLocationsReplaysResultsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4898 c.parent = parent
4899 return c
4900 }
4901
4902 // PageSize sets the optional parameter "pageSize": The maximum number of
4903 // ReplayResult objects to return. Defaults to 5000. The maximum value is 5000;
4904 // values above 5000 are rounded down to 5000.
4905 func (c *OrganizationsLocationsReplaysResultsListCall) PageSize(pageSize int64) *OrganizationsLocationsReplaysResultsListCall {
4906 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4907 return c
4908 }
4909
4910 // PageToken sets the optional parameter "pageToken": A page token, received
4911 // from a previous Simulator.ListReplayResults call. Provide this token to
4912 // retrieve the next page of results. When paginating, all other parameters
4913 // provided to [Simulator.ListReplayResults[] must match the call that provided
4914 // the page token.
4915 func (c *OrganizationsLocationsReplaysResultsListCall) PageToken(pageToken string) *OrganizationsLocationsReplaysResultsListCall {
4916 c.urlParams_.Set("pageToken", pageToken)
4917 return c
4918 }
4919
4920 // Fields allows partial responses to be retrieved. See
4921 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4922 // details.
4923 func (c *OrganizationsLocationsReplaysResultsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysResultsListCall {
4924 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4925 return c
4926 }
4927
4928 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4929 // object's ETag matches the given value. This is useful for getting updates
4930 // only after the object has changed since the last request.
4931 func (c *OrganizationsLocationsReplaysResultsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysResultsListCall {
4932 c.ifNoneMatch_ = entityTag
4933 return c
4934 }
4935
4936 // Context sets the context to be used in this call's Do method.
4937 func (c *OrganizationsLocationsReplaysResultsListCall) Context(ctx context.Context) *OrganizationsLocationsReplaysResultsListCall {
4938 c.ctx_ = ctx
4939 return c
4940 }
4941
4942 // Header returns a http.Header that can be modified by the caller to add
4943 // headers to the request.
4944 func (c *OrganizationsLocationsReplaysResultsListCall) Header() http.Header {
4945 if c.header_ == nil {
4946 c.header_ = make(http.Header)
4947 }
4948 return c.header_
4949 }
4950
4951 func (c *OrganizationsLocationsReplaysResultsListCall) doRequest(alt string) (*http.Response, error) {
4952 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4953 if c.ifNoneMatch_ != "" {
4954 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4955 }
4956 c.urlParams_.Set("alt", alt)
4957 c.urlParams_.Set("prettyPrint", "false")
4958 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/results")
4959 urls += "?" + c.urlParams_.Encode()
4960 req, err := http.NewRequest("GET", urls, nil)
4961 if err != nil {
4962 return nil, err
4963 }
4964 req.Header = reqHeaders
4965 googleapi.Expand(req.URL, map[string]string{
4966 "parent": c.parent,
4967 })
4968 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.results.list", "request", internallog.HTTPRequest(req, nil))
4969 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4970 }
4971
4972 // Do executes the "policysimulator.organizations.locations.replays.results.list" call.
4973 // Any non-2xx status code is an error. Response headers are in either
4974 // *GoogleCloudPolicysimulatorV1ListReplayResultsResponse.ServerResponse.Header
4975 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
4976 // Use googleapi.IsNotModified to check whether the returned error was because
4977 // http.StatusNotModified was returned.
4978 func (c *OrganizationsLocationsReplaysResultsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1ListReplayResultsResponse, error) {
4979 gensupport.SetOptions(c.urlParams_, opts...)
4980 res, err := c.doRequest("json")
4981 if res != nil && res.StatusCode == http.StatusNotModified {
4982 if res.Body != nil {
4983 res.Body.Close()
4984 }
4985 return nil, gensupport.WrapError(&googleapi.Error{
4986 Code: res.StatusCode,
4987 Header: res.Header,
4988 })
4989 }
4990 if err != nil {
4991 return nil, err
4992 }
4993 defer googleapi.CloseBody(res)
4994 if err := googleapi.CheckResponse(res); err != nil {
4995 return nil, gensupport.WrapError(err)
4996 }
4997 ret := &GoogleCloudPolicysimulatorV1ListReplayResultsResponse{
4998 ServerResponse: googleapi.ServerResponse{
4999 Header: res.Header,
5000 HTTPStatusCode: res.StatusCode,
5001 },
5002 }
5003 target := &ret
5004 b, err := gensupport.DecodeResponseBytes(target, res)
5005 if err != nil {
5006 return nil, err
5007 }
5008 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.results.list", "response", internallog.HTTPResponse(res, b))
5009 return ret, nil
5010 }
5011
5012 // Pages invokes f for each page of results.
5013 // A non-nil error returned from f will halt the iteration.
5014 // The provided context supersedes any context provided to the Context method.
5015 func (c *OrganizationsLocationsReplaysResultsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1ListReplayResultsResponse) error) error {
5016 c.ctx_ = ctx
5017 defer c.PageToken(c.urlParams_.Get("pageToken"))
5018 for {
5019 x, err := c.Do()
5020 if err != nil {
5021 return err
5022 }
5023 if err := f(x); err != nil {
5024 return err
5025 }
5026 if x.NextPageToken == "" {
5027 return nil
5028 }
5029 c.PageToken(x.NextPageToken)
5030 }
5031 }
5032
5033 type ProjectsLocationsAccessPolicySimulationsOperationsGetCall struct {
5034 s *Service
5035 name string
5036 urlParams_ gensupport.URLParams
5037 ifNoneMatch_ string
5038 ctx_ context.Context
5039 header_ http.Header
5040 }
5041
5042 // Get: Gets the latest state of a long-running operation. Clients can use this
5043 // method to poll the operation result at intervals as recommended by the API
5044 // service.
5045 //
5046 // - name: The name of the operation resource.
5047 func (r *ProjectsLocationsAccessPolicySimulationsOperationsService) Get(name string) *ProjectsLocationsAccessPolicySimulationsOperationsGetCall {
5048 c := &ProjectsLocationsAccessPolicySimulationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5049 c.name = name
5050 return c
5051 }
5052
5053 // Fields allows partial responses to be retrieved. See
5054 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5055 // details.
5056 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAccessPolicySimulationsOperationsGetCall {
5057 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5058 return c
5059 }
5060
5061 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5062 // object's ETag matches the given value. This is useful for getting updates
5063 // only after the object has changed since the last request.
5064 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAccessPolicySimulationsOperationsGetCall {
5065 c.ifNoneMatch_ = entityTag
5066 return c
5067 }
5068
5069 // Context sets the context to be used in this call's Do method.
5070 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsAccessPolicySimulationsOperationsGetCall {
5071 c.ctx_ = ctx
5072 return c
5073 }
5074
5075 // Header returns a http.Header that can be modified by the caller to add
5076 // headers to the request.
5077 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) Header() http.Header {
5078 if c.header_ == nil {
5079 c.header_ = make(http.Header)
5080 }
5081 return c.header_
5082 }
5083
5084 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
5085 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5086 if c.ifNoneMatch_ != "" {
5087 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5088 }
5089 c.urlParams_.Set("alt", alt)
5090 c.urlParams_.Set("prettyPrint", "false")
5091 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5092 urls += "?" + c.urlParams_.Encode()
5093 req, err := http.NewRequest("GET", urls, nil)
5094 if err != nil {
5095 return nil, err
5096 }
5097 req.Header = reqHeaders
5098 googleapi.Expand(req.URL, map[string]string{
5099 "name": c.name,
5100 })
5101 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.accessPolicySimulations.operations.get", "request", internallog.HTTPRequest(req, nil))
5102 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5103 }
5104
5105 // Do executes the "policysimulator.projects.locations.accessPolicySimulations.operations.get" call.
5106 // Any non-2xx status code is an error. Response headers are in either
5107 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
5108 // returned at all) in error.(*googleapi.Error).Header. Use
5109 // googleapi.IsNotModified to check whether the returned error was because
5110 // http.StatusNotModified was returned.
5111 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5112 gensupport.SetOptions(c.urlParams_, opts...)
5113 res, err := c.doRequest("json")
5114 if res != nil && res.StatusCode == http.StatusNotModified {
5115 if res.Body != nil {
5116 res.Body.Close()
5117 }
5118 return nil, gensupport.WrapError(&googleapi.Error{
5119 Code: res.StatusCode,
5120 Header: res.Header,
5121 })
5122 }
5123 if err != nil {
5124 return nil, err
5125 }
5126 defer googleapi.CloseBody(res)
5127 if err := googleapi.CheckResponse(res); err != nil {
5128 return nil, gensupport.WrapError(err)
5129 }
5130 ret := &GoogleLongrunningOperation{
5131 ServerResponse: googleapi.ServerResponse{
5132 Header: res.Header,
5133 HTTPStatusCode: res.StatusCode,
5134 },
5135 }
5136 target := &ret
5137 b, err := gensupport.DecodeResponseBytes(target, res)
5138 if err != nil {
5139 return nil, err
5140 }
5141 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.accessPolicySimulations.operations.get", "response", internallog.HTTPResponse(res, b))
5142 return ret, nil
5143 }
5144
5145 type ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
5146 s *Service
5147 name string
5148 urlParams_ gensupport.URLParams
5149 ifNoneMatch_ string
5150 ctx_ context.Context
5151 header_ http.Header
5152 }
5153
5154 // Get: Gets the latest state of a long-running operation. Clients can use this
5155 // method to poll the operation result at intervals as recommended by the API
5156 // service.
5157 //
5158 // - name: The name of the operation resource.
5159 func (r *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
5160 c := &ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5161 c.name = name
5162 return c
5163 }
5164
5165 // Fields allows partial responses to be retrieved. See
5166 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5167 // details.
5168 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
5169 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5170 return c
5171 }
5172
5173 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5174 // object's ETag matches the given value. This is useful for getting updates
5175 // only after the object has changed since the last request.
5176 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
5177 c.ifNoneMatch_ = entityTag
5178 return c
5179 }
5180
5181 // Context sets the context to be used in this call's Do method.
5182 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
5183 c.ctx_ = ctx
5184 return c
5185 }
5186
5187 // Header returns a http.Header that can be modified by the caller to add
5188 // headers to the request.
5189 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
5190 if c.header_ == nil {
5191 c.header_ = make(http.Header)
5192 }
5193 return c.header_
5194 }
5195
5196 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
5197 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5198 if c.ifNoneMatch_ != "" {
5199 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5200 }
5201 c.urlParams_.Set("alt", alt)
5202 c.urlParams_.Set("prettyPrint", "false")
5203 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5204 urls += "?" + c.urlParams_.Encode()
5205 req, err := http.NewRequest("GET", urls, nil)
5206 if err != nil {
5207 return nil, err
5208 }
5209 req.Header = reqHeaders
5210 googleapi.Expand(req.URL, map[string]string{
5211 "name": c.name,
5212 })
5213 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get", "request", internallog.HTTPRequest(req, nil))
5214 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5215 }
5216
5217 // Do executes the "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get" call.
5218 // Any non-2xx status code is an error. Response headers are in either
5219 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
5220 // returned at all) in error.(*googleapi.Error).Header. Use
5221 // googleapi.IsNotModified to check whether the returned error was because
5222 // http.StatusNotModified was returned.
5223 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5224 gensupport.SetOptions(c.urlParams_, opts...)
5225 res, err := c.doRequest("json")
5226 if res != nil && res.StatusCode == http.StatusNotModified {
5227 if res.Body != nil {
5228 res.Body.Close()
5229 }
5230 return nil, gensupport.WrapError(&googleapi.Error{
5231 Code: res.StatusCode,
5232 Header: res.Header,
5233 })
5234 }
5235 if err != nil {
5236 return nil, err
5237 }
5238 defer googleapi.CloseBody(res)
5239 if err := googleapi.CheckResponse(res); err != nil {
5240 return nil, gensupport.WrapError(err)
5241 }
5242 ret := &GoogleLongrunningOperation{
5243 ServerResponse: googleapi.ServerResponse{
5244 Header: res.Header,
5245 HTTPStatusCode: res.StatusCode,
5246 },
5247 }
5248 target := &ret
5249 b, err := gensupport.DecodeResponseBytes(target, res)
5250 if err != nil {
5251 return nil, err
5252 }
5253 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get", "response", internallog.HTTPResponse(res, b))
5254 return ret, nil
5255 }
5256
5257 type ProjectsLocationsReplaysCreateCall struct {
5258 s *Service
5259 parent string
5260 googlecloudpolicysimulatorv1replay *GoogleCloudPolicysimulatorV1Replay
5261 urlParams_ gensupport.URLParams
5262 ctx_ context.Context
5263 header_ http.Header
5264 }
5265
5266 // Create: Creates and starts a Replay using the given ReplayConfig.
5267 //
5268 // - parent: The parent resource where this Replay will be created. This
5269 // resource must be a project, folder, or organization with a location.
5270 // Example: `projects/my-example-project/locations/global`.
5271 func (r *ProjectsLocationsReplaysService) Create(parent string, googlecloudpolicysimulatorv1replay *GoogleCloudPolicysimulatorV1Replay) *ProjectsLocationsReplaysCreateCall {
5272 c := &ProjectsLocationsReplaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5273 c.parent = parent
5274 c.googlecloudpolicysimulatorv1replay = googlecloudpolicysimulatorv1replay
5275 return c
5276 }
5277
5278 // Fields allows partial responses to be retrieved. See
5279 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5280 // details.
5281 func (c *ProjectsLocationsReplaysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysCreateCall {
5282 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5283 return c
5284 }
5285
5286 // Context sets the context to be used in this call's Do method.
5287 func (c *ProjectsLocationsReplaysCreateCall) Context(ctx context.Context) *ProjectsLocationsReplaysCreateCall {
5288 c.ctx_ = ctx
5289 return c
5290 }
5291
5292 // Header returns a http.Header that can be modified by the caller to add
5293 // headers to the request.
5294 func (c *ProjectsLocationsReplaysCreateCall) Header() http.Header {
5295 if c.header_ == nil {
5296 c.header_ = make(http.Header)
5297 }
5298 return c.header_
5299 }
5300
5301 func (c *ProjectsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) {
5302 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5303 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1replay)
5304 if err != nil {
5305 return nil, err
5306 }
5307 c.urlParams_.Set("alt", alt)
5308 c.urlParams_.Set("prettyPrint", "false")
5309 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/replays")
5310 urls += "?" + c.urlParams_.Encode()
5311 req, err := http.NewRequest("POST", urls, body)
5312 if err != nil {
5313 return nil, err
5314 }
5315 req.Header = reqHeaders
5316 googleapi.Expand(req.URL, map[string]string{
5317 "parent": c.parent,
5318 })
5319 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5320 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5321 }
5322
5323 // Do executes the "policysimulator.projects.locations.replays.create" call.
5324 // Any non-2xx status code is an error. Response headers are in either
5325 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
5326 // returned at all) in error.(*googleapi.Error).Header. Use
5327 // googleapi.IsNotModified to check whether the returned error was because
5328 // http.StatusNotModified was returned.
5329 func (c *ProjectsLocationsReplaysCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5330 gensupport.SetOptions(c.urlParams_, opts...)
5331 res, err := c.doRequest("json")
5332 if res != nil && res.StatusCode == http.StatusNotModified {
5333 if res.Body != nil {
5334 res.Body.Close()
5335 }
5336 return nil, gensupport.WrapError(&googleapi.Error{
5337 Code: res.StatusCode,
5338 Header: res.Header,
5339 })
5340 }
5341 if err != nil {
5342 return nil, err
5343 }
5344 defer googleapi.CloseBody(res)
5345 if err := googleapi.CheckResponse(res); err != nil {
5346 return nil, gensupport.WrapError(err)
5347 }
5348 ret := &GoogleLongrunningOperation{
5349 ServerResponse: googleapi.ServerResponse{
5350 Header: res.Header,
5351 HTTPStatusCode: res.StatusCode,
5352 },
5353 }
5354 target := &ret
5355 b, err := gensupport.DecodeResponseBytes(target, res)
5356 if err != nil {
5357 return nil, err
5358 }
5359 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.create", "response", internallog.HTTPResponse(res, b))
5360 return ret, nil
5361 }
5362
5363 type ProjectsLocationsReplaysGetCall struct {
5364 s *Service
5365 name string
5366 urlParams_ gensupport.URLParams
5367 ifNoneMatch_ string
5368 ctx_ context.Context
5369 header_ http.Header
5370 }
5371
5372 // Get: Gets the specified Replay. Each `Replay` is available for at least 7
5373 // days.
5374 //
5375 // - name: The name of the Replay to retrieve, in the following format:
5376 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
5377 // eplay-id}`, where `{resource-id}` is the ID of the project, folder, or
5378 // organization that owns the `Replay`. Example:
5379 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e
5380 // 03-479ce1833c36`.
5381 func (r *ProjectsLocationsReplaysService) Get(name string) *ProjectsLocationsReplaysGetCall {
5382 c := &ProjectsLocationsReplaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5383 c.name = name
5384 return c
5385 }
5386
5387 // Fields allows partial responses to be retrieved. See
5388 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5389 // details.
5390 func (c *ProjectsLocationsReplaysGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysGetCall {
5391 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5392 return c
5393 }
5394
5395 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5396 // object's ETag matches the given value. This is useful for getting updates
5397 // only after the object has changed since the last request.
5398 func (c *ProjectsLocationsReplaysGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysGetCall {
5399 c.ifNoneMatch_ = entityTag
5400 return c
5401 }
5402
5403 // Context sets the context to be used in this call's Do method.
5404 func (c *ProjectsLocationsReplaysGetCall) Context(ctx context.Context) *ProjectsLocationsReplaysGetCall {
5405 c.ctx_ = ctx
5406 return c
5407 }
5408
5409 // Header returns a http.Header that can be modified by the caller to add
5410 // headers to the request.
5411 func (c *ProjectsLocationsReplaysGetCall) Header() http.Header {
5412 if c.header_ == nil {
5413 c.header_ = make(http.Header)
5414 }
5415 return c.header_
5416 }
5417
5418 func (c *ProjectsLocationsReplaysGetCall) doRequest(alt string) (*http.Response, error) {
5419 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5420 if c.ifNoneMatch_ != "" {
5421 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5422 }
5423 c.urlParams_.Set("alt", alt)
5424 c.urlParams_.Set("prettyPrint", "false")
5425 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5426 urls += "?" + c.urlParams_.Encode()
5427 req, err := http.NewRequest("GET", urls, nil)
5428 if err != nil {
5429 return nil, err
5430 }
5431 req.Header = reqHeaders
5432 googleapi.Expand(req.URL, map[string]string{
5433 "name": c.name,
5434 })
5435 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.get", "request", internallog.HTTPRequest(req, nil))
5436 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5437 }
5438
5439 // Do executes the "policysimulator.projects.locations.replays.get" call.
5440 // Any non-2xx status code is an error. Response headers are in either
5441 // *GoogleCloudPolicysimulatorV1Replay.ServerResponse.Header or (if a response
5442 // was returned at all) in error.(*googleapi.Error).Header. Use
5443 // googleapi.IsNotModified to check whether the returned error was because
5444 // http.StatusNotModified was returned.
5445 func (c *ProjectsLocationsReplaysGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1Replay, error) {
5446 gensupport.SetOptions(c.urlParams_, opts...)
5447 res, err := c.doRequest("json")
5448 if res != nil && res.StatusCode == http.StatusNotModified {
5449 if res.Body != nil {
5450 res.Body.Close()
5451 }
5452 return nil, gensupport.WrapError(&googleapi.Error{
5453 Code: res.StatusCode,
5454 Header: res.Header,
5455 })
5456 }
5457 if err != nil {
5458 return nil, err
5459 }
5460 defer googleapi.CloseBody(res)
5461 if err := googleapi.CheckResponse(res); err != nil {
5462 return nil, gensupport.WrapError(err)
5463 }
5464 ret := &GoogleCloudPolicysimulatorV1Replay{
5465 ServerResponse: googleapi.ServerResponse{
5466 Header: res.Header,
5467 HTTPStatusCode: res.StatusCode,
5468 },
5469 }
5470 target := &ret
5471 b, err := gensupport.DecodeResponseBytes(target, res)
5472 if err != nil {
5473 return nil, err
5474 }
5475 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.get", "response", internallog.HTTPResponse(res, b))
5476 return ret, nil
5477 }
5478
5479 type ProjectsLocationsReplaysOperationsGetCall struct {
5480 s *Service
5481 name string
5482 urlParams_ gensupport.URLParams
5483 ifNoneMatch_ string
5484 ctx_ context.Context
5485 header_ http.Header
5486 }
5487
5488 // Get: Gets the latest state of a long-running operation. Clients can use this
5489 // method to poll the operation result at intervals as recommended by the API
5490 // service.
5491 //
5492 // - name: The name of the operation resource.
5493 func (r *ProjectsLocationsReplaysOperationsService) Get(name string) *ProjectsLocationsReplaysOperationsGetCall {
5494 c := &ProjectsLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5495 c.name = name
5496 return c
5497 }
5498
5499 // Fields allows partial responses to be retrieved. See
5500 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5501 // details.
5502 func (c *ProjectsLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysOperationsGetCall {
5503 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5504 return c
5505 }
5506
5507 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5508 // object's ETag matches the given value. This is useful for getting updates
5509 // only after the object has changed since the last request.
5510 func (c *ProjectsLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysOperationsGetCall {
5511 c.ifNoneMatch_ = entityTag
5512 return c
5513 }
5514
5515 // Context sets the context to be used in this call's Do method.
5516 func (c *ProjectsLocationsReplaysOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsReplaysOperationsGetCall {
5517 c.ctx_ = ctx
5518 return c
5519 }
5520
5521 // Header returns a http.Header that can be modified by the caller to add
5522 // headers to the request.
5523 func (c *ProjectsLocationsReplaysOperationsGetCall) Header() http.Header {
5524 if c.header_ == nil {
5525 c.header_ = make(http.Header)
5526 }
5527 return c.header_
5528 }
5529
5530 func (c *ProjectsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
5531 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5532 if c.ifNoneMatch_ != "" {
5533 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5534 }
5535 c.urlParams_.Set("alt", alt)
5536 c.urlParams_.Set("prettyPrint", "false")
5537 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5538 urls += "?" + c.urlParams_.Encode()
5539 req, err := http.NewRequest("GET", urls, nil)
5540 if err != nil {
5541 return nil, err
5542 }
5543 req.Header = reqHeaders
5544 googleapi.Expand(req.URL, map[string]string{
5545 "name": c.name,
5546 })
5547 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.operations.get", "request", internallog.HTTPRequest(req, nil))
5548 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5549 }
5550
5551 // Do executes the "policysimulator.projects.locations.replays.operations.get" call.
5552 // Any non-2xx status code is an error. Response headers are in either
5553 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
5554 // returned at all) in error.(*googleapi.Error).Header. Use
5555 // googleapi.IsNotModified to check whether the returned error was because
5556 // http.StatusNotModified was returned.
5557 func (c *ProjectsLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5558 gensupport.SetOptions(c.urlParams_, opts...)
5559 res, err := c.doRequest("json")
5560 if res != nil && res.StatusCode == http.StatusNotModified {
5561 if res.Body != nil {
5562 res.Body.Close()
5563 }
5564 return nil, gensupport.WrapError(&googleapi.Error{
5565 Code: res.StatusCode,
5566 Header: res.Header,
5567 })
5568 }
5569 if err != nil {
5570 return nil, err
5571 }
5572 defer googleapi.CloseBody(res)
5573 if err := googleapi.CheckResponse(res); err != nil {
5574 return nil, gensupport.WrapError(err)
5575 }
5576 ret := &GoogleLongrunningOperation{
5577 ServerResponse: googleapi.ServerResponse{
5578 Header: res.Header,
5579 HTTPStatusCode: res.StatusCode,
5580 },
5581 }
5582 target := &ret
5583 b, err := gensupport.DecodeResponseBytes(target, res)
5584 if err != nil {
5585 return nil, err
5586 }
5587 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.operations.get", "response", internallog.HTTPResponse(res, b))
5588 return ret, nil
5589 }
5590
5591 type ProjectsLocationsReplaysOperationsListCall struct {
5592 s *Service
5593 name string
5594 urlParams_ gensupport.URLParams
5595 ifNoneMatch_ string
5596 ctx_ context.Context
5597 header_ http.Header
5598 }
5599
5600 // List: Lists operations that match the specified filter in the request. If
5601 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
5602 //
5603 // - name: The name of the operation's parent resource.
5604 func (r *ProjectsLocationsReplaysOperationsService) List(name string) *ProjectsLocationsReplaysOperationsListCall {
5605 c := &ProjectsLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5606 c.name = name
5607 return c
5608 }
5609
5610 // Filter sets the optional parameter "filter": The standard list filter.
5611 func (c *ProjectsLocationsReplaysOperationsListCall) Filter(filter string) *ProjectsLocationsReplaysOperationsListCall {
5612 c.urlParams_.Set("filter", filter)
5613 return c
5614 }
5615
5616 // PageSize sets the optional parameter "pageSize": The standard list page
5617 // size.
5618 func (c *ProjectsLocationsReplaysOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsReplaysOperationsListCall {
5619 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5620 return c
5621 }
5622
5623 // PageToken sets the optional parameter "pageToken": The standard list page
5624 // token.
5625 func (c *ProjectsLocationsReplaysOperationsListCall) PageToken(pageToken string) *ProjectsLocationsReplaysOperationsListCall {
5626 c.urlParams_.Set("pageToken", pageToken)
5627 return c
5628 }
5629
5630 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
5631 // When set to `true`, operations that are reachable are returned as normal,
5632 // and those that are unreachable are returned in the
5633 // ListOperationsResponse.unreachable field. This can only be `true` when
5634 // reading across collections. For example, when `parent` is set to
5635 // "projects/example/locations/-". This field is not supported by default and
5636 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
5637 // otherwise in service or product specific documentation.
5638 func (c *ProjectsLocationsReplaysOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsReplaysOperationsListCall {
5639 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
5640 return c
5641 }
5642
5643 // Fields allows partial responses to be retrieved. See
5644 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5645 // details.
5646 func (c *ProjectsLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysOperationsListCall {
5647 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5648 return c
5649 }
5650
5651 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5652 // object's ETag matches the given value. This is useful for getting updates
5653 // only after the object has changed since the last request.
5654 func (c *ProjectsLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysOperationsListCall {
5655 c.ifNoneMatch_ = entityTag
5656 return c
5657 }
5658
5659 // Context sets the context to be used in this call's Do method.
5660 func (c *ProjectsLocationsReplaysOperationsListCall) Context(ctx context.Context) *ProjectsLocationsReplaysOperationsListCall {
5661 c.ctx_ = ctx
5662 return c
5663 }
5664
5665 // Header returns a http.Header that can be modified by the caller to add
5666 // headers to the request.
5667 func (c *ProjectsLocationsReplaysOperationsListCall) Header() http.Header {
5668 if c.header_ == nil {
5669 c.header_ = make(http.Header)
5670 }
5671 return c.header_
5672 }
5673
5674 func (c *ProjectsLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
5675 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5676 if c.ifNoneMatch_ != "" {
5677 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5678 }
5679 c.urlParams_.Set("alt", alt)
5680 c.urlParams_.Set("prettyPrint", "false")
5681 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
5682 urls += "?" + c.urlParams_.Encode()
5683 req, err := http.NewRequest("GET", urls, nil)
5684 if err != nil {
5685 return nil, err
5686 }
5687 req.Header = reqHeaders
5688 googleapi.Expand(req.URL, map[string]string{
5689 "name": c.name,
5690 })
5691 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.operations.list", "request", internallog.HTTPRequest(req, nil))
5692 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5693 }
5694
5695 // Do executes the "policysimulator.projects.locations.replays.operations.list" call.
5696 // Any non-2xx status code is an error. Response headers are in either
5697 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
5698 // response was returned at all) in error.(*googleapi.Error).Header. Use
5699 // googleapi.IsNotModified to check whether the returned error was because
5700 // http.StatusNotModified was returned.
5701 func (c *ProjectsLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
5702 gensupport.SetOptions(c.urlParams_, opts...)
5703 res, err := c.doRequest("json")
5704 if res != nil && res.StatusCode == http.StatusNotModified {
5705 if res.Body != nil {
5706 res.Body.Close()
5707 }
5708 return nil, gensupport.WrapError(&googleapi.Error{
5709 Code: res.StatusCode,
5710 Header: res.Header,
5711 })
5712 }
5713 if err != nil {
5714 return nil, err
5715 }
5716 defer googleapi.CloseBody(res)
5717 if err := googleapi.CheckResponse(res); err != nil {
5718 return nil, gensupport.WrapError(err)
5719 }
5720 ret := &GoogleLongrunningListOperationsResponse{
5721 ServerResponse: googleapi.ServerResponse{
5722 Header: res.Header,
5723 HTTPStatusCode: res.StatusCode,
5724 },
5725 }
5726 target := &ret
5727 b, err := gensupport.DecodeResponseBytes(target, res)
5728 if err != nil {
5729 return nil, err
5730 }
5731 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.operations.list", "response", internallog.HTTPResponse(res, b))
5732 return ret, nil
5733 }
5734
5735 // Pages invokes f for each page of results.
5736 // A non-nil error returned from f will halt the iteration.
5737 // The provided context supersedes any context provided to the Context method.
5738 func (c *ProjectsLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
5739 c.ctx_ = ctx
5740 defer c.PageToken(c.urlParams_.Get("pageToken"))
5741 for {
5742 x, err := c.Do()
5743 if err != nil {
5744 return err
5745 }
5746 if err := f(x); err != nil {
5747 return err
5748 }
5749 if x.NextPageToken == "" {
5750 return nil
5751 }
5752 c.PageToken(x.NextPageToken)
5753 }
5754 }
5755
5756 type ProjectsLocationsReplaysResultsListCall struct {
5757 s *Service
5758 parent string
5759 urlParams_ gensupport.URLParams
5760 ifNoneMatch_ string
5761 ctx_ context.Context
5762 header_ http.Header
5763 }
5764
5765 // List: Lists the results of running a Replay.
5766 //
5767 // - parent: The Replay whose results are listed, in the following format:
5768 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
5769 // eplay-id}` Example:
5770 // `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce
5771 // 1833c36`.
5772 func (r *ProjectsLocationsReplaysResultsService) List(parent string) *ProjectsLocationsReplaysResultsListCall {
5773 c := &ProjectsLocationsReplaysResultsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5774 c.parent = parent
5775 return c
5776 }
5777
5778 // PageSize sets the optional parameter "pageSize": The maximum number of
5779 // ReplayResult objects to return. Defaults to 5000. The maximum value is 5000;
5780 // values above 5000 are rounded down to 5000.
5781 func (c *ProjectsLocationsReplaysResultsListCall) PageSize(pageSize int64) *ProjectsLocationsReplaysResultsListCall {
5782 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5783 return c
5784 }
5785
5786 // PageToken sets the optional parameter "pageToken": A page token, received
5787 // from a previous Simulator.ListReplayResults call. Provide this token to
5788 // retrieve the next page of results. When paginating, all other parameters
5789 // provided to [Simulator.ListReplayResults[] must match the call that provided
5790 // the page token.
5791 func (c *ProjectsLocationsReplaysResultsListCall) PageToken(pageToken string) *ProjectsLocationsReplaysResultsListCall {
5792 c.urlParams_.Set("pageToken", pageToken)
5793 return c
5794 }
5795
5796 // Fields allows partial responses to be retrieved. See
5797 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5798 // details.
5799 func (c *ProjectsLocationsReplaysResultsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysResultsListCall {
5800 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5801 return c
5802 }
5803
5804 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5805 // object's ETag matches the given value. This is useful for getting updates
5806 // only after the object has changed since the last request.
5807 func (c *ProjectsLocationsReplaysResultsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysResultsListCall {
5808 c.ifNoneMatch_ = entityTag
5809 return c
5810 }
5811
5812 // Context sets the context to be used in this call's Do method.
5813 func (c *ProjectsLocationsReplaysResultsListCall) Context(ctx context.Context) *ProjectsLocationsReplaysResultsListCall {
5814 c.ctx_ = ctx
5815 return c
5816 }
5817
5818 // Header returns a http.Header that can be modified by the caller to add
5819 // headers to the request.
5820 func (c *ProjectsLocationsReplaysResultsListCall) Header() http.Header {
5821 if c.header_ == nil {
5822 c.header_ = make(http.Header)
5823 }
5824 return c.header_
5825 }
5826
5827 func (c *ProjectsLocationsReplaysResultsListCall) doRequest(alt string) (*http.Response, error) {
5828 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5829 if c.ifNoneMatch_ != "" {
5830 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5831 }
5832 c.urlParams_.Set("alt", alt)
5833 c.urlParams_.Set("prettyPrint", "false")
5834 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/results")
5835 urls += "?" + c.urlParams_.Encode()
5836 req, err := http.NewRequest("GET", urls, nil)
5837 if err != nil {
5838 return nil, err
5839 }
5840 req.Header = reqHeaders
5841 googleapi.Expand(req.URL, map[string]string{
5842 "parent": c.parent,
5843 })
5844 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.results.list", "request", internallog.HTTPRequest(req, nil))
5845 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5846 }
5847
5848 // Do executes the "policysimulator.projects.locations.replays.results.list" call.
5849 // Any non-2xx status code is an error. Response headers are in either
5850 // *GoogleCloudPolicysimulatorV1ListReplayResultsResponse.ServerResponse.Header
5851 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
5852 // Use googleapi.IsNotModified to check whether the returned error was because
5853 // http.StatusNotModified was returned.
5854 func (c *ProjectsLocationsReplaysResultsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1ListReplayResultsResponse, error) {
5855 gensupport.SetOptions(c.urlParams_, opts...)
5856 res, err := c.doRequest("json")
5857 if res != nil && res.StatusCode == http.StatusNotModified {
5858 if res.Body != nil {
5859 res.Body.Close()
5860 }
5861 return nil, gensupport.WrapError(&googleapi.Error{
5862 Code: res.StatusCode,
5863 Header: res.Header,
5864 })
5865 }
5866 if err != nil {
5867 return nil, err
5868 }
5869 defer googleapi.CloseBody(res)
5870 if err := googleapi.CheckResponse(res); err != nil {
5871 return nil, gensupport.WrapError(err)
5872 }
5873 ret := &GoogleCloudPolicysimulatorV1ListReplayResultsResponse{
5874 ServerResponse: googleapi.ServerResponse{
5875 Header: res.Header,
5876 HTTPStatusCode: res.StatusCode,
5877 },
5878 }
5879 target := &ret
5880 b, err := gensupport.DecodeResponseBytes(target, res)
5881 if err != nil {
5882 return nil, err
5883 }
5884 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.results.list", "response", internallog.HTTPResponse(res, b))
5885 return ret, nil
5886 }
5887
5888 // Pages invokes f for each page of results.
5889 // A non-nil error returned from f will halt the iteration.
5890 // The provided context supersedes any context provided to the Context method.
5891 func (c *ProjectsLocationsReplaysResultsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1ListReplayResultsResponse) error) error {
5892 c.ctx_ = ctx
5893 defer c.PageToken(c.urlParams_.Get("pageToken"))
5894 for {
5895 x, err := c.Do()
5896 if err != nil {
5897 return err
5898 }
5899 if err := f(x); err != nil {
5900 return err
5901 }
5902 if x.NextPageToken == "" {
5903 return nil
5904 }
5905 c.PageToken(x.NextPageToken)
5906 }
5907 }