Debian Codegraph @

policysimulator/v1beta/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/v1beta"
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/v1beta"
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:v1beta"
93 const apiName = "policysimulator"
94 const apiVersion = "v1beta"
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 // GoogleCloudPolicysimulatorV1Replay: A resource describing a `Replay`, or
800 // simulation.
801 type GoogleCloudPolicysimulatorV1Replay struct {
802 // Config: Required. The configuration used for the `Replay`.
803 Config *GoogleCloudPolicysimulatorV1ReplayConfig `json:"config,omitempty"`
804 // Name: Output only. The resource name of the `Replay`, which has the
805 // following format:
806 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{rep
807 // lay-id}`, where `{resource-id}` is the ID of the project, folder, or
808 // organization that owns the Replay. Example:
809 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03
810 // -479ce1833c36`
811 Name string `json:"name,omitempty"`
812 // ResultsSummary: Output only. Summary statistics about the replayed log
813 // entries.
814 ResultsSummary *GoogleCloudPolicysimulatorV1ReplayResultsSummary `json:"resultsSummary,omitempty"`
815 // State: Output only. The current state of the `Replay`.
816 //
817 // Possible values:
818 // "STATE_UNSPECIFIED" - Default value. This value is unused.
819 // "PENDING" - The `Replay` has not started yet.
820 // "RUNNING" - The `Replay` is currently running.
821 // "SUCCEEDED" - The `Replay` has successfully completed.
822 // "FAILED" - The `Replay` has finished with an error.
823 State string `json:"state,omitempty"`
824 // ForceSendFields is a list of field names (e.g. "Config") to unconditionally
825 // include in API requests. By default, fields with empty or default values are
826 // omitted from API requests. See
827 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
828 // details.
829 ForceSendFields []string `json:"-"`
830 // NullFields is a list of field names (e.g. "Config") to include in API
831 // requests with the JSON null value. By default, fields with empty values are
832 // omitted from API requests. See
833 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
834 NullFields []string `json:"-"`
835 }
836
837 func (s GoogleCloudPolicysimulatorV1Replay) MarshalJSON() ([]byte, error) {
838 type NoMethod GoogleCloudPolicysimulatorV1Replay
839 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
840 }
841
842 // GoogleCloudPolicysimulatorV1ReplayConfig: The configuration used for a
843 // Replay.
844 type GoogleCloudPolicysimulatorV1ReplayConfig struct {
845 // LogSource: The logs to use as input for the Replay.
846 //
847 // Possible values:
848 // "LOG_SOURCE_UNSPECIFIED" - An unspecified log source. If the log source is
849 // unspecified, the Replay defaults to using `RECENT_ACCESSES`.
850 // "RECENT_ACCESSES" - All access logs from the last 90 days. These logs may
851 // not include logs from the most recent 7 days.
852 LogSource string `json:"logSource,omitempty"`
853 // PolicyOverlay: A mapping of the resources that you want to simulate policies
854 // for and the policies that you want to simulate. Keys are the full resource
855 // names for the resources. For example,
856 // `//cloudresourcemanager.googleapis.com/projects/my-project`. For examples of
857 // full resource names for Google Cloud services, see
858 // https://cloud.google.com/iam/help/troubleshooter/full-resource-names. Values
859 // are Policy objects representing the policies that you want to simulate.
860 // Replays automatically take into account any IAM policies inherited through
861 // the resource hierarchy, and any policies set on descendant resources. You do
862 // not need to include these policies in the policy overlay.
863 PolicyOverlay map[string]GoogleIamV1Policy `json:"policyOverlay,omitempty"`
864 // ForceSendFields is a list of field names (e.g. "LogSource") to
865 // unconditionally include in API requests. By default, fields with empty or
866 // default values are omitted from API requests. See
867 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
868 // details.
869 ForceSendFields []string `json:"-"`
870 // NullFields is a list of field names (e.g. "LogSource") to include in API
871 // requests with the JSON null value. By default, fields with empty values are
872 // omitted from API requests. See
873 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
874 NullFields []string `json:"-"`
875 }
876
877 func (s GoogleCloudPolicysimulatorV1ReplayConfig) MarshalJSON() ([]byte, error) {
878 type NoMethod GoogleCloudPolicysimulatorV1ReplayConfig
879 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
880 }
881
882 // GoogleCloudPolicysimulatorV1ReplayOperationMetadata: Metadata about a Replay
883 // operation.
884 type GoogleCloudPolicysimulatorV1ReplayOperationMetadata struct {
885 // StartTime: Time when the request was received.
886 StartTime string `json:"startTime,omitempty"`
887 // ForceSendFields is a list of field names (e.g. "StartTime") to
888 // unconditionally include in API requests. By default, fields with empty or
889 // default values are omitted from API requests. See
890 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
891 // details.
892 ForceSendFields []string `json:"-"`
893 // NullFields is a list of field names (e.g. "StartTime") to include in API
894 // requests with the JSON null value. By default, fields with empty values are
895 // omitted from API requests. See
896 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
897 NullFields []string `json:"-"`
898 }
899
900 func (s GoogleCloudPolicysimulatorV1ReplayOperationMetadata) MarshalJSON() ([]byte, error) {
901 type NoMethod GoogleCloudPolicysimulatorV1ReplayOperationMetadata
902 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
903 }
904
905 // GoogleCloudPolicysimulatorV1ReplayResultsSummary: Summary statistics about
906 // the replayed log entries.
907 type GoogleCloudPolicysimulatorV1ReplayResultsSummary struct {
908 // DifferenceCount: The number of replayed log entries with a difference
909 // between baseline and simulated policies.
910 DifferenceCount int64 `json:"differenceCount,omitempty"`
911 // ErrorCount: The number of log entries that could not be replayed.
912 ErrorCount int64 `json:"errorCount,omitempty"`
913 // LogCount: The total number of log entries replayed.
914 LogCount int64 `json:"logCount,omitempty"`
915 // NewestDate: The date of the newest log entry replayed.
916 NewestDate *GoogleTypeDate `json:"newestDate,omitempty"`
917 // OldestDate: The date of the oldest log entry replayed.
918 OldestDate *GoogleTypeDate `json:"oldestDate,omitempty"`
919 // UnchangedCount: The number of replayed log entries with no difference
920 // between baseline and simulated policies.
921 UnchangedCount int64 `json:"unchangedCount,omitempty"`
922 // ForceSendFields is a list of field names (e.g. "DifferenceCount") to
923 // unconditionally include in API requests. By default, fields with empty or
924 // default values are omitted from API requests. See
925 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
926 // details.
927 ForceSendFields []string `json:"-"`
928 // NullFields is a list of field names (e.g. "DifferenceCount") to include in
929 // API requests with the JSON null value. By default, fields with empty values
930 // are omitted from API requests. See
931 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
932 NullFields []string `json:"-"`
933 }
934
935 func (s GoogleCloudPolicysimulatorV1ReplayResultsSummary) MarshalJSON() ([]byte, error) {
936 type NoMethod GoogleCloudPolicysimulatorV1ReplayResultsSummary
937 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
938 }
939
940 // GoogleCloudPolicysimulatorV1betaAccessStateDiff: A summary and comparison of
941 // the principal's access under the current (baseline) policies and the
942 // proposed (simulated) policies for a single access tuple.
943 type GoogleCloudPolicysimulatorV1betaAccessStateDiff struct {
944 // AccessChange: How the principal's access, specified in the AccessState
945 // field, changed between the current (baseline) policies and proposed
946 // (simulated) policies.
947 //
948 // Possible values:
949 // "ACCESS_CHANGE_TYPE_UNSPECIFIED" - Default value. This value is unused.
950 // "NO_CHANGE" - The principal's access did not change. This includes the
951 // case where both baseline and simulated are UNKNOWN, but the unknown
952 // information is equivalent.
953 // "UNKNOWN_CHANGE" - The principal's access under both the current policies
954 // and the proposed policies is `UNKNOWN`, but the unknown information differs
955 // between them.
956 // "ACCESS_REVOKED" - The principal had access under the current policies
957 // (`GRANTED`), but will no longer have access after the proposed changes
958 // (`NOT_GRANTED`).
959 // "ACCESS_GAINED" - The principal did not have access under the current
960 // policies (`NOT_GRANTED`), but will have access after the proposed changes
961 // (`GRANTED`).
962 // "ACCESS_MAYBE_REVOKED" - This result can occur for the following reasons:
963 // * The principal had access under the current policies (`GRANTED`), but their
964 // access after the proposed changes is `UNKNOWN`. * The principal's access
965 // under the current policies is `UNKNOWN`, but they will not have access after
966 // the proposed changes (`NOT_GRANTED`).
967 // "ACCESS_MAYBE_GAINED" - This result can occur for the following reasons: *
968 // The principal did not have access under the current policies
969 // (`NOT_GRANTED`), but their access after the proposed changes is `UNKNOWN`. *
970 // The principal's access under the current policies is `UNKNOWN`, but they
971 // will have access after the proposed changes (`GRANTED`).
972 AccessChange string `json:"accessChange,omitempty"`
973 // Baseline: The results of evaluating the access tuple under the current
974 // (baseline) policies. If the AccessState couldn't be fully evaluated, this
975 // field explains why.
976 Baseline *GoogleCloudPolicysimulatorV1betaExplainedAccess `json:"baseline,omitempty"`
977 // Simulated: The results of evaluating the access tuple under the proposed
978 // (simulated) policies. If the AccessState couldn't be fully evaluated, this
979 // field explains why.
980 Simulated *GoogleCloudPolicysimulatorV1betaExplainedAccess `json:"simulated,omitempty"`
981 // ForceSendFields is a list of field names (e.g. "AccessChange") to
982 // unconditionally include in API requests. By default, fields with empty or
983 // default values are omitted from API requests. See
984 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
985 // details.
986 ForceSendFields []string `json:"-"`
987 // NullFields is a list of field names (e.g. "AccessChange") to include in API
988 // requests with the JSON null value. By default, fields with empty values are
989 // omitted from API requests. See
990 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
991 NullFields []string `json:"-"`
992 }
993
994 func (s GoogleCloudPolicysimulatorV1betaAccessStateDiff) MarshalJSON() ([]byte, error) {
995 type NoMethod GoogleCloudPolicysimulatorV1betaAccessStateDiff
996 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
997 }
998
999 // GoogleCloudPolicysimulatorV1betaAccessTuple: Information about the
1000 // principal, resource, and permission to check.
1001 type GoogleCloudPolicysimulatorV1betaAccessTuple struct {
1002 // FullResourceName: Required. The full resource name that identifies the
1003 // resource. For example,
1004 // `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/m
1005 // y-instance`. For examples of full resource names for Google Cloud services,
1006 // see https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
1007 FullResourceName string `json:"fullResourceName,omitempty"`
1008 // Permission: Required. The IAM permission to check for the specified
1009 // principal and resource. For a complete list of IAM permissions, see
1010 // https://cloud.google.com/iam/help/permissions/reference. For a complete list
1011 // of predefined IAM roles and the permissions in each role, see
1012 // https://cloud.google.com/iam/help/roles/reference.
1013 Permission string `json:"permission,omitempty"`
1014 // Principal: Required. The principal whose access you want to check, in the
1015 // form of the email address that represents that principal. For example,
1016 // `[email protected]` or
1017 // `[email protected]`. The principal must
1018 // be a Google Account or a service account. Other types of principals are not
1019 // supported.
1020 Principal string `json:"principal,omitempty"`
1021 // ForceSendFields is a list of field names (e.g. "FullResourceName") to
1022 // unconditionally include in API requests. By default, fields with empty or
1023 // default values are omitted from API requests. See
1024 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1025 // details.
1026 ForceSendFields []string `json:"-"`
1027 // NullFields is a list of field names (e.g. "FullResourceName") to include in
1028 // API requests with the JSON null value. By default, fields with empty values
1029 // are omitted from API requests. See
1030 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1031 NullFields []string `json:"-"`
1032 }
1033
1034 func (s GoogleCloudPolicysimulatorV1betaAccessTuple) MarshalJSON() ([]byte, error) {
1035 type NoMethod GoogleCloudPolicysimulatorV1betaAccessTuple
1036 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1037 }
1038
1039 // GoogleCloudPolicysimulatorV1betaBindingExplanation: Details about how a
1040 // binding in a policy affects a principal's ability to use a permission.
1041 type GoogleCloudPolicysimulatorV1betaBindingExplanation struct {
1042 // Access: Required. Indicates whether _this binding_ provides the specified
1043 // permission to the specified principal for the specified resource. This field
1044 // does _not_ indicate whether the principal actually has the permission for
1045 // the resource. There might be another binding that overrides this binding. To
1046 // determine whether the principal actually has the permission, use the
1047 // `access` field in the TroubleshootIamPolicyResponse.
1048 //
1049 // Possible values:
1050 // "ACCESS_STATE_UNSPECIFIED" - Default value. This value is unused.
1051 // "GRANTED" - The principal has the permission.
1052 // "NOT_GRANTED" - The principal does not have the permission.
1053 // "UNKNOWN_CONDITIONAL" - The principal has the permission only if a
1054 // condition expression evaluates to `true`.
1055 // "UNKNOWN_INFO_DENIED" - The user who created the Replay does not have
1056 // access to all of the policies that Policy Simulator needs to evaluate.
1057 Access string `json:"access,omitempty"`
1058 // Condition: A condition expression that prevents this binding from granting
1059 // access unless the expression evaluates to `true`. To learn about IAM
1060 // Conditions, see https://cloud.google.com/iam/docs/conditions-overview.
1061 Condition *GoogleTypeExpr `json:"condition,omitempty"`
1062 // Memberships: Indicates whether each principal in the binding includes the
1063 // principal specified in the request, either directly or indirectly. Each key
1064 // identifies a principal in the binding, and each value indicates whether the
1065 // principal in the binding includes the principal in the request. For example,
1066 // suppose that a binding includes the following principals: *
1067 // `user:[email protected]` * `group:[email protected]` The principal in
1068 // the replayed access tuple is `user:[email protected]`. This user is a
1069 // principal of the group `group:[email protected]`. For the first
1070 // principal in the binding, the key is `user:[email protected]`, and the
1071 // `membership` field in the value is set to `MEMBERSHIP_NOT_INCLUDED`. For the
1072 // second principal in the binding, the key is `group:[email protected]`,
1073 // and the `membership` field in the value is set to `MEMBERSHIP_INCLUDED`.
1074 Memberships map[string]GoogleCloudPolicysimulatorV1betaBindingExplanationAnnotatedMembership `json:"memberships,omitempty"`
1075 // Relevance: The relevance of this binding to the overall determination for
1076 // the entire policy.
1077 //
1078 // Possible values:
1079 // "HEURISTIC_RELEVANCE_UNSPECIFIED" - Default value. This value is unused.
1080 // "NORMAL" - The data point has a limited effect on the result. Changing the
1081 // data point is unlikely to affect the overall determination.
1082 // "HIGH" - The data point has a strong effect on the result. Changing the
1083 // data point is likely to affect the overall determination.
1084 Relevance string `json:"relevance,omitempty"`
1085 // Role: The role that this binding grants. For example,
1086 // `roles/compute.serviceAgent`. For a complete list of predefined IAM roles,
1087 // as well as the permissions in each role, see
1088 // https://cloud.google.com/iam/help/roles/reference.
1089 Role string `json:"role,omitempty"`
1090 // RolePermission: Indicates whether the role granted by this binding contains
1091 // the specified permission.
1092 //
1093 // Possible values:
1094 // "ROLE_PERMISSION_UNSPECIFIED" - Default value. This value is unused.
1095 // "ROLE_PERMISSION_INCLUDED" - The permission is included in the role.
1096 // "ROLE_PERMISSION_NOT_INCLUDED" - The permission is not included in the
1097 // role.
1098 // "ROLE_PERMISSION_UNKNOWN_INFO_DENIED" - The user who created the Replay is
1099 // not allowed to access the binding.
1100 RolePermission string `json:"rolePermission,omitempty"`
1101 // RolePermissionRelevance: The relevance of the permission's existence, or
1102 // nonexistence, in the role to the overall determination for the entire
1103 // policy.
1104 //
1105 // Possible values:
1106 // "HEURISTIC_RELEVANCE_UNSPECIFIED" - Default value. This value is unused.
1107 // "NORMAL" - The data point has a limited effect on the result. Changing the
1108 // data point is unlikely to affect the overall determination.
1109 // "HIGH" - The data point has a strong effect on the result. Changing the
1110 // data point is likely to affect the overall determination.
1111 RolePermissionRelevance string `json:"rolePermissionRelevance,omitempty"`
1112 // ForceSendFields is a list of field names (e.g. "Access") to unconditionally
1113 // include in API requests. By default, fields with empty or default values are
1114 // omitted from API requests. See
1115 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1116 // details.
1117 ForceSendFields []string `json:"-"`
1118 // NullFields is a list of field names (e.g. "Access") to include in API
1119 // requests with the JSON null value. By default, fields with empty values are
1120 // omitted from API requests. See
1121 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1122 NullFields []string `json:"-"`
1123 }
1124
1125 func (s GoogleCloudPolicysimulatorV1betaBindingExplanation) MarshalJSON() ([]byte, error) {
1126 type NoMethod GoogleCloudPolicysimulatorV1betaBindingExplanation
1127 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1128 }
1129
1130 // GoogleCloudPolicysimulatorV1betaBindingExplanationAnnotatedMembership:
1131 // Details about whether the binding includes the principal.
1132 type GoogleCloudPolicysimulatorV1betaBindingExplanationAnnotatedMembership struct {
1133 // Membership: Indicates whether the binding includes the principal.
1134 //
1135 // Possible values:
1136 // "MEMBERSHIP_UNSPECIFIED" - Default value. This value is unused.
1137 // "MEMBERSHIP_INCLUDED" - The binding includes the principal. The principal
1138 // can be included directly or indirectly. For example: * A principal is
1139 // included directly if that principal is listed in the binding. * A principal
1140 // is included indirectly if that principal is in a Google group or Google
1141 // Workspace domain that is listed in the binding.
1142 // "MEMBERSHIP_NOT_INCLUDED" - The binding does not include the principal.
1143 // "MEMBERSHIP_UNKNOWN_INFO_DENIED" - The user who created the Replay is not
1144 // allowed to access the binding.
1145 // "MEMBERSHIP_UNKNOWN_UNSUPPORTED" - The principal is an unsupported type.
1146 // Only Google Accounts and service accounts are supported.
1147 Membership string `json:"membership,omitempty"`
1148 // Relevance: The relevance of the principal's status to the overall
1149 // determination for the binding.
1150 //
1151 // Possible values:
1152 // "HEURISTIC_RELEVANCE_UNSPECIFIED" - Default value. This value is unused.
1153 // "NORMAL" - The data point has a limited effect on the result. Changing the
1154 // data point is unlikely to affect the overall determination.
1155 // "HIGH" - The data point has a strong effect on the result. Changing the
1156 // data point is likely to affect the overall determination.
1157 Relevance string `json:"relevance,omitempty"`
1158 // ForceSendFields is a list of field names (e.g. "Membership") to
1159 // unconditionally include in API requests. By default, fields with empty or
1160 // default values are omitted from API requests. See
1161 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1162 // details.
1163 ForceSendFields []string `json:"-"`
1164 // NullFields is a list of field names (e.g. "Membership") to include in API
1165 // requests with the JSON null value. By default, fields with empty values are
1166 // omitted from API requests. See
1167 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1168 NullFields []string `json:"-"`
1169 }
1170
1171 func (s GoogleCloudPolicysimulatorV1betaBindingExplanationAnnotatedMembership) MarshalJSON() ([]byte, error) {
1172 type NoMethod GoogleCloudPolicysimulatorV1betaBindingExplanationAnnotatedMembership
1173 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1174 }
1175
1176 // GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMeta
1177 // data: CreateOrgPolicyViolationsPreviewOperationMetadata is metadata about an
1178 // OrgPolicyViolationsPreview generations operation.
1179 type GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata struct {
1180 // RequestTime: Time when the request was received.
1181 RequestTime string `json:"requestTime,omitempty"`
1182 // ResourcesFound: Total number of resources that need scanning. Should equal
1183 // resource_scanned + resources_pending
1184 ResourcesFound int64 `json:"resourcesFound,omitempty"`
1185 // ResourcesPending: Number of resources still to scan.
1186 ResourcesPending int64 `json:"resourcesPending,omitempty"`
1187 // ResourcesScanned: Number of resources already scanned.
1188 ResourcesScanned int64 `json:"resourcesScanned,omitempty"`
1189 // StartTime: Time when the request started processing, i.e., when the state
1190 // was set to RUNNING.
1191 StartTime string `json:"startTime,omitempty"`
1192 // State: Output only. The current state of the operation.
1193 //
1194 // Possible values:
1195 // "PREVIEW_STATE_UNSPECIFIED" - The state is unspecified.
1196 // "PREVIEW_PENDING" - The OrgPolicyViolationsPreview has not been created
1197 // yet.
1198 // "PREVIEW_RUNNING" - The OrgPolicyViolationsPreview is currently being
1199 // created.
1200 // "PREVIEW_SUCCEEDED" - The OrgPolicyViolationsPreview creation finished
1201 // successfully.
1202 // "PREVIEW_FAILED" - The OrgPolicyViolationsPreview creation failed with an
1203 // error.
1204 State string `json:"state,omitempty"`
1205 // ForceSendFields is a list of field names (e.g. "RequestTime") to
1206 // unconditionally include in API requests. By default, fields with empty or
1207 // default values are omitted from API requests. See
1208 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1209 // details.
1210 ForceSendFields []string `json:"-"`
1211 // NullFields is a list of field names (e.g. "RequestTime") to include in API
1212 // requests with the JSON null value. By default, fields with empty values are
1213 // omitted from API requests. See
1214 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1215 NullFields []string `json:"-"`
1216 }
1217
1218 func (s GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata) MarshalJSON() ([]byte, error) {
1219 type NoMethod GoogleCloudPolicysimulatorV1betaCreateOrgPolicyViolationsPreviewOperationMetadata
1220 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1221 }
1222
1223 // GoogleCloudPolicysimulatorV1betaExplainedAccess: Details about how a set of
1224 // policies, listed in ExplainedPolicy, resulted in a certain AccessState when
1225 // replaying an access tuple.
1226 type GoogleCloudPolicysimulatorV1betaExplainedAccess struct {
1227 // AccessState: Whether the principal in the access tuple has permission to
1228 // access the resource in the access tuple under the given policies.
1229 //
1230 // Possible values:
1231 // "ACCESS_STATE_UNSPECIFIED" - Default value. This value is unused.
1232 // "GRANTED" - The principal has the permission.
1233 // "NOT_GRANTED" - The principal does not have the permission.
1234 // "UNKNOWN_CONDITIONAL" - The principal has the permission only if a
1235 // condition expression evaluates to `true`.
1236 // "UNKNOWN_INFO_DENIED" - The user who created the Replay does not have
1237 // access to all of the policies that Policy Simulator needs to evaluate.
1238 AccessState string `json:"accessState,omitempty"`
1239 // Errors: If the AccessState is `UNKNOWN`, this field contains a list of
1240 // errors explaining why the result is `UNKNOWN`. If the `AccessState` is
1241 // `GRANTED` or `NOT_GRANTED`, this field is omitted.
1242 Errors []*GoogleRpcStatus `json:"errors,omitempty"`
1243 // Policies: If the AccessState is `UNKNOWN`, this field contains the policies
1244 // that led to that result. If the `AccessState` is `GRANTED` or `NOT_GRANTED`,
1245 // this field is omitted.
1246 Policies []*GoogleCloudPolicysimulatorV1betaExplainedPolicy `json:"policies,omitempty"`
1247 // ForceSendFields is a list of field names (e.g. "AccessState") 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. "AccessState") to include in API
1254 // requests with the JSON null value. By default, fields with empty values are
1255 // 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 GoogleCloudPolicysimulatorV1betaExplainedAccess) MarshalJSON() ([]byte, error) {
1261 type NoMethod GoogleCloudPolicysimulatorV1betaExplainedAccess
1262 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1263 }
1264
1265 // GoogleCloudPolicysimulatorV1betaExplainedPolicy: Details about how a
1266 // specific IAM Policy contributed to the access check.
1267 type GoogleCloudPolicysimulatorV1betaExplainedPolicy struct {
1268 // Access: Indicates whether _this policy_ provides the specified permission to
1269 // the specified principal for the specified resource. This field does _not_
1270 // indicate whether the principal actually has the permission for the resource.
1271 // There might be another policy that overrides this policy. To determine
1272 // whether the principal actually has the permission, use the `access` field in
1273 // the TroubleshootIamPolicyResponse.
1274 //
1275 // Possible values:
1276 // "ACCESS_STATE_UNSPECIFIED" - Default value. This value is unused.
1277 // "GRANTED" - The principal has the permission.
1278 // "NOT_GRANTED" - The principal does not have the permission.
1279 // "UNKNOWN_CONDITIONAL" - The principal has the permission only if a
1280 // condition expression evaluates to `true`.
1281 // "UNKNOWN_INFO_DENIED" - The user who created the Replay does not have
1282 // access to all of the policies that Policy Simulator needs to evaluate.
1283 Access string `json:"access,omitempty"`
1284 // BindingExplanations: Details about how each binding in the policy affects
1285 // the principal's ability, or inability, to use the permission for the
1286 // resource. If the user who created the Replay does not have access to the
1287 // policy, this field is omitted.
1288 BindingExplanations []*GoogleCloudPolicysimulatorV1betaBindingExplanation `json:"bindingExplanations,omitempty"`
1289 // FullResourceName: The full resource name that identifies the resource. For
1290 // example,
1291 // `//compute.googleapis.com/projects/my-project/zones/us-central1-a/instances/m
1292 // y-instance`. If the user who created the Replay does not have access to the
1293 // policy, this field is omitted. For examples of full resource names for
1294 // Google Cloud services, see
1295 // https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
1296 FullResourceName string `json:"fullResourceName,omitempty"`
1297 // Policy: The IAM policy attached to the resource. If the user who created the
1298 // Replay does not have access to the policy, this field is empty.
1299 Policy *GoogleIamV1Policy `json:"policy,omitempty"`
1300 // Relevance: The relevance of this policy to the overall determination in the
1301 // TroubleshootIamPolicyResponse. If the user who created the Replay does not
1302 // have access to the policy, this field is omitted.
1303 //
1304 // Possible values:
1305 // "HEURISTIC_RELEVANCE_UNSPECIFIED" - Default value. This value is unused.
1306 // "NORMAL" - The data point has a limited effect on the result. Changing the
1307 // data point is unlikely to affect the overall determination.
1308 // "HIGH" - The data point has a strong effect on the result. Changing the
1309 // data point is likely to affect the overall determination.
1310 Relevance string `json:"relevance,omitempty"`
1311 // ForceSendFields is a list of field names (e.g. "Access") to unconditionally
1312 // include in API requests. By default, fields with empty or default values are
1313 // omitted from API requests. See
1314 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1315 // details.
1316 ForceSendFields []string `json:"-"`
1317 // NullFields is a list of field names (e.g. "Access") to include in API
1318 // requests with the JSON null value. By default, fields with empty values are
1319 // omitted from API requests. See
1320 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1321 NullFields []string `json:"-"`
1322 }
1323
1324 func (s GoogleCloudPolicysimulatorV1betaExplainedPolicy) MarshalJSON() ([]byte, error) {
1325 type NoMethod GoogleCloudPolicysimulatorV1betaExplainedPolicy
1326 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1327 }
1328
1329 // GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMe
1330 // tadata: GenerateOrgPolicyViolationsPreviewOperationMetadata is metadata
1331 // about an OrgPolicyViolationsPreview generations operation.
1332 type GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata struct {
1333 // RequestTime: Time when the request was received.
1334 RequestTime string `json:"requestTime,omitempty"`
1335 // ResourcesFound: Total number of resources that need scanning. Should equal
1336 // resource_scanned + resources_pending
1337 ResourcesFound int64 `json:"resourcesFound,omitempty"`
1338 // ResourcesPending: Number of resources still to scan.
1339 ResourcesPending int64 `json:"resourcesPending,omitempty"`
1340 // ResourcesScanned: Number of resources already scanned.
1341 ResourcesScanned int64 `json:"resourcesScanned,omitempty"`
1342 // StartTime: Time when the request started processing, i.e. when the state was
1343 // set to RUNNING.
1344 StartTime string `json:"startTime,omitempty"`
1345 // State: The current state of the operation.
1346 //
1347 // Possible values:
1348 // "PREVIEW_STATE_UNSPECIFIED" - The state is unspecified.
1349 // "PREVIEW_PENDING" - The OrgPolicyViolationsPreview has not been created
1350 // yet.
1351 // "PREVIEW_RUNNING" - The OrgPolicyViolationsPreview is currently being
1352 // created.
1353 // "PREVIEW_SUCCEEDED" - The OrgPolicyViolationsPreview creation finished
1354 // successfully.
1355 // "PREVIEW_FAILED" - The OrgPolicyViolationsPreview creation failed with an
1356 // error.
1357 State string `json:"state,omitempty"`
1358 // ForceSendFields is a list of field names (e.g. "RequestTime") to
1359 // unconditionally include in API requests. By default, fields with empty or
1360 // default values are omitted from API requests. See
1361 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1362 // details.
1363 ForceSendFields []string `json:"-"`
1364 // NullFields is a list of field names (e.g. "RequestTime") to include in API
1365 // requests with the JSON null value. By default, fields with empty values are
1366 // omitted from API requests. See
1367 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1368 NullFields []string `json:"-"`
1369 }
1370
1371 func (s GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata) MarshalJSON() ([]byte, error) {
1372 type NoMethod GoogleCloudPolicysimulatorV1betaGenerateOrgPolicyViolationsPreviewOperationMetadata
1373 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1374 }
1375
1376 // GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsPreviewsResponse:
1377 // ListOrgPolicyViolationsPreviewsResponse is the response message for
1378 // OrgPolicyViolationsPreviewService.ListOrgPolicyViolationsPreviews.
1379 type GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsPreviewsResponse struct {
1380 // NextPageToken: A token that you can use to retrieve the next page of
1381 // results. If this field is omitted, there are no subsequent pages.
1382 NextPageToken string `json:"nextPageToken,omitempty"`
1383 // OrgPolicyViolationsPreviews: The list of OrgPolicyViolationsPreview
1384 OrgPolicyViolationsPreviews []*GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview `json:"orgPolicyViolationsPreviews,omitempty"`
1385
1386 // ServerResponse contains the HTTP response code and headers from the server.
1387 googleapi.ServerResponse `json:"-"`
1388 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1389 // unconditionally include in API requests. By default, fields with empty or
1390 // default values are omitted from API requests. See
1391 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1392 // details.
1393 ForceSendFields []string `json:"-"`
1394 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1395 // requests with the JSON null value. By default, fields with empty values are
1396 // omitted from API requests. See
1397 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1398 NullFields []string `json:"-"`
1399 }
1400
1401 func (s GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsPreviewsResponse) MarshalJSON() ([]byte, error) {
1402 type NoMethod GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsPreviewsResponse
1403 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1404 }
1405
1406 // GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsResponse:
1407 // ListOrgPolicyViolationsResponse is the response message for
1408 // OrgPolicyViolationsPreviewService.ListOrgPolicyViolations
1409 type GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsResponse struct {
1410 // NextPageToken: A token that you can use to retrieve the next page of
1411 // results. If this field is omitted, there are no subsequent pages.
1412 NextPageToken string `json:"nextPageToken,omitempty"`
1413 // OrgPolicyViolations: The list of OrgPolicyViolations
1414 OrgPolicyViolations []*GoogleCloudPolicysimulatorV1betaOrgPolicyViolation `json:"orgPolicyViolations,omitempty"`
1415
1416 // ServerResponse contains the HTTP response code and headers from the server.
1417 googleapi.ServerResponse `json:"-"`
1418 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1419 // unconditionally include in API requests. By default, fields with empty or
1420 // default values are omitted from API requests. See
1421 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1422 // details.
1423 ForceSendFields []string `json:"-"`
1424 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1425 // requests with the JSON null value. By default, fields with empty values are
1426 // omitted from API requests. See
1427 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1428 NullFields []string `json:"-"`
1429 }
1430
1431 func (s GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsResponse) MarshalJSON() ([]byte, error) {
1432 type NoMethod GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsResponse
1433 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1434 }
1435
1436 // GoogleCloudPolicysimulatorV1betaListReplayResultsResponse: Response message
1437 // for Simulator.ListReplayResults.
1438 type GoogleCloudPolicysimulatorV1betaListReplayResultsResponse struct {
1439 // NextPageToken: A token that you can use to retrieve the next page of
1440 // ReplayResult objects. If this field is omitted, there are no subsequent
1441 // pages.
1442 NextPageToken string `json:"nextPageToken,omitempty"`
1443 // ReplayResults: The results of running a Replay.
1444 ReplayResults []*GoogleCloudPolicysimulatorV1betaReplayResult `json:"replayResults,omitempty"`
1445
1446 // ServerResponse contains the HTTP response code and headers from the server.
1447 googleapi.ServerResponse `json:"-"`
1448 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1449 // unconditionally include in API requests. By default, fields with empty or
1450 // default values are omitted from API requests. See
1451 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1452 // details.
1453 ForceSendFields []string `json:"-"`
1454 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1455 // requests with the JSON null value. By default, fields with empty values are
1456 // omitted from API requests. See
1457 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1458 NullFields []string `json:"-"`
1459 }
1460
1461 func (s GoogleCloudPolicysimulatorV1betaListReplayResultsResponse) MarshalJSON() ([]byte, error) {
1462 type NoMethod GoogleCloudPolicysimulatorV1betaListReplayResultsResponse
1463 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1464 }
1465
1466 // GoogleCloudPolicysimulatorV1betaListReplaysResponse: Response message for
1467 // Simulator.ListReplays.
1468 type GoogleCloudPolicysimulatorV1betaListReplaysResponse struct {
1469 // NextPageToken: A token that you can use to retrieve the next page of
1470 // results. If this field is omitted, there are no subsequent pages.
1471 NextPageToken string `json:"nextPageToken,omitempty"`
1472 // Replays: The list of Replay objects.
1473 Replays []*GoogleCloudPolicysimulatorV1betaReplay `json:"replays,omitempty"`
1474
1475 // ServerResponse contains the HTTP response code and headers from the server.
1476 googleapi.ServerResponse `json:"-"`
1477 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1478 // unconditionally include in API requests. By default, fields with empty or
1479 // default values are omitted from API requests. See
1480 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1481 // details.
1482 ForceSendFields []string `json:"-"`
1483 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
1484 // requests with the JSON null value. By default, fields with empty values are
1485 // omitted from API requests. See
1486 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1487 NullFields []string `json:"-"`
1488 }
1489
1490 func (s GoogleCloudPolicysimulatorV1betaListReplaysResponse) MarshalJSON() ([]byte, error) {
1491 type NoMethod GoogleCloudPolicysimulatorV1betaListReplaysResponse
1492 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1493 }
1494
1495 // GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay: The proposed changes to
1496 // OrgPolicy.
1497 type GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay struct {
1498 // CustomConstraints: Optional. The OrgPolicy CustomConstraint changes to
1499 // preview violations for. Any existing CustomConstraints with the same name
1500 // will be overridden in the simulation. That is, violations will be determined
1501 // as if all custom constraints in the overlay were instantiated. Only a single
1502 // custom_constraint is supported in the overlay at a time. For evaluating
1503 // multiple constraints, multiple `GenerateOrgPolicyViolationsPreview` requests
1504 // are made, where each request evaluates a single constraint.
1505 CustomConstraints []*GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay `json:"customConstraints,omitempty"`
1506 // Policies: Optional. The OrgPolicy changes to preview violations for. Any
1507 // existing OrgPolicies with the same name will be overridden in the
1508 // simulation. That is, violations will be determined as if all policies in the
1509 // overlay were created or updated.
1510 Policies []*GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay `json:"policies,omitempty"`
1511 // ForceSendFields is a list of field names (e.g. "CustomConstraints") to
1512 // unconditionally include in API requests. By default, fields with empty or
1513 // default values are omitted from API requests. See
1514 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1515 // details.
1516 ForceSendFields []string `json:"-"`
1517 // NullFields is a list of field names (e.g. "CustomConstraints") to include in
1518 // API requests with the JSON null value. By default, fields with empty values
1519 // are omitted from API requests. See
1520 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1521 NullFields []string `json:"-"`
1522 }
1523
1524 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay) MarshalJSON() ([]byte, error) {
1525 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay
1526 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1527 }
1528
1529 // GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay: A
1530 // change to an OrgPolicy custom constraint.
1531 type GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay struct {
1532 // CustomConstraint: Optional. The new or updated custom constraint.
1533 CustomConstraint *GoogleCloudOrgpolicyV2CustomConstraint `json:"customConstraint,omitempty"`
1534 // CustomConstraintParent: Optional. Resource the constraint is attached to.
1535 // Example: "organization/987654"
1536 CustomConstraintParent string `json:"customConstraintParent,omitempty"`
1537 // ForceSendFields is a list of field names (e.g. "CustomConstraint") to
1538 // unconditionally include in API requests. By default, fields with empty or
1539 // default values are omitted from API requests. See
1540 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1541 // details.
1542 ForceSendFields []string `json:"-"`
1543 // NullFields is a list of field names (e.g. "CustomConstraint") to include in
1544 // API requests with the JSON null value. By default, fields with empty values
1545 // are omitted from API requests. See
1546 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1547 NullFields []string `json:"-"`
1548 }
1549
1550 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay) MarshalJSON() ([]byte, error) {
1551 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayCustomConstraintOverlay
1552 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1553 }
1554
1555 // GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay: A change to
1556 // an OrgPolicy.
1557 type GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay struct {
1558 // Policy: Optional. The new or updated OrgPolicy.
1559 Policy *GoogleCloudOrgpolicyV2Policy `json:"policy,omitempty"`
1560 // PolicyParent: Optional. The parent of the policy we are attaching to.
1561 // Example: "projects/123456"
1562 PolicyParent string `json:"policyParent,omitempty"`
1563 // ForceSendFields is a list of field names (e.g. "Policy") to unconditionally
1564 // include in API requests. By default, fields with empty or default values are
1565 // omitted from API requests. See
1566 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1567 // details.
1568 ForceSendFields []string `json:"-"`
1569 // NullFields is a list of field names (e.g. "Policy") to include in API
1570 // requests with the JSON null value. By default, fields with empty values are
1571 // omitted from API requests. See
1572 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1573 NullFields []string `json:"-"`
1574 }
1575
1576 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay) MarshalJSON() ([]byte, error) {
1577 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyOverlayPolicyOverlay
1578 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1579 }
1580
1581 // GoogleCloudPolicysimulatorV1betaOrgPolicyViolation: OrgPolicyViolation is a
1582 // resource representing a single resource violating a single OrgPolicy
1583 // constraint.
1584 type GoogleCloudPolicysimulatorV1betaOrgPolicyViolation struct {
1585 // CustomConstraint: The custom constraint being violated.
1586 CustomConstraint *GoogleCloudOrgpolicyV2CustomConstraint `json:"customConstraint,omitempty"`
1587 // Error: Any error encountered during the evaluation.
1588 Error *GoogleRpcStatus `json:"error,omitempty"`
1589 // Name: The name of the `OrgPolicyViolation`. Example:
1590 // organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/506
1591 // a5f7f/orgPolicyViolations/38ce`
1592 Name string `json:"name,omitempty"`
1593 // Resource: The resource violating the constraint.
1594 Resource *GoogleCloudPolicysimulatorV1betaResourceContext `json:"resource,omitempty"`
1595 // ForceSendFields is a list of field names (e.g. "CustomConstraint") to
1596 // unconditionally include in API requests. By default, fields with empty or
1597 // default values are omitted from API requests. See
1598 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1599 // details.
1600 ForceSendFields []string `json:"-"`
1601 // NullFields is a list of field names (e.g. "CustomConstraint") to include in
1602 // API requests with the JSON null value. By default, fields with empty values
1603 // are omitted from API requests. See
1604 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1605 NullFields []string `json:"-"`
1606 }
1607
1608 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyViolation) MarshalJSON() ([]byte, error) {
1609 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyViolation
1610 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1611 }
1612
1613 // GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview:
1614 // OrgPolicyViolationsPreview is a resource providing a preview of the
1615 // violations that will exist if an OrgPolicy change is made. The list of
1616 // violations are modeled as child resources and retrieved via a
1617 // ListOrgPolicyViolations API call. There are potentially more
1618 // OrgPolicyViolations than could fit in an embedded field. Thus, the use of a
1619 // child resource instead of a field.
1620 type GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview struct {
1621 // CreateTime: Output only. Time when this `OrgPolicyViolationsPreview` was
1622 // created.
1623 CreateTime string `json:"createTime,omitempty"`
1624 // CustomConstraints: Output only. The names of the constraints against which
1625 // all `OrgPolicyViolations` were evaluated. If `OrgPolicyOverlay` only
1626 // contains `PolicyOverlay` then it contains the name of the configured custom
1627 // constraint, applicable to the specified policies. Otherwise it contains the
1628 // name of the constraint specified in `CustomConstraintOverlay`. Format:
1629 // `organizations/{organization_id}/customConstraints/{custom_constraint_id}`
1630 // Example: `organizations/123/customConstraints/custom.createOnlyE2TypeVms`
1631 CustomConstraints []string `json:"customConstraints,omitempty"`
1632 // Name: Output only. The resource name of the `OrgPolicyViolationsPreview`. It
1633 // has the following format:
1634 // `organizations/{organization}/locations/{location}/orgPolicyViolationsPreview
1635 // s/{orgPolicyViolationsPreview}` Example:
1636 // `organizations/my-example-org/locations/global/orgPolicyViolationsPreviews/50
1637 // 6a5f7f`
1638 Name string `json:"name,omitempty"`
1639 // Overlay: Required. The proposed changes we are previewing violations for.
1640 Overlay *GoogleCloudPolicysimulatorV1betaOrgPolicyOverlay `json:"overlay,omitempty"`
1641 // ResourceCounts: Output only. A summary of the state of all resources scanned
1642 // for compliance with the changed OrgPolicy.
1643 ResourceCounts *GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts `json:"resourceCounts,omitempty"`
1644 // State: Output only. The state of the `OrgPolicyViolationsPreview`.
1645 //
1646 // Possible values:
1647 // "PREVIEW_STATE_UNSPECIFIED" - The state is unspecified.
1648 // "PREVIEW_PENDING" - The OrgPolicyViolationsPreview has not been created
1649 // yet.
1650 // "PREVIEW_RUNNING" - The OrgPolicyViolationsPreview is currently being
1651 // created.
1652 // "PREVIEW_SUCCEEDED" - The OrgPolicyViolationsPreview creation finished
1653 // successfully.
1654 // "PREVIEW_FAILED" - The OrgPolicyViolationsPreview creation failed with an
1655 // error.
1656 State string `json:"state,omitempty"`
1657 // ViolationsCount: Output only. The number of OrgPolicyViolations in this
1658 // `OrgPolicyViolationsPreview`. This count may differ from
1659 // `resource_summary.noncompliant_count` because each OrgPolicyViolation is
1660 // specific to a resource **and** constraint. If there are multiple constraints
1661 // being evaluated (i.e. multiple policies in the overlay), a single resource
1662 // may violate multiple constraints.
1663 ViolationsCount int64 `json:"violationsCount,omitempty"`
1664
1665 // ServerResponse contains the HTTP response code and headers from the server.
1666 googleapi.ServerResponse `json:"-"`
1667 // ForceSendFields is a list of field names (e.g. "CreateTime") to
1668 // unconditionally include in API requests. By default, fields with empty or
1669 // default values are omitted from API requests. See
1670 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1671 // details.
1672 ForceSendFields []string `json:"-"`
1673 // NullFields is a list of field names (e.g. "CreateTime") to include in API
1674 // requests with the JSON null value. By default, fields with empty values are
1675 // omitted from API requests. See
1676 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1677 NullFields []string `json:"-"`
1678 }
1679
1680 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview) MarshalJSON() ([]byte, error) {
1681 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview
1682 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1683 }
1684
1685 // GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts: A
1686 // summary of the state of all resources scanned for compliance with the
1687 // changed OrgPolicy.
1688 type GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts struct {
1689 // Compliant: Output only. Number of scanned resources with zero violations.
1690 Compliant int64 `json:"compliant,omitempty"`
1691 // Errors: Output only. Number of resources that returned an error when
1692 // scanned.
1693 Errors int64 `json:"errors,omitempty"`
1694 // Noncompliant: Output only. Number of scanned resources with at least one
1695 // violation.
1696 Noncompliant int64 `json:"noncompliant,omitempty"`
1697 // Scanned: Output only. Number of resources checked for compliance. Must
1698 // equal: unenforced + noncompliant + compliant + error
1699 Scanned int64 `json:"scanned,omitempty"`
1700 // Unenforced: Output only. Number of resources where the constraint was not
1701 // enforced, i.e. the Policy set `enforced: false` for that resource.
1702 Unenforced int64 `json:"unenforced,omitempty"`
1703 // ForceSendFields is a list of field names (e.g. "Compliant") to
1704 // unconditionally include in API requests. By default, fields with empty or
1705 // default values are omitted from API requests. See
1706 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1707 // details.
1708 ForceSendFields []string `json:"-"`
1709 // NullFields is a list of field names (e.g. "Compliant") to include in API
1710 // requests with the JSON null value. By default, fields with empty values are
1711 // omitted from API requests. See
1712 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1713 NullFields []string `json:"-"`
1714 }
1715
1716 func (s GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts) MarshalJSON() ([]byte, error) {
1717 type NoMethod GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreviewResourceCounts
1718 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1719 }
1720
1721 // GoogleCloudPolicysimulatorV1betaReplay: A resource describing a `Replay`, or
1722 // simulation.
1723 type GoogleCloudPolicysimulatorV1betaReplay struct {
1724 // Config: Required. The configuration used for the `Replay`.
1725 Config *GoogleCloudPolicysimulatorV1betaReplayConfig `json:"config,omitempty"`
1726 // Name: Output only. The resource name of the `Replay`, which has the
1727 // following format:
1728 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{rep
1729 // lay-id}`, where `{resource-id}` is the ID of the project, folder, or
1730 // organization that owns the Replay. Example:
1731 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03
1732 // -479ce1833c36`
1733 Name string `json:"name,omitempty"`
1734 // ResultsSummary: Output only. Summary statistics about the replayed log
1735 // entries.
1736 ResultsSummary *GoogleCloudPolicysimulatorV1betaReplayResultsSummary `json:"resultsSummary,omitempty"`
1737 // State: Output only. The current state of the `Replay`.
1738 //
1739 // Possible values:
1740 // "STATE_UNSPECIFIED" - Default value. This value is unused.
1741 // "PENDING" - The `Replay` has not started yet.
1742 // "RUNNING" - The `Replay` is currently running.
1743 // "SUCCEEDED" - The `Replay` has successfully completed.
1744 // "FAILED" - The `Replay` has finished with an error.
1745 State string `json:"state,omitempty"`
1746
1747 // ServerResponse contains the HTTP response code and headers from the server.
1748 googleapi.ServerResponse `json:"-"`
1749 // ForceSendFields is a list of field names (e.g. "Config") to unconditionally
1750 // include in API requests. By default, fields with empty or default values are
1751 // omitted from API requests. See
1752 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1753 // details.
1754 ForceSendFields []string `json:"-"`
1755 // NullFields is a list of field names (e.g. "Config") to include in API
1756 // requests with the JSON null value. By default, fields with empty values are
1757 // omitted from API requests. See
1758 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1759 NullFields []string `json:"-"`
1760 }
1761
1762 func (s GoogleCloudPolicysimulatorV1betaReplay) MarshalJSON() ([]byte, error) {
1763 type NoMethod GoogleCloudPolicysimulatorV1betaReplay
1764 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1765 }
1766
1767 // GoogleCloudPolicysimulatorV1betaReplayConfig: The configuration used for a
1768 // Replay.
1769 type GoogleCloudPolicysimulatorV1betaReplayConfig struct {
1770 // LogSource: The logs to use as input for the Replay.
1771 //
1772 // Possible values:
1773 // "LOG_SOURCE_UNSPECIFIED" - An unspecified log source. If the log source is
1774 // unspecified, the Replay defaults to using `RECENT_ACCESSES`.
1775 // "RECENT_ACCESSES" - All access logs from the last 90 days. These logs may
1776 // not include logs from the most recent 7 days.
1777 LogSource string `json:"logSource,omitempty"`
1778 // PolicyOverlay: A mapping of the resources that you want to simulate policies
1779 // for and the policies that you want to simulate. Keys are the full resource
1780 // names for the resources. For example,
1781 // `//cloudresourcemanager.googleapis.com/projects/my-project`. For examples of
1782 // full resource names for Google Cloud services, see
1783 // https://cloud.google.com/iam/help/troubleshooter/full-resource-names. Values
1784 // are Policy objects representing the policies that you want to simulate.
1785 // Replays automatically take into account any IAM policies inherited through
1786 // the resource hierarchy, and any policies set on descendant resources. You do
1787 // not need to include these policies in the policy overlay.
1788 PolicyOverlay map[string]GoogleIamV1Policy `json:"policyOverlay,omitempty"`
1789 // ForceSendFields is a list of field names (e.g. "LogSource") to
1790 // unconditionally include in API requests. By default, fields with empty or
1791 // default values are omitted from API requests. See
1792 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1793 // details.
1794 ForceSendFields []string `json:"-"`
1795 // NullFields is a list of field names (e.g. "LogSource") to include in API
1796 // requests with the JSON null value. By default, fields with empty values are
1797 // omitted from API requests. See
1798 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1799 NullFields []string `json:"-"`
1800 }
1801
1802 func (s GoogleCloudPolicysimulatorV1betaReplayConfig) MarshalJSON() ([]byte, error) {
1803 type NoMethod GoogleCloudPolicysimulatorV1betaReplayConfig
1804 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1805 }
1806
1807 // GoogleCloudPolicysimulatorV1betaReplayDiff: The difference between the
1808 // results of evaluating an access tuple under the current (baseline) policies
1809 // and under the proposed (simulated) policies. This difference explains how a
1810 // principal's access could change if the proposed policies were applied.
1811 type GoogleCloudPolicysimulatorV1betaReplayDiff struct {
1812 // AccessDiff: A summary and comparison of the principal's access under the
1813 // current (baseline) policies and the proposed (simulated) policies for a
1814 // single access tuple. The evaluation of the principal's access is reported in
1815 // the AccessState field.
1816 AccessDiff *GoogleCloudPolicysimulatorV1betaAccessStateDiff `json:"accessDiff,omitempty"`
1817 // ForceSendFields is a list of field names (e.g. "AccessDiff") to
1818 // unconditionally include in API requests. By default, fields with empty or
1819 // default values are omitted from API requests. See
1820 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1821 // details.
1822 ForceSendFields []string `json:"-"`
1823 // NullFields is a list of field names (e.g. "AccessDiff") to include in API
1824 // requests with the JSON null value. By default, fields with empty values are
1825 // omitted from API requests. See
1826 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1827 NullFields []string `json:"-"`
1828 }
1829
1830 func (s GoogleCloudPolicysimulatorV1betaReplayDiff) MarshalJSON() ([]byte, error) {
1831 type NoMethod GoogleCloudPolicysimulatorV1betaReplayDiff
1832 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1833 }
1834
1835 // GoogleCloudPolicysimulatorV1betaReplayResult: The result of replaying a
1836 // single access tuple against a simulated state.
1837 type GoogleCloudPolicysimulatorV1betaReplayResult struct {
1838 // AccessTuple: The access tuple that was replayed. This field includes
1839 // information about the principal, resource, and permission that were involved
1840 // in the access attempt.
1841 AccessTuple *GoogleCloudPolicysimulatorV1betaAccessTuple `json:"accessTuple,omitempty"`
1842 // Diff: The difference between the principal's access under the current
1843 // (baseline) policies and the principal's access under the proposed
1844 // (simulated) policies. This field is only included for access tuples that
1845 // were successfully replayed and had different results under the current
1846 // policies and the proposed policies.
1847 Diff *GoogleCloudPolicysimulatorV1betaReplayDiff `json:"diff,omitempty"`
1848 // Error: The error that caused the access tuple replay to fail. This field is
1849 // only included for access tuples that were not replayed successfully.
1850 Error *GoogleRpcStatus `json:"error,omitempty"`
1851 // LastSeenDate: The latest date this access tuple was seen in the logs.
1852 LastSeenDate *GoogleTypeDate `json:"lastSeenDate,omitempty"`
1853 // Name: The resource name of the `ReplayResult`, in the following format:
1854 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{rep
1855 // lay-id}/results/{replay-result-id}`, where `{resource-id}` is the ID of the
1856 // project, folder, or organization that owns the Replay. Example:
1857 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03
1858 // -479ce1833c36/results/1234`
1859 Name string `json:"name,omitempty"`
1860 // Parent: The Replay that the access tuple was included in.
1861 Parent string `json:"parent,omitempty"`
1862 // ForceSendFields is a list of field names (e.g. "AccessTuple") to
1863 // unconditionally include in API requests. By default, fields with empty or
1864 // default values are omitted from API requests. See
1865 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1866 // details.
1867 ForceSendFields []string `json:"-"`
1868 // NullFields is a list of field names (e.g. "AccessTuple") to include in API
1869 // requests with the JSON null value. By default, fields with empty values are
1870 // omitted from API requests. See
1871 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1872 NullFields []string `json:"-"`
1873 }
1874
1875 func (s GoogleCloudPolicysimulatorV1betaReplayResult) MarshalJSON() ([]byte, error) {
1876 type NoMethod GoogleCloudPolicysimulatorV1betaReplayResult
1877 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1878 }
1879
1880 // GoogleCloudPolicysimulatorV1betaReplayResultsSummary: Summary statistics
1881 // about the replayed log entries.
1882 type GoogleCloudPolicysimulatorV1betaReplayResultsSummary struct {
1883 // DifferenceCount: The number of replayed log entries with a difference
1884 // between baseline and simulated policies.
1885 DifferenceCount int64 `json:"differenceCount,omitempty"`
1886 // ErrorCount: The number of log entries that could not be replayed.
1887 ErrorCount int64 `json:"errorCount,omitempty"`
1888 // LogCount: The total number of log entries replayed.
1889 LogCount int64 `json:"logCount,omitempty"`
1890 // NewestDate: The date of the newest log entry replayed.
1891 NewestDate *GoogleTypeDate `json:"newestDate,omitempty"`
1892 // OldestDate: The date of the oldest log entry replayed.
1893 OldestDate *GoogleTypeDate `json:"oldestDate,omitempty"`
1894 // UnchangedCount: The number of replayed log entries with no difference
1895 // between baseline and simulated policies.
1896 UnchangedCount int64 `json:"unchangedCount,omitempty"`
1897 // ForceSendFields is a list of field names (e.g. "DifferenceCount") to
1898 // unconditionally include in API requests. By default, fields with empty or
1899 // default values are omitted from API requests. See
1900 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1901 // details.
1902 ForceSendFields []string `json:"-"`
1903 // NullFields is a list of field names (e.g. "DifferenceCount") to include in
1904 // API requests with the JSON null value. By default, fields with empty values
1905 // are omitted from API requests. See
1906 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1907 NullFields []string `json:"-"`
1908 }
1909
1910 func (s GoogleCloudPolicysimulatorV1betaReplayResultsSummary) MarshalJSON() ([]byte, error) {
1911 type NoMethod GoogleCloudPolicysimulatorV1betaReplayResultsSummary
1912 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1913 }
1914
1915 // GoogleCloudPolicysimulatorV1betaResourceContext: ResourceContext provides
1916 // the context we know about a resource. It is similar in concept to
1917 // google.cloud.asset.v1.Resource, but focuses on the information specifically
1918 // used by Simulator.
1919 type GoogleCloudPolicysimulatorV1betaResourceContext struct {
1920 // Ancestors: The ancestry path of the resource in Google Cloud resource
1921 // hierarchy
1922 // (https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
1923 // represented as a list of relative resource names. An ancestry path starts
1924 // with the closest ancestor in the hierarchy and ends at root. If the resource
1925 // is a project, folder, or organization, the ancestry path starts from the
1926 // resource itself. Example: `["projects/123456789", "folders/5432",
1927 // "organizations/1234"]`
1928 Ancestors []string `json:"ancestors,omitempty"`
1929 // AssetType: The asset type of the resource as defined by CAIS. Example:
1930 // `compute.googleapis.com/Firewall` See Supported asset types
1931 // (https://cloud.google.com/asset-inventory/docs/supported-asset-types) for
1932 // more information.
1933 AssetType string `json:"assetType,omitempty"`
1934 // Resource: The full name of the resource. Example:
1935 // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/insta
1936 // nce1` See Resource names
1937 // (https://cloud.google.com/apis/design/resource_names#full_resource_name) for
1938 // more information.
1939 Resource string `json:"resource,omitempty"`
1940 // ForceSendFields is a list of field names (e.g. "Ancestors") to
1941 // unconditionally include in API requests. By default, fields with empty or
1942 // default values are omitted from API requests. See
1943 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1944 // details.
1945 ForceSendFields []string `json:"-"`
1946 // NullFields is a list of field names (e.g. "Ancestors") to include in API
1947 // requests with the JSON null value. By default, fields with empty values are
1948 // omitted from API requests. See
1949 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1950 NullFields []string `json:"-"`
1951 }
1952
1953 func (s GoogleCloudPolicysimulatorV1betaResourceContext) MarshalJSON() ([]byte, error) {
1954 type NoMethod GoogleCloudPolicysimulatorV1betaResourceContext
1955 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1956 }
1957
1958 // GoogleIamV1AuditConfig: Specifies the audit configuration for a service. The
1959 // configuration determines which permission types are logged, and what
1960 // identities, if any, are exempted from logging. An AuditConfig must have one
1961 // or more AuditLogConfigs. If there are AuditConfigs for both `allServices`
1962 // and a specific service, the union of the two AuditConfigs is used for that
1963 // service: the log_types specified in each AuditConfig are enabled, and the
1964 // exempted_members in each AuditLogConfig are exempted. Example Policy with
1965 // multiple AuditConfigs: { "audit_configs": [ { "service": "allServices",
1966 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [
1967 // "user:[email protected]" ] }, { "log_type": "DATA_WRITE" }, { "log_type":
1968 // "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com",
1969 // "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type":
1970 // "DATA_WRITE", "exempted_members": [ "user:[email protected]" ] } ] } ] } For
1971 // sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
1972 // logging. It also exempts `[email protected]` from DATA_READ logging, and
1973 // `[email protected]` from DATA_WRITE logging.
1974 type GoogleIamV1AuditConfig struct {
1975 // AuditLogConfigs: The configuration for logging of each type of permission.
1976 AuditLogConfigs []*GoogleIamV1AuditLogConfig `json:"auditLogConfigs,omitempty"`
1977 // Service: Specifies a service that will be enabled for audit logging. For
1978 // example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices`
1979 // is a special value that covers all services.
1980 Service string `json:"service,omitempty"`
1981 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
1982 // unconditionally include in API requests. By default, fields with empty or
1983 // default values are omitted from API requests. See
1984 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1985 // details.
1986 ForceSendFields []string `json:"-"`
1987 // NullFields is a list of field names (e.g. "AuditLogConfigs") to include in
1988 // API requests with the JSON null value. By default, fields with empty values
1989 // are omitted from API requests. See
1990 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1991 NullFields []string `json:"-"`
1992 }
1993
1994 func (s GoogleIamV1AuditConfig) MarshalJSON() ([]byte, error) {
1995 type NoMethod GoogleIamV1AuditConfig
1996 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1997 }
1998
1999 // GoogleIamV1AuditLogConfig: Provides the configuration for logging a type of
2000 // permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ",
2001 // "exempted_members": [ "user:[email protected]" ] }, { "log_type":
2002 // "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while
2003 // exempting [email protected] from DATA_READ logging.
2004 type GoogleIamV1AuditLogConfig struct {
2005 // ExemptedMembers: Specifies the identities that do not cause logging for this
2006 // type of permission. Follows the same format of Binding.members.
2007 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
2008 // LogType: The log type that this config enables.
2009 //
2010 // Possible values:
2011 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
2012 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
2013 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
2014 // "DATA_READ" - Data reads. Example: CloudSQL Users list
2015 LogType string `json:"logType,omitempty"`
2016 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
2017 // unconditionally include in API requests. By default, fields with empty or
2018 // default values are omitted from API requests. See
2019 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2020 // details.
2021 ForceSendFields []string `json:"-"`
2022 // NullFields is a list of field names (e.g. "ExemptedMembers") to include in
2023 // API requests with the JSON null value. By default, fields with empty values
2024 // are omitted from API requests. See
2025 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2026 NullFields []string `json:"-"`
2027 }
2028
2029 func (s GoogleIamV1AuditLogConfig) MarshalJSON() ([]byte, error) {
2030 type NoMethod GoogleIamV1AuditLogConfig
2031 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2032 }
2033
2034 // GoogleIamV1Binding: Associates `members`, or principals, with a `role`.
2035 type GoogleIamV1Binding struct {
2036 // Condition: The condition that is associated with this binding. If the
2037 // condition evaluates to `true`, then this binding applies to the current
2038 // request. If the condition evaluates to `false`, then this binding does not
2039 // apply to the current request. However, a different role binding might grant
2040 // the same role to one or more of the principals in this binding. To learn
2041 // which resources support conditions in their IAM policies, see the IAM
2042 // documentation
2043 // (https://cloud.google.com/iam/help/conditions/resource-policies).
2044 Condition *GoogleTypeExpr `json:"condition,omitempty"`
2045 // Members: Specifies the principals requesting access for a Google Cloud
2046 // resource. `members` can have the following values: * `allUsers`: A special
2047 // identifier that represents anyone who is on the internet; with or without a
2048 // Google account. * `allAuthenticatedUsers`: A special identifier that
2049 // represents anyone who is authenticated with a Google account or a service
2050 // account. Does not include identities that come from external identity
2051 // providers (IdPs) through identity federation. * `user:{emailid}`: An email
2052 // address that represents a specific Google account. For example,
2053 // `[email protected]` . * `serviceAccount:{emailid}`: An email address that
2054 // represents a Google service account. For example,
2055 // `[email protected]`. *
2056 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An
2057 // identifier for a Kubernetes service account
2058 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
2059 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. *
2060 // `group:{emailid}`: An email address that represents a Google group. For
2061 // example, `[email protected]`. * `domain:{domain}`: The G Suite domain
2062 // (primary) that represents all the users of that domain. For example,
2063 // `google.com` or `example.com`. *
2064 // `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/sub
2065 // ject/{subject_attribute_value}`: A single identity in a workforce identity
2066 // pool. *
2067 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
2068 // group/{group_id}`: All workforce identities in a group. *
2069 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
2070 // attribute.{attribute_name}/{attribute_value}`: All workforce identities with
2071 // a specific attribute value. *
2072 // `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/
2073 // *`: All identities in a workforce identity pool. *
2074 // `principal://iam.googleapis.com/projects/{project_number}/locations/global/wo
2075 // rkloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single
2076 // identity in a workload identity pool. *
2077 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
2078 // /workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool
2079 // group. *
2080 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
2081 // /workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}
2082 // `: All identities in a workload identity pool with a certain attribute. *
2083 // `principalSet://iam.googleapis.com/projects/{project_number}/locations/global
2084 // /workloadIdentityPools/{pool_id}/*`: All identities in a workload identity
2085 // pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
2086 // unique identifier) representing a user that has been recently deleted. For
2087 // example, `[email protected]?uid=123456789012345678901`. If the user is
2088 // recovered, this value reverts to `user:{emailid}` and the recovered user
2089 // retains the role in the binding. *
2090 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
2091 // unique identifier) representing a service account that has been recently
2092 // deleted. For example,
2093 // `[email protected]?uid=123456789012345678901`. If the
2094 // service account is undeleted, this value reverts to
2095 // `serviceAccount:{emailid}` and the undeleted service account retains the
2096 // role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email
2097 // address (plus unique identifier) representing a Google group that has been
2098 // recently deleted. For example,
2099 // `[email protected]?uid=123456789012345678901`. If the group is recovered,
2100 // this value reverts to `group:{emailid}` and the recovered group retains the
2101 // role in the binding. *
2102 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool
2103 // _id}/subject/{subject_attribute_value}`: Deleted single identity in a
2104 // workforce identity pool. For example,
2105 // `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-po
2106 // ol-id/subject/my-subject-attribute-value`.
2107 Members []string `json:"members,omitempty"`
2108 // Role: Role that is assigned to the list of `members`, or principals. For
2109 // example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview
2110 // of the IAM roles and permissions, see the IAM documentation
2111 // (https://cloud.google.com/iam/docs/roles-overview). For a list of the
2112 // available pre-defined roles, see here
2113 // (https://cloud.google.com/iam/docs/understanding-roles).
2114 Role string `json:"role,omitempty"`
2115 // ForceSendFields is a list of field names (e.g. "Condition") to
2116 // unconditionally include in API requests. By default, fields with empty or
2117 // default values are omitted from API requests. See
2118 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2119 // details.
2120 ForceSendFields []string `json:"-"`
2121 // NullFields is a list of field names (e.g. "Condition") to include in API
2122 // requests with the JSON null value. By default, fields with empty values are
2123 // omitted from API requests. See
2124 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2125 NullFields []string `json:"-"`
2126 }
2127
2128 func (s GoogleIamV1Binding) MarshalJSON() ([]byte, error) {
2129 type NoMethod GoogleIamV1Binding
2130 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2131 }
2132
2133 // GoogleIamV1Policy: An Identity and Access Management (IAM) policy, which
2134 // specifies access controls for Google Cloud resources. A `Policy` is a
2135 // collection of `bindings`. A `binding` binds one or more `members`, or
2136 // principals, to a single `role`. Principals can be user accounts, service
2137 // accounts, Google groups, and domains (such as G Suite). A `role` is a named
2138 // list of permissions; each `role` can be an IAM predefined role or a
2139 // user-created custom role. For some types of Google Cloud resources, a
2140 // `binding` can also specify a `condition`, which is a logical expression that
2141 // allows access to a resource only if the expression evaluates to `true`. A
2142 // condition can add constraints based on attributes of the request, the
2143 // resource, or both. To learn which resources support conditions in their IAM
2144 // policies, see the IAM documentation
2145 // (https://cloud.google.com/iam/help/conditions/resource-policies). **JSON
2146 // example:** ``` { "bindings": [ { "role":
2147 // "roles/resourcemanager.organizationAdmin", "members": [
2148 // "user:[email protected]", "group:[email protected]", "domain:google.com",
2149 // "serviceAccount:[email protected]" ] }, { "role":
2150 // "roles/resourcemanager.organizationViewer", "members": [
2151 // "user:[email protected]" ], "condition": { "title": "expirable access",
2152 // "description": "Does not grant access after Sep 2020", "expression":
2153 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag":
2154 // "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: -
2155 // members: - user:[email protected] - group:[email protected] -
2156 // domain:google.com - serviceAccount:[email protected]
2157 // role: roles/resourcemanager.organizationAdmin - members: -
2158 // user:[email protected] role: roles/resourcemanager.organizationViewer
2159 // condition: title: expirable access description: Does not grant access after
2160 // Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z')
2161 // etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features,
2162 // see the IAM documentation (https://cloud.google.com/iam/docs/).
2163 type GoogleIamV1Policy struct {
2164 // AuditConfigs: Specifies cloud audit logging configuration for this policy.
2165 AuditConfigs []*GoogleIamV1AuditConfig `json:"auditConfigs,omitempty"`
2166 // Bindings: Associates a list of `members`, or principals, with a `role`.
2167 // Optionally, may specify a `condition` that determines how and when the
2168 // `bindings` are applied. Each of the `bindings` must contain at least one
2169 // principal. The `bindings` in a `Policy` can refer to up to 1,500 principals;
2170 // up to 250 of these principals can be Google groups. Each occurrence of a
2171 // principal counts towards these limits. For example, if the `bindings` grant
2172 // 50 different roles to `user:[email protected]`, and not to any other
2173 // principal, then you can add another 1,450 principals to the `bindings` in
2174 // the `Policy`.
2175 Bindings []*GoogleIamV1Binding `json:"bindings,omitempty"`
2176 // Etag: `etag` is used for optimistic concurrency control as a way to help
2177 // prevent simultaneous updates of a policy from overwriting each other. It is
2178 // strongly suggested that systems make use of the `etag` in the
2179 // read-modify-write cycle to perform policy updates in order to avoid race
2180 // conditions: An `etag` is returned in the response to `getIamPolicy`, and
2181 // systems are expected to put that etag in the request to `setIamPolicy` to
2182 // ensure that their change will be applied to the same version of the policy.
2183 // **Important:** If you use IAM Conditions, you must include the `etag` field
2184 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
2185 // you to overwrite a version `3` policy with a version `1` policy, and all of
2186 // the conditions in the version `3` policy are lost.
2187 Etag string `json:"etag,omitempty"`
2188 // Version: Specifies the format of the policy. Valid values are `0`, `1`, and
2189 // `3`. Requests that specify an invalid value are rejected. Any operation that
2190 // affects conditional role bindings must specify version `3`. This requirement
2191 // applies to the following operations: * Getting a policy that includes a
2192 // conditional role binding * Adding a conditional role binding to a policy *
2193 // Changing a conditional role binding in a policy * Removing any role binding,
2194 // with or without a condition, from a policy that includes conditions
2195 // **Important:** If you use IAM Conditions, you must include the `etag` field
2196 // whenever you call `setIamPolicy`. If you omit this field, then IAM allows
2197 // you to overwrite a version `3` policy with a version `1` policy, and all of
2198 // the conditions in the version `3` policy are lost. If a policy does not
2199 // include any conditions, operations on that policy may specify any valid
2200 // version or leave the field unset. To learn which resources support
2201 // conditions in their IAM policies, see the IAM documentation
2202 // (https://cloud.google.com/iam/help/conditions/resource-policies).
2203 Version int64 `json:"version,omitempty"`
2204 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
2205 // unconditionally include in API requests. By default, fields with empty or
2206 // default values are omitted from API requests. See
2207 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2208 // details.
2209 ForceSendFields []string `json:"-"`
2210 // NullFields is a list of field names (e.g. "AuditConfigs") to include in API
2211 // requests with the JSON null value. By default, fields with empty values are
2212 // omitted from API requests. See
2213 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2214 NullFields []string `json:"-"`
2215 }
2216
2217 func (s GoogleIamV1Policy) MarshalJSON() ([]byte, error) {
2218 type NoMethod GoogleIamV1Policy
2219 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2220 }
2221
2222 // GoogleLongrunningListOperationsResponse: The response message for
2223 // Operations.ListOperations.
2224 type GoogleLongrunningListOperationsResponse struct {
2225 // NextPageToken: The standard List next-page token.
2226 NextPageToken string `json:"nextPageToken,omitempty"`
2227 // Operations: A list of operations that matches the specified filter in the
2228 // request.
2229 Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
2230 // Unreachable: Unordered list. Unreachable resources. Populated when the
2231 // request sets `ListOperationsRequest.return_partial_success` and reads across
2232 // collections. For example, when attempting to list all resources across all
2233 // supported locations.
2234 Unreachable []string `json:"unreachable,omitempty"`
2235
2236 // ServerResponse contains the HTTP response code and headers from the server.
2237 googleapi.ServerResponse `json:"-"`
2238 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
2239 // unconditionally include in API requests. By default, fields with empty or
2240 // default values are omitted from API requests. See
2241 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2242 // details.
2243 ForceSendFields []string `json:"-"`
2244 // NullFields is a list of field names (e.g. "NextPageToken") to include in API
2245 // requests with the JSON null value. By default, fields with empty values are
2246 // omitted from API requests. See
2247 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2248 NullFields []string `json:"-"`
2249 }
2250
2251 func (s GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
2252 type NoMethod GoogleLongrunningListOperationsResponse
2253 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2254 }
2255
2256 // GoogleLongrunningOperation: This resource represents a long-running
2257 // operation that is the result of a network API call.
2258 type GoogleLongrunningOperation struct {
2259 // Done: If the value is `false`, it means the operation is still in progress.
2260 // If `true`, the operation is completed, and either `error` or `response` is
2261 // available.
2262 Done bool `json:"done,omitempty"`
2263 // Error: The error result of the operation in case of failure or cancellation.
2264 Error *GoogleRpcStatus `json:"error,omitempty"`
2265 // Metadata: Service-specific metadata associated with the operation. It
2266 // typically contains progress information and common metadata such as create
2267 // time. Some services might not provide such metadata. Any method that returns
2268 // a long-running operation should document the metadata type, if any.
2269 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
2270 // Name: The server-assigned name, which is only unique within the same service
2271 // that originally returns it. If you use the default HTTP mapping, the `name`
2272 // should be a resource name ending with `operations/{unique_id}`.
2273 Name string `json:"name,omitempty"`
2274 // Response: The normal, successful response of the operation. If the original
2275 // method returns no data on success, such as `Delete`, the response is
2276 // `google.protobuf.Empty`. If the original method is standard
2277 // `Get`/`Create`/`Update`, the response should be the resource. For other
2278 // methods, the response should have the type `XxxResponse`, where `Xxx` is the
2279 // original method name. For example, if the original method name is
2280 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
2281 Response googleapi.RawMessage `json:"response,omitempty"`
2282
2283 // ServerResponse contains the HTTP response code and headers from the server.
2284 googleapi.ServerResponse `json:"-"`
2285 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally
2286 // include in API requests. By default, fields with empty or default values are
2287 // omitted from API requests. See
2288 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2289 // details.
2290 ForceSendFields []string `json:"-"`
2291 // NullFields is a list of field names (e.g. "Done") to include in API requests
2292 // with the JSON null value. By default, fields with empty values are omitted
2293 // from API requests. See
2294 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2295 NullFields []string `json:"-"`
2296 }
2297
2298 func (s GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
2299 type NoMethod GoogleLongrunningOperation
2300 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2301 }
2302
2303 // GoogleRpcStatus: The `Status` type defines a logical error model that is
2304 // suitable for different programming environments, including REST APIs and RPC
2305 // APIs. It is used by gRPC (https://github.com/grpc). Each `Status` message
2306 // contains three pieces of data: error code, error message, and error details.
2307 // You can find out more about this error model and how to work with it in the
2308 // API Design Guide (https://cloud.google.com/apis/design/errors).
2309 type GoogleRpcStatus struct {
2310 // Code: The status code, which should be an enum value of google.rpc.Code.
2311 Code int64 `json:"code,omitempty"`
2312 // Details: A list of messages that carry the error details. There is a common
2313 // set of message types for APIs to use.
2314 Details []googleapi.RawMessage `json:"details,omitempty"`
2315 // Message: A developer-facing error message, which should be in English. Any
2316 // user-facing error message should be localized and sent in the
2317 // google.rpc.Status.details field, or localized by the client.
2318 Message string `json:"message,omitempty"`
2319 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally
2320 // include in API requests. By default, fields with empty or default values are
2321 // omitted from API requests. See
2322 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2323 // details.
2324 ForceSendFields []string `json:"-"`
2325 // NullFields is a list of field names (e.g. "Code") to include in API requests
2326 // with the JSON null value. By default, fields with empty values are omitted
2327 // from API requests. See
2328 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2329 NullFields []string `json:"-"`
2330 }
2331
2332 func (s GoogleRpcStatus) MarshalJSON() ([]byte, error) {
2333 type NoMethod GoogleRpcStatus
2334 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2335 }
2336
2337 // GoogleTypeDate: Represents a whole or partial calendar date, such as a
2338 // birthday. The time of day and time zone are either specified elsewhere or
2339 // are insignificant. The date is relative to the Gregorian Calendar. This can
2340 // represent one of the following: * A full date, with non-zero year, month,
2341 // and day values. * A month and day, with a zero year (for example, an
2342 // anniversary). * A year on its own, with a zero month and a zero day. * A
2343 // year and month, with a zero day (for example, a credit card expiration
2344 // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
2345 // google.protobuf.Timestamp
2346 type GoogleTypeDate struct {
2347 // Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
2348 // or 0 to specify a year by itself or a year and month where the day isn't
2349 // significant.
2350 Day int64 `json:"day,omitempty"`
2351 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
2352 // a month and day.
2353 Month int64 `json:"month,omitempty"`
2354 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
2355 // without a year.
2356 Year int64 `json:"year,omitempty"`
2357 // ForceSendFields is a list of field names (e.g. "Day") to unconditionally
2358 // include in API requests. By default, fields with empty or default values are
2359 // omitted from API requests. See
2360 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2361 // details.
2362 ForceSendFields []string `json:"-"`
2363 // NullFields is a list of field names (e.g. "Day") to include in API requests
2364 // with the JSON null value. By default, fields with empty values are omitted
2365 // from API requests. See
2366 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2367 NullFields []string `json:"-"`
2368 }
2369
2370 func (s GoogleTypeDate) MarshalJSON() ([]byte, error) {
2371 type NoMethod GoogleTypeDate
2372 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2373 }
2374
2375 // GoogleTypeExpr: Represents a textual expression in the Common Expression
2376 // Language (CEL) syntax. CEL is a C-like expression language. The syntax and
2377 // semantics of CEL are documented at https://github.com/google/cel-spec.
2378 // Example (Comparison): title: "Summary size limit" description: "Determines
2379 // if a summary is less than 100 chars" expression: "document.summary.size() <
2380 // 100" Example (Equality): title: "Requestor is owner" description:
2381 // "Determines if requestor is the document owner" expression: "document.owner
2382 // == request.auth.claims.email" Example (Logic): title: "Public documents"
2383 // description: "Determine whether the document should be publicly visible"
2384 // expression: "document.type != 'private' && document.type != 'internal'"
2385 // Example (Data Manipulation): title: "Notification string" description:
2386 // "Create a notification string with a timestamp." expression: "'New message
2387 // received at ' + string(document.create_time)" The exact variables and
2388 // functions that may be referenced within an expression are determined by the
2389 // service that evaluates it. See the service documentation for additional
2390 // information.
2391 type GoogleTypeExpr struct {
2392 // Description: Optional. Description of the expression. This is a longer text
2393 // which describes the expression, e.g. when hovered over it in a UI.
2394 Description string `json:"description,omitempty"`
2395 // Expression: Textual representation of an expression in Common Expression
2396 // Language syntax.
2397 Expression string `json:"expression,omitempty"`
2398 // Location: Optional. String indicating the location of the expression for
2399 // error reporting, e.g. a file name and a position in the file.
2400 Location string `json:"location,omitempty"`
2401 // Title: Optional. Title for the expression, i.e. a short string describing
2402 // its purpose. This can be used e.g. in UIs which allow to enter the
2403 // expression.
2404 Title string `json:"title,omitempty"`
2405 // ForceSendFields is a list of field names (e.g. "Description") to
2406 // unconditionally include in API requests. By default, fields with empty or
2407 // default values are omitted from API requests. See
2408 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2409 // details.
2410 ForceSendFields []string `json:"-"`
2411 // NullFields is a list of field names (e.g. "Description") to include in API
2412 // requests with the JSON null value. By default, fields with empty values are
2413 // omitted from API requests. See
2414 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2415 NullFields []string `json:"-"`
2416 }
2417
2418 func (s GoogleTypeExpr) MarshalJSON() ([]byte, error) {
2419 type NoMethod GoogleTypeExpr
2420 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2421 }
2422
2423 type FoldersLocationsAccessPolicySimulationsOperationsGetCall struct {
2424 s *Service
2425 name string
2426 urlParams_ gensupport.URLParams
2427 ifNoneMatch_ string
2428 ctx_ context.Context
2429 header_ http.Header
2430 }
2431
2432 // Get: Gets the latest state of a long-running operation. Clients can use this
2433 // method to poll the operation result at intervals as recommended by the API
2434 // service.
2435 //
2436 // - name: The name of the operation resource.
2437 func (r *FoldersLocationsAccessPolicySimulationsOperationsService) Get(name string) *FoldersLocationsAccessPolicySimulationsOperationsGetCall {
2438 c := &FoldersLocationsAccessPolicySimulationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2439 c.name = name
2440 return c
2441 }
2442
2443 // Fields allows partial responses to be retrieved. See
2444 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2445 // details.
2446 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsAccessPolicySimulationsOperationsGetCall {
2447 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2448 return c
2449 }
2450
2451 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2452 // object's ETag matches the given value. This is useful for getting updates
2453 // only after the object has changed since the last request.
2454 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsAccessPolicySimulationsOperationsGetCall {
2455 c.ifNoneMatch_ = entityTag
2456 return c
2457 }
2458
2459 // Context sets the context to be used in this call's Do method.
2460 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) Context(ctx context.Context) *FoldersLocationsAccessPolicySimulationsOperationsGetCall {
2461 c.ctx_ = ctx
2462 return c
2463 }
2464
2465 // Header returns a http.Header that can be modified by the caller to add
2466 // headers to the request.
2467 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) Header() http.Header {
2468 if c.header_ == nil {
2469 c.header_ = make(http.Header)
2470 }
2471 return c.header_
2472 }
2473
2474 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2475 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2476 if c.ifNoneMatch_ != "" {
2477 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2478 }
2479 c.urlParams_.Set("alt", alt)
2480 c.urlParams_.Set("prettyPrint", "false")
2481 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
2482 urls += "?" + c.urlParams_.Encode()
2483 req, err := http.NewRequest("GET", urls, nil)
2484 if err != nil {
2485 return nil, err
2486 }
2487 req.Header = reqHeaders
2488 googleapi.Expand(req.URL, map[string]string{
2489 "name": c.name,
2490 })
2491 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.accessPolicySimulations.operations.get", "request", internallog.HTTPRequest(req, nil))
2492 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2493 }
2494
2495 // Do executes the "policysimulator.folders.locations.accessPolicySimulations.operations.get" call.
2496 // Any non-2xx status code is an error. Response headers are in either
2497 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
2498 // returned at all) in error.(*googleapi.Error).Header. Use
2499 // googleapi.IsNotModified to check whether the returned error was because
2500 // http.StatusNotModified was returned.
2501 func (c *FoldersLocationsAccessPolicySimulationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2502 gensupport.SetOptions(c.urlParams_, opts...)
2503 res, err := c.doRequest("json")
2504 if res != nil && res.StatusCode == http.StatusNotModified {
2505 if res.Body != nil {
2506 res.Body.Close()
2507 }
2508 return nil, gensupport.WrapError(&googleapi.Error{
2509 Code: res.StatusCode,
2510 Header: res.Header,
2511 })
2512 }
2513 if err != nil {
2514 return nil, err
2515 }
2516 defer googleapi.CloseBody(res)
2517 if err := googleapi.CheckResponse(res); err != nil {
2518 return nil, gensupport.WrapError(err)
2519 }
2520 ret := &GoogleLongrunningOperation{
2521 ServerResponse: googleapi.ServerResponse{
2522 Header: res.Header,
2523 HTTPStatusCode: res.StatusCode,
2524 },
2525 }
2526 target := &ret
2527 b, err := gensupport.DecodeResponseBytes(target, res)
2528 if err != nil {
2529 return nil, err
2530 }
2531 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.accessPolicySimulations.operations.get", "response", internallog.HTTPResponse(res, b))
2532 return ret, nil
2533 }
2534
2535 type FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
2536 s *Service
2537 name string
2538 urlParams_ gensupport.URLParams
2539 ifNoneMatch_ string
2540 ctx_ context.Context
2541 header_ http.Header
2542 }
2543
2544 // Get: Gets the latest state of a long-running operation. Clients can use this
2545 // method to poll the operation result at intervals as recommended by the API
2546 // service.
2547 //
2548 // - name: The name of the operation resource.
2549 func (r *FoldersLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2550 c := &FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2551 c.name = name
2552 return c
2553 }
2554
2555 // Fields allows partial responses to be retrieved. See
2556 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2557 // details.
2558 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2559 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2560 return c
2561 }
2562
2563 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2564 // object's ETag matches the given value. This is useful for getting updates
2565 // only after the object has changed since the last request.
2566 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2567 c.ifNoneMatch_ = entityTag
2568 return c
2569 }
2570
2571 // Context sets the context to be used in this call's Do method.
2572 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2573 c.ctx_ = ctx
2574 return c
2575 }
2576
2577 // Header returns a http.Header that can be modified by the caller to add
2578 // headers to the request.
2579 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
2580 if c.header_ == nil {
2581 c.header_ = make(http.Header)
2582 }
2583 return c.header_
2584 }
2585
2586 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2587 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2588 if c.ifNoneMatch_ != "" {
2589 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2590 }
2591 c.urlParams_.Set("alt", alt)
2592 c.urlParams_.Set("prettyPrint", "false")
2593 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
2594 urls += "?" + c.urlParams_.Encode()
2595 req, err := http.NewRequest("GET", urls, nil)
2596 if err != nil {
2597 return nil, err
2598 }
2599 req.Header = reqHeaders
2600 googleapi.Expand(req.URL, map[string]string{
2601 "name": c.name,
2602 })
2603 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get", "request", internallog.HTTPRequest(req, nil))
2604 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2605 }
2606
2607 // Do executes the "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get" call.
2608 // Any non-2xx status code is an error. Response headers are in either
2609 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
2610 // returned at all) in error.(*googleapi.Error).Header. Use
2611 // googleapi.IsNotModified to check whether the returned error was because
2612 // http.StatusNotModified was returned.
2613 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2614 gensupport.SetOptions(c.urlParams_, opts...)
2615 res, err := c.doRequest("json")
2616 if res != nil && res.StatusCode == http.StatusNotModified {
2617 if res.Body != nil {
2618 res.Body.Close()
2619 }
2620 return nil, gensupport.WrapError(&googleapi.Error{
2621 Code: res.StatusCode,
2622 Header: res.Header,
2623 })
2624 }
2625 if err != nil {
2626 return nil, err
2627 }
2628 defer googleapi.CloseBody(res)
2629 if err := googleapi.CheckResponse(res); err != nil {
2630 return nil, gensupport.WrapError(err)
2631 }
2632 ret := &GoogleLongrunningOperation{
2633 ServerResponse: googleapi.ServerResponse{
2634 Header: res.Header,
2635 HTTPStatusCode: res.StatusCode,
2636 },
2637 }
2638 target := &ret
2639 b, err := gensupport.DecodeResponseBytes(target, res)
2640 if err != nil {
2641 return nil, err
2642 }
2643 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get", "response", internallog.HTTPResponse(res, b))
2644 return ret, nil
2645 }
2646
2647 type FoldersLocationsReplaysCreateCall struct {
2648 s *Service
2649 parent string
2650 googlecloudpolicysimulatorv1betareplay *GoogleCloudPolicysimulatorV1betaReplay
2651 urlParams_ gensupport.URLParams
2652 ctx_ context.Context
2653 header_ http.Header
2654 }
2655
2656 // Create: Creates and starts a Replay using the given ReplayConfig.
2657 //
2658 // - parent: The parent resource where this Replay will be created. This
2659 // resource must be a project, folder, or organization with a location.
2660 // Example: `projects/my-example-project/locations/global`.
2661 func (r *FoldersLocationsReplaysService) Create(parent string, googlecloudpolicysimulatorv1betareplay *GoogleCloudPolicysimulatorV1betaReplay) *FoldersLocationsReplaysCreateCall {
2662 c := &FoldersLocationsReplaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2663 c.parent = parent
2664 c.googlecloudpolicysimulatorv1betareplay = googlecloudpolicysimulatorv1betareplay
2665 return c
2666 }
2667
2668 // Fields allows partial responses to be retrieved. See
2669 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2670 // details.
2671 func (c *FoldersLocationsReplaysCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysCreateCall {
2672 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2673 return c
2674 }
2675
2676 // Context sets the context to be used in this call's Do method.
2677 func (c *FoldersLocationsReplaysCreateCall) Context(ctx context.Context) *FoldersLocationsReplaysCreateCall {
2678 c.ctx_ = ctx
2679 return c
2680 }
2681
2682 // Header returns a http.Header that can be modified by the caller to add
2683 // headers to the request.
2684 func (c *FoldersLocationsReplaysCreateCall) Header() http.Header {
2685 if c.header_ == nil {
2686 c.header_ = make(http.Header)
2687 }
2688 return c.header_
2689 }
2690
2691 func (c *FoldersLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) {
2692 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
2693 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betareplay)
2694 if err != nil {
2695 return nil, err
2696 }
2697 c.urlParams_.Set("alt", alt)
2698 c.urlParams_.Set("prettyPrint", "false")
2699 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays")
2700 urls += "?" + c.urlParams_.Encode()
2701 req, err := http.NewRequest("POST", urls, body)
2702 if err != nil {
2703 return nil, err
2704 }
2705 req.Header = reqHeaders
2706 googleapi.Expand(req.URL, map[string]string{
2707 "parent": c.parent,
2708 })
2709 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.create", "request", internallog.HTTPRequest(req, body.Bytes()))
2710 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2711 }
2712
2713 // Do executes the "policysimulator.folders.locations.replays.create" call.
2714 // Any non-2xx status code is an error. Response headers are in either
2715 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
2716 // returned at all) in error.(*googleapi.Error).Header. Use
2717 // googleapi.IsNotModified to check whether the returned error was because
2718 // http.StatusNotModified was returned.
2719 func (c *FoldersLocationsReplaysCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2720 gensupport.SetOptions(c.urlParams_, opts...)
2721 res, err := c.doRequest("json")
2722 if res != nil && res.StatusCode == http.StatusNotModified {
2723 if res.Body != nil {
2724 res.Body.Close()
2725 }
2726 return nil, gensupport.WrapError(&googleapi.Error{
2727 Code: res.StatusCode,
2728 Header: res.Header,
2729 })
2730 }
2731 if err != nil {
2732 return nil, err
2733 }
2734 defer googleapi.CloseBody(res)
2735 if err := googleapi.CheckResponse(res); err != nil {
2736 return nil, gensupport.WrapError(err)
2737 }
2738 ret := &GoogleLongrunningOperation{
2739 ServerResponse: googleapi.ServerResponse{
2740 Header: res.Header,
2741 HTTPStatusCode: res.StatusCode,
2742 },
2743 }
2744 target := &ret
2745 b, err := gensupport.DecodeResponseBytes(target, res)
2746 if err != nil {
2747 return nil, err
2748 }
2749 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.create", "response", internallog.HTTPResponse(res, b))
2750 return ret, nil
2751 }
2752
2753 type FoldersLocationsReplaysGetCall struct {
2754 s *Service
2755 name string
2756 urlParams_ gensupport.URLParams
2757 ifNoneMatch_ string
2758 ctx_ context.Context
2759 header_ http.Header
2760 }
2761
2762 // Get: Gets the specified Replay. Each `Replay` is available for at least 7
2763 // days.
2764 //
2765 // - name: The name of the Replay to retrieve, in the following format:
2766 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
2767 // eplay-id}`, where `{resource-id}` is the ID of the project, folder, or
2768 // organization that owns the `Replay`. Example:
2769 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e
2770 // 03-479ce1833c36`.
2771 func (r *FoldersLocationsReplaysService) Get(name string) *FoldersLocationsReplaysGetCall {
2772 c := &FoldersLocationsReplaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2773 c.name = name
2774 return c
2775 }
2776
2777 // Fields allows partial responses to be retrieved. See
2778 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2779 // details.
2780 func (c *FoldersLocationsReplaysGetCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysGetCall {
2781 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2782 return c
2783 }
2784
2785 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2786 // object's ETag matches the given value. This is useful for getting updates
2787 // only after the object has changed since the last request.
2788 func (c *FoldersLocationsReplaysGetCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysGetCall {
2789 c.ifNoneMatch_ = entityTag
2790 return c
2791 }
2792
2793 // Context sets the context to be used in this call's Do method.
2794 func (c *FoldersLocationsReplaysGetCall) Context(ctx context.Context) *FoldersLocationsReplaysGetCall {
2795 c.ctx_ = ctx
2796 return c
2797 }
2798
2799 // Header returns a http.Header that can be modified by the caller to add
2800 // headers to the request.
2801 func (c *FoldersLocationsReplaysGetCall) Header() http.Header {
2802 if c.header_ == nil {
2803 c.header_ = make(http.Header)
2804 }
2805 return c.header_
2806 }
2807
2808 func (c *FoldersLocationsReplaysGetCall) doRequest(alt string) (*http.Response, error) {
2809 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2810 if c.ifNoneMatch_ != "" {
2811 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2812 }
2813 c.urlParams_.Set("alt", alt)
2814 c.urlParams_.Set("prettyPrint", "false")
2815 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
2816 urls += "?" + c.urlParams_.Encode()
2817 req, err := http.NewRequest("GET", urls, nil)
2818 if err != nil {
2819 return nil, err
2820 }
2821 req.Header = reqHeaders
2822 googleapi.Expand(req.URL, map[string]string{
2823 "name": c.name,
2824 })
2825 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.get", "request", internallog.HTTPRequest(req, nil))
2826 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2827 }
2828
2829 // Do executes the "policysimulator.folders.locations.replays.get" call.
2830 // Any non-2xx status code is an error. Response headers are in either
2831 // *GoogleCloudPolicysimulatorV1betaReplay.ServerResponse.Header or (if a
2832 // response was returned at all) in error.(*googleapi.Error).Header. Use
2833 // googleapi.IsNotModified to check whether the returned error was because
2834 // http.StatusNotModified was returned.
2835 func (c *FoldersLocationsReplaysGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaReplay, error) {
2836 gensupport.SetOptions(c.urlParams_, opts...)
2837 res, err := c.doRequest("json")
2838 if res != nil && res.StatusCode == http.StatusNotModified {
2839 if res.Body != nil {
2840 res.Body.Close()
2841 }
2842 return nil, gensupport.WrapError(&googleapi.Error{
2843 Code: res.StatusCode,
2844 Header: res.Header,
2845 })
2846 }
2847 if err != nil {
2848 return nil, err
2849 }
2850 defer googleapi.CloseBody(res)
2851 if err := googleapi.CheckResponse(res); err != nil {
2852 return nil, gensupport.WrapError(err)
2853 }
2854 ret := &GoogleCloudPolicysimulatorV1betaReplay{
2855 ServerResponse: googleapi.ServerResponse{
2856 Header: res.Header,
2857 HTTPStatusCode: res.StatusCode,
2858 },
2859 }
2860 target := &ret
2861 b, err := gensupport.DecodeResponseBytes(target, res)
2862 if err != nil {
2863 return nil, err
2864 }
2865 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.get", "response", internallog.HTTPResponse(res, b))
2866 return ret, nil
2867 }
2868
2869 type FoldersLocationsReplaysListCall struct {
2870 s *Service
2871 parent string
2872 urlParams_ gensupport.URLParams
2873 ifNoneMatch_ string
2874 ctx_ context.Context
2875 header_ http.Header
2876 }
2877
2878 // List: Lists each Replay in a project, folder, or organization. Each `Replay`
2879 // is available for at least 7 days.
2880 //
2881 // - parent: The parent resource, in the following format:
2882 // `{projects|folders|organizations}/{resource-id}/locations/global`, where
2883 // `{resource-id}` is the ID of the project, folder, or organization that
2884 // owns the Replay. Example: `projects/my-example-project/locations/global`
2885 // Only `Replay` objects that are direct children of the provided parent are
2886 // listed. In other words, `Replay` objects that are children of a project
2887 // will not be included when the parent is a folder of that project.
2888 func (r *FoldersLocationsReplaysService) List(parent string) *FoldersLocationsReplaysListCall {
2889 c := &FoldersLocationsReplaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2890 c.parent = parent
2891 return c
2892 }
2893
2894 // PageSize sets the optional parameter "pageSize": The maximum number of
2895 // Replay objects to return. Defaults to 50. The maximum value is 1000; values
2896 // above 1000 are rounded down to 1000.
2897 func (c *FoldersLocationsReplaysListCall) PageSize(pageSize int64) *FoldersLocationsReplaysListCall {
2898 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2899 return c
2900 }
2901
2902 // PageToken sets the optional parameter "pageToken": A page token, received
2903 // from a previous Simulator.ListReplays call. Provide this to retrieve the
2904 // subsequent page. When paginating, all other parameters provided to
2905 // Simulator.ListReplays must match the call that provided the page token.
2906 func (c *FoldersLocationsReplaysListCall) PageToken(pageToken string) *FoldersLocationsReplaysListCall {
2907 c.urlParams_.Set("pageToken", pageToken)
2908 return c
2909 }
2910
2911 // Fields allows partial responses to be retrieved. See
2912 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
2913 // details.
2914 func (c *FoldersLocationsReplaysListCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysListCall {
2915 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2916 return c
2917 }
2918
2919 // IfNoneMatch sets an optional parameter which makes the operation fail if the
2920 // object's ETag matches the given value. This is useful for getting updates
2921 // only after the object has changed since the last request.
2922 func (c *FoldersLocationsReplaysListCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysListCall {
2923 c.ifNoneMatch_ = entityTag
2924 return c
2925 }
2926
2927 // Context sets the context to be used in this call's Do method.
2928 func (c *FoldersLocationsReplaysListCall) Context(ctx context.Context) *FoldersLocationsReplaysListCall {
2929 c.ctx_ = ctx
2930 return c
2931 }
2932
2933 // Header returns a http.Header that can be modified by the caller to add
2934 // headers to the request.
2935 func (c *FoldersLocationsReplaysListCall) Header() http.Header {
2936 if c.header_ == nil {
2937 c.header_ = make(http.Header)
2938 }
2939 return c.header_
2940 }
2941
2942 func (c *FoldersLocationsReplaysListCall) doRequest(alt string) (*http.Response, error) {
2943 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
2944 if c.ifNoneMatch_ != "" {
2945 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2946 }
2947 c.urlParams_.Set("alt", alt)
2948 c.urlParams_.Set("prettyPrint", "false")
2949 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays")
2950 urls += "?" + c.urlParams_.Encode()
2951 req, err := http.NewRequest("GET", urls, nil)
2952 if err != nil {
2953 return nil, err
2954 }
2955 req.Header = reqHeaders
2956 googleapi.Expand(req.URL, map[string]string{
2957 "parent": c.parent,
2958 })
2959 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.list", "request", internallog.HTTPRequest(req, nil))
2960 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2961 }
2962
2963 // Do executes the "policysimulator.folders.locations.replays.list" call.
2964 // Any non-2xx status code is an error. Response headers are in either
2965 // *GoogleCloudPolicysimulatorV1betaListReplaysResponse.ServerResponse.Header
2966 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
2967 // Use googleapi.IsNotModified to check whether the returned error was because
2968 // http.StatusNotModified was returned.
2969 func (c *FoldersLocationsReplaysListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaListReplaysResponse, error) {
2970 gensupport.SetOptions(c.urlParams_, opts...)
2971 res, err := c.doRequest("json")
2972 if res != nil && res.StatusCode == http.StatusNotModified {
2973 if res.Body != nil {
2974 res.Body.Close()
2975 }
2976 return nil, gensupport.WrapError(&googleapi.Error{
2977 Code: res.StatusCode,
2978 Header: res.Header,
2979 })
2980 }
2981 if err != nil {
2982 return nil, err
2983 }
2984 defer googleapi.CloseBody(res)
2985 if err := googleapi.CheckResponse(res); err != nil {
2986 return nil, gensupport.WrapError(err)
2987 }
2988 ret := &GoogleCloudPolicysimulatorV1betaListReplaysResponse{
2989 ServerResponse: googleapi.ServerResponse{
2990 Header: res.Header,
2991 HTTPStatusCode: res.StatusCode,
2992 },
2993 }
2994 target := &ret
2995 b, err := gensupport.DecodeResponseBytes(target, res)
2996 if err != nil {
2997 return nil, err
2998 }
2999 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.list", "response", internallog.HTTPResponse(res, b))
3000 return ret, nil
3001 }
3002
3003 // Pages invokes f for each page of results.
3004 // A non-nil error returned from f will halt the iteration.
3005 // The provided context supersedes any context provided to the Context method.
3006 func (c *FoldersLocationsReplaysListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1betaListReplaysResponse) error) error {
3007 c.ctx_ = ctx
3008 defer c.PageToken(c.urlParams_.Get("pageToken"))
3009 for {
3010 x, err := c.Do()
3011 if err != nil {
3012 return err
3013 }
3014 if err := f(x); err != nil {
3015 return err
3016 }
3017 if x.NextPageToken == "" {
3018 return nil
3019 }
3020 c.PageToken(x.NextPageToken)
3021 }
3022 }
3023
3024 type FoldersLocationsReplaysOperationsGetCall struct {
3025 s *Service
3026 name string
3027 urlParams_ gensupport.URLParams
3028 ifNoneMatch_ string
3029 ctx_ context.Context
3030 header_ http.Header
3031 }
3032
3033 // Get: Gets the latest state of a long-running operation. Clients can use this
3034 // method to poll the operation result at intervals as recommended by the API
3035 // service.
3036 //
3037 // - name: The name of the operation resource.
3038 func (r *FoldersLocationsReplaysOperationsService) Get(name string) *FoldersLocationsReplaysOperationsGetCall {
3039 c := &FoldersLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3040 c.name = name
3041 return c
3042 }
3043
3044 // Fields allows partial responses to be retrieved. See
3045 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3046 // details.
3047 func (c *FoldersLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysOperationsGetCall {
3048 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3049 return c
3050 }
3051
3052 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3053 // object's ETag matches the given value. This is useful for getting updates
3054 // only after the object has changed since the last request.
3055 func (c *FoldersLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysOperationsGetCall {
3056 c.ifNoneMatch_ = entityTag
3057 return c
3058 }
3059
3060 // Context sets the context to be used in this call's Do method.
3061 func (c *FoldersLocationsReplaysOperationsGetCall) Context(ctx context.Context) *FoldersLocationsReplaysOperationsGetCall {
3062 c.ctx_ = ctx
3063 return c
3064 }
3065
3066 // Header returns a http.Header that can be modified by the caller to add
3067 // headers to the request.
3068 func (c *FoldersLocationsReplaysOperationsGetCall) Header() http.Header {
3069 if c.header_ == nil {
3070 c.header_ = make(http.Header)
3071 }
3072 return c.header_
3073 }
3074
3075 func (c *FoldersLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
3076 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3077 if c.ifNoneMatch_ != "" {
3078 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3079 }
3080 c.urlParams_.Set("alt", alt)
3081 c.urlParams_.Set("prettyPrint", "false")
3082 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
3083 urls += "?" + c.urlParams_.Encode()
3084 req, err := http.NewRequest("GET", urls, nil)
3085 if err != nil {
3086 return nil, err
3087 }
3088 req.Header = reqHeaders
3089 googleapi.Expand(req.URL, map[string]string{
3090 "name": c.name,
3091 })
3092 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.operations.get", "request", internallog.HTTPRequest(req, nil))
3093 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3094 }
3095
3096 // Do executes the "policysimulator.folders.locations.replays.operations.get" call.
3097 // Any non-2xx status code is an error. Response headers are in either
3098 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
3099 // returned at all) in error.(*googleapi.Error).Header. Use
3100 // googleapi.IsNotModified to check whether the returned error was because
3101 // http.StatusNotModified was returned.
3102 func (c *FoldersLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3103 gensupport.SetOptions(c.urlParams_, opts...)
3104 res, err := c.doRequest("json")
3105 if res != nil && res.StatusCode == http.StatusNotModified {
3106 if res.Body != nil {
3107 res.Body.Close()
3108 }
3109 return nil, gensupport.WrapError(&googleapi.Error{
3110 Code: res.StatusCode,
3111 Header: res.Header,
3112 })
3113 }
3114 if err != nil {
3115 return nil, err
3116 }
3117 defer googleapi.CloseBody(res)
3118 if err := googleapi.CheckResponse(res); err != nil {
3119 return nil, gensupport.WrapError(err)
3120 }
3121 ret := &GoogleLongrunningOperation{
3122 ServerResponse: googleapi.ServerResponse{
3123 Header: res.Header,
3124 HTTPStatusCode: res.StatusCode,
3125 },
3126 }
3127 target := &ret
3128 b, err := gensupport.DecodeResponseBytes(target, res)
3129 if err != nil {
3130 return nil, err
3131 }
3132 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.operations.get", "response", internallog.HTTPResponse(res, b))
3133 return ret, nil
3134 }
3135
3136 type FoldersLocationsReplaysOperationsListCall struct {
3137 s *Service
3138 name string
3139 urlParams_ gensupport.URLParams
3140 ifNoneMatch_ string
3141 ctx_ context.Context
3142 header_ http.Header
3143 }
3144
3145 // List: Lists operations that match the specified filter in the request. If
3146 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
3147 //
3148 // - name: The name of the operation's parent resource.
3149 func (r *FoldersLocationsReplaysOperationsService) List(name string) *FoldersLocationsReplaysOperationsListCall {
3150 c := &FoldersLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3151 c.name = name
3152 return c
3153 }
3154
3155 // Filter sets the optional parameter "filter": The standard list filter.
3156 func (c *FoldersLocationsReplaysOperationsListCall) Filter(filter string) *FoldersLocationsReplaysOperationsListCall {
3157 c.urlParams_.Set("filter", filter)
3158 return c
3159 }
3160
3161 // PageSize sets the optional parameter "pageSize": The standard list page
3162 // size.
3163 func (c *FoldersLocationsReplaysOperationsListCall) PageSize(pageSize int64) *FoldersLocationsReplaysOperationsListCall {
3164 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3165 return c
3166 }
3167
3168 // PageToken sets the optional parameter "pageToken": The standard list page
3169 // token.
3170 func (c *FoldersLocationsReplaysOperationsListCall) PageToken(pageToken string) *FoldersLocationsReplaysOperationsListCall {
3171 c.urlParams_.Set("pageToken", pageToken)
3172 return c
3173 }
3174
3175 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
3176 // When set to `true`, operations that are reachable are returned as normal,
3177 // and those that are unreachable are returned in the
3178 // ListOperationsResponse.unreachable field. This can only be `true` when
3179 // reading across collections. For example, when `parent` is set to
3180 // "projects/example/locations/-". This field is not supported by default and
3181 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
3182 // otherwise in service or product specific documentation.
3183 func (c *FoldersLocationsReplaysOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *FoldersLocationsReplaysOperationsListCall {
3184 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
3185 return c
3186 }
3187
3188 // Fields allows partial responses to be retrieved. See
3189 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3190 // details.
3191 func (c *FoldersLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysOperationsListCall {
3192 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3193 return c
3194 }
3195
3196 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3197 // object's ETag matches the given value. This is useful for getting updates
3198 // only after the object has changed since the last request.
3199 func (c *FoldersLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysOperationsListCall {
3200 c.ifNoneMatch_ = entityTag
3201 return c
3202 }
3203
3204 // Context sets the context to be used in this call's Do method.
3205 func (c *FoldersLocationsReplaysOperationsListCall) Context(ctx context.Context) *FoldersLocationsReplaysOperationsListCall {
3206 c.ctx_ = ctx
3207 return c
3208 }
3209
3210 // Header returns a http.Header that can be modified by the caller to add
3211 // headers to the request.
3212 func (c *FoldersLocationsReplaysOperationsListCall) Header() http.Header {
3213 if c.header_ == nil {
3214 c.header_ = make(http.Header)
3215 }
3216 return c.header_
3217 }
3218
3219 func (c *FoldersLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
3220 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3221 if c.ifNoneMatch_ != "" {
3222 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3223 }
3224 c.urlParams_.Set("alt", alt)
3225 c.urlParams_.Set("prettyPrint", "false")
3226 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
3227 urls += "?" + c.urlParams_.Encode()
3228 req, err := http.NewRequest("GET", urls, nil)
3229 if err != nil {
3230 return nil, err
3231 }
3232 req.Header = reqHeaders
3233 googleapi.Expand(req.URL, map[string]string{
3234 "name": c.name,
3235 })
3236 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.operations.list", "request", internallog.HTTPRequest(req, nil))
3237 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3238 }
3239
3240 // Do executes the "policysimulator.folders.locations.replays.operations.list" call.
3241 // Any non-2xx status code is an error. Response headers are in either
3242 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
3243 // response was returned at all) in error.(*googleapi.Error).Header. Use
3244 // googleapi.IsNotModified to check whether the returned error was because
3245 // http.StatusNotModified was returned.
3246 func (c *FoldersLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
3247 gensupport.SetOptions(c.urlParams_, opts...)
3248 res, err := c.doRequest("json")
3249 if res != nil && res.StatusCode == http.StatusNotModified {
3250 if res.Body != nil {
3251 res.Body.Close()
3252 }
3253 return nil, gensupport.WrapError(&googleapi.Error{
3254 Code: res.StatusCode,
3255 Header: res.Header,
3256 })
3257 }
3258 if err != nil {
3259 return nil, err
3260 }
3261 defer googleapi.CloseBody(res)
3262 if err := googleapi.CheckResponse(res); err != nil {
3263 return nil, gensupport.WrapError(err)
3264 }
3265 ret := &GoogleLongrunningListOperationsResponse{
3266 ServerResponse: googleapi.ServerResponse{
3267 Header: res.Header,
3268 HTTPStatusCode: res.StatusCode,
3269 },
3270 }
3271 target := &ret
3272 b, err := gensupport.DecodeResponseBytes(target, res)
3273 if err != nil {
3274 return nil, err
3275 }
3276 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.operations.list", "response", internallog.HTTPResponse(res, b))
3277 return ret, nil
3278 }
3279
3280 // Pages invokes f for each page of results.
3281 // A non-nil error returned from f will halt the iteration.
3282 // The provided context supersedes any context provided to the Context method.
3283 func (c *FoldersLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
3284 c.ctx_ = ctx
3285 defer c.PageToken(c.urlParams_.Get("pageToken"))
3286 for {
3287 x, err := c.Do()
3288 if err != nil {
3289 return err
3290 }
3291 if err := f(x); err != nil {
3292 return err
3293 }
3294 if x.NextPageToken == "" {
3295 return nil
3296 }
3297 c.PageToken(x.NextPageToken)
3298 }
3299 }
3300
3301 type FoldersLocationsReplaysResultsListCall struct {
3302 s *Service
3303 parent string
3304 urlParams_ gensupport.URLParams
3305 ifNoneMatch_ string
3306 ctx_ context.Context
3307 header_ http.Header
3308 }
3309
3310 // List: Lists the results of running a Replay.
3311 //
3312 // - parent: The Replay whose results are listed, in the following format:
3313 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
3314 // eplay-id}` Example:
3315 // `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce
3316 // 1833c36`.
3317 func (r *FoldersLocationsReplaysResultsService) List(parent string) *FoldersLocationsReplaysResultsListCall {
3318 c := &FoldersLocationsReplaysResultsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3319 c.parent = parent
3320 return c
3321 }
3322
3323 // PageSize sets the optional parameter "pageSize": The maximum number of
3324 // ReplayResult objects to return. Defaults to 5000. The maximum value is 5000;
3325 // values above 5000 are rounded down to 5000.
3326 func (c *FoldersLocationsReplaysResultsListCall) PageSize(pageSize int64) *FoldersLocationsReplaysResultsListCall {
3327 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3328 return c
3329 }
3330
3331 // PageToken sets the optional parameter "pageToken": A page token, received
3332 // from a previous Simulator.ListReplayResults call. Provide this token to
3333 // retrieve the next page of results. When paginating, all other parameters
3334 // provided to [Simulator.ListReplayResults[] must match the call that provided
3335 // the page token.
3336 func (c *FoldersLocationsReplaysResultsListCall) PageToken(pageToken string) *FoldersLocationsReplaysResultsListCall {
3337 c.urlParams_.Set("pageToken", pageToken)
3338 return c
3339 }
3340
3341 // Fields allows partial responses to be retrieved. See
3342 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3343 // details.
3344 func (c *FoldersLocationsReplaysResultsListCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysResultsListCall {
3345 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3346 return c
3347 }
3348
3349 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3350 // object's ETag matches the given value. This is useful for getting updates
3351 // only after the object has changed since the last request.
3352 func (c *FoldersLocationsReplaysResultsListCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysResultsListCall {
3353 c.ifNoneMatch_ = entityTag
3354 return c
3355 }
3356
3357 // Context sets the context to be used in this call's Do method.
3358 func (c *FoldersLocationsReplaysResultsListCall) Context(ctx context.Context) *FoldersLocationsReplaysResultsListCall {
3359 c.ctx_ = ctx
3360 return c
3361 }
3362
3363 // Header returns a http.Header that can be modified by the caller to add
3364 // headers to the request.
3365 func (c *FoldersLocationsReplaysResultsListCall) Header() http.Header {
3366 if c.header_ == nil {
3367 c.header_ = make(http.Header)
3368 }
3369 return c.header_
3370 }
3371
3372 func (c *FoldersLocationsReplaysResultsListCall) doRequest(alt string) (*http.Response, error) {
3373 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3374 if c.ifNoneMatch_ != "" {
3375 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3376 }
3377 c.urlParams_.Set("alt", alt)
3378 c.urlParams_.Set("prettyPrint", "false")
3379 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/results")
3380 urls += "?" + c.urlParams_.Encode()
3381 req, err := http.NewRequest("GET", urls, nil)
3382 if err != nil {
3383 return nil, err
3384 }
3385 req.Header = reqHeaders
3386 googleapi.Expand(req.URL, map[string]string{
3387 "parent": c.parent,
3388 })
3389 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.results.list", "request", internallog.HTTPRequest(req, nil))
3390 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3391 }
3392
3393 // Do executes the "policysimulator.folders.locations.replays.results.list" call.
3394 // Any non-2xx status code is an error. Response headers are in either
3395 // *GoogleCloudPolicysimulatorV1betaListReplayResultsResponse.ServerResponse.Hea
3396 // der or (if a response was returned at all) in
3397 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
3398 // whether the returned error was because http.StatusNotModified was returned.
3399 func (c *FoldersLocationsReplaysResultsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaListReplayResultsResponse, error) {
3400 gensupport.SetOptions(c.urlParams_, opts...)
3401 res, err := c.doRequest("json")
3402 if res != nil && res.StatusCode == http.StatusNotModified {
3403 if res.Body != nil {
3404 res.Body.Close()
3405 }
3406 return nil, gensupport.WrapError(&googleapi.Error{
3407 Code: res.StatusCode,
3408 Header: res.Header,
3409 })
3410 }
3411 if err != nil {
3412 return nil, err
3413 }
3414 defer googleapi.CloseBody(res)
3415 if err := googleapi.CheckResponse(res); err != nil {
3416 return nil, gensupport.WrapError(err)
3417 }
3418 ret := &GoogleCloudPolicysimulatorV1betaListReplayResultsResponse{
3419 ServerResponse: googleapi.ServerResponse{
3420 Header: res.Header,
3421 HTTPStatusCode: res.StatusCode,
3422 },
3423 }
3424 target := &ret
3425 b, err := gensupport.DecodeResponseBytes(target, res)
3426 if err != nil {
3427 return nil, err
3428 }
3429 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.folders.locations.replays.results.list", "response", internallog.HTTPResponse(res, b))
3430 return ret, nil
3431 }
3432
3433 // Pages invokes f for each page of results.
3434 // A non-nil error returned from f will halt the iteration.
3435 // The provided context supersedes any context provided to the Context method.
3436 func (c *FoldersLocationsReplaysResultsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1betaListReplayResultsResponse) error) error {
3437 c.ctx_ = ctx
3438 defer c.PageToken(c.urlParams_.Get("pageToken"))
3439 for {
3440 x, err := c.Do()
3441 if err != nil {
3442 return err
3443 }
3444 if err := f(x); err != nil {
3445 return err
3446 }
3447 if x.NextPageToken == "" {
3448 return nil
3449 }
3450 c.PageToken(x.NextPageToken)
3451 }
3452 }
3453
3454 type OperationsGetCall struct {
3455 s *Service
3456 name string
3457 urlParams_ gensupport.URLParams
3458 ifNoneMatch_ string
3459 ctx_ context.Context
3460 header_ http.Header
3461 }
3462
3463 // Get: Gets the latest state of a long-running operation. Clients can use this
3464 // method to poll the operation result at intervals as recommended by the API
3465 // service.
3466 //
3467 // - name: The name of the operation resource.
3468 func (r *OperationsService) Get(name string) *OperationsGetCall {
3469 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3470 c.name = name
3471 return c
3472 }
3473
3474 // Fields allows partial responses to be retrieved. See
3475 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3476 // details.
3477 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
3478 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3479 return c
3480 }
3481
3482 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3483 // object's ETag matches the given value. This is useful for getting updates
3484 // only after the object has changed since the last request.
3485 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
3486 c.ifNoneMatch_ = entityTag
3487 return c
3488 }
3489
3490 // Context sets the context to be used in this call's Do method.
3491 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
3492 c.ctx_ = ctx
3493 return c
3494 }
3495
3496 // Header returns a http.Header that can be modified by the caller to add
3497 // headers to the request.
3498 func (c *OperationsGetCall) Header() http.Header {
3499 if c.header_ == nil {
3500 c.header_ = make(http.Header)
3501 }
3502 return c.header_
3503 }
3504
3505 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
3506 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3507 if c.ifNoneMatch_ != "" {
3508 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3509 }
3510 c.urlParams_.Set("alt", alt)
3511 c.urlParams_.Set("prettyPrint", "false")
3512 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
3513 urls += "?" + c.urlParams_.Encode()
3514 req, err := http.NewRequest("GET", urls, nil)
3515 if err != nil {
3516 return nil, err
3517 }
3518 req.Header = reqHeaders
3519 googleapi.Expand(req.URL, map[string]string{
3520 "name": c.name,
3521 })
3522 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.operations.get", "request", internallog.HTTPRequest(req, nil))
3523 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3524 }
3525
3526 // Do executes the "policysimulator.operations.get" call.
3527 // Any non-2xx status code is an error. Response headers are in either
3528 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
3529 // returned at all) in error.(*googleapi.Error).Header. Use
3530 // googleapi.IsNotModified to check whether the returned error was because
3531 // http.StatusNotModified was returned.
3532 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3533 gensupport.SetOptions(c.urlParams_, opts...)
3534 res, err := c.doRequest("json")
3535 if res != nil && res.StatusCode == http.StatusNotModified {
3536 if res.Body != nil {
3537 res.Body.Close()
3538 }
3539 return nil, gensupport.WrapError(&googleapi.Error{
3540 Code: res.StatusCode,
3541 Header: res.Header,
3542 })
3543 }
3544 if err != nil {
3545 return nil, err
3546 }
3547 defer googleapi.CloseBody(res)
3548 if err := googleapi.CheckResponse(res); err != nil {
3549 return nil, gensupport.WrapError(err)
3550 }
3551 ret := &GoogleLongrunningOperation{
3552 ServerResponse: googleapi.ServerResponse{
3553 Header: res.Header,
3554 HTTPStatusCode: res.StatusCode,
3555 },
3556 }
3557 target := &ret
3558 b, err := gensupport.DecodeResponseBytes(target, res)
3559 if err != nil {
3560 return nil, err
3561 }
3562 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.operations.get", "response", internallog.HTTPResponse(res, b))
3563 return ret, nil
3564 }
3565
3566 type OperationsListCall struct {
3567 s *Service
3568 name string
3569 urlParams_ gensupport.URLParams
3570 ifNoneMatch_ string
3571 ctx_ context.Context
3572 header_ http.Header
3573 }
3574
3575 // List: Lists operations that match the specified filter in the request. If
3576 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
3577 //
3578 // - name: The name of the operation's parent resource.
3579 func (r *OperationsService) List(name string) *OperationsListCall {
3580 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3581 c.name = name
3582 return c
3583 }
3584
3585 // Filter sets the optional parameter "filter": The standard list filter.
3586 func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
3587 c.urlParams_.Set("filter", filter)
3588 return c
3589 }
3590
3591 // PageSize sets the optional parameter "pageSize": The standard list page
3592 // size.
3593 func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
3594 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3595 return c
3596 }
3597
3598 // PageToken sets the optional parameter "pageToken": The standard list page
3599 // token.
3600 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
3601 c.urlParams_.Set("pageToken", pageToken)
3602 return c
3603 }
3604
3605 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
3606 // When set to `true`, operations that are reachable are returned as normal,
3607 // and those that are unreachable are returned in the
3608 // ListOperationsResponse.unreachable field. This can only be `true` when
3609 // reading across collections. For example, when `parent` is set to
3610 // "projects/example/locations/-". This field is not supported by default and
3611 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
3612 // otherwise in service or product specific documentation.
3613 func (c *OperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *OperationsListCall {
3614 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
3615 return c
3616 }
3617
3618 // Fields allows partial responses to be retrieved. See
3619 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3620 // details.
3621 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
3622 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3623 return c
3624 }
3625
3626 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3627 // object's ETag matches the given value. This is useful for getting updates
3628 // only after the object has changed since the last request.
3629 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
3630 c.ifNoneMatch_ = entityTag
3631 return c
3632 }
3633
3634 // Context sets the context to be used in this call's Do method.
3635 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
3636 c.ctx_ = ctx
3637 return c
3638 }
3639
3640 // Header returns a http.Header that can be modified by the caller to add
3641 // headers to the request.
3642 func (c *OperationsListCall) Header() http.Header {
3643 if c.header_ == nil {
3644 c.header_ = make(http.Header)
3645 }
3646 return c.header_
3647 }
3648
3649 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
3650 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3651 if c.ifNoneMatch_ != "" {
3652 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3653 }
3654 c.urlParams_.Set("alt", alt)
3655 c.urlParams_.Set("prettyPrint", "false")
3656 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
3657 urls += "?" + c.urlParams_.Encode()
3658 req, err := http.NewRequest("GET", urls, nil)
3659 if err != nil {
3660 return nil, err
3661 }
3662 req.Header = reqHeaders
3663 googleapi.Expand(req.URL, map[string]string{
3664 "name": c.name,
3665 })
3666 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.operations.list", "request", internallog.HTTPRequest(req, nil))
3667 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3668 }
3669
3670 // Do executes the "policysimulator.operations.list" call.
3671 // Any non-2xx status code is an error. Response headers are in either
3672 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
3673 // response was returned at all) in error.(*googleapi.Error).Header. Use
3674 // googleapi.IsNotModified to check whether the returned error was because
3675 // http.StatusNotModified was returned.
3676 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
3677 gensupport.SetOptions(c.urlParams_, opts...)
3678 res, err := c.doRequest("json")
3679 if res != nil && res.StatusCode == http.StatusNotModified {
3680 if res.Body != nil {
3681 res.Body.Close()
3682 }
3683 return nil, gensupport.WrapError(&googleapi.Error{
3684 Code: res.StatusCode,
3685 Header: res.Header,
3686 })
3687 }
3688 if err != nil {
3689 return nil, err
3690 }
3691 defer googleapi.CloseBody(res)
3692 if err := googleapi.CheckResponse(res); err != nil {
3693 return nil, gensupport.WrapError(err)
3694 }
3695 ret := &GoogleLongrunningListOperationsResponse{
3696 ServerResponse: googleapi.ServerResponse{
3697 Header: res.Header,
3698 HTTPStatusCode: res.StatusCode,
3699 },
3700 }
3701 target := &ret
3702 b, err := gensupport.DecodeResponseBytes(target, res)
3703 if err != nil {
3704 return nil, err
3705 }
3706 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.operations.list", "response", internallog.HTTPResponse(res, b))
3707 return ret, nil
3708 }
3709
3710 // Pages invokes f for each page of results.
3711 // A non-nil error returned from f will halt the iteration.
3712 // The provided context supersedes any context provided to the Context method.
3713 func (c *OperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
3714 c.ctx_ = ctx
3715 defer c.PageToken(c.urlParams_.Get("pageToken"))
3716 for {
3717 x, err := c.Do()
3718 if err != nil {
3719 return err
3720 }
3721 if err := f(x); err != nil {
3722 return err
3723 }
3724 if x.NextPageToken == "" {
3725 return nil
3726 }
3727 c.PageToken(x.NextPageToken)
3728 }
3729 }
3730
3731 type OrganizationsLocationsAccessPolicySimulationsOperationsGetCall struct {
3732 s *Service
3733 name string
3734 urlParams_ gensupport.URLParams
3735 ifNoneMatch_ string
3736 ctx_ context.Context
3737 header_ http.Header
3738 }
3739
3740 // Get: Gets the latest state of a long-running operation. Clients can use this
3741 // method to poll the operation result at intervals as recommended by the API
3742 // service.
3743 //
3744 // - name: The name of the operation resource.
3745 func (r *OrganizationsLocationsAccessPolicySimulationsOperationsService) Get(name string) *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall {
3746 c := &OrganizationsLocationsAccessPolicySimulationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3747 c.name = name
3748 return c
3749 }
3750
3751 // Fields allows partial responses to be retrieved. See
3752 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3753 // details.
3754 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall {
3755 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3756 return c
3757 }
3758
3759 // IfNoneMatch sets an optional parameter which makes the operation fail if the
3760 // object's ETag matches the given value. This is useful for getting updates
3761 // only after the object has changed since the last request.
3762 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall {
3763 c.ifNoneMatch_ = entityTag
3764 return c
3765 }
3766
3767 // Context sets the context to be used in this call's Do method.
3768 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall {
3769 c.ctx_ = ctx
3770 return c
3771 }
3772
3773 // Header returns a http.Header that can be modified by the caller to add
3774 // headers to the request.
3775 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) Header() http.Header {
3776 if c.header_ == nil {
3777 c.header_ = make(http.Header)
3778 }
3779 return c.header_
3780 }
3781
3782 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
3783 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
3784 if c.ifNoneMatch_ != "" {
3785 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3786 }
3787 c.urlParams_.Set("alt", alt)
3788 c.urlParams_.Set("prettyPrint", "false")
3789 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
3790 urls += "?" + c.urlParams_.Encode()
3791 req, err := http.NewRequest("GET", urls, nil)
3792 if err != nil {
3793 return nil, err
3794 }
3795 req.Header = reqHeaders
3796 googleapi.Expand(req.URL, map[string]string{
3797 "name": c.name,
3798 })
3799 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.accessPolicySimulations.operations.get", "request", internallog.HTTPRequest(req, nil))
3800 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3801 }
3802
3803 // Do executes the "policysimulator.organizations.locations.accessPolicySimulations.operations.get" call.
3804 // Any non-2xx status code is an error. Response headers are in either
3805 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
3806 // returned at all) in error.(*googleapi.Error).Header. Use
3807 // googleapi.IsNotModified to check whether the returned error was because
3808 // http.StatusNotModified was returned.
3809 func (c *OrganizationsLocationsAccessPolicySimulationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3810 gensupport.SetOptions(c.urlParams_, opts...)
3811 res, err := c.doRequest("json")
3812 if res != nil && res.StatusCode == http.StatusNotModified {
3813 if res.Body != nil {
3814 res.Body.Close()
3815 }
3816 return nil, gensupport.WrapError(&googleapi.Error{
3817 Code: res.StatusCode,
3818 Header: res.Header,
3819 })
3820 }
3821 if err != nil {
3822 return nil, err
3823 }
3824 defer googleapi.CloseBody(res)
3825 if err := googleapi.CheckResponse(res); err != nil {
3826 return nil, gensupport.WrapError(err)
3827 }
3828 ret := &GoogleLongrunningOperation{
3829 ServerResponse: googleapi.ServerResponse{
3830 Header: res.Header,
3831 HTTPStatusCode: res.StatusCode,
3832 },
3833 }
3834 target := &ret
3835 b, err := gensupport.DecodeResponseBytes(target, res)
3836 if err != nil {
3837 return nil, err
3838 }
3839 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.accessPolicySimulations.operations.get", "response", internallog.HTTPResponse(res, b))
3840 return ret, nil
3841 }
3842
3843 type OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall struct {
3844 s *Service
3845 parent string
3846 googlecloudpolicysimulatorv1betaorgpolicyviolationspreview *GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview
3847 urlParams_ gensupport.URLParams
3848 ctx_ context.Context
3849 header_ http.Header
3850 }
3851
3852 // Create: CreateOrgPolicyViolationsPreview creates an
3853 // OrgPolicyViolationsPreview for the proposed changes in the provided
3854 // OrgPolicyViolationsPreview.OrgPolicyOverlay. The changes to OrgPolicy are
3855 // specified by this `OrgPolicyOverlay`. The resources to scan are inferred
3856 // from these specified changes.
3857 //
3858 // - parent: The organization under which this OrgPolicyViolationsPreview will
3859 // be created. Example: `organizations/my-example-org/locations/global`.
3860 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) Create(parent string, googlecloudpolicysimulatorv1betaorgpolicyviolationspreview *GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall {
3861 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3862 c.parent = parent
3863 c.googlecloudpolicysimulatorv1betaorgpolicyviolationspreview = googlecloudpolicysimulatorv1betaorgpolicyviolationspreview
3864 return c
3865 }
3866
3867 // OrgPolicyViolationsPreviewId sets the optional parameter
3868 // "orgPolicyViolationsPreviewId": An optional user-specified ID for the
3869 // OrgPolicyViolationsPreview. If not provided, a random ID will be generated.
3870 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) OrgPolicyViolationsPreviewId(orgPolicyViolationsPreviewId string) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall {
3871 c.urlParams_.Set("orgPolicyViolationsPreviewId", orgPolicyViolationsPreviewId)
3872 return c
3873 }
3874
3875 // Fields allows partial responses to be retrieved. See
3876 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3877 // details.
3878 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall {
3879 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3880 return c
3881 }
3882
3883 // Context sets the context to be used in this call's Do method.
3884 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall {
3885 c.ctx_ = ctx
3886 return c
3887 }
3888
3889 // Header returns a http.Header that can be modified by the caller to add
3890 // headers to the request.
3891 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Header() http.Header {
3892 if c.header_ == nil {
3893 c.header_ = make(http.Header)
3894 }
3895 return c.header_
3896 }
3897
3898 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) doRequest(alt string) (*http.Response, error) {
3899 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
3900 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betaorgpolicyviolationspreview)
3901 if err != nil {
3902 return nil, err
3903 }
3904 c.urlParams_.Set("alt", alt)
3905 c.urlParams_.Set("prettyPrint", "false")
3906 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/orgPolicyViolationsPreviews")
3907 urls += "?" + c.urlParams_.Encode()
3908 req, err := http.NewRequest("POST", urls, body)
3909 if err != nil {
3910 return nil, err
3911 }
3912 req.Header = reqHeaders
3913 googleapi.Expand(req.URL, map[string]string{
3914 "parent": c.parent,
3915 })
3916 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.create", "request", internallog.HTTPRequest(req, body.Bytes()))
3917 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3918 }
3919
3920 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.create" call.
3921 // Any non-2xx status code is an error. Response headers are in either
3922 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
3923 // returned at all) in error.(*googleapi.Error).Header. Use
3924 // googleapi.IsNotModified to check whether the returned error was because
3925 // http.StatusNotModified was returned.
3926 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
3927 gensupport.SetOptions(c.urlParams_, opts...)
3928 res, err := c.doRequest("json")
3929 if res != nil && res.StatusCode == http.StatusNotModified {
3930 if res.Body != nil {
3931 res.Body.Close()
3932 }
3933 return nil, gensupport.WrapError(&googleapi.Error{
3934 Code: res.StatusCode,
3935 Header: res.Header,
3936 })
3937 }
3938 if err != nil {
3939 return nil, err
3940 }
3941 defer googleapi.CloseBody(res)
3942 if err := googleapi.CheckResponse(res); err != nil {
3943 return nil, gensupport.WrapError(err)
3944 }
3945 ret := &GoogleLongrunningOperation{
3946 ServerResponse: googleapi.ServerResponse{
3947 Header: res.Header,
3948 HTTPStatusCode: res.StatusCode,
3949 },
3950 }
3951 target := &ret
3952 b, err := gensupport.DecodeResponseBytes(target, res)
3953 if err != nil {
3954 return nil, err
3955 }
3956 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.create", "response", internallog.HTTPResponse(res, b))
3957 return ret, nil
3958 }
3959
3960 type OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall struct {
3961 s *Service
3962 parent string
3963 googlecloudpolicysimulatorv1betaorgpolicyviolationspreview *GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview
3964 urlParams_ gensupport.URLParams
3965 ctx_ context.Context
3966 header_ http.Header
3967 }
3968
3969 // Generate: GenerateOrgPolicyViolationsPreview generates an
3970 // OrgPolicyViolationsPreview for the proposed changes in the provided
3971 // OrgPolicyViolationsPreview.OrgPolicyOverlay. The changes to OrgPolicy are
3972 // specified by this `OrgPolicyOverlay`. The resources to scan are inferred
3973 // from these specified changes.
3974 //
3975 // - parent: The organization under which this OrgPolicyViolationsPreview will
3976 // be created. Example: `organizations/my-example-org/locations/global`.
3977 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) Generate(parent string, googlecloudpolicysimulatorv1betaorgpolicyviolationspreview *GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview) *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall {
3978 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3979 c.parent = parent
3980 c.googlecloudpolicysimulatorv1betaorgpolicyviolationspreview = googlecloudpolicysimulatorv1betaorgpolicyviolationspreview
3981 return c
3982 }
3983
3984 // Fields allows partial responses to be retrieved. See
3985 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
3986 // details.
3987 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall {
3988 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3989 return c
3990 }
3991
3992 // Context sets the context to be used in this call's Do method.
3993 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall {
3994 c.ctx_ = ctx
3995 return c
3996 }
3997
3998 // Header returns a http.Header that can be modified by the caller to add
3999 // headers to the request.
4000 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) Header() http.Header {
4001 if c.header_ == nil {
4002 c.header_ = make(http.Header)
4003 }
4004 return c.header_
4005 }
4006
4007 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) doRequest(alt string) (*http.Response, error) {
4008 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4009 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betaorgpolicyviolationspreview)
4010 if err != nil {
4011 return nil, err
4012 }
4013 c.urlParams_.Set("alt", alt)
4014 c.urlParams_.Set("prettyPrint", "false")
4015 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/orgPolicyViolationsPreviews:generate")
4016 urls += "?" + c.urlParams_.Encode()
4017 req, err := http.NewRequest("POST", urls, body)
4018 if err != nil {
4019 return nil, err
4020 }
4021 req.Header = reqHeaders
4022 googleapi.Expand(req.URL, map[string]string{
4023 "parent": c.parent,
4024 })
4025 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.generate", "request", internallog.HTTPRequest(req, body.Bytes()))
4026 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4027 }
4028
4029 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.generate" call.
4030 // Any non-2xx status code is an error. Response headers are in either
4031 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
4032 // returned at all) in error.(*googleapi.Error).Header. Use
4033 // googleapi.IsNotModified to check whether the returned error was because
4034 // http.StatusNotModified was returned.
4035 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGenerateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
4036 gensupport.SetOptions(c.urlParams_, opts...)
4037 res, err := c.doRequest("json")
4038 if res != nil && res.StatusCode == http.StatusNotModified {
4039 if res.Body != nil {
4040 res.Body.Close()
4041 }
4042 return nil, gensupport.WrapError(&googleapi.Error{
4043 Code: res.StatusCode,
4044 Header: res.Header,
4045 })
4046 }
4047 if err != nil {
4048 return nil, err
4049 }
4050 defer googleapi.CloseBody(res)
4051 if err := googleapi.CheckResponse(res); err != nil {
4052 return nil, gensupport.WrapError(err)
4053 }
4054 ret := &GoogleLongrunningOperation{
4055 ServerResponse: googleapi.ServerResponse{
4056 Header: res.Header,
4057 HTTPStatusCode: res.StatusCode,
4058 },
4059 }
4060 target := &ret
4061 b, err := gensupport.DecodeResponseBytes(target, res)
4062 if err != nil {
4063 return nil, err
4064 }
4065 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.generate", "response", internallog.HTTPResponse(res, b))
4066 return ret, nil
4067 }
4068
4069 type OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall struct {
4070 s *Service
4071 name string
4072 urlParams_ gensupport.URLParams
4073 ifNoneMatch_ string
4074 ctx_ context.Context
4075 header_ http.Header
4076 }
4077
4078 // Get: GetOrgPolicyViolationsPreview gets the specified
4079 // OrgPolicyViolationsPreview. Each OrgPolicyViolationsPreview is available for
4080 // at least 7 days.
4081 //
4082 // - name: The name of the OrgPolicyViolationsPreview to get.
4083 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) Get(name string) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall {
4084 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4085 c.name = name
4086 return c
4087 }
4088
4089 // Fields allows partial responses to be retrieved. See
4090 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4091 // details.
4092 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall {
4093 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4094 return c
4095 }
4096
4097 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4098 // object's ETag matches the given value. This is useful for getting updates
4099 // only after the object has changed since the last request.
4100 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall {
4101 c.ifNoneMatch_ = entityTag
4102 return c
4103 }
4104
4105 // Context sets the context to be used in this call's Do method.
4106 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall {
4107 c.ctx_ = ctx
4108 return c
4109 }
4110
4111 // Header returns a http.Header that can be modified by the caller to add
4112 // headers to the request.
4113 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Header() http.Header {
4114 if c.header_ == nil {
4115 c.header_ = make(http.Header)
4116 }
4117 return c.header_
4118 }
4119
4120 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) doRequest(alt string) (*http.Response, error) {
4121 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4122 if c.ifNoneMatch_ != "" {
4123 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4124 }
4125 c.urlParams_.Set("alt", alt)
4126 c.urlParams_.Set("prettyPrint", "false")
4127 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
4128 urls += "?" + c.urlParams_.Encode()
4129 req, err := http.NewRequest("GET", urls, nil)
4130 if err != nil {
4131 return nil, err
4132 }
4133 req.Header = reqHeaders
4134 googleapi.Expand(req.URL, map[string]string{
4135 "name": c.name,
4136 })
4137 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.get", "request", internallog.HTTPRequest(req, nil))
4138 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4139 }
4140
4141 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.get" call.
4142 // Any non-2xx status code is an error. Response headers are in either
4143 // *GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview.ServerResponse.He
4144 // ader or (if a response was returned at all) in
4145 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4146 // whether the returned error was because http.StatusNotModified was returned.
4147 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview, error) {
4148 gensupport.SetOptions(c.urlParams_, opts...)
4149 res, err := c.doRequest("json")
4150 if res != nil && res.StatusCode == http.StatusNotModified {
4151 if res.Body != nil {
4152 res.Body.Close()
4153 }
4154 return nil, gensupport.WrapError(&googleapi.Error{
4155 Code: res.StatusCode,
4156 Header: res.Header,
4157 })
4158 }
4159 if err != nil {
4160 return nil, err
4161 }
4162 defer googleapi.CloseBody(res)
4163 if err := googleapi.CheckResponse(res); err != nil {
4164 return nil, gensupport.WrapError(err)
4165 }
4166 ret := &GoogleCloudPolicysimulatorV1betaOrgPolicyViolationsPreview{
4167 ServerResponse: googleapi.ServerResponse{
4168 Header: res.Header,
4169 HTTPStatusCode: res.StatusCode,
4170 },
4171 }
4172 target := &ret
4173 b, err := gensupport.DecodeResponseBytes(target, res)
4174 if err != nil {
4175 return nil, err
4176 }
4177 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.get", "response", internallog.HTTPResponse(res, b))
4178 return ret, nil
4179 }
4180
4181 type OrganizationsLocationsOrgPolicyViolationsPreviewsListCall struct {
4182 s *Service
4183 parent string
4184 urlParams_ gensupport.URLParams
4185 ifNoneMatch_ string
4186 ctx_ context.Context
4187 header_ http.Header
4188 }
4189
4190 // List: ListOrgPolicyViolationsPreviews lists each OrgPolicyViolationsPreview
4191 // in an organization. Each OrgPolicyViolationsPreview is available for at
4192 // least 7 days.
4193 //
4194 // - parent: The parent the violations are scoped to. Format:
4195 // `organizations/{organization}/locations/{location}` Example:
4196 // `organizations/my-example-org/locations/global`.
4197 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsService) List(parent string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4198 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4199 c.parent = parent
4200 return c
4201 }
4202
4203 // PageSize sets the optional parameter "pageSize": The maximum number of items
4204 // to return. The service may return fewer than this value. If unspecified, at
4205 // most 5 items will be returned. The maximum value is 10; values above 10 will
4206 // be coerced to 10.
4207 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) PageSize(pageSize int64) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4208 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4209 return c
4210 }
4211
4212 // PageToken sets the optional parameter "pageToken": A page token, received
4213 // from a previous call. Provide this to retrieve the subsequent page. When
4214 // paginating, all other parameters must match the call that provided the page
4215 // token.
4216 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) PageToken(pageToken string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4217 c.urlParams_.Set("pageToken", pageToken)
4218 return c
4219 }
4220
4221 // Fields allows partial responses to be retrieved. See
4222 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4223 // details.
4224 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4225 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4226 return c
4227 }
4228
4229 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4230 // object's ETag matches the given value. This is useful for getting updates
4231 // only after the object has changed since the last request.
4232 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4233 c.ifNoneMatch_ = entityTag
4234 return c
4235 }
4236
4237 // Context sets the context to be used in this call's Do method.
4238 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall {
4239 c.ctx_ = ctx
4240 return c
4241 }
4242
4243 // Header returns a http.Header that can be modified by the caller to add
4244 // headers to the request.
4245 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Header() http.Header {
4246 if c.header_ == nil {
4247 c.header_ = make(http.Header)
4248 }
4249 return c.header_
4250 }
4251
4252 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) doRequest(alt string) (*http.Response, error) {
4253 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4254 if c.ifNoneMatch_ != "" {
4255 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4256 }
4257 c.urlParams_.Set("alt", alt)
4258 c.urlParams_.Set("prettyPrint", "false")
4259 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/orgPolicyViolationsPreviews")
4260 urls += "?" + c.urlParams_.Encode()
4261 req, err := http.NewRequest("GET", urls, nil)
4262 if err != nil {
4263 return nil, err
4264 }
4265 req.Header = reqHeaders
4266 googleapi.Expand(req.URL, map[string]string{
4267 "parent": c.parent,
4268 })
4269 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.list", "request", internallog.HTTPRequest(req, nil))
4270 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4271 }
4272
4273 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.list" call.
4274 // Any non-2xx status code is an error. Response headers are in either
4275 // *GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsPreviewsResponse.Serv
4276 // erResponse.Header or (if a response was returned at all) in
4277 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4278 // whether the returned error was because http.StatusNotModified was returned.
4279 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsPreviewsResponse, error) {
4280 gensupport.SetOptions(c.urlParams_, opts...)
4281 res, err := c.doRequest("json")
4282 if res != nil && res.StatusCode == http.StatusNotModified {
4283 if res.Body != nil {
4284 res.Body.Close()
4285 }
4286 return nil, gensupport.WrapError(&googleapi.Error{
4287 Code: res.StatusCode,
4288 Header: res.Header,
4289 })
4290 }
4291 if err != nil {
4292 return nil, err
4293 }
4294 defer googleapi.CloseBody(res)
4295 if err := googleapi.CheckResponse(res); err != nil {
4296 return nil, gensupport.WrapError(err)
4297 }
4298 ret := &GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsPreviewsResponse{
4299 ServerResponse: googleapi.ServerResponse{
4300 Header: res.Header,
4301 HTTPStatusCode: res.StatusCode,
4302 },
4303 }
4304 target := &ret
4305 b, err := gensupport.DecodeResponseBytes(target, res)
4306 if err != nil {
4307 return nil, err
4308 }
4309 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.list", "response", internallog.HTTPResponse(res, b))
4310 return ret, nil
4311 }
4312
4313 // Pages invokes f for each page of results.
4314 // A non-nil error returned from f will halt the iteration.
4315 // The provided context supersedes any context provided to the Context method.
4316 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsPreviewsResponse) error) error {
4317 c.ctx_ = ctx
4318 defer c.PageToken(c.urlParams_.Get("pageToken"))
4319 for {
4320 x, err := c.Do()
4321 if err != nil {
4322 return err
4323 }
4324 if err := f(x); err != nil {
4325 return err
4326 }
4327 if x.NextPageToken == "" {
4328 return nil
4329 }
4330 c.PageToken(x.NextPageToken)
4331 }
4332 }
4333
4334 type OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
4335 s *Service
4336 name string
4337 urlParams_ gensupport.URLParams
4338 ifNoneMatch_ string
4339 ctx_ context.Context
4340 header_ http.Header
4341 }
4342
4343 // Get: Gets the latest state of a long-running operation. Clients can use this
4344 // method to poll the operation result at intervals as recommended by the API
4345 // service.
4346 //
4347 // - name: The name of the operation resource.
4348 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
4349 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4350 c.name = name
4351 return c
4352 }
4353
4354 // Fields allows partial responses to be retrieved. See
4355 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4356 // details.
4357 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
4358 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4359 return c
4360 }
4361
4362 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4363 // object's ETag matches the given value. This is useful for getting updates
4364 // only after the object has changed since the last request.
4365 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
4366 c.ifNoneMatch_ = entityTag
4367 return c
4368 }
4369
4370 // Context sets the context to be used in this call's Do method.
4371 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
4372 c.ctx_ = ctx
4373 return c
4374 }
4375
4376 // Header returns a http.Header that can be modified by the caller to add
4377 // headers to the request.
4378 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
4379 if c.header_ == nil {
4380 c.header_ = make(http.Header)
4381 }
4382 return c.header_
4383 }
4384
4385 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
4386 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4387 if c.ifNoneMatch_ != "" {
4388 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4389 }
4390 c.urlParams_.Set("alt", alt)
4391 c.urlParams_.Set("prettyPrint", "false")
4392 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
4393 urls += "?" + c.urlParams_.Encode()
4394 req, err := http.NewRequest("GET", urls, nil)
4395 if err != nil {
4396 return nil, err
4397 }
4398 req.Header = reqHeaders
4399 googleapi.Expand(req.URL, map[string]string{
4400 "name": c.name,
4401 })
4402 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get", "request", internallog.HTTPRequest(req, nil))
4403 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4404 }
4405
4406 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get" call.
4407 // Any non-2xx status code is an error. Response headers are in either
4408 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
4409 // returned at all) in error.(*googleapi.Error).Header. Use
4410 // googleapi.IsNotModified to check whether the returned error was because
4411 // http.StatusNotModified was returned.
4412 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
4413 gensupport.SetOptions(c.urlParams_, opts...)
4414 res, err := c.doRequest("json")
4415 if res != nil && res.StatusCode == http.StatusNotModified {
4416 if res.Body != nil {
4417 res.Body.Close()
4418 }
4419 return nil, gensupport.WrapError(&googleapi.Error{
4420 Code: res.StatusCode,
4421 Header: res.Header,
4422 })
4423 }
4424 if err != nil {
4425 return nil, err
4426 }
4427 defer googleapi.CloseBody(res)
4428 if err := googleapi.CheckResponse(res); err != nil {
4429 return nil, gensupport.WrapError(err)
4430 }
4431 ret := &GoogleLongrunningOperation{
4432 ServerResponse: googleapi.ServerResponse{
4433 Header: res.Header,
4434 HTTPStatusCode: res.StatusCode,
4435 },
4436 }
4437 target := &ret
4438 b, err := gensupport.DecodeResponseBytes(target, res)
4439 if err != nil {
4440 return nil, err
4441 }
4442 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get", "response", internallog.HTTPResponse(res, b))
4443 return ret, nil
4444 }
4445
4446 type OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall struct {
4447 s *Service
4448 parent string
4449 urlParams_ gensupport.URLParams
4450 ifNoneMatch_ string
4451 ctx_ context.Context
4452 header_ http.Header
4453 }
4454
4455 // List: ListOrgPolicyViolations lists the OrgPolicyViolations that are present
4456 // in an OrgPolicyViolationsPreview.
4457 //
4458 // - parent: The OrgPolicyViolationsPreview to get OrgPolicyViolations from.
4459 // Format:
4460 // organizations/{organization}/locations/{location}/orgPolicyViolationsPrevie
4461 // ws/{orgPolicyViolationsPreview}.
4462 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsService) List(parent string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4463 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4464 c.parent = parent
4465 return c
4466 }
4467
4468 // PageSize sets the optional parameter "pageSize": The maximum number of items
4469 // to return. The service may return fewer than this value. If unspecified, at
4470 // most 1000 items will be returned. The maximum value is 1000; values above
4471 // 1000 will be coerced to 1000.
4472 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4473 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4474 return c
4475 }
4476
4477 // PageToken sets the optional parameter "pageToken": A page token, received
4478 // from a previous call. Provide this to retrieve the subsequent page. When
4479 // paginating, all other parameters must match the call that provided the page
4480 // token.
4481 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) PageToken(pageToken string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4482 c.urlParams_.Set("pageToken", pageToken)
4483 return c
4484 }
4485
4486 // Fields allows partial responses to be retrieved. See
4487 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4488 // details.
4489 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4490 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4491 return c
4492 }
4493
4494 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4495 // object's ETag matches the given value. This is useful for getting updates
4496 // only after the object has changed since the last request.
4497 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4498 c.ifNoneMatch_ = entityTag
4499 return c
4500 }
4501
4502 // Context sets the context to be used in this call's Do method.
4503 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall {
4504 c.ctx_ = ctx
4505 return c
4506 }
4507
4508 // Header returns a http.Header that can be modified by the caller to add
4509 // headers to the request.
4510 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Header() http.Header {
4511 if c.header_ == nil {
4512 c.header_ = make(http.Header)
4513 }
4514 return c.header_
4515 }
4516
4517 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) doRequest(alt string) (*http.Response, error) {
4518 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4519 if c.ifNoneMatch_ != "" {
4520 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4521 }
4522 c.urlParams_.Set("alt", alt)
4523 c.urlParams_.Set("prettyPrint", "false")
4524 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/orgPolicyViolations")
4525 urls += "?" + c.urlParams_.Encode()
4526 req, err := http.NewRequest("GET", urls, nil)
4527 if err != nil {
4528 return nil, err
4529 }
4530 req.Header = reqHeaders
4531 googleapi.Expand(req.URL, map[string]string{
4532 "parent": c.parent,
4533 })
4534 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.orgPolicyViolations.list", "request", internallog.HTTPRequest(req, nil))
4535 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4536 }
4537
4538 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.orgPolicyViolations.list" call.
4539 // Any non-2xx status code is an error. Response headers are in either
4540 // *GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsResponse.ServerRespon
4541 // se.Header or (if a response was returned at all) in
4542 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
4543 // whether the returned error was because http.StatusNotModified was returned.
4544 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsResponse, error) {
4545 gensupport.SetOptions(c.urlParams_, opts...)
4546 res, err := c.doRequest("json")
4547 if res != nil && res.StatusCode == http.StatusNotModified {
4548 if res.Body != nil {
4549 res.Body.Close()
4550 }
4551 return nil, gensupport.WrapError(&googleapi.Error{
4552 Code: res.StatusCode,
4553 Header: res.Header,
4554 })
4555 }
4556 if err != nil {
4557 return nil, err
4558 }
4559 defer googleapi.CloseBody(res)
4560 if err := googleapi.CheckResponse(res); err != nil {
4561 return nil, gensupport.WrapError(err)
4562 }
4563 ret := &GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsResponse{
4564 ServerResponse: googleapi.ServerResponse{
4565 Header: res.Header,
4566 HTTPStatusCode: res.StatusCode,
4567 },
4568 }
4569 target := &ret
4570 b, err := gensupport.DecodeResponseBytes(target, res)
4571 if err != nil {
4572 return nil, err
4573 }
4574 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.orgPolicyViolationsPreviews.orgPolicyViolations.list", "response", internallog.HTTPResponse(res, b))
4575 return ret, nil
4576 }
4577
4578 // Pages invokes f for each page of results.
4579 // A non-nil error returned from f will halt the iteration.
4580 // The provided context supersedes any context provided to the Context method.
4581 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOrgPolicyViolationsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1betaListOrgPolicyViolationsResponse) error) error {
4582 c.ctx_ = ctx
4583 defer c.PageToken(c.urlParams_.Get("pageToken"))
4584 for {
4585 x, err := c.Do()
4586 if err != nil {
4587 return err
4588 }
4589 if err := f(x); err != nil {
4590 return err
4591 }
4592 if x.NextPageToken == "" {
4593 return nil
4594 }
4595 c.PageToken(x.NextPageToken)
4596 }
4597 }
4598
4599 type OrganizationsLocationsReplaysCreateCall struct {
4600 s *Service
4601 parent string
4602 googlecloudpolicysimulatorv1betareplay *GoogleCloudPolicysimulatorV1betaReplay
4603 urlParams_ gensupport.URLParams
4604 ctx_ context.Context
4605 header_ http.Header
4606 }
4607
4608 // Create: Creates and starts a Replay using the given ReplayConfig.
4609 //
4610 // - parent: The parent resource where this Replay will be created. This
4611 // resource must be a project, folder, or organization with a location.
4612 // Example: `projects/my-example-project/locations/global`.
4613 func (r *OrganizationsLocationsReplaysService) Create(parent string, googlecloudpolicysimulatorv1betareplay *GoogleCloudPolicysimulatorV1betaReplay) *OrganizationsLocationsReplaysCreateCall {
4614 c := &OrganizationsLocationsReplaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4615 c.parent = parent
4616 c.googlecloudpolicysimulatorv1betareplay = googlecloudpolicysimulatorv1betareplay
4617 return c
4618 }
4619
4620 // Fields allows partial responses to be retrieved. See
4621 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4622 // details.
4623 func (c *OrganizationsLocationsReplaysCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysCreateCall {
4624 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4625 return c
4626 }
4627
4628 // Context sets the context to be used in this call's Do method.
4629 func (c *OrganizationsLocationsReplaysCreateCall) Context(ctx context.Context) *OrganizationsLocationsReplaysCreateCall {
4630 c.ctx_ = ctx
4631 return c
4632 }
4633
4634 // Header returns a http.Header that can be modified by the caller to add
4635 // headers to the request.
4636 func (c *OrganizationsLocationsReplaysCreateCall) Header() http.Header {
4637 if c.header_ == nil {
4638 c.header_ = make(http.Header)
4639 }
4640 return c.header_
4641 }
4642
4643 func (c *OrganizationsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) {
4644 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
4645 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betareplay)
4646 if err != nil {
4647 return nil, err
4648 }
4649 c.urlParams_.Set("alt", alt)
4650 c.urlParams_.Set("prettyPrint", "false")
4651 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays")
4652 urls += "?" + c.urlParams_.Encode()
4653 req, err := http.NewRequest("POST", urls, body)
4654 if err != nil {
4655 return nil, err
4656 }
4657 req.Header = reqHeaders
4658 googleapi.Expand(req.URL, map[string]string{
4659 "parent": c.parent,
4660 })
4661 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.create", "request", internallog.HTTPRequest(req, body.Bytes()))
4662 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4663 }
4664
4665 // Do executes the "policysimulator.organizations.locations.replays.create" call.
4666 // Any non-2xx status code is an error. Response headers are in either
4667 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
4668 // returned at all) in error.(*googleapi.Error).Header. Use
4669 // googleapi.IsNotModified to check whether the returned error was because
4670 // http.StatusNotModified was returned.
4671 func (c *OrganizationsLocationsReplaysCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
4672 gensupport.SetOptions(c.urlParams_, opts...)
4673 res, err := c.doRequest("json")
4674 if res != nil && res.StatusCode == http.StatusNotModified {
4675 if res.Body != nil {
4676 res.Body.Close()
4677 }
4678 return nil, gensupport.WrapError(&googleapi.Error{
4679 Code: res.StatusCode,
4680 Header: res.Header,
4681 })
4682 }
4683 if err != nil {
4684 return nil, err
4685 }
4686 defer googleapi.CloseBody(res)
4687 if err := googleapi.CheckResponse(res); err != nil {
4688 return nil, gensupport.WrapError(err)
4689 }
4690 ret := &GoogleLongrunningOperation{
4691 ServerResponse: googleapi.ServerResponse{
4692 Header: res.Header,
4693 HTTPStatusCode: res.StatusCode,
4694 },
4695 }
4696 target := &ret
4697 b, err := gensupport.DecodeResponseBytes(target, res)
4698 if err != nil {
4699 return nil, err
4700 }
4701 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.create", "response", internallog.HTTPResponse(res, b))
4702 return ret, nil
4703 }
4704
4705 type OrganizationsLocationsReplaysGetCall struct {
4706 s *Service
4707 name string
4708 urlParams_ gensupport.URLParams
4709 ifNoneMatch_ string
4710 ctx_ context.Context
4711 header_ http.Header
4712 }
4713
4714 // Get: Gets the specified Replay. Each `Replay` is available for at least 7
4715 // days.
4716 //
4717 // - name: The name of the Replay to retrieve, in the following format:
4718 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
4719 // eplay-id}`, where `{resource-id}` is the ID of the project, folder, or
4720 // organization that owns the `Replay`. Example:
4721 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e
4722 // 03-479ce1833c36`.
4723 func (r *OrganizationsLocationsReplaysService) Get(name string) *OrganizationsLocationsReplaysGetCall {
4724 c := &OrganizationsLocationsReplaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4725 c.name = name
4726 return c
4727 }
4728
4729 // Fields allows partial responses to be retrieved. See
4730 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4731 // details.
4732 func (c *OrganizationsLocationsReplaysGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysGetCall {
4733 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4734 return c
4735 }
4736
4737 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4738 // object's ETag matches the given value. This is useful for getting updates
4739 // only after the object has changed since the last request.
4740 func (c *OrganizationsLocationsReplaysGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysGetCall {
4741 c.ifNoneMatch_ = entityTag
4742 return c
4743 }
4744
4745 // Context sets the context to be used in this call's Do method.
4746 func (c *OrganizationsLocationsReplaysGetCall) Context(ctx context.Context) *OrganizationsLocationsReplaysGetCall {
4747 c.ctx_ = ctx
4748 return c
4749 }
4750
4751 // Header returns a http.Header that can be modified by the caller to add
4752 // headers to the request.
4753 func (c *OrganizationsLocationsReplaysGetCall) Header() http.Header {
4754 if c.header_ == nil {
4755 c.header_ = make(http.Header)
4756 }
4757 return c.header_
4758 }
4759
4760 func (c *OrganizationsLocationsReplaysGetCall) doRequest(alt string) (*http.Response, error) {
4761 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4762 if c.ifNoneMatch_ != "" {
4763 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4764 }
4765 c.urlParams_.Set("alt", alt)
4766 c.urlParams_.Set("prettyPrint", "false")
4767 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
4768 urls += "?" + c.urlParams_.Encode()
4769 req, err := http.NewRequest("GET", urls, nil)
4770 if err != nil {
4771 return nil, err
4772 }
4773 req.Header = reqHeaders
4774 googleapi.Expand(req.URL, map[string]string{
4775 "name": c.name,
4776 })
4777 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.get", "request", internallog.HTTPRequest(req, nil))
4778 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4779 }
4780
4781 // Do executes the "policysimulator.organizations.locations.replays.get" call.
4782 // Any non-2xx status code is an error. Response headers are in either
4783 // *GoogleCloudPolicysimulatorV1betaReplay.ServerResponse.Header or (if a
4784 // response was returned at all) in error.(*googleapi.Error).Header. Use
4785 // googleapi.IsNotModified to check whether the returned error was because
4786 // http.StatusNotModified was returned.
4787 func (c *OrganizationsLocationsReplaysGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaReplay, error) {
4788 gensupport.SetOptions(c.urlParams_, opts...)
4789 res, err := c.doRequest("json")
4790 if res != nil && res.StatusCode == http.StatusNotModified {
4791 if res.Body != nil {
4792 res.Body.Close()
4793 }
4794 return nil, gensupport.WrapError(&googleapi.Error{
4795 Code: res.StatusCode,
4796 Header: res.Header,
4797 })
4798 }
4799 if err != nil {
4800 return nil, err
4801 }
4802 defer googleapi.CloseBody(res)
4803 if err := googleapi.CheckResponse(res); err != nil {
4804 return nil, gensupport.WrapError(err)
4805 }
4806 ret := &GoogleCloudPolicysimulatorV1betaReplay{
4807 ServerResponse: googleapi.ServerResponse{
4808 Header: res.Header,
4809 HTTPStatusCode: res.StatusCode,
4810 },
4811 }
4812 target := &ret
4813 b, err := gensupport.DecodeResponseBytes(target, res)
4814 if err != nil {
4815 return nil, err
4816 }
4817 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.get", "response", internallog.HTTPResponse(res, b))
4818 return ret, nil
4819 }
4820
4821 type OrganizationsLocationsReplaysListCall struct {
4822 s *Service
4823 parent string
4824 urlParams_ gensupport.URLParams
4825 ifNoneMatch_ string
4826 ctx_ context.Context
4827 header_ http.Header
4828 }
4829
4830 // List: Lists each Replay in a project, folder, or organization. Each `Replay`
4831 // is available for at least 7 days.
4832 //
4833 // - parent: The parent resource, in the following format:
4834 // `{projects|folders|organizations}/{resource-id}/locations/global`, where
4835 // `{resource-id}` is the ID of the project, folder, or organization that
4836 // owns the Replay. Example: `projects/my-example-project/locations/global`
4837 // Only `Replay` objects that are direct children of the provided parent are
4838 // listed. In other words, `Replay` objects that are children of a project
4839 // will not be included when the parent is a folder of that project.
4840 func (r *OrganizationsLocationsReplaysService) List(parent string) *OrganizationsLocationsReplaysListCall {
4841 c := &OrganizationsLocationsReplaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4842 c.parent = parent
4843 return c
4844 }
4845
4846 // PageSize sets the optional parameter "pageSize": The maximum number of
4847 // Replay objects to return. Defaults to 50. The maximum value is 1000; values
4848 // above 1000 are rounded down to 1000.
4849 func (c *OrganizationsLocationsReplaysListCall) PageSize(pageSize int64) *OrganizationsLocationsReplaysListCall {
4850 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4851 return c
4852 }
4853
4854 // PageToken sets the optional parameter "pageToken": A page token, received
4855 // from a previous Simulator.ListReplays call. Provide this to retrieve the
4856 // subsequent page. When paginating, all other parameters provided to
4857 // Simulator.ListReplays must match the call that provided the page token.
4858 func (c *OrganizationsLocationsReplaysListCall) PageToken(pageToken string) *OrganizationsLocationsReplaysListCall {
4859 c.urlParams_.Set("pageToken", pageToken)
4860 return c
4861 }
4862
4863 // Fields allows partial responses to be retrieved. See
4864 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4865 // details.
4866 func (c *OrganizationsLocationsReplaysListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysListCall {
4867 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4868 return c
4869 }
4870
4871 // IfNoneMatch sets an optional parameter which makes the operation fail if the
4872 // object's ETag matches the given value. This is useful for getting updates
4873 // only after the object has changed since the last request.
4874 func (c *OrganizationsLocationsReplaysListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysListCall {
4875 c.ifNoneMatch_ = entityTag
4876 return c
4877 }
4878
4879 // Context sets the context to be used in this call's Do method.
4880 func (c *OrganizationsLocationsReplaysListCall) Context(ctx context.Context) *OrganizationsLocationsReplaysListCall {
4881 c.ctx_ = ctx
4882 return c
4883 }
4884
4885 // Header returns a http.Header that can be modified by the caller to add
4886 // headers to the request.
4887 func (c *OrganizationsLocationsReplaysListCall) Header() http.Header {
4888 if c.header_ == nil {
4889 c.header_ = make(http.Header)
4890 }
4891 return c.header_
4892 }
4893
4894 func (c *OrganizationsLocationsReplaysListCall) doRequest(alt string) (*http.Response, error) {
4895 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
4896 if c.ifNoneMatch_ != "" {
4897 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4898 }
4899 c.urlParams_.Set("alt", alt)
4900 c.urlParams_.Set("prettyPrint", "false")
4901 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays")
4902 urls += "?" + c.urlParams_.Encode()
4903 req, err := http.NewRequest("GET", urls, nil)
4904 if err != nil {
4905 return nil, err
4906 }
4907 req.Header = reqHeaders
4908 googleapi.Expand(req.URL, map[string]string{
4909 "parent": c.parent,
4910 })
4911 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.list", "request", internallog.HTTPRequest(req, nil))
4912 return gensupport.SendRequest(c.ctx_, c.s.client, req)
4913 }
4914
4915 // Do executes the "policysimulator.organizations.locations.replays.list" call.
4916 // Any non-2xx status code is an error. Response headers are in either
4917 // *GoogleCloudPolicysimulatorV1betaListReplaysResponse.ServerResponse.Header
4918 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
4919 // Use googleapi.IsNotModified to check whether the returned error was because
4920 // http.StatusNotModified was returned.
4921 func (c *OrganizationsLocationsReplaysListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaListReplaysResponse, error) {
4922 gensupport.SetOptions(c.urlParams_, opts...)
4923 res, err := c.doRequest("json")
4924 if res != nil && res.StatusCode == http.StatusNotModified {
4925 if res.Body != nil {
4926 res.Body.Close()
4927 }
4928 return nil, gensupport.WrapError(&googleapi.Error{
4929 Code: res.StatusCode,
4930 Header: res.Header,
4931 })
4932 }
4933 if err != nil {
4934 return nil, err
4935 }
4936 defer googleapi.CloseBody(res)
4937 if err := googleapi.CheckResponse(res); err != nil {
4938 return nil, gensupport.WrapError(err)
4939 }
4940 ret := &GoogleCloudPolicysimulatorV1betaListReplaysResponse{
4941 ServerResponse: googleapi.ServerResponse{
4942 Header: res.Header,
4943 HTTPStatusCode: res.StatusCode,
4944 },
4945 }
4946 target := &ret
4947 b, err := gensupport.DecodeResponseBytes(target, res)
4948 if err != nil {
4949 return nil, err
4950 }
4951 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.list", "response", internallog.HTTPResponse(res, b))
4952 return ret, nil
4953 }
4954
4955 // Pages invokes f for each page of results.
4956 // A non-nil error returned from f will halt the iteration.
4957 // The provided context supersedes any context provided to the Context method.
4958 func (c *OrganizationsLocationsReplaysListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1betaListReplaysResponse) error) error {
4959 c.ctx_ = ctx
4960 defer c.PageToken(c.urlParams_.Get("pageToken"))
4961 for {
4962 x, err := c.Do()
4963 if err != nil {
4964 return err
4965 }
4966 if err := f(x); err != nil {
4967 return err
4968 }
4969 if x.NextPageToken == "" {
4970 return nil
4971 }
4972 c.PageToken(x.NextPageToken)
4973 }
4974 }
4975
4976 type OrganizationsLocationsReplaysOperationsGetCall struct {
4977 s *Service
4978 name string
4979 urlParams_ gensupport.URLParams
4980 ifNoneMatch_ string
4981 ctx_ context.Context
4982 header_ http.Header
4983 }
4984
4985 // Get: Gets the latest state of a long-running operation. Clients can use this
4986 // method to poll the operation result at intervals as recommended by the API
4987 // service.
4988 //
4989 // - name: The name of the operation resource.
4990 func (r *OrganizationsLocationsReplaysOperationsService) Get(name string) *OrganizationsLocationsReplaysOperationsGetCall {
4991 c := &OrganizationsLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4992 c.name = name
4993 return c
4994 }
4995
4996 // Fields allows partial responses to be retrieved. See
4997 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
4998 // details.
4999 func (c *OrganizationsLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysOperationsGetCall {
5000 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5001 return c
5002 }
5003
5004 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5005 // object's ETag matches the given value. This is useful for getting updates
5006 // only after the object has changed since the last request.
5007 func (c *OrganizationsLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysOperationsGetCall {
5008 c.ifNoneMatch_ = entityTag
5009 return c
5010 }
5011
5012 // Context sets the context to be used in this call's Do method.
5013 func (c *OrganizationsLocationsReplaysOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsReplaysOperationsGetCall {
5014 c.ctx_ = ctx
5015 return c
5016 }
5017
5018 // Header returns a http.Header that can be modified by the caller to add
5019 // headers to the request.
5020 func (c *OrganizationsLocationsReplaysOperationsGetCall) Header() http.Header {
5021 if c.header_ == nil {
5022 c.header_ = make(http.Header)
5023 }
5024 return c.header_
5025 }
5026
5027 func (c *OrganizationsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
5028 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5029 if c.ifNoneMatch_ != "" {
5030 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5031 }
5032 c.urlParams_.Set("alt", alt)
5033 c.urlParams_.Set("prettyPrint", "false")
5034 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
5035 urls += "?" + c.urlParams_.Encode()
5036 req, err := http.NewRequest("GET", urls, nil)
5037 if err != nil {
5038 return nil, err
5039 }
5040 req.Header = reqHeaders
5041 googleapi.Expand(req.URL, map[string]string{
5042 "name": c.name,
5043 })
5044 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.operations.get", "request", internallog.HTTPRequest(req, nil))
5045 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5046 }
5047
5048 // Do executes the "policysimulator.organizations.locations.replays.operations.get" call.
5049 // Any non-2xx status code is an error. Response headers are in either
5050 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
5051 // returned at all) in error.(*googleapi.Error).Header. Use
5052 // googleapi.IsNotModified to check whether the returned error was because
5053 // http.StatusNotModified was returned.
5054 func (c *OrganizationsLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5055 gensupport.SetOptions(c.urlParams_, opts...)
5056 res, err := c.doRequest("json")
5057 if res != nil && res.StatusCode == http.StatusNotModified {
5058 if res.Body != nil {
5059 res.Body.Close()
5060 }
5061 return nil, gensupport.WrapError(&googleapi.Error{
5062 Code: res.StatusCode,
5063 Header: res.Header,
5064 })
5065 }
5066 if err != nil {
5067 return nil, err
5068 }
5069 defer googleapi.CloseBody(res)
5070 if err := googleapi.CheckResponse(res); err != nil {
5071 return nil, gensupport.WrapError(err)
5072 }
5073 ret := &GoogleLongrunningOperation{
5074 ServerResponse: googleapi.ServerResponse{
5075 Header: res.Header,
5076 HTTPStatusCode: res.StatusCode,
5077 },
5078 }
5079 target := &ret
5080 b, err := gensupport.DecodeResponseBytes(target, res)
5081 if err != nil {
5082 return nil, err
5083 }
5084 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.operations.get", "response", internallog.HTTPResponse(res, b))
5085 return ret, nil
5086 }
5087
5088 type OrganizationsLocationsReplaysOperationsListCall struct {
5089 s *Service
5090 name string
5091 urlParams_ gensupport.URLParams
5092 ifNoneMatch_ string
5093 ctx_ context.Context
5094 header_ http.Header
5095 }
5096
5097 // List: Lists operations that match the specified filter in the request. If
5098 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
5099 //
5100 // - name: The name of the operation's parent resource.
5101 func (r *OrganizationsLocationsReplaysOperationsService) List(name string) *OrganizationsLocationsReplaysOperationsListCall {
5102 c := &OrganizationsLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5103 c.name = name
5104 return c
5105 }
5106
5107 // Filter sets the optional parameter "filter": The standard list filter.
5108 func (c *OrganizationsLocationsReplaysOperationsListCall) Filter(filter string) *OrganizationsLocationsReplaysOperationsListCall {
5109 c.urlParams_.Set("filter", filter)
5110 return c
5111 }
5112
5113 // PageSize sets the optional parameter "pageSize": The standard list page
5114 // size.
5115 func (c *OrganizationsLocationsReplaysOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsReplaysOperationsListCall {
5116 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5117 return c
5118 }
5119
5120 // PageToken sets the optional parameter "pageToken": The standard list page
5121 // token.
5122 func (c *OrganizationsLocationsReplaysOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsReplaysOperationsListCall {
5123 c.urlParams_.Set("pageToken", pageToken)
5124 return c
5125 }
5126
5127 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
5128 // When set to `true`, operations that are reachable are returned as normal,
5129 // and those that are unreachable are returned in the
5130 // ListOperationsResponse.unreachable field. This can only be `true` when
5131 // reading across collections. For example, when `parent` is set to
5132 // "projects/example/locations/-". This field is not supported by default and
5133 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
5134 // otherwise in service or product specific documentation.
5135 func (c *OrganizationsLocationsReplaysOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *OrganizationsLocationsReplaysOperationsListCall {
5136 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
5137 return c
5138 }
5139
5140 // Fields allows partial responses to be retrieved. See
5141 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5142 // details.
5143 func (c *OrganizationsLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysOperationsListCall {
5144 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5145 return c
5146 }
5147
5148 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5149 // object's ETag matches the given value. This is useful for getting updates
5150 // only after the object has changed since the last request.
5151 func (c *OrganizationsLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysOperationsListCall {
5152 c.ifNoneMatch_ = entityTag
5153 return c
5154 }
5155
5156 // Context sets the context to be used in this call's Do method.
5157 func (c *OrganizationsLocationsReplaysOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsReplaysOperationsListCall {
5158 c.ctx_ = ctx
5159 return c
5160 }
5161
5162 // Header returns a http.Header that can be modified by the caller to add
5163 // headers to the request.
5164 func (c *OrganizationsLocationsReplaysOperationsListCall) Header() http.Header {
5165 if c.header_ == nil {
5166 c.header_ = make(http.Header)
5167 }
5168 return c.header_
5169 }
5170
5171 func (c *OrganizationsLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
5172 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5173 if c.ifNoneMatch_ != "" {
5174 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5175 }
5176 c.urlParams_.Set("alt", alt)
5177 c.urlParams_.Set("prettyPrint", "false")
5178 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
5179 urls += "?" + c.urlParams_.Encode()
5180 req, err := http.NewRequest("GET", urls, nil)
5181 if err != nil {
5182 return nil, err
5183 }
5184 req.Header = reqHeaders
5185 googleapi.Expand(req.URL, map[string]string{
5186 "name": c.name,
5187 })
5188 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.operations.list", "request", internallog.HTTPRequest(req, nil))
5189 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5190 }
5191
5192 // Do executes the "policysimulator.organizations.locations.replays.operations.list" call.
5193 // Any non-2xx status code is an error. Response headers are in either
5194 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
5195 // response was returned at all) in error.(*googleapi.Error).Header. Use
5196 // googleapi.IsNotModified to check whether the returned error was because
5197 // http.StatusNotModified was returned.
5198 func (c *OrganizationsLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
5199 gensupport.SetOptions(c.urlParams_, opts...)
5200 res, err := c.doRequest("json")
5201 if res != nil && res.StatusCode == http.StatusNotModified {
5202 if res.Body != nil {
5203 res.Body.Close()
5204 }
5205 return nil, gensupport.WrapError(&googleapi.Error{
5206 Code: res.StatusCode,
5207 Header: res.Header,
5208 })
5209 }
5210 if err != nil {
5211 return nil, err
5212 }
5213 defer googleapi.CloseBody(res)
5214 if err := googleapi.CheckResponse(res); err != nil {
5215 return nil, gensupport.WrapError(err)
5216 }
5217 ret := &GoogleLongrunningListOperationsResponse{
5218 ServerResponse: googleapi.ServerResponse{
5219 Header: res.Header,
5220 HTTPStatusCode: res.StatusCode,
5221 },
5222 }
5223 target := &ret
5224 b, err := gensupport.DecodeResponseBytes(target, res)
5225 if err != nil {
5226 return nil, err
5227 }
5228 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.operations.list", "response", internallog.HTTPResponse(res, b))
5229 return ret, nil
5230 }
5231
5232 // Pages invokes f for each page of results.
5233 // A non-nil error returned from f will halt the iteration.
5234 // The provided context supersedes any context provided to the Context method.
5235 func (c *OrganizationsLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
5236 c.ctx_ = ctx
5237 defer c.PageToken(c.urlParams_.Get("pageToken"))
5238 for {
5239 x, err := c.Do()
5240 if err != nil {
5241 return err
5242 }
5243 if err := f(x); err != nil {
5244 return err
5245 }
5246 if x.NextPageToken == "" {
5247 return nil
5248 }
5249 c.PageToken(x.NextPageToken)
5250 }
5251 }
5252
5253 type OrganizationsLocationsReplaysResultsListCall struct {
5254 s *Service
5255 parent string
5256 urlParams_ gensupport.URLParams
5257 ifNoneMatch_ string
5258 ctx_ context.Context
5259 header_ http.Header
5260 }
5261
5262 // List: Lists the results of running a Replay.
5263 //
5264 // - parent: The Replay whose results are listed, in the following format:
5265 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
5266 // eplay-id}` Example:
5267 // `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce
5268 // 1833c36`.
5269 func (r *OrganizationsLocationsReplaysResultsService) List(parent string) *OrganizationsLocationsReplaysResultsListCall {
5270 c := &OrganizationsLocationsReplaysResultsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5271 c.parent = parent
5272 return c
5273 }
5274
5275 // PageSize sets the optional parameter "pageSize": The maximum number of
5276 // ReplayResult objects to return. Defaults to 5000. The maximum value is 5000;
5277 // values above 5000 are rounded down to 5000.
5278 func (c *OrganizationsLocationsReplaysResultsListCall) PageSize(pageSize int64) *OrganizationsLocationsReplaysResultsListCall {
5279 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5280 return c
5281 }
5282
5283 // PageToken sets the optional parameter "pageToken": A page token, received
5284 // from a previous Simulator.ListReplayResults call. Provide this token to
5285 // retrieve the next page of results. When paginating, all other parameters
5286 // provided to [Simulator.ListReplayResults[] must match the call that provided
5287 // the page token.
5288 func (c *OrganizationsLocationsReplaysResultsListCall) PageToken(pageToken string) *OrganizationsLocationsReplaysResultsListCall {
5289 c.urlParams_.Set("pageToken", pageToken)
5290 return c
5291 }
5292
5293 // Fields allows partial responses to be retrieved. See
5294 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5295 // details.
5296 func (c *OrganizationsLocationsReplaysResultsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysResultsListCall {
5297 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5298 return c
5299 }
5300
5301 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5302 // object's ETag matches the given value. This is useful for getting updates
5303 // only after the object has changed since the last request.
5304 func (c *OrganizationsLocationsReplaysResultsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysResultsListCall {
5305 c.ifNoneMatch_ = entityTag
5306 return c
5307 }
5308
5309 // Context sets the context to be used in this call's Do method.
5310 func (c *OrganizationsLocationsReplaysResultsListCall) Context(ctx context.Context) *OrganizationsLocationsReplaysResultsListCall {
5311 c.ctx_ = ctx
5312 return c
5313 }
5314
5315 // Header returns a http.Header that can be modified by the caller to add
5316 // headers to the request.
5317 func (c *OrganizationsLocationsReplaysResultsListCall) Header() http.Header {
5318 if c.header_ == nil {
5319 c.header_ = make(http.Header)
5320 }
5321 return c.header_
5322 }
5323
5324 func (c *OrganizationsLocationsReplaysResultsListCall) doRequest(alt string) (*http.Response, error) {
5325 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5326 if c.ifNoneMatch_ != "" {
5327 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5328 }
5329 c.urlParams_.Set("alt", alt)
5330 c.urlParams_.Set("prettyPrint", "false")
5331 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/results")
5332 urls += "?" + c.urlParams_.Encode()
5333 req, err := http.NewRequest("GET", urls, nil)
5334 if err != nil {
5335 return nil, err
5336 }
5337 req.Header = reqHeaders
5338 googleapi.Expand(req.URL, map[string]string{
5339 "parent": c.parent,
5340 })
5341 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.results.list", "request", internallog.HTTPRequest(req, nil))
5342 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5343 }
5344
5345 // Do executes the "policysimulator.organizations.locations.replays.results.list" call.
5346 // Any non-2xx status code is an error. Response headers are in either
5347 // *GoogleCloudPolicysimulatorV1betaListReplayResultsResponse.ServerResponse.Hea
5348 // der or (if a response was returned at all) in
5349 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
5350 // whether the returned error was because http.StatusNotModified was returned.
5351 func (c *OrganizationsLocationsReplaysResultsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaListReplayResultsResponse, error) {
5352 gensupport.SetOptions(c.urlParams_, opts...)
5353 res, err := c.doRequest("json")
5354 if res != nil && res.StatusCode == http.StatusNotModified {
5355 if res.Body != nil {
5356 res.Body.Close()
5357 }
5358 return nil, gensupport.WrapError(&googleapi.Error{
5359 Code: res.StatusCode,
5360 Header: res.Header,
5361 })
5362 }
5363 if err != nil {
5364 return nil, err
5365 }
5366 defer googleapi.CloseBody(res)
5367 if err := googleapi.CheckResponse(res); err != nil {
5368 return nil, gensupport.WrapError(err)
5369 }
5370 ret := &GoogleCloudPolicysimulatorV1betaListReplayResultsResponse{
5371 ServerResponse: googleapi.ServerResponse{
5372 Header: res.Header,
5373 HTTPStatusCode: res.StatusCode,
5374 },
5375 }
5376 target := &ret
5377 b, err := gensupport.DecodeResponseBytes(target, res)
5378 if err != nil {
5379 return nil, err
5380 }
5381 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.organizations.locations.replays.results.list", "response", internallog.HTTPResponse(res, b))
5382 return ret, nil
5383 }
5384
5385 // Pages invokes f for each page of results.
5386 // A non-nil error returned from f will halt the iteration.
5387 // The provided context supersedes any context provided to the Context method.
5388 func (c *OrganizationsLocationsReplaysResultsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1betaListReplayResultsResponse) error) error {
5389 c.ctx_ = ctx
5390 defer c.PageToken(c.urlParams_.Get("pageToken"))
5391 for {
5392 x, err := c.Do()
5393 if err != nil {
5394 return err
5395 }
5396 if err := f(x); err != nil {
5397 return err
5398 }
5399 if x.NextPageToken == "" {
5400 return nil
5401 }
5402 c.PageToken(x.NextPageToken)
5403 }
5404 }
5405
5406 type ProjectsLocationsAccessPolicySimulationsOperationsGetCall struct {
5407 s *Service
5408 name string
5409 urlParams_ gensupport.URLParams
5410 ifNoneMatch_ string
5411 ctx_ context.Context
5412 header_ http.Header
5413 }
5414
5415 // Get: Gets the latest state of a long-running operation. Clients can use this
5416 // method to poll the operation result at intervals as recommended by the API
5417 // service.
5418 //
5419 // - name: The name of the operation resource.
5420 func (r *ProjectsLocationsAccessPolicySimulationsOperationsService) Get(name string) *ProjectsLocationsAccessPolicySimulationsOperationsGetCall {
5421 c := &ProjectsLocationsAccessPolicySimulationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5422 c.name = name
5423 return c
5424 }
5425
5426 // Fields allows partial responses to be retrieved. See
5427 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5428 // details.
5429 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAccessPolicySimulationsOperationsGetCall {
5430 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5431 return c
5432 }
5433
5434 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5435 // object's ETag matches the given value. This is useful for getting updates
5436 // only after the object has changed since the last request.
5437 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAccessPolicySimulationsOperationsGetCall {
5438 c.ifNoneMatch_ = entityTag
5439 return c
5440 }
5441
5442 // Context sets the context to be used in this call's Do method.
5443 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsAccessPolicySimulationsOperationsGetCall {
5444 c.ctx_ = ctx
5445 return c
5446 }
5447
5448 // Header returns a http.Header that can be modified by the caller to add
5449 // headers to the request.
5450 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) Header() http.Header {
5451 if c.header_ == nil {
5452 c.header_ = make(http.Header)
5453 }
5454 return c.header_
5455 }
5456
5457 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
5458 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5459 if c.ifNoneMatch_ != "" {
5460 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5461 }
5462 c.urlParams_.Set("alt", alt)
5463 c.urlParams_.Set("prettyPrint", "false")
5464 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
5465 urls += "?" + c.urlParams_.Encode()
5466 req, err := http.NewRequest("GET", urls, nil)
5467 if err != nil {
5468 return nil, err
5469 }
5470 req.Header = reqHeaders
5471 googleapi.Expand(req.URL, map[string]string{
5472 "name": c.name,
5473 })
5474 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.accessPolicySimulations.operations.get", "request", internallog.HTTPRequest(req, nil))
5475 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5476 }
5477
5478 // Do executes the "policysimulator.projects.locations.accessPolicySimulations.operations.get" call.
5479 // Any non-2xx status code is an error. Response headers are in either
5480 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
5481 // returned at all) in error.(*googleapi.Error).Header. Use
5482 // googleapi.IsNotModified to check whether the returned error was because
5483 // http.StatusNotModified was returned.
5484 func (c *ProjectsLocationsAccessPolicySimulationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5485 gensupport.SetOptions(c.urlParams_, opts...)
5486 res, err := c.doRequest("json")
5487 if res != nil && res.StatusCode == http.StatusNotModified {
5488 if res.Body != nil {
5489 res.Body.Close()
5490 }
5491 return nil, gensupport.WrapError(&googleapi.Error{
5492 Code: res.StatusCode,
5493 Header: res.Header,
5494 })
5495 }
5496 if err != nil {
5497 return nil, err
5498 }
5499 defer googleapi.CloseBody(res)
5500 if err := googleapi.CheckResponse(res); err != nil {
5501 return nil, gensupport.WrapError(err)
5502 }
5503 ret := &GoogleLongrunningOperation{
5504 ServerResponse: googleapi.ServerResponse{
5505 Header: res.Header,
5506 HTTPStatusCode: res.StatusCode,
5507 },
5508 }
5509 target := &ret
5510 b, err := gensupport.DecodeResponseBytes(target, res)
5511 if err != nil {
5512 return nil, err
5513 }
5514 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.accessPolicySimulations.operations.get", "response", internallog.HTTPResponse(res, b))
5515 return ret, nil
5516 }
5517
5518 type ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
5519 s *Service
5520 name string
5521 urlParams_ gensupport.URLParams
5522 ifNoneMatch_ string
5523 ctx_ context.Context
5524 header_ http.Header
5525 }
5526
5527 // Get: Gets the latest state of a long-running operation. Clients can use this
5528 // method to poll the operation result at intervals as recommended by the API
5529 // service.
5530 //
5531 // - name: The name of the operation resource.
5532 func (r *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
5533 c := &ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5534 c.name = name
5535 return c
5536 }
5537
5538 // Fields allows partial responses to be retrieved. See
5539 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5540 // details.
5541 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
5542 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5543 return c
5544 }
5545
5546 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5547 // object's ETag matches the given value. This is useful for getting updates
5548 // only after the object has changed since the last request.
5549 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
5550 c.ifNoneMatch_ = entityTag
5551 return c
5552 }
5553
5554 // Context sets the context to be used in this call's Do method.
5555 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
5556 c.ctx_ = ctx
5557 return c
5558 }
5559
5560 // Header returns a http.Header that can be modified by the caller to add
5561 // headers to the request.
5562 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
5563 if c.header_ == nil {
5564 c.header_ = make(http.Header)
5565 }
5566 return c.header_
5567 }
5568
5569 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
5570 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5571 if c.ifNoneMatch_ != "" {
5572 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5573 }
5574 c.urlParams_.Set("alt", alt)
5575 c.urlParams_.Set("prettyPrint", "false")
5576 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
5577 urls += "?" + c.urlParams_.Encode()
5578 req, err := http.NewRequest("GET", urls, nil)
5579 if err != nil {
5580 return nil, err
5581 }
5582 req.Header = reqHeaders
5583 googleapi.Expand(req.URL, map[string]string{
5584 "name": c.name,
5585 })
5586 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get", "request", internallog.HTTPRequest(req, nil))
5587 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5588 }
5589
5590 // Do executes the "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get" call.
5591 // Any non-2xx status code is an error. Response headers are in either
5592 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
5593 // returned at all) in error.(*googleapi.Error).Header. Use
5594 // googleapi.IsNotModified to check whether the returned error was because
5595 // http.StatusNotModified was returned.
5596 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5597 gensupport.SetOptions(c.urlParams_, opts...)
5598 res, err := c.doRequest("json")
5599 if res != nil && res.StatusCode == http.StatusNotModified {
5600 if res.Body != nil {
5601 res.Body.Close()
5602 }
5603 return nil, gensupport.WrapError(&googleapi.Error{
5604 Code: res.StatusCode,
5605 Header: res.Header,
5606 })
5607 }
5608 if err != nil {
5609 return nil, err
5610 }
5611 defer googleapi.CloseBody(res)
5612 if err := googleapi.CheckResponse(res); err != nil {
5613 return nil, gensupport.WrapError(err)
5614 }
5615 ret := &GoogleLongrunningOperation{
5616 ServerResponse: googleapi.ServerResponse{
5617 Header: res.Header,
5618 HTTPStatusCode: res.StatusCode,
5619 },
5620 }
5621 target := &ret
5622 b, err := gensupport.DecodeResponseBytes(target, res)
5623 if err != nil {
5624 return nil, err
5625 }
5626 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get", "response", internallog.HTTPResponse(res, b))
5627 return ret, nil
5628 }
5629
5630 type ProjectsLocationsReplaysCreateCall struct {
5631 s *Service
5632 parent string
5633 googlecloudpolicysimulatorv1betareplay *GoogleCloudPolicysimulatorV1betaReplay
5634 urlParams_ gensupport.URLParams
5635 ctx_ context.Context
5636 header_ http.Header
5637 }
5638
5639 // Create: Creates and starts a Replay using the given ReplayConfig.
5640 //
5641 // - parent: The parent resource where this Replay will be created. This
5642 // resource must be a project, folder, or organization with a location.
5643 // Example: `projects/my-example-project/locations/global`.
5644 func (r *ProjectsLocationsReplaysService) Create(parent string, googlecloudpolicysimulatorv1betareplay *GoogleCloudPolicysimulatorV1betaReplay) *ProjectsLocationsReplaysCreateCall {
5645 c := &ProjectsLocationsReplaysCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5646 c.parent = parent
5647 c.googlecloudpolicysimulatorv1betareplay = googlecloudpolicysimulatorv1betareplay
5648 return c
5649 }
5650
5651 // Fields allows partial responses to be retrieved. See
5652 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5653 // details.
5654 func (c *ProjectsLocationsReplaysCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysCreateCall {
5655 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5656 return c
5657 }
5658
5659 // Context sets the context to be used in this call's Do method.
5660 func (c *ProjectsLocationsReplaysCreateCall) Context(ctx context.Context) *ProjectsLocationsReplaysCreateCall {
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 *ProjectsLocationsReplaysCreateCall) Header() http.Header {
5668 if c.header_ == nil {
5669 c.header_ = make(http.Header)
5670 }
5671 return c.header_
5672 }
5673
5674 func (c *ProjectsLocationsReplaysCreateCall) doRequest(alt string) (*http.Response, error) {
5675 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
5676 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.googlecloudpolicysimulatorv1betareplay)
5677 if err != nil {
5678 return nil, err
5679 }
5680 c.urlParams_.Set("alt", alt)
5681 c.urlParams_.Set("prettyPrint", "false")
5682 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays")
5683 urls += "?" + c.urlParams_.Encode()
5684 req, err := http.NewRequest("POST", urls, body)
5685 if err != nil {
5686 return nil, err
5687 }
5688 req.Header = reqHeaders
5689 googleapi.Expand(req.URL, map[string]string{
5690 "parent": c.parent,
5691 })
5692 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.create", "request", internallog.HTTPRequest(req, body.Bytes()))
5693 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5694 }
5695
5696 // Do executes the "policysimulator.projects.locations.replays.create" call.
5697 // Any non-2xx status code is an error. Response headers are in either
5698 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
5699 // returned at all) in error.(*googleapi.Error).Header. Use
5700 // googleapi.IsNotModified to check whether the returned error was because
5701 // http.StatusNotModified was returned.
5702 func (c *ProjectsLocationsReplaysCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
5703 gensupport.SetOptions(c.urlParams_, opts...)
5704 res, err := c.doRequest("json")
5705 if res != nil && res.StatusCode == http.StatusNotModified {
5706 if res.Body != nil {
5707 res.Body.Close()
5708 }
5709 return nil, gensupport.WrapError(&googleapi.Error{
5710 Code: res.StatusCode,
5711 Header: res.Header,
5712 })
5713 }
5714 if err != nil {
5715 return nil, err
5716 }
5717 defer googleapi.CloseBody(res)
5718 if err := googleapi.CheckResponse(res); err != nil {
5719 return nil, gensupport.WrapError(err)
5720 }
5721 ret := &GoogleLongrunningOperation{
5722 ServerResponse: googleapi.ServerResponse{
5723 Header: res.Header,
5724 HTTPStatusCode: res.StatusCode,
5725 },
5726 }
5727 target := &ret
5728 b, err := gensupport.DecodeResponseBytes(target, res)
5729 if err != nil {
5730 return nil, err
5731 }
5732 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.create", "response", internallog.HTTPResponse(res, b))
5733 return ret, nil
5734 }
5735
5736 type ProjectsLocationsReplaysGetCall struct {
5737 s *Service
5738 name string
5739 urlParams_ gensupport.URLParams
5740 ifNoneMatch_ string
5741 ctx_ context.Context
5742 header_ http.Header
5743 }
5744
5745 // Get: Gets the specified Replay. Each `Replay` is available for at least 7
5746 // days.
5747 //
5748 // - name: The name of the Replay to retrieve, in the following format:
5749 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
5750 // eplay-id}`, where `{resource-id}` is the ID of the project, folder, or
5751 // organization that owns the `Replay`. Example:
5752 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d7d-8e
5753 // 03-479ce1833c36`.
5754 func (r *ProjectsLocationsReplaysService) Get(name string) *ProjectsLocationsReplaysGetCall {
5755 c := &ProjectsLocationsReplaysGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5756 c.name = name
5757 return c
5758 }
5759
5760 // Fields allows partial responses to be retrieved. See
5761 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5762 // details.
5763 func (c *ProjectsLocationsReplaysGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysGetCall {
5764 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5765 return c
5766 }
5767
5768 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5769 // object's ETag matches the given value. This is useful for getting updates
5770 // only after the object has changed since the last request.
5771 func (c *ProjectsLocationsReplaysGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysGetCall {
5772 c.ifNoneMatch_ = entityTag
5773 return c
5774 }
5775
5776 // Context sets the context to be used in this call's Do method.
5777 func (c *ProjectsLocationsReplaysGetCall) Context(ctx context.Context) *ProjectsLocationsReplaysGetCall {
5778 c.ctx_ = ctx
5779 return c
5780 }
5781
5782 // Header returns a http.Header that can be modified by the caller to add
5783 // headers to the request.
5784 func (c *ProjectsLocationsReplaysGetCall) Header() http.Header {
5785 if c.header_ == nil {
5786 c.header_ = make(http.Header)
5787 }
5788 return c.header_
5789 }
5790
5791 func (c *ProjectsLocationsReplaysGetCall) doRequest(alt string) (*http.Response, error) {
5792 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5793 if c.ifNoneMatch_ != "" {
5794 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5795 }
5796 c.urlParams_.Set("alt", alt)
5797 c.urlParams_.Set("prettyPrint", "false")
5798 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
5799 urls += "?" + c.urlParams_.Encode()
5800 req, err := http.NewRequest("GET", urls, nil)
5801 if err != nil {
5802 return nil, err
5803 }
5804 req.Header = reqHeaders
5805 googleapi.Expand(req.URL, map[string]string{
5806 "name": c.name,
5807 })
5808 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.get", "request", internallog.HTTPRequest(req, nil))
5809 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5810 }
5811
5812 // Do executes the "policysimulator.projects.locations.replays.get" call.
5813 // Any non-2xx status code is an error. Response headers are in either
5814 // *GoogleCloudPolicysimulatorV1betaReplay.ServerResponse.Header or (if a
5815 // response was returned at all) in error.(*googleapi.Error).Header. Use
5816 // googleapi.IsNotModified to check whether the returned error was because
5817 // http.StatusNotModified was returned.
5818 func (c *ProjectsLocationsReplaysGetCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaReplay, error) {
5819 gensupport.SetOptions(c.urlParams_, opts...)
5820 res, err := c.doRequest("json")
5821 if res != nil && res.StatusCode == http.StatusNotModified {
5822 if res.Body != nil {
5823 res.Body.Close()
5824 }
5825 return nil, gensupport.WrapError(&googleapi.Error{
5826 Code: res.StatusCode,
5827 Header: res.Header,
5828 })
5829 }
5830 if err != nil {
5831 return nil, err
5832 }
5833 defer googleapi.CloseBody(res)
5834 if err := googleapi.CheckResponse(res); err != nil {
5835 return nil, gensupport.WrapError(err)
5836 }
5837 ret := &GoogleCloudPolicysimulatorV1betaReplay{
5838 ServerResponse: googleapi.ServerResponse{
5839 Header: res.Header,
5840 HTTPStatusCode: res.StatusCode,
5841 },
5842 }
5843 target := &ret
5844 b, err := gensupport.DecodeResponseBytes(target, res)
5845 if err != nil {
5846 return nil, err
5847 }
5848 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.get", "response", internallog.HTTPResponse(res, b))
5849 return ret, nil
5850 }
5851
5852 type ProjectsLocationsReplaysListCall struct {
5853 s *Service
5854 parent string
5855 urlParams_ gensupport.URLParams
5856 ifNoneMatch_ string
5857 ctx_ context.Context
5858 header_ http.Header
5859 }
5860
5861 // List: Lists each Replay in a project, folder, or organization. Each `Replay`
5862 // is available for at least 7 days.
5863 //
5864 // - parent: The parent resource, in the following format:
5865 // `{projects|folders|organizations}/{resource-id}/locations/global`, where
5866 // `{resource-id}` is the ID of the project, folder, or organization that
5867 // owns the Replay. Example: `projects/my-example-project/locations/global`
5868 // Only `Replay` objects that are direct children of the provided parent are
5869 // listed. In other words, `Replay` objects that are children of a project
5870 // will not be included when the parent is a folder of that project.
5871 func (r *ProjectsLocationsReplaysService) List(parent string) *ProjectsLocationsReplaysListCall {
5872 c := &ProjectsLocationsReplaysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5873 c.parent = parent
5874 return c
5875 }
5876
5877 // PageSize sets the optional parameter "pageSize": The maximum number of
5878 // Replay objects to return. Defaults to 50. The maximum value is 1000; values
5879 // above 1000 are rounded down to 1000.
5880 func (c *ProjectsLocationsReplaysListCall) PageSize(pageSize int64) *ProjectsLocationsReplaysListCall {
5881 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5882 return c
5883 }
5884
5885 // PageToken sets the optional parameter "pageToken": A page token, received
5886 // from a previous Simulator.ListReplays call. Provide this to retrieve the
5887 // subsequent page. When paginating, all other parameters provided to
5888 // Simulator.ListReplays must match the call that provided the page token.
5889 func (c *ProjectsLocationsReplaysListCall) PageToken(pageToken string) *ProjectsLocationsReplaysListCall {
5890 c.urlParams_.Set("pageToken", pageToken)
5891 return c
5892 }
5893
5894 // Fields allows partial responses to be retrieved. See
5895 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
5896 // details.
5897 func (c *ProjectsLocationsReplaysListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysListCall {
5898 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5899 return c
5900 }
5901
5902 // IfNoneMatch sets an optional parameter which makes the operation fail if the
5903 // object's ETag matches the given value. This is useful for getting updates
5904 // only after the object has changed since the last request.
5905 func (c *ProjectsLocationsReplaysListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysListCall {
5906 c.ifNoneMatch_ = entityTag
5907 return c
5908 }
5909
5910 // Context sets the context to be used in this call's Do method.
5911 func (c *ProjectsLocationsReplaysListCall) Context(ctx context.Context) *ProjectsLocationsReplaysListCall {
5912 c.ctx_ = ctx
5913 return c
5914 }
5915
5916 // Header returns a http.Header that can be modified by the caller to add
5917 // headers to the request.
5918 func (c *ProjectsLocationsReplaysListCall) Header() http.Header {
5919 if c.header_ == nil {
5920 c.header_ = make(http.Header)
5921 }
5922 return c.header_
5923 }
5924
5925 func (c *ProjectsLocationsReplaysListCall) doRequest(alt string) (*http.Response, error) {
5926 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
5927 if c.ifNoneMatch_ != "" {
5928 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5929 }
5930 c.urlParams_.Set("alt", alt)
5931 c.urlParams_.Set("prettyPrint", "false")
5932 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/replays")
5933 urls += "?" + c.urlParams_.Encode()
5934 req, err := http.NewRequest("GET", urls, nil)
5935 if err != nil {
5936 return nil, err
5937 }
5938 req.Header = reqHeaders
5939 googleapi.Expand(req.URL, map[string]string{
5940 "parent": c.parent,
5941 })
5942 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.list", "request", internallog.HTTPRequest(req, nil))
5943 return gensupport.SendRequest(c.ctx_, c.s.client, req)
5944 }
5945
5946 // Do executes the "policysimulator.projects.locations.replays.list" call.
5947 // Any non-2xx status code is an error. Response headers are in either
5948 // *GoogleCloudPolicysimulatorV1betaListReplaysResponse.ServerResponse.Header
5949 // or (if a response was returned at all) in error.(*googleapi.Error).Header.
5950 // Use googleapi.IsNotModified to check whether the returned error was because
5951 // http.StatusNotModified was returned.
5952 func (c *ProjectsLocationsReplaysListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaListReplaysResponse, error) {
5953 gensupport.SetOptions(c.urlParams_, opts...)
5954 res, err := c.doRequest("json")
5955 if res != nil && res.StatusCode == http.StatusNotModified {
5956 if res.Body != nil {
5957 res.Body.Close()
5958 }
5959 return nil, gensupport.WrapError(&googleapi.Error{
5960 Code: res.StatusCode,
5961 Header: res.Header,
5962 })
5963 }
5964 if err != nil {
5965 return nil, err
5966 }
5967 defer googleapi.CloseBody(res)
5968 if err := googleapi.CheckResponse(res); err != nil {
5969 return nil, gensupport.WrapError(err)
5970 }
5971 ret := &GoogleCloudPolicysimulatorV1betaListReplaysResponse{
5972 ServerResponse: googleapi.ServerResponse{
5973 Header: res.Header,
5974 HTTPStatusCode: res.StatusCode,
5975 },
5976 }
5977 target := &ret
5978 b, err := gensupport.DecodeResponseBytes(target, res)
5979 if err != nil {
5980 return nil, err
5981 }
5982 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.list", "response", internallog.HTTPResponse(res, b))
5983 return ret, nil
5984 }
5985
5986 // Pages invokes f for each page of results.
5987 // A non-nil error returned from f will halt the iteration.
5988 // The provided context supersedes any context provided to the Context method.
5989 func (c *ProjectsLocationsReplaysListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1betaListReplaysResponse) error) error {
5990 c.ctx_ = ctx
5991 defer c.PageToken(c.urlParams_.Get("pageToken"))
5992 for {
5993 x, err := c.Do()
5994 if err != nil {
5995 return err
5996 }
5997 if err := f(x); err != nil {
5998 return err
5999 }
6000 if x.NextPageToken == "" {
6001 return nil
6002 }
6003 c.PageToken(x.NextPageToken)
6004 }
6005 }
6006
6007 type ProjectsLocationsReplaysOperationsGetCall struct {
6008 s *Service
6009 name string
6010 urlParams_ gensupport.URLParams
6011 ifNoneMatch_ string
6012 ctx_ context.Context
6013 header_ http.Header
6014 }
6015
6016 // Get: Gets the latest state of a long-running operation. Clients can use this
6017 // method to poll the operation result at intervals as recommended by the API
6018 // service.
6019 //
6020 // - name: The name of the operation resource.
6021 func (r *ProjectsLocationsReplaysOperationsService) Get(name string) *ProjectsLocationsReplaysOperationsGetCall {
6022 c := &ProjectsLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6023 c.name = name
6024 return c
6025 }
6026
6027 // Fields allows partial responses to be retrieved. See
6028 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6029 // details.
6030 func (c *ProjectsLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysOperationsGetCall {
6031 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6032 return c
6033 }
6034
6035 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6036 // object's ETag matches the given value. This is useful for getting updates
6037 // only after the object has changed since the last request.
6038 func (c *ProjectsLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysOperationsGetCall {
6039 c.ifNoneMatch_ = entityTag
6040 return c
6041 }
6042
6043 // Context sets the context to be used in this call's Do method.
6044 func (c *ProjectsLocationsReplaysOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsReplaysOperationsGetCall {
6045 c.ctx_ = ctx
6046 return c
6047 }
6048
6049 // Header returns a http.Header that can be modified by the caller to add
6050 // headers to the request.
6051 func (c *ProjectsLocationsReplaysOperationsGetCall) Header() http.Header {
6052 if c.header_ == nil {
6053 c.header_ = make(http.Header)
6054 }
6055 return c.header_
6056 }
6057
6058 func (c *ProjectsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
6059 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6060 if c.ifNoneMatch_ != "" {
6061 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6062 }
6063 c.urlParams_.Set("alt", alt)
6064 c.urlParams_.Set("prettyPrint", "false")
6065 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
6066 urls += "?" + c.urlParams_.Encode()
6067 req, err := http.NewRequest("GET", urls, nil)
6068 if err != nil {
6069 return nil, err
6070 }
6071 req.Header = reqHeaders
6072 googleapi.Expand(req.URL, map[string]string{
6073 "name": c.name,
6074 })
6075 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.operations.get", "request", internallog.HTTPRequest(req, nil))
6076 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6077 }
6078
6079 // Do executes the "policysimulator.projects.locations.replays.operations.get" call.
6080 // Any non-2xx status code is an error. Response headers are in either
6081 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
6082 // returned at all) in error.(*googleapi.Error).Header. Use
6083 // googleapi.IsNotModified to check whether the returned error was because
6084 // http.StatusNotModified was returned.
6085 func (c *ProjectsLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
6086 gensupport.SetOptions(c.urlParams_, opts...)
6087 res, err := c.doRequest("json")
6088 if res != nil && res.StatusCode == http.StatusNotModified {
6089 if res.Body != nil {
6090 res.Body.Close()
6091 }
6092 return nil, gensupport.WrapError(&googleapi.Error{
6093 Code: res.StatusCode,
6094 Header: res.Header,
6095 })
6096 }
6097 if err != nil {
6098 return nil, err
6099 }
6100 defer googleapi.CloseBody(res)
6101 if err := googleapi.CheckResponse(res); err != nil {
6102 return nil, gensupport.WrapError(err)
6103 }
6104 ret := &GoogleLongrunningOperation{
6105 ServerResponse: googleapi.ServerResponse{
6106 Header: res.Header,
6107 HTTPStatusCode: res.StatusCode,
6108 },
6109 }
6110 target := &ret
6111 b, err := gensupport.DecodeResponseBytes(target, res)
6112 if err != nil {
6113 return nil, err
6114 }
6115 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.operations.get", "response", internallog.HTTPResponse(res, b))
6116 return ret, nil
6117 }
6118
6119 type ProjectsLocationsReplaysOperationsListCall struct {
6120 s *Service
6121 name string
6122 urlParams_ gensupport.URLParams
6123 ifNoneMatch_ string
6124 ctx_ context.Context
6125 header_ http.Header
6126 }
6127
6128 // List: Lists operations that match the specified filter in the request. If
6129 // the server doesn't support this method, it returns `UNIMPLEMENTED`.
6130 //
6131 // - name: The name of the operation's parent resource.
6132 func (r *ProjectsLocationsReplaysOperationsService) List(name string) *ProjectsLocationsReplaysOperationsListCall {
6133 c := &ProjectsLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6134 c.name = name
6135 return c
6136 }
6137
6138 // Filter sets the optional parameter "filter": The standard list filter.
6139 func (c *ProjectsLocationsReplaysOperationsListCall) Filter(filter string) *ProjectsLocationsReplaysOperationsListCall {
6140 c.urlParams_.Set("filter", filter)
6141 return c
6142 }
6143
6144 // PageSize sets the optional parameter "pageSize": The standard list page
6145 // size.
6146 func (c *ProjectsLocationsReplaysOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsReplaysOperationsListCall {
6147 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6148 return c
6149 }
6150
6151 // PageToken sets the optional parameter "pageToken": The standard list page
6152 // token.
6153 func (c *ProjectsLocationsReplaysOperationsListCall) PageToken(pageToken string) *ProjectsLocationsReplaysOperationsListCall {
6154 c.urlParams_.Set("pageToken", pageToken)
6155 return c
6156 }
6157
6158 // ReturnPartialSuccess sets the optional parameter "returnPartialSuccess":
6159 // When set to `true`, operations that are reachable are returned as normal,
6160 // and those that are unreachable are returned in the
6161 // ListOperationsResponse.unreachable field. This can only be `true` when
6162 // reading across collections. For example, when `parent` is set to
6163 // "projects/example/locations/-". This field is not supported by default and
6164 // will result in an `UNIMPLEMENTED` error if set unless explicitly documented
6165 // otherwise in service or product specific documentation.
6166 func (c *ProjectsLocationsReplaysOperationsListCall) ReturnPartialSuccess(returnPartialSuccess bool) *ProjectsLocationsReplaysOperationsListCall {
6167 c.urlParams_.Set("returnPartialSuccess", fmt.Sprint(returnPartialSuccess))
6168 return c
6169 }
6170
6171 // Fields allows partial responses to be retrieved. See
6172 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6173 // details.
6174 func (c *ProjectsLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysOperationsListCall {
6175 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6176 return c
6177 }
6178
6179 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6180 // object's ETag matches the given value. This is useful for getting updates
6181 // only after the object has changed since the last request.
6182 func (c *ProjectsLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysOperationsListCall {
6183 c.ifNoneMatch_ = entityTag
6184 return c
6185 }
6186
6187 // Context sets the context to be used in this call's Do method.
6188 func (c *ProjectsLocationsReplaysOperationsListCall) Context(ctx context.Context) *ProjectsLocationsReplaysOperationsListCall {
6189 c.ctx_ = ctx
6190 return c
6191 }
6192
6193 // Header returns a http.Header that can be modified by the caller to add
6194 // headers to the request.
6195 func (c *ProjectsLocationsReplaysOperationsListCall) Header() http.Header {
6196 if c.header_ == nil {
6197 c.header_ = make(http.Header)
6198 }
6199 return c.header_
6200 }
6201
6202 func (c *ProjectsLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
6203 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6204 if c.ifNoneMatch_ != "" {
6205 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6206 }
6207 c.urlParams_.Set("alt", alt)
6208 c.urlParams_.Set("prettyPrint", "false")
6209 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+name}")
6210 urls += "?" + c.urlParams_.Encode()
6211 req, err := http.NewRequest("GET", urls, nil)
6212 if err != nil {
6213 return nil, err
6214 }
6215 req.Header = reqHeaders
6216 googleapi.Expand(req.URL, map[string]string{
6217 "name": c.name,
6218 })
6219 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.operations.list", "request", internallog.HTTPRequest(req, nil))
6220 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6221 }
6222
6223 // Do executes the "policysimulator.projects.locations.replays.operations.list" call.
6224 // Any non-2xx status code is an error. Response headers are in either
6225 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if a
6226 // response was returned at all) in error.(*googleapi.Error).Header. Use
6227 // googleapi.IsNotModified to check whether the returned error was because
6228 // http.StatusNotModified was returned.
6229 func (c *ProjectsLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
6230 gensupport.SetOptions(c.urlParams_, opts...)
6231 res, err := c.doRequest("json")
6232 if res != nil && res.StatusCode == http.StatusNotModified {
6233 if res.Body != nil {
6234 res.Body.Close()
6235 }
6236 return nil, gensupport.WrapError(&googleapi.Error{
6237 Code: res.StatusCode,
6238 Header: res.Header,
6239 })
6240 }
6241 if err != nil {
6242 return nil, err
6243 }
6244 defer googleapi.CloseBody(res)
6245 if err := googleapi.CheckResponse(res); err != nil {
6246 return nil, gensupport.WrapError(err)
6247 }
6248 ret := &GoogleLongrunningListOperationsResponse{
6249 ServerResponse: googleapi.ServerResponse{
6250 Header: res.Header,
6251 HTTPStatusCode: res.StatusCode,
6252 },
6253 }
6254 target := &ret
6255 b, err := gensupport.DecodeResponseBytes(target, res)
6256 if err != nil {
6257 return nil, err
6258 }
6259 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.operations.list", "response", internallog.HTTPResponse(res, b))
6260 return ret, nil
6261 }
6262
6263 // Pages invokes f for each page of results.
6264 // A non-nil error returned from f will halt the iteration.
6265 // The provided context supersedes any context provided to the Context method.
6266 func (c *ProjectsLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
6267 c.ctx_ = ctx
6268 defer c.PageToken(c.urlParams_.Get("pageToken"))
6269 for {
6270 x, err := c.Do()
6271 if err != nil {
6272 return err
6273 }
6274 if err := f(x); err != nil {
6275 return err
6276 }
6277 if x.NextPageToken == "" {
6278 return nil
6279 }
6280 c.PageToken(x.NextPageToken)
6281 }
6282 }
6283
6284 type ProjectsLocationsReplaysResultsListCall struct {
6285 s *Service
6286 parent string
6287 urlParams_ gensupport.URLParams
6288 ifNoneMatch_ string
6289 ctx_ context.Context
6290 header_ http.Header
6291 }
6292
6293 // List: Lists the results of running a Replay.
6294 //
6295 // - parent: The Replay whose results are listed, in the following format:
6296 // `{projects|folders|organizations}/{resource-id}/locations/global/replays/{r
6297 // eplay-id}` Example:
6298 // `projects/my-project/locations/global/replays/506a5f7f-38ce-4d7d-8e03-479ce
6299 // 1833c36`.
6300 func (r *ProjectsLocationsReplaysResultsService) List(parent string) *ProjectsLocationsReplaysResultsListCall {
6301 c := &ProjectsLocationsReplaysResultsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6302 c.parent = parent
6303 return c
6304 }
6305
6306 // PageSize sets the optional parameter "pageSize": The maximum number of
6307 // ReplayResult objects to return. Defaults to 5000. The maximum value is 5000;
6308 // values above 5000 are rounded down to 5000.
6309 func (c *ProjectsLocationsReplaysResultsListCall) PageSize(pageSize int64) *ProjectsLocationsReplaysResultsListCall {
6310 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6311 return c
6312 }
6313
6314 // PageToken sets the optional parameter "pageToken": A page token, received
6315 // from a previous Simulator.ListReplayResults call. Provide this token to
6316 // retrieve the next page of results. When paginating, all other parameters
6317 // provided to [Simulator.ListReplayResults[] must match the call that provided
6318 // the page token.
6319 func (c *ProjectsLocationsReplaysResultsListCall) PageToken(pageToken string) *ProjectsLocationsReplaysResultsListCall {
6320 c.urlParams_.Set("pageToken", pageToken)
6321 return c
6322 }
6323
6324 // Fields allows partial responses to be retrieved. See
6325 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
6326 // details.
6327 func (c *ProjectsLocationsReplaysResultsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysResultsListCall {
6328 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6329 return c
6330 }
6331
6332 // IfNoneMatch sets an optional parameter which makes the operation fail if the
6333 // object's ETag matches the given value. This is useful for getting updates
6334 // only after the object has changed since the last request.
6335 func (c *ProjectsLocationsReplaysResultsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysResultsListCall {
6336 c.ifNoneMatch_ = entityTag
6337 return c
6338 }
6339
6340 // Context sets the context to be used in this call's Do method.
6341 func (c *ProjectsLocationsReplaysResultsListCall) Context(ctx context.Context) *ProjectsLocationsReplaysResultsListCall {
6342 c.ctx_ = ctx
6343 return c
6344 }
6345
6346 // Header returns a http.Header that can be modified by the caller to add
6347 // headers to the request.
6348 func (c *ProjectsLocationsReplaysResultsListCall) Header() http.Header {
6349 if c.header_ == nil {
6350 c.header_ = make(http.Header)
6351 }
6352 return c.header_
6353 }
6354
6355 func (c *ProjectsLocationsReplaysResultsListCall) doRequest(alt string) (*http.Response, error) {
6356 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
6357 if c.ifNoneMatch_ != "" {
6358 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6359 }
6360 c.urlParams_.Set("alt", alt)
6361 c.urlParams_.Set("prettyPrint", "false")
6362 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta/{+parent}/results")
6363 urls += "?" + c.urlParams_.Encode()
6364 req, err := http.NewRequest("GET", urls, nil)
6365 if err != nil {
6366 return nil, err
6367 }
6368 req.Header = reqHeaders
6369 googleapi.Expand(req.URL, map[string]string{
6370 "parent": c.parent,
6371 })
6372 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.results.list", "request", internallog.HTTPRequest(req, nil))
6373 return gensupport.SendRequest(c.ctx_, c.s.client, req)
6374 }
6375
6376 // Do executes the "policysimulator.projects.locations.replays.results.list" call.
6377 // Any non-2xx status code is an error. Response headers are in either
6378 // *GoogleCloudPolicysimulatorV1betaListReplayResultsResponse.ServerResponse.Hea
6379 // der or (if a response was returned at all) in
6380 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
6381 // whether the returned error was because http.StatusNotModified was returned.
6382 func (c *ProjectsLocationsReplaysResultsListCall) Do(opts ...googleapi.CallOption) (*GoogleCloudPolicysimulatorV1betaListReplayResultsResponse, error) {
6383 gensupport.SetOptions(c.urlParams_, opts...)
6384 res, err := c.doRequest("json")
6385 if res != nil && res.StatusCode == http.StatusNotModified {
6386 if res.Body != nil {
6387 res.Body.Close()
6388 }
6389 return nil, gensupport.WrapError(&googleapi.Error{
6390 Code: res.StatusCode,
6391 Header: res.Header,
6392 })
6393 }
6394 if err != nil {
6395 return nil, err
6396 }
6397 defer googleapi.CloseBody(res)
6398 if err := googleapi.CheckResponse(res); err != nil {
6399 return nil, gensupport.WrapError(err)
6400 }
6401 ret := &GoogleCloudPolicysimulatorV1betaListReplayResultsResponse{
6402 ServerResponse: googleapi.ServerResponse{
6403 Header: res.Header,
6404 HTTPStatusCode: res.StatusCode,
6405 },
6406 }
6407 target := &ret
6408 b, err := gensupport.DecodeResponseBytes(target, res)
6409 if err != nil {
6410 return nil, err
6411 }
6412 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "policysimulator.projects.locations.replays.results.list", "response", internallog.HTTPResponse(res, b))
6413 return ret, nil
6414 }
6415
6416 // Pages invokes f for each page of results.
6417 // A non-nil error returned from f will halt the iteration.
6418 // The provided context supersedes any context provided to the Context method.
6419 func (c *ProjectsLocationsReplaysResultsListCall) Pages(ctx context.Context, f func(*GoogleCloudPolicysimulatorV1betaListReplayResultsResponse) error) error {
6420 c.ctx_ = ctx
6421 defer c.PageToken(c.urlParams_.Get("pageToken"))
6422 for {
6423 x, err := c.Do()
6424 if err != nil {
6425 return err
6426 }
6427 if err := f(x); err != nil {
6428 return err
6429 }
6430 if x.NextPageToken == "" {
6431 return nil
6432 }
6433 c.PageToken(x.NextPageToken)
6434 }
6435 }