Debian Codegraph @

policysimulator/v1beta1/policysimulator-gen.go

raw
1 // Copyright 2023 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 // # Creating a client
12 //
13 // Usage example:
14 //
15 // import "google.golang.org/api/policysimulator/v1beta1"
16 // ...
17 // ctx := context.Background()
18 // policysimulatorService, err := policysimulator.NewService(ctx)
19 //
20 // In this example, Google Application Default Credentials are used for authentication.
21 //
22 // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23 //
24 // # Other authentication options
25 //
26 // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
27 //
28 // policysimulatorService, err := policysimulator.NewService(ctx, option.WithAPIKey("AIza..."))
29 //
30 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
31 //
32 // config := &oauth2.Config{...}
33 // // ...
34 // token, err := config.Exchange(ctx, ...)
35 // policysimulatorService, err := policysimulator.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
36 //
37 // See https://godoc.org/google.golang.org/api/option/ for details on options.
38 package policysimulator // import "google.golang.org/api/policysimulator/v1beta1"
39
40 import (
41 "bytes"
42 "context"
43 "encoding/json"
44 "errors"
45 "fmt"
46 "io"
47 "net/http"
48 "net/url"
49 "strconv"
50 "strings"
51
52 googleapi "google.golang.org/api/googleapi"
53 internal "google.golang.org/api/internal"
54 gensupport "google.golang.org/api/internal/gensupport"
55 option "google.golang.org/api/option"
56 internaloption "google.golang.org/api/option/internaloption"
57 htransport "google.golang.org/api/transport/http"
58 )
59
60 // Always reference these packages, just in case the auto-generated code
61 // below doesn't.
62 var _ = bytes.NewBuffer
63 var _ = strconv.Itoa
64 var _ = fmt.Sprintf
65 var _ = json.NewDecoder
66 var _ = io.Copy
67 var _ = url.Parse
68 var _ = gensupport.MarshalJSON
69 var _ = googleapi.Version
70 var _ = errors.New
71 var _ = strings.Replace
72 var _ = context.Canceled
73 var _ = internaloption.WithDefaultEndpoint
74
75 const apiId = "policysimulator:v1beta1"
76 const apiName = "policysimulator"
77 const apiVersion = "v1beta1"
78 const basePath = "https://policysimulator.googleapis.com/"
79 const mtlsBasePath = "https://policysimulator.mtls.googleapis.com/"
80
81 // OAuth2 scopes used by this API.
82 const (
83 // See, edit, configure, and delete your Google Cloud data and see the
84 // email address for your Google Account.
85 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
86 )
87
88 // NewService creates a new Service.
89 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
90 scopesOption := internaloption.WithDefaultScopes(
91 "https://www.googleapis.com/auth/cloud-platform",
92 )
93 // NOTE: prepend, so we don't override user-specified scopes.
94 opts = append([]option.ClientOption{scopesOption}, opts...)
95 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
96 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
97 client, endpoint, err := htransport.NewClient(ctx, opts...)
98 if err != nil {
99 return nil, err
100 }
101 s, err := New(client)
102 if err != nil {
103 return nil, err
104 }
105 if endpoint != "" {
106 s.BasePath = endpoint
107 }
108 return s, nil
109 }
110
111 // New creates a new Service. It uses the provided http.Client for requests.
112 //
113 // Deprecated: please use NewService instead.
114 // To provide a custom HTTP client, use option.WithHTTPClient.
115 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
116 func New(client *http.Client) (*Service, error) {
117 if client == nil {
118 return nil, errors.New("client is nil")
119 }
120 s := &Service{client: client, BasePath: basePath}
121 s.Folders = NewFoldersService(s)
122 s.Operations = NewOperationsService(s)
123 s.Organizations = NewOrganizationsService(s)
124 s.Projects = NewProjectsService(s)
125 return s, nil
126 }
127
128 type Service struct {
129 client *http.Client
130 BasePath string // API endpoint base URL
131 UserAgent string // optional additional User-Agent fragment
132
133 Folders *FoldersService
134
135 Operations *OperationsService
136
137 Organizations *OrganizationsService
138
139 Projects *ProjectsService
140 }
141
142 func (s *Service) userAgent() string {
143 if s.UserAgent == "" {
144 return googleapi.UserAgent
145 }
146 return googleapi.UserAgent + " " + s.UserAgent
147 }
148
149 func NewFoldersService(s *Service) *FoldersService {
150 rs := &FoldersService{s: s}
151 rs.Locations = NewFoldersLocationsService(s)
152 return rs
153 }
154
155 type FoldersService struct {
156 s *Service
157
158 Locations *FoldersLocationsService
159 }
160
161 func NewFoldersLocationsService(s *Service) *FoldersLocationsService {
162 rs := &FoldersLocationsService{s: s}
163 rs.OrgPolicyViolationsPreviews = NewFoldersLocationsOrgPolicyViolationsPreviewsService(s)
164 rs.Replays = NewFoldersLocationsReplaysService(s)
165 return rs
166 }
167
168 type FoldersLocationsService struct {
169 s *Service
170
171 OrgPolicyViolationsPreviews *FoldersLocationsOrgPolicyViolationsPreviewsService
172
173 Replays *FoldersLocationsReplaysService
174 }
175
176 func NewFoldersLocationsOrgPolicyViolationsPreviewsService(s *Service) *FoldersLocationsOrgPolicyViolationsPreviewsService {
177 rs := &FoldersLocationsOrgPolicyViolationsPreviewsService{s: s}
178 rs.Operations = NewFoldersLocationsOrgPolicyViolationsPreviewsOperationsService(s)
179 return rs
180 }
181
182 type FoldersLocationsOrgPolicyViolationsPreviewsService struct {
183 s *Service
184
185 Operations *FoldersLocationsOrgPolicyViolationsPreviewsOperationsService
186 }
187
188 func NewFoldersLocationsOrgPolicyViolationsPreviewsOperationsService(s *Service) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsService {
189 rs := &FoldersLocationsOrgPolicyViolationsPreviewsOperationsService{s: s}
190 return rs
191 }
192
193 type FoldersLocationsOrgPolicyViolationsPreviewsOperationsService struct {
194 s *Service
195 }
196
197 func NewFoldersLocationsReplaysService(s *Service) *FoldersLocationsReplaysService {
198 rs := &FoldersLocationsReplaysService{s: s}
199 rs.Operations = NewFoldersLocationsReplaysOperationsService(s)
200 return rs
201 }
202
203 type FoldersLocationsReplaysService struct {
204 s *Service
205
206 Operations *FoldersLocationsReplaysOperationsService
207 }
208
209 func NewFoldersLocationsReplaysOperationsService(s *Service) *FoldersLocationsReplaysOperationsService {
210 rs := &FoldersLocationsReplaysOperationsService{s: s}
211 return rs
212 }
213
214 type FoldersLocationsReplaysOperationsService struct {
215 s *Service
216 }
217
218 func NewOperationsService(s *Service) *OperationsService {
219 rs := &OperationsService{s: s}
220 return rs
221 }
222
223 type OperationsService struct {
224 s *Service
225 }
226
227 func NewOrganizationsService(s *Service) *OrganizationsService {
228 rs := &OrganizationsService{s: s}
229 rs.Locations = NewOrganizationsLocationsService(s)
230 return rs
231 }
232
233 type OrganizationsService struct {
234 s *Service
235
236 Locations *OrganizationsLocationsService
237 }
238
239 func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService {
240 rs := &OrganizationsLocationsService{s: s}
241 rs.OrgPolicyViolationsPreviews = NewOrganizationsLocationsOrgPolicyViolationsPreviewsService(s)
242 rs.Replays = NewOrganizationsLocationsReplaysService(s)
243 return rs
244 }
245
246 type OrganizationsLocationsService struct {
247 s *Service
248
249 OrgPolicyViolationsPreviews *OrganizationsLocationsOrgPolicyViolationsPreviewsService
250
251 Replays *OrganizationsLocationsReplaysService
252 }
253
254 func NewOrganizationsLocationsOrgPolicyViolationsPreviewsService(s *Service) *OrganizationsLocationsOrgPolicyViolationsPreviewsService {
255 rs := &OrganizationsLocationsOrgPolicyViolationsPreviewsService{s: s}
256 rs.Operations = NewOrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService(s)
257 return rs
258 }
259
260 type OrganizationsLocationsOrgPolicyViolationsPreviewsService struct {
261 s *Service
262
263 Operations *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService
264 }
265
266 func NewOrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService(s *Service) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService {
267 rs := &OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService{s: s}
268 return rs
269 }
270
271 type OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService struct {
272 s *Service
273 }
274
275 func NewOrganizationsLocationsReplaysService(s *Service) *OrganizationsLocationsReplaysService {
276 rs := &OrganizationsLocationsReplaysService{s: s}
277 rs.Operations = NewOrganizationsLocationsReplaysOperationsService(s)
278 return rs
279 }
280
281 type OrganizationsLocationsReplaysService struct {
282 s *Service
283
284 Operations *OrganizationsLocationsReplaysOperationsService
285 }
286
287 func NewOrganizationsLocationsReplaysOperationsService(s *Service) *OrganizationsLocationsReplaysOperationsService {
288 rs := &OrganizationsLocationsReplaysOperationsService{s: s}
289 return rs
290 }
291
292 type OrganizationsLocationsReplaysOperationsService struct {
293 s *Service
294 }
295
296 func NewProjectsService(s *Service) *ProjectsService {
297 rs := &ProjectsService{s: s}
298 rs.Locations = NewProjectsLocationsService(s)
299 return rs
300 }
301
302 type ProjectsService struct {
303 s *Service
304
305 Locations *ProjectsLocationsService
306 }
307
308 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
309 rs := &ProjectsLocationsService{s: s}
310 rs.OrgPolicyViolationsPreviews = NewProjectsLocationsOrgPolicyViolationsPreviewsService(s)
311 rs.Replays = NewProjectsLocationsReplaysService(s)
312 return rs
313 }
314
315 type ProjectsLocationsService struct {
316 s *Service
317
318 OrgPolicyViolationsPreviews *ProjectsLocationsOrgPolicyViolationsPreviewsService
319
320 Replays *ProjectsLocationsReplaysService
321 }
322
323 func NewProjectsLocationsOrgPolicyViolationsPreviewsService(s *Service) *ProjectsLocationsOrgPolicyViolationsPreviewsService {
324 rs := &ProjectsLocationsOrgPolicyViolationsPreviewsService{s: s}
325 rs.Operations = NewProjectsLocationsOrgPolicyViolationsPreviewsOperationsService(s)
326 return rs
327 }
328
329 type ProjectsLocationsOrgPolicyViolationsPreviewsService struct {
330 s *Service
331
332 Operations *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService
333 }
334
335 func NewProjectsLocationsOrgPolicyViolationsPreviewsOperationsService(s *Service) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService {
336 rs := &ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService{s: s}
337 return rs
338 }
339
340 type ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService struct {
341 s *Service
342 }
343
344 func NewProjectsLocationsReplaysService(s *Service) *ProjectsLocationsReplaysService {
345 rs := &ProjectsLocationsReplaysService{s: s}
346 rs.Operations = NewProjectsLocationsReplaysOperationsService(s)
347 return rs
348 }
349
350 type ProjectsLocationsReplaysService struct {
351 s *Service
352
353 Operations *ProjectsLocationsReplaysOperationsService
354 }
355
356 func NewProjectsLocationsReplaysOperationsService(s *Service) *ProjectsLocationsReplaysOperationsService {
357 rs := &ProjectsLocationsReplaysOperationsService{s: s}
358 return rs
359 }
360
361 type ProjectsLocationsReplaysOperationsService struct {
362 s *Service
363 }
364
365 // GoogleCloudPolicysimulatorV1Replay: A resource describing a `Replay`,
366 // or simulation.
367 type GoogleCloudPolicysimulatorV1Replay struct {
368 // Config: Required. The configuration used for the `Replay`.
369 Config *GoogleCloudPolicysimulatorV1ReplayConfig `json:"config,omitempty"`
370
371 // Name: Output only. The resource name of the `Replay`, which has the
372 // following format:
373 // `{projects|folders|organizations}/{resource-id}/locations/global/repla
374 // ys/{replay-id}`, where `{resource-id}` is the ID of the project,
375 // folder, or organization that owns the Replay. Example:
376 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d
377 // 7d-8e03-479ce1833c36`
378 Name string `json:"name,omitempty"`
379
380 // ResultsSummary: Output only. Summary statistics about the replayed
381 // log entries.
382 ResultsSummary *GoogleCloudPolicysimulatorV1ReplayResultsSummary `json:"resultsSummary,omitempty"`
383
384 // State: Output only. The current state of the `Replay`.
385 //
386 // Possible values:
387 // "STATE_UNSPECIFIED" - Default value. This value is unused.
388 // "PENDING" - The `Replay` has not started yet.
389 // "RUNNING" - The `Replay` is currently running.
390 // "SUCCEEDED" - The `Replay` has successfully completed.
391 // "FAILED" - The `Replay` has finished with an error.
392 State string `json:"state,omitempty"`
393
394 // ForceSendFields is a list of field names (e.g. "Config") to
395 // unconditionally include in API requests. By default, fields with
396 // empty or default values are omitted from API requests. However, any
397 // non-pointer, non-interface field appearing in ForceSendFields will be
398 // sent to the server regardless of whether the field is empty or not.
399 // This may be used to include empty fields in Patch requests.
400 ForceSendFields []string `json:"-"`
401
402 // NullFields is a list of field names (e.g. "Config") to include in API
403 // requests with the JSON null value. By default, fields with empty
404 // values are omitted from API requests. However, any field with an
405 // empty value appearing in NullFields will be sent to the server as
406 // null. It is an error if a field in this list has a non-empty value.
407 // This may be used to include null fields in Patch requests.
408 NullFields []string `json:"-"`
409 }
410
411 func (s *GoogleCloudPolicysimulatorV1Replay) MarshalJSON() ([]byte, error) {
412 type NoMethod GoogleCloudPolicysimulatorV1Replay
413 raw := NoMethod(*s)
414 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
415 }
416
417 // GoogleCloudPolicysimulatorV1ReplayConfig: The configuration used for
418 // a Replay.
419 type GoogleCloudPolicysimulatorV1ReplayConfig struct {
420 // LogSource: The logs to use as input for the Replay.
421 //
422 // Possible values:
423 // "LOG_SOURCE_UNSPECIFIED" - An unspecified log source. If the log
424 // source is unspecified, the Replay defaults to using
425 // `RECENT_ACCESSES`.
426 // "RECENT_ACCESSES" - All access logs from the last 90 days. These
427 // logs may not include logs from the most recent 7 days.
428 LogSource string `json:"logSource,omitempty"`
429
430 // PolicyOverlay: A mapping of the resources that you want to simulate
431 // policies for and the policies that you want to simulate. Keys are the
432 // full resource names for the resources. For example,
433 // `//cloudresourcemanager.googleapis.com/projects/my-project`. For
434 // examples of full resource names for Google Cloud services, see
435 // https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
436 // Values are Policy objects representing the policies that you want to
437 // simulate. Replays automatically take into account any IAM policies
438 // inherited through the resource hierarchy, and any policies set on
439 // descendant resources. You do not need to include these policies in
440 // the policy overlay.
441 PolicyOverlay map[string]GoogleIamV1Policy `json:"policyOverlay,omitempty"`
442
443 // ForceSendFields is a list of field names (e.g. "LogSource") to
444 // unconditionally include in API requests. By default, fields with
445 // empty or default values are omitted from API requests. However, any
446 // non-pointer, non-interface field appearing in ForceSendFields will be
447 // sent to the server regardless of whether the field is empty or not.
448 // This may be used to include empty fields in Patch requests.
449 ForceSendFields []string `json:"-"`
450
451 // NullFields is a list of field names (e.g. "LogSource") to include in
452 // API requests with the JSON null value. By default, fields with empty
453 // values are omitted from API requests. However, any field with an
454 // empty value appearing in NullFields will be sent to the server as
455 // null. It is an error if a field in this list has a non-empty value.
456 // This may be used to include null fields in Patch requests.
457 NullFields []string `json:"-"`
458 }
459
460 func (s *GoogleCloudPolicysimulatorV1ReplayConfig) MarshalJSON() ([]byte, error) {
461 type NoMethod GoogleCloudPolicysimulatorV1ReplayConfig
462 raw := NoMethod(*s)
463 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
464 }
465
466 // GoogleCloudPolicysimulatorV1ReplayOperationMetadata: Metadata about a
467 // Replay operation.
468 type GoogleCloudPolicysimulatorV1ReplayOperationMetadata struct {
469 // StartTime: Time when the request was received.
470 StartTime string `json:"startTime,omitempty"`
471
472 // ForceSendFields is a list of field names (e.g. "StartTime") to
473 // unconditionally include in API requests. By default, fields with
474 // empty or default values are omitted from API requests. However, any
475 // non-pointer, non-interface field appearing in ForceSendFields will be
476 // sent to the server regardless of whether the field is empty or not.
477 // This may be used to include empty fields in Patch requests.
478 ForceSendFields []string `json:"-"`
479
480 // NullFields is a list of field names (e.g. "StartTime") to include in
481 // API requests with the JSON null value. By default, fields with empty
482 // values are omitted from API requests. However, any field with an
483 // empty value appearing in NullFields will be sent to the server as
484 // null. It is an error if a field in this list has a non-empty value.
485 // This may be used to include null fields in Patch requests.
486 NullFields []string `json:"-"`
487 }
488
489 func (s *GoogleCloudPolicysimulatorV1ReplayOperationMetadata) MarshalJSON() ([]byte, error) {
490 type NoMethod GoogleCloudPolicysimulatorV1ReplayOperationMetadata
491 raw := NoMethod(*s)
492 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
493 }
494
495 // GoogleCloudPolicysimulatorV1ReplayResultsSummary: Summary statistics
496 // about the replayed log entries.
497 type GoogleCloudPolicysimulatorV1ReplayResultsSummary struct {
498 // DifferenceCount: The number of replayed log entries with a difference
499 // between baseline and simulated policies.
500 DifferenceCount int64 `json:"differenceCount,omitempty"`
501
502 // ErrorCount: The number of log entries that could not be replayed.
503 ErrorCount int64 `json:"errorCount,omitempty"`
504
505 // LogCount: The total number of log entries replayed.
506 LogCount int64 `json:"logCount,omitempty"`
507
508 // NewestDate: The date of the newest log entry replayed.
509 NewestDate *GoogleTypeDate `json:"newestDate,omitempty"`
510
511 // OldestDate: The date of the oldest log entry replayed.
512 OldestDate *GoogleTypeDate `json:"oldestDate,omitempty"`
513
514 // UnchangedCount: The number of replayed log entries with no difference
515 // between baseline and simulated policies.
516 UnchangedCount int64 `json:"unchangedCount,omitempty"`
517
518 // ForceSendFields is a list of field names (e.g. "DifferenceCount") to
519 // unconditionally include in API requests. By default, fields with
520 // empty or default values are omitted from API requests. However, any
521 // non-pointer, non-interface field appearing in ForceSendFields will be
522 // sent to the server regardless of whether the field is empty or not.
523 // This may be used to include empty fields in Patch requests.
524 ForceSendFields []string `json:"-"`
525
526 // NullFields is a list of field names (e.g. "DifferenceCount") to
527 // include in API requests with the JSON null value. By default, fields
528 // with empty values are omitted from API requests. However, any field
529 // with an empty value appearing in NullFields will be sent to the
530 // server as null. It is an error if a field in this list has a
531 // non-empty value. This may be used to include null fields in Patch
532 // requests.
533 NullFields []string `json:"-"`
534 }
535
536 func (s *GoogleCloudPolicysimulatorV1ReplayResultsSummary) MarshalJSON() ([]byte, error) {
537 type NoMethod GoogleCloudPolicysimulatorV1ReplayResultsSummary
538 raw := NoMethod(*s)
539 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
540 }
541
542 // GoogleCloudPolicysimulatorV1beta1Replay: A resource describing a
543 // `Replay`, or simulation.
544 type GoogleCloudPolicysimulatorV1beta1Replay struct {
545 // Config: Required. The configuration used for the `Replay`.
546 Config *GoogleCloudPolicysimulatorV1beta1ReplayConfig `json:"config,omitempty"`
547
548 // Name: Output only. The resource name of the `Replay`, which has the
549 // following format:
550 // `{projects|folders|organizations}/{resource-id}/locations/global/repla
551 // ys/{replay-id}`, where `{resource-id}` is the ID of the project,
552 // folder, or organization that owns the Replay. Example:
553 // `projects/my-example-project/locations/global/replays/506a5f7f-38ce-4d
554 // 7d-8e03-479ce1833c36`
555 Name string `json:"name,omitempty"`
556
557 // ResultsSummary: Output only. Summary statistics about the replayed
558 // log entries.
559 ResultsSummary *GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary `json:"resultsSummary,omitempty"`
560
561 // State: Output only. The current state of the `Replay`.
562 //
563 // Possible values:
564 // "STATE_UNSPECIFIED" - The state is unspecified.
565 // "PENDING" - The `Replay` has not started yet.
566 // "RUNNING" - The `Replay` is currently running.
567 // "SUCCEEDED" - The `Replay` has successfully completed.
568 // "FAILED" - The `Replay` has finished with an error.
569 State string `json:"state,omitempty"`
570
571 // ForceSendFields is a list of field names (e.g. "Config") to
572 // unconditionally include in API requests. By default, fields with
573 // empty or default values are omitted from API requests. However, any
574 // non-pointer, non-interface field appearing in ForceSendFields will be
575 // sent to the server regardless of whether the field is empty or not.
576 // This may be used to include empty fields in Patch requests.
577 ForceSendFields []string `json:"-"`
578
579 // NullFields is a list of field names (e.g. "Config") to include in API
580 // requests with the JSON null value. By default, fields with empty
581 // values are omitted from API requests. However, any field with an
582 // empty value appearing in NullFields will be sent to the server as
583 // null. It is an error if a field in this list has a non-empty value.
584 // This may be used to include null fields in Patch requests.
585 NullFields []string `json:"-"`
586 }
587
588 func (s *GoogleCloudPolicysimulatorV1beta1Replay) MarshalJSON() ([]byte, error) {
589 type NoMethod GoogleCloudPolicysimulatorV1beta1Replay
590 raw := NoMethod(*s)
591 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
592 }
593
594 // GoogleCloudPolicysimulatorV1beta1ReplayConfig: The configuration used
595 // for a Replay.
596 type GoogleCloudPolicysimulatorV1beta1ReplayConfig struct {
597 // LogSource: The logs to use as input for the Replay.
598 //
599 // Possible values:
600 // "LOG_SOURCE_UNSPECIFIED" - An unspecified log source. If the log
601 // source is unspecified, the Replay defaults to using
602 // `RECENT_ACCESSES`.
603 // "RECENT_ACCESSES" - All access logs from the last 90 days. These
604 // logs may not include logs from the most recent 7 days.
605 LogSource string `json:"logSource,omitempty"`
606
607 // PolicyOverlay: A mapping of the resources that you want to simulate
608 // policies for and the policies that you want to simulate. Keys are the
609 // full resource names for the resources. For example,
610 // `//cloudresourcemanager.googleapis.com/projects/my-project`. For
611 // examples of full resource names for Google Cloud services, see
612 // https://cloud.google.com/iam/help/troubleshooter/full-resource-names.
613 // Values are Policy objects representing the policies that you want to
614 // simulate. Replays automatically take into account any IAM policies
615 // inherited through the resource hierarchy, and any policies set on
616 // descendant resources. You do not need to include these policies in
617 // the policy overlay.
618 PolicyOverlay map[string]GoogleIamV1Policy `json:"policyOverlay,omitempty"`
619
620 // ForceSendFields is a list of field names (e.g. "LogSource") to
621 // unconditionally include in API requests. By default, fields with
622 // empty or default values are omitted from API requests. However, any
623 // non-pointer, non-interface field appearing in ForceSendFields will be
624 // sent to the server regardless of whether the field is empty or not.
625 // This may be used to include empty fields in Patch requests.
626 ForceSendFields []string `json:"-"`
627
628 // NullFields is a list of field names (e.g. "LogSource") to include in
629 // API requests with the JSON null value. By default, fields with empty
630 // values are omitted from API requests. However, any field with an
631 // empty value appearing in NullFields will be sent to the server as
632 // null. It is an error if a field in this list has a non-empty value.
633 // This may be used to include null fields in Patch requests.
634 NullFields []string `json:"-"`
635 }
636
637 func (s *GoogleCloudPolicysimulatorV1beta1ReplayConfig) MarshalJSON() ([]byte, error) {
638 type NoMethod GoogleCloudPolicysimulatorV1beta1ReplayConfig
639 raw := NoMethod(*s)
640 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
641 }
642
643 // GoogleCloudPolicysimulatorV1beta1ReplayOperationMetadata: Metadata
644 // about a Replay operation.
645 type GoogleCloudPolicysimulatorV1beta1ReplayOperationMetadata struct {
646 // StartTime: Time when the request was received.
647 StartTime string `json:"startTime,omitempty"`
648
649 // ForceSendFields is a list of field names (e.g. "StartTime") to
650 // unconditionally include in API requests. By default, fields with
651 // empty or default values are omitted from API requests. However, any
652 // non-pointer, non-interface field appearing in ForceSendFields will be
653 // sent to the server regardless of whether the field is empty or not.
654 // This may be used to include empty fields in Patch requests.
655 ForceSendFields []string `json:"-"`
656
657 // NullFields is a list of field names (e.g. "StartTime") to include in
658 // API requests with the JSON null value. By default, fields with empty
659 // values are omitted from API requests. However, any field with an
660 // empty value appearing in NullFields will be sent to the server as
661 // null. It is an error if a field in this list has a non-empty value.
662 // This may be used to include null fields in Patch requests.
663 NullFields []string `json:"-"`
664 }
665
666 func (s *GoogleCloudPolicysimulatorV1beta1ReplayOperationMetadata) MarshalJSON() ([]byte, error) {
667 type NoMethod GoogleCloudPolicysimulatorV1beta1ReplayOperationMetadata
668 raw := NoMethod(*s)
669 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
670 }
671
672 // GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary: Summary
673 // statistics about the replayed log entries.
674 type GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary struct {
675 // DifferenceCount: The number of replayed log entries with a difference
676 // between baseline and simulated policies.
677 DifferenceCount int64 `json:"differenceCount,omitempty"`
678
679 // ErrorCount: The number of log entries that could not be replayed.
680 ErrorCount int64 `json:"errorCount,omitempty"`
681
682 // LogCount: The total number of log entries replayed.
683 LogCount int64 `json:"logCount,omitempty"`
684
685 // NewestDate: The date of the newest log entry replayed.
686 NewestDate *GoogleTypeDate `json:"newestDate,omitempty"`
687
688 // OldestDate: The date of the oldest log entry replayed.
689 OldestDate *GoogleTypeDate `json:"oldestDate,omitempty"`
690
691 // UnchangedCount: The number of replayed log entries with no difference
692 // between baseline and simulated policies.
693 UnchangedCount int64 `json:"unchangedCount,omitempty"`
694
695 // ForceSendFields is a list of field names (e.g. "DifferenceCount") to
696 // unconditionally include in API requests. By default, fields with
697 // empty or default values are omitted from API requests. However, any
698 // non-pointer, non-interface field appearing in ForceSendFields will be
699 // sent to the server regardless of whether the field is empty or not.
700 // This may be used to include empty fields in Patch requests.
701 ForceSendFields []string `json:"-"`
702
703 // NullFields is a list of field names (e.g. "DifferenceCount") to
704 // include in API requests with the JSON null value. By default, fields
705 // with empty values are omitted from API requests. However, any field
706 // with an empty value appearing in NullFields will be sent to the
707 // server as null. It is an error if a field in this list has a
708 // non-empty value. This may be used to include null fields in Patch
709 // requests.
710 NullFields []string `json:"-"`
711 }
712
713 func (s *GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary) MarshalJSON() ([]byte, error) {
714 type NoMethod GoogleCloudPolicysimulatorV1beta1ReplayResultsSummary
715 raw := NoMethod(*s)
716 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
717 }
718
719 // GoogleIamV1AuditConfig: Specifies the audit configuration for a
720 // service. The configuration determines which permission types are
721 // logged, and what identities, if any, are exempted from logging. An
722 // AuditConfig must have one or more AuditLogConfigs. If there are
723 // AuditConfigs for both `allServices` and a specific service, the union
724 // of the two AuditConfigs is used for that service: the log_types
725 // specified in each AuditConfig are enabled, and the exempted_members
726 // in each AuditLogConfig are exempted. Example Policy with multiple
727 // AuditConfigs: { "audit_configs": [ { "service": "allServices",
728 // "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members":
729 // [ "user:[email protected]" ] }, { "log_type": "DATA_WRITE" }, {
730 // "log_type": "ADMIN_READ" } ] }, { "service":
731 // "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type":
732 // "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [
733 // "user:[email protected]" ] } ] } ] } For sampleservice, this policy
734 // enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts
735 // `[email protected]` from DATA_READ logging, and `[email protected]`
736 // from DATA_WRITE logging.
737 type GoogleIamV1AuditConfig struct {
738 // AuditLogConfigs: The configuration for logging of each type of
739 // permission.
740 AuditLogConfigs []*GoogleIamV1AuditLogConfig `json:"auditLogConfigs,omitempty"`
741
742 // Service: Specifies a service that will be enabled for audit logging.
743 // For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
744 // `allServices` is a special value that covers all services.
745 Service string `json:"service,omitempty"`
746
747 // ForceSendFields is a list of field names (e.g. "AuditLogConfigs") to
748 // unconditionally include in API requests. By default, fields with
749 // empty or default values are omitted from API requests. However, any
750 // non-pointer, non-interface field appearing in ForceSendFields will be
751 // sent to the server regardless of whether the field is empty or not.
752 // This may be used to include empty fields in Patch requests.
753 ForceSendFields []string `json:"-"`
754
755 // NullFields is a list of field names (e.g. "AuditLogConfigs") to
756 // include in API requests with the JSON null value. By default, fields
757 // with empty values are omitted from API requests. However, any field
758 // with an empty value appearing in NullFields will be sent to the
759 // server as null. It is an error if a field in this list has a
760 // non-empty value. This may be used to include null fields in Patch
761 // requests.
762 NullFields []string `json:"-"`
763 }
764
765 func (s *GoogleIamV1AuditConfig) MarshalJSON() ([]byte, error) {
766 type NoMethod GoogleIamV1AuditConfig
767 raw := NoMethod(*s)
768 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
769 }
770
771 // GoogleIamV1AuditLogConfig: Provides the configuration for logging a
772 // type of permissions. Example: { "audit_log_configs": [ { "log_type":
773 // "DATA_READ", "exempted_members": [ "user:[email protected]" ] }, {
774 // "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and
775 // 'DATA_WRITE' logging, while exempting [email protected] from DATA_READ
776 // logging.
777 type GoogleIamV1AuditLogConfig struct {
778 // ExemptedMembers: Specifies the identities that do not cause logging
779 // for this type of permission. Follows the same format of
780 // Binding.members.
781 ExemptedMembers []string `json:"exemptedMembers,omitempty"`
782
783 // LogType: The log type that this config enables.
784 //
785 // Possible values:
786 // "LOG_TYPE_UNSPECIFIED" - Default case. Should never be this.
787 // "ADMIN_READ" - Admin reads. Example: CloudIAM getIamPolicy
788 // "DATA_WRITE" - Data writes. Example: CloudSQL Users create
789 // "DATA_READ" - Data reads. Example: CloudSQL Users list
790 LogType string `json:"logType,omitempty"`
791
792 // ForceSendFields is a list of field names (e.g. "ExemptedMembers") to
793 // unconditionally include in API requests. By default, fields with
794 // empty or default values are omitted from API requests. However, any
795 // non-pointer, non-interface field appearing in ForceSendFields will be
796 // sent to the server regardless of whether the field is empty or not.
797 // This may be used to include empty fields in Patch requests.
798 ForceSendFields []string `json:"-"`
799
800 // NullFields is a list of field names (e.g. "ExemptedMembers") to
801 // include in API requests with the JSON null value. By default, fields
802 // with empty values are omitted from API requests. However, any field
803 // with an empty value appearing in NullFields will be sent to the
804 // server as null. It is an error if a field in this list has a
805 // non-empty value. This may be used to include null fields in Patch
806 // requests.
807 NullFields []string `json:"-"`
808 }
809
810 func (s *GoogleIamV1AuditLogConfig) MarshalJSON() ([]byte, error) {
811 type NoMethod GoogleIamV1AuditLogConfig
812 raw := NoMethod(*s)
813 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
814 }
815
816 // GoogleIamV1Binding: Associates `members`, or principals, with a
817 // `role`.
818 type GoogleIamV1Binding struct {
819 // Condition: The condition that is associated with this binding. If the
820 // condition evaluates to `true`, then this binding applies to the
821 // current request. If the condition evaluates to `false`, then this
822 // binding does not apply to the current request. However, a different
823 // role binding might grant the same role to one or more of the
824 // principals in this binding. To learn which resources support
825 // conditions in their IAM policies, see the IAM documentation
826 // (https://cloud.google.com/iam/help/conditions/resource-policies).
827 Condition *GoogleTypeExpr `json:"condition,omitempty"`
828
829 // Members: Specifies the principals requesting access for a Google
830 // Cloud resource. `members` can have the following values: *
831 // `allUsers`: A special identifier that represents anyone who is on the
832 // internet; with or without a Google account. *
833 // `allAuthenticatedUsers`: A special identifier that represents anyone
834 // who is authenticated with a Google account or a service account. Does
835 // not include identities that come from external identity providers
836 // (IdPs) through identity federation. * `user:{emailid}`: An email
837 // address that represents a specific Google account. For example,
838 // `[email protected]` . * `serviceAccount:{emailid}`: An email address
839 // that represents a Google service account. For example,
840 // `[email protected]`. *
841 // `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`:
842 // An identifier for a Kubernetes service account
843 // (https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts).
844 // For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`.
845 // * `group:{emailid}`: An email address that represents a Google group.
846 // For example, `[email protected]`. * `domain:{domain}`: The G Suite
847 // domain (primary) that represents all the users of that domain. For
848 // example, `google.com` or `example.com`. *
849 // `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus
850 // unique identifier) representing a user that has been recently
851 // deleted. For example, `[email protected]?uid=123456789012345678901`.
852 // If the user is recovered, this value reverts to `user:{emailid}` and
853 // the recovered user retains the role in the binding. *
854 // `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address
855 // (plus unique identifier) representing a service account that has been
856 // recently deleted. For example,
857 // `[email protected]?uid=123456789012345678901`.
858 // If the service account is undeleted, this value reverts to
859 // `serviceAccount:{emailid}` and the undeleted service account retains
860 // the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`:
861 // An email address (plus unique identifier) representing a Google group
862 // that has been recently deleted. For example,
863 // `[email protected]?uid=123456789012345678901`. If the group is
864 // recovered, this value reverts to `group:{emailid}` and the recovered
865 // group retains the role in the binding.
866 Members []string `json:"members,omitempty"`
867
868 // Role: Role that is assigned to the list of `members`, or principals.
869 // For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
870 Role string `json:"role,omitempty"`
871
872 // ForceSendFields is a list of field names (e.g. "Condition") to
873 // unconditionally include in API requests. By default, fields with
874 // empty or default values are omitted from API requests. However, any
875 // non-pointer, non-interface field appearing in ForceSendFields will be
876 // sent to the server regardless of whether the field is empty or not.
877 // This may be used to include empty fields in Patch requests.
878 ForceSendFields []string `json:"-"`
879
880 // NullFields is a list of field names (e.g. "Condition") to include in
881 // API requests with the JSON null value. By default, fields with empty
882 // values are omitted from API requests. However, any field with an
883 // empty value appearing in NullFields will be sent to the server as
884 // null. It is an error if a field in this list has a non-empty value.
885 // This may be used to include null fields in Patch requests.
886 NullFields []string `json:"-"`
887 }
888
889 func (s *GoogleIamV1Binding) MarshalJSON() ([]byte, error) {
890 type NoMethod GoogleIamV1Binding
891 raw := NoMethod(*s)
892 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
893 }
894
895 // GoogleIamV1Policy: An Identity and Access Management (IAM) policy,
896 // which specifies access controls for Google Cloud resources. A
897 // `Policy` is a collection of `bindings`. A `binding` binds one or more
898 // `members`, or principals, to a single `role`. Principals can be user
899 // accounts, service accounts, Google groups, and domains (such as G
900 // Suite). A `role` is a named list of permissions; each `role` can be
901 // an IAM predefined role or a user-created custom role. For some types
902 // of Google Cloud resources, a `binding` can also specify a
903 // `condition`, which is a logical expression that allows access to a
904 // resource only if the expression evaluates to `true`. A condition can
905 // add constraints based on attributes of the request, the resource, or
906 // both. To learn which resources support conditions in their IAM
907 // policies, see the IAM documentation
908 // (https://cloud.google.com/iam/help/conditions/resource-policies).
909 // **JSON example:** { "bindings": [ { "role":
910 // "roles/resourcemanager.organizationAdmin", "members": [
911 // "user:[email protected]", "group:[email protected]",
912 // "domain:google.com",
913 // "serviceAccount:[email protected]" ] }, {
914 // "role": "roles/resourcemanager.organizationViewer", "members": [
915 // "user:[email protected]" ], "condition": { "title": "expirable access",
916 // "description": "Does not grant access after Sep 2020", "expression":
917 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ],
918 // "etag": "BwWWja0YfJA=", "version": 3 } **YAML example:** bindings: -
919 // members: - user:[email protected] - group:[email protected] -
920 // domain:google.com -
921 // serviceAccount:[email protected] role:
922 // roles/resourcemanager.organizationAdmin - members: -
923 // user:[email protected] role: roles/resourcemanager.organizationViewer
924 // condition: title: expirable access description: Does not grant access
925 // after Sep 2020 expression: request.time <
926 // timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3
927 // For a description of IAM and its features, see the IAM documentation
928 // (https://cloud.google.com/iam/docs/).
929 type GoogleIamV1Policy struct {
930 // AuditConfigs: Specifies cloud audit logging configuration for this
931 // policy.
932 AuditConfigs []*GoogleIamV1AuditConfig `json:"auditConfigs,omitempty"`
933
934 // Bindings: Associates a list of `members`, or principals, with a
935 // `role`. Optionally, may specify a `condition` that determines how and
936 // when the `bindings` are applied. Each of the `bindings` must contain
937 // at least one principal. The `bindings` in a `Policy` can refer to up
938 // to 1,500 principals; up to 250 of these principals can be Google
939 // groups. Each occurrence of a principal counts towards these limits.
940 // For example, if the `bindings` grant 50 different roles to
941 // `user:[email protected]`, and not to any other principal, then you
942 // can add another 1,450 principals to the `bindings` in the `Policy`.
943 Bindings []*GoogleIamV1Binding `json:"bindings,omitempty"`
944
945 // Etag: `etag` is used for optimistic concurrency control as a way to
946 // help prevent simultaneous updates of a policy from overwriting each
947 // other. It is strongly suggested that systems make use of the `etag`
948 // in the read-modify-write cycle to perform policy updates in order to
949 // avoid race conditions: An `etag` is returned in the response to
950 // `getIamPolicy`, and systems are expected to put that etag in the
951 // request to `setIamPolicy` to ensure that their change will be applied
952 // to the same version of the policy. **Important:** If you use IAM
953 // Conditions, you must include the `etag` field whenever you call
954 // `setIamPolicy`. If you omit this field, then IAM allows you to
955 // overwrite a version `3` policy with a version `1` policy, and all of
956 // the conditions in the version `3` policy are lost.
957 Etag string `json:"etag,omitempty"`
958
959 // Version: Specifies the format of the policy. Valid values are `0`,
960 // `1`, and `3`. Requests that specify an invalid value are rejected.
961 // Any operation that affects conditional role bindings must specify
962 // version `3`. This requirement applies to the following operations: *
963 // Getting a policy that includes a conditional role binding * Adding a
964 // conditional role binding to a policy * Changing a conditional role
965 // binding in a policy * Removing any role binding, with or without a
966 // condition, from a policy that includes conditions **Important:** If
967 // you use IAM Conditions, you must include the `etag` field whenever
968 // you call `setIamPolicy`. If you omit this field, then IAM allows you
969 // to overwrite a version `3` policy with a version `1` policy, and all
970 // of the conditions in the version `3` policy are lost. If a policy
971 // does not include any conditions, operations on that policy may
972 // specify any valid version or leave the field unset. To learn which
973 // resources support conditions in their IAM policies, see the IAM
974 // documentation
975 // (https://cloud.google.com/iam/help/conditions/resource-policies).
976 Version int64 `json:"version,omitempty"`
977
978 // ForceSendFields is a list of field names (e.g. "AuditConfigs") to
979 // unconditionally include in API requests. By default, fields with
980 // empty or default values are omitted from API requests. However, any
981 // non-pointer, non-interface field appearing in ForceSendFields will be
982 // sent to the server regardless of whether the field is empty or not.
983 // This may be used to include empty fields in Patch requests.
984 ForceSendFields []string `json:"-"`
985
986 // NullFields is a list of field names (e.g. "AuditConfigs") to include
987 // in API requests with the JSON null value. By default, fields with
988 // empty values are omitted from API requests. However, any field with
989 // an empty value appearing in NullFields will be sent to the server as
990 // null. It is an error if a field in this list has a non-empty value.
991 // This may be used to include null fields in Patch requests.
992 NullFields []string `json:"-"`
993 }
994
995 func (s *GoogleIamV1Policy) MarshalJSON() ([]byte, error) {
996 type NoMethod GoogleIamV1Policy
997 raw := NoMethod(*s)
998 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
999 }
1000
1001 // GoogleLongrunningListOperationsResponse: The response message for
1002 // Operations.ListOperations.
1003 type GoogleLongrunningListOperationsResponse struct {
1004 // NextPageToken: The standard List next-page token.
1005 NextPageToken string `json:"nextPageToken,omitempty"`
1006
1007 // Operations: A list of operations that matches the specified filter in
1008 // the request.
1009 Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
1010
1011 // ServerResponse contains the HTTP response code and headers from the
1012 // server.
1013 googleapi.ServerResponse `json:"-"`
1014
1015 // ForceSendFields is a list of field names (e.g. "NextPageToken") to
1016 // unconditionally include in API requests. By default, fields with
1017 // empty or default values are omitted from API requests. However, any
1018 // non-pointer, non-interface field appearing in ForceSendFields will be
1019 // sent to the server regardless of whether the field is empty or not.
1020 // This may be used to include empty fields in Patch requests.
1021 ForceSendFields []string `json:"-"`
1022
1023 // NullFields is a list of field names (e.g. "NextPageToken") to include
1024 // in API requests with the JSON null value. By default, fields with
1025 // empty values are omitted from API requests. However, any field with
1026 // an empty value appearing in NullFields will be sent to the server as
1027 // null. It is an error if a field in this list has a non-empty value.
1028 // This may be used to include null fields in Patch requests.
1029 NullFields []string `json:"-"`
1030 }
1031
1032 func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
1033 type NoMethod GoogleLongrunningListOperationsResponse
1034 raw := NoMethod(*s)
1035 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1036 }
1037
1038 // GoogleLongrunningOperation: This resource represents a long-running
1039 // operation that is the result of a network API call.
1040 type GoogleLongrunningOperation struct {
1041 // Done: If the value is `false`, it means the operation is still in
1042 // progress. If `true`, the operation is completed, and either `error`
1043 // or `response` is available.
1044 Done bool `json:"done,omitempty"`
1045
1046 // Error: The error result of the operation in case of failure or
1047 // cancellation.
1048 Error *GoogleRpcStatus `json:"error,omitempty"`
1049
1050 // Metadata: Service-specific metadata associated with the operation. It
1051 // typically contains progress information and common metadata such as
1052 // create time. Some services might not provide such metadata. Any
1053 // method that returns a long-running operation should document the
1054 // metadata type, if any.
1055 Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1056
1057 // Name: The server-assigned name, which is only unique within the same
1058 // service that originally returns it. If you use the default HTTP
1059 // mapping, the `name` should be a resource name ending with
1060 // `operations/{unique_id}`.
1061 Name string `json:"name,omitempty"`
1062
1063 // Response: The normal response of the operation in case of success. If
1064 // the original method returns no data on success, such as `Delete`, the
1065 // response is `google.protobuf.Empty`. If the original method is
1066 // standard `Get`/`Create`/`Update`, the response should be the
1067 // resource. For other methods, the response should have the type
1068 // `XxxResponse`, where `Xxx` is the original method name. For example,
1069 // if the original method name is `TakeSnapshot()`, the inferred
1070 // response type is `TakeSnapshotResponse`.
1071 Response googleapi.RawMessage `json:"response,omitempty"`
1072
1073 // ServerResponse contains the HTTP response code and headers from the
1074 // server.
1075 googleapi.ServerResponse `json:"-"`
1076
1077 // ForceSendFields is a list of field names (e.g. "Done") to
1078 // unconditionally include in API requests. By default, fields with
1079 // empty or default values are omitted from API requests. However, any
1080 // non-pointer, non-interface field appearing in ForceSendFields will be
1081 // sent to the server regardless of whether the field is empty or not.
1082 // This may be used to include empty fields in Patch requests.
1083 ForceSendFields []string `json:"-"`
1084
1085 // NullFields is a list of field names (e.g. "Done") to include in API
1086 // requests with the JSON null value. By default, fields with empty
1087 // values are omitted from API requests. However, any field with an
1088 // empty value appearing in NullFields will be sent to the server as
1089 // null. It is an error if a field in this list has a non-empty value.
1090 // This may be used to include null fields in Patch requests.
1091 NullFields []string `json:"-"`
1092 }
1093
1094 func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
1095 type NoMethod GoogleLongrunningOperation
1096 raw := NoMethod(*s)
1097 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1098 }
1099
1100 // GoogleRpcStatus: The `Status` type defines a logical error model that
1101 // is suitable for different programming environments, including REST
1102 // APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each
1103 // `Status` message contains three pieces of data: error code, error
1104 // message, and error details. You can find out more about this error
1105 // model and how to work with it in the API Design Guide
1106 // (https://cloud.google.com/apis/design/errors).
1107 type GoogleRpcStatus struct {
1108 // Code: The status code, which should be an enum value of
1109 // google.rpc.Code.
1110 Code int64 `json:"code,omitempty"`
1111
1112 // Details: A list of messages that carry the error details. There is a
1113 // common set of message types for APIs to use.
1114 Details []googleapi.RawMessage `json:"details,omitempty"`
1115
1116 // Message: A developer-facing error message, which should be in
1117 // English. Any user-facing error message should be localized and sent
1118 // in the google.rpc.Status.details field, or localized by the client.
1119 Message string `json:"message,omitempty"`
1120
1121 // ForceSendFields is a list of field names (e.g. "Code") to
1122 // unconditionally include in API requests. By default, fields with
1123 // empty or default values are omitted from API requests. However, any
1124 // non-pointer, non-interface field appearing in ForceSendFields will be
1125 // sent to the server regardless of whether the field is empty or not.
1126 // This may be used to include empty fields in Patch requests.
1127 ForceSendFields []string `json:"-"`
1128
1129 // NullFields is a list of field names (e.g. "Code") to include in API
1130 // requests with the JSON null value. By default, fields with empty
1131 // values are omitted from API requests. However, any field with an
1132 // empty value appearing in NullFields will be sent to the server as
1133 // null. It is an error if a field in this list has a non-empty value.
1134 // This may be used to include null fields in Patch requests.
1135 NullFields []string `json:"-"`
1136 }
1137
1138 func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
1139 type NoMethod GoogleRpcStatus
1140 raw := NoMethod(*s)
1141 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1142 }
1143
1144 // GoogleTypeDate: Represents a whole or partial calendar date, such as
1145 // a birthday. The time of day and time zone are either specified
1146 // elsewhere or are insignificant. The date is relative to the Gregorian
1147 // Calendar. This can represent one of the following: * A full date,
1148 // with non-zero year, month, and day values. * A month and day, with a
1149 // zero year (for example, an anniversary). * A year on its own, with a
1150 // zero month and a zero day. * A year and month, with a zero day (for
1151 // example, a credit card expiration date). Related types: *
1152 // google.type.TimeOfDay * google.type.DateTime *
1153 // google.protobuf.Timestamp
1154 type GoogleTypeDate struct {
1155 // Day: Day of a month. Must be from 1 to 31 and valid for the year and
1156 // month, or 0 to specify a year by itself or a year and month where the
1157 // day isn't significant.
1158 Day int64 `json:"day,omitempty"`
1159
1160 // Month: Month of a year. Must be from 1 to 12, or 0 to specify a year
1161 // without a month and day.
1162 Month int64 `json:"month,omitempty"`
1163
1164 // Year: Year of the date. Must be from 1 to 9999, or 0 to specify a
1165 // date without a year.
1166 Year int64 `json:"year,omitempty"`
1167
1168 // ForceSendFields is a list of field names (e.g. "Day") to
1169 // unconditionally include in API requests. By default, fields with
1170 // empty or default values are omitted from API requests. However, any
1171 // non-pointer, non-interface field appearing in ForceSendFields will be
1172 // sent to the server regardless of whether the field is empty or not.
1173 // This may be used to include empty fields in Patch requests.
1174 ForceSendFields []string `json:"-"`
1175
1176 // NullFields is a list of field names (e.g. "Day") to include in API
1177 // requests with the JSON null value. By default, fields with empty
1178 // values are omitted from API requests. However, any field with an
1179 // empty value appearing in NullFields will be sent to the server as
1180 // null. It is an error if a field in this list has a non-empty value.
1181 // This may be used to include null fields in Patch requests.
1182 NullFields []string `json:"-"`
1183 }
1184
1185 func (s *GoogleTypeDate) MarshalJSON() ([]byte, error) {
1186 type NoMethod GoogleTypeDate
1187 raw := NoMethod(*s)
1188 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1189 }
1190
1191 // GoogleTypeExpr: Represents a textual expression in the Common
1192 // Expression Language (CEL) syntax. CEL is a C-like expression
1193 // language. The syntax and semantics of CEL are documented at
1194 // https://github.com/google/cel-spec. Example (Comparison): title:
1195 // "Summary size limit" description: "Determines if a summary is less
1196 // than 100 chars" expression: "document.summary.size() < 100" Example
1197 // (Equality): title: "Requestor is owner" description: "Determines if
1198 // requestor is the document owner" expression: "document.owner ==
1199 // request.auth.claims.email" Example (Logic): title: "Public documents"
1200 // description: "Determine whether the document should be publicly
1201 // visible" expression: "document.type != 'private' && document.type !=
1202 // 'internal'" Example (Data Manipulation): title: "Notification string"
1203 // description: "Create a notification string with a timestamp."
1204 // expression: "'New message received at ' +
1205 // string(document.create_time)" The exact variables and functions that
1206 // may be referenced within an expression are determined by the service
1207 // that evaluates it. See the service documentation for additional
1208 // information.
1209 type GoogleTypeExpr struct {
1210 // Description: Optional. Description of the expression. This is a
1211 // longer text which describes the expression, e.g. when hovered over it
1212 // in a UI.
1213 Description string `json:"description,omitempty"`
1214
1215 // Expression: Textual representation of an expression in Common
1216 // Expression Language syntax.
1217 Expression string `json:"expression,omitempty"`
1218
1219 // Location: Optional. String indicating the location of the expression
1220 // for error reporting, e.g. a file name and a position in the file.
1221 Location string `json:"location,omitempty"`
1222
1223 // Title: Optional. Title for the expression, i.e. a short string
1224 // describing its purpose. This can be used e.g. in UIs which allow to
1225 // enter the expression.
1226 Title string `json:"title,omitempty"`
1227
1228 // ForceSendFields is a list of field names (e.g. "Description") to
1229 // unconditionally include in API requests. By default, fields with
1230 // empty or default values are omitted from API requests. However, any
1231 // non-pointer, non-interface field appearing in ForceSendFields will be
1232 // sent to the server regardless of whether the field is empty or not.
1233 // This may be used to include empty fields in Patch requests.
1234 ForceSendFields []string `json:"-"`
1235
1236 // NullFields is a list of field names (e.g. "Description") to include
1237 // in API requests with the JSON null value. By default, fields with
1238 // empty values are omitted from API requests. However, any field with
1239 // an empty value appearing in NullFields will be sent to the server as
1240 // null. It is an error if a field in this list has a non-empty value.
1241 // This may be used to include null fields in Patch requests.
1242 NullFields []string `json:"-"`
1243 }
1244
1245 func (s *GoogleTypeExpr) MarshalJSON() ([]byte, error) {
1246 type NoMethod GoogleTypeExpr
1247 raw := NoMethod(*s)
1248 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1249 }
1250
1251 // method id "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get":
1252
1253 type FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
1254 s *Service
1255 name string
1256 urlParams_ gensupport.URLParams
1257 ifNoneMatch_ string
1258 ctx_ context.Context
1259 header_ http.Header
1260 }
1261
1262 // Get: Gets the latest state of a long-running operation. Clients can
1263 // use this method to poll the operation result at intervals as
1264 // recommended by the API service.
1265 //
1266 // - name: The name of the operation resource.
1267 func (r *FoldersLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
1268 c := &FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1269 c.name = name
1270 return c
1271 }
1272
1273 // Fields allows partial responses to be retrieved. See
1274 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1275 // for more information.
1276 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
1277 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1278 return c
1279 }
1280
1281 // IfNoneMatch sets the optional parameter which makes the operation
1282 // fail if the object's ETag matches the given value. This is useful for
1283 // getting updates only after the object has changed since the last
1284 // request. Use googleapi.IsNotModified to check whether the response
1285 // error from Do is the result of In-None-Match.
1286 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
1287 c.ifNoneMatch_ = entityTag
1288 return c
1289 }
1290
1291 // Context sets the context to be used in this call's Do method. Any
1292 // pending HTTP request will be aborted if the provided context is
1293 // canceled.
1294 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
1295 c.ctx_ = ctx
1296 return c
1297 }
1298
1299 // Header returns an http.Header that can be modified by the caller to
1300 // add HTTP headers to the request.
1301 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
1302 if c.header_ == nil {
1303 c.header_ = make(http.Header)
1304 }
1305 return c.header_
1306 }
1307
1308 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
1309 reqHeaders := make(http.Header)
1310 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
1311 for k, v := range c.header_ {
1312 reqHeaders[k] = v
1313 }
1314 reqHeaders.Set("User-Agent", c.s.userAgent())
1315 if c.ifNoneMatch_ != "" {
1316 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1317 }
1318 var body io.Reader = nil
1319 c.urlParams_.Set("alt", alt)
1320 c.urlParams_.Set("prettyPrint", "false")
1321 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1322 urls += "?" + c.urlParams_.Encode()
1323 req, err := http.NewRequest("GET", urls, body)
1324 if err != nil {
1325 return nil, err
1326 }
1327 req.Header = reqHeaders
1328 googleapi.Expand(req.URL, map[string]string{
1329 "name": c.name,
1330 })
1331 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1332 }
1333
1334 // Do executes the "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get" call.
1335 // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
1336 // Any non-2xx status code is an error. Response headers are in either
1337 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
1338 // was returned at all) in error.(*googleapi.Error).Header. Use
1339 // googleapi.IsNotModified to check whether the returned error was
1340 // because http.StatusNotModified was returned.
1341 func (c *FoldersLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
1342 gensupport.SetOptions(c.urlParams_, opts...)
1343 res, err := c.doRequest("json")
1344 if res != nil && res.StatusCode == http.StatusNotModified {
1345 if res.Body != nil {
1346 res.Body.Close()
1347 }
1348 return nil, gensupport.WrapError(&googleapi.Error{
1349 Code: res.StatusCode,
1350 Header: res.Header,
1351 })
1352 }
1353 if err != nil {
1354 return nil, err
1355 }
1356 defer googleapi.CloseBody(res)
1357 if err := googleapi.CheckResponse(res); err != nil {
1358 return nil, gensupport.WrapError(err)
1359 }
1360 ret := &GoogleLongrunningOperation{
1361 ServerResponse: googleapi.ServerResponse{
1362 Header: res.Header,
1363 HTTPStatusCode: res.StatusCode,
1364 },
1365 }
1366 target := &ret
1367 if err := gensupport.DecodeResponse(target, res); err != nil {
1368 return nil, err
1369 }
1370 return ret, nil
1371 // {
1372 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
1373 // "flatPath": "v1beta1/folders/{foldersId}/locations/{locationsId}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreviewsId}/operations/{operationsId}",
1374 // "httpMethod": "GET",
1375 // "id": "policysimulator.folders.locations.orgPolicyViolationsPreviews.operations.get",
1376 // "parameterOrder": [
1377 // "name"
1378 // ],
1379 // "parameters": {
1380 // "name": {
1381 // "description": "The name of the operation resource.",
1382 // "location": "path",
1383 // "pattern": "^folders/[^/]+/locations/[^/]+/orgPolicyViolationsPreviews/[^/]+/operations/.*$",
1384 // "required": true,
1385 // "type": "string"
1386 // }
1387 // },
1388 // "path": "v1beta1/{+name}",
1389 // "response": {
1390 // "$ref": "GoogleLongrunningOperation"
1391 // },
1392 // "scopes": [
1393 // "https://www.googleapis.com/auth/cloud-platform"
1394 // ]
1395 // }
1396
1397 }
1398
1399 // method id "policysimulator.folders.locations.replays.operations.get":
1400
1401 type FoldersLocationsReplaysOperationsGetCall struct {
1402 s *Service
1403 name string
1404 urlParams_ gensupport.URLParams
1405 ifNoneMatch_ string
1406 ctx_ context.Context
1407 header_ http.Header
1408 }
1409
1410 // Get: Gets the latest state of a long-running operation. Clients can
1411 // use this method to poll the operation result at intervals as
1412 // recommended by the API service.
1413 //
1414 // - name: The name of the operation resource.
1415 func (r *FoldersLocationsReplaysOperationsService) Get(name string) *FoldersLocationsReplaysOperationsGetCall {
1416 c := &FoldersLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1417 c.name = name
1418 return c
1419 }
1420
1421 // Fields allows partial responses to be retrieved. See
1422 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1423 // for more information.
1424 func (c *FoldersLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysOperationsGetCall {
1425 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1426 return c
1427 }
1428
1429 // IfNoneMatch sets the optional parameter which makes the operation
1430 // fail if the object's ETag matches the given value. This is useful for
1431 // getting updates only after the object has changed since the last
1432 // request. Use googleapi.IsNotModified to check whether the response
1433 // error from Do is the result of In-None-Match.
1434 func (c *FoldersLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysOperationsGetCall {
1435 c.ifNoneMatch_ = entityTag
1436 return c
1437 }
1438
1439 // Context sets the context to be used in this call's Do method. Any
1440 // pending HTTP request will be aborted if the provided context is
1441 // canceled.
1442 func (c *FoldersLocationsReplaysOperationsGetCall) Context(ctx context.Context) *FoldersLocationsReplaysOperationsGetCall {
1443 c.ctx_ = ctx
1444 return c
1445 }
1446
1447 // Header returns an http.Header that can be modified by the caller to
1448 // add HTTP headers to the request.
1449 func (c *FoldersLocationsReplaysOperationsGetCall) Header() http.Header {
1450 if c.header_ == nil {
1451 c.header_ = make(http.Header)
1452 }
1453 return c.header_
1454 }
1455
1456 func (c *FoldersLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
1457 reqHeaders := make(http.Header)
1458 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
1459 for k, v := range c.header_ {
1460 reqHeaders[k] = v
1461 }
1462 reqHeaders.Set("User-Agent", c.s.userAgent())
1463 if c.ifNoneMatch_ != "" {
1464 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1465 }
1466 var body io.Reader = nil
1467 c.urlParams_.Set("alt", alt)
1468 c.urlParams_.Set("prettyPrint", "false")
1469 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1470 urls += "?" + c.urlParams_.Encode()
1471 req, err := http.NewRequest("GET", urls, body)
1472 if err != nil {
1473 return nil, err
1474 }
1475 req.Header = reqHeaders
1476 googleapi.Expand(req.URL, map[string]string{
1477 "name": c.name,
1478 })
1479 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1480 }
1481
1482 // Do executes the "policysimulator.folders.locations.replays.operations.get" call.
1483 // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
1484 // Any non-2xx status code is an error. Response headers are in either
1485 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
1486 // was returned at all) in error.(*googleapi.Error).Header. Use
1487 // googleapi.IsNotModified to check whether the returned error was
1488 // because http.StatusNotModified was returned.
1489 func (c *FoldersLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
1490 gensupport.SetOptions(c.urlParams_, opts...)
1491 res, err := c.doRequest("json")
1492 if res != nil && res.StatusCode == http.StatusNotModified {
1493 if res.Body != nil {
1494 res.Body.Close()
1495 }
1496 return nil, gensupport.WrapError(&googleapi.Error{
1497 Code: res.StatusCode,
1498 Header: res.Header,
1499 })
1500 }
1501 if err != nil {
1502 return nil, err
1503 }
1504 defer googleapi.CloseBody(res)
1505 if err := googleapi.CheckResponse(res); err != nil {
1506 return nil, gensupport.WrapError(err)
1507 }
1508 ret := &GoogleLongrunningOperation{
1509 ServerResponse: googleapi.ServerResponse{
1510 Header: res.Header,
1511 HTTPStatusCode: res.StatusCode,
1512 },
1513 }
1514 target := &ret
1515 if err := gensupport.DecodeResponse(target, res); err != nil {
1516 return nil, err
1517 }
1518 return ret, nil
1519 // {
1520 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
1521 // "flatPath": "v1beta1/folders/{foldersId}/locations/{locationsId}/replays/{replaysId}/operations/{operationsId}",
1522 // "httpMethod": "GET",
1523 // "id": "policysimulator.folders.locations.replays.operations.get",
1524 // "parameterOrder": [
1525 // "name"
1526 // ],
1527 // "parameters": {
1528 // "name": {
1529 // "description": "The name of the operation resource.",
1530 // "location": "path",
1531 // "pattern": "^folders/[^/]+/locations/[^/]+/replays/[^/]+/operations/.*$",
1532 // "required": true,
1533 // "type": "string"
1534 // }
1535 // },
1536 // "path": "v1beta1/{+name}",
1537 // "response": {
1538 // "$ref": "GoogleLongrunningOperation"
1539 // },
1540 // "scopes": [
1541 // "https://www.googleapis.com/auth/cloud-platform"
1542 // ]
1543 // }
1544
1545 }
1546
1547 // method id "policysimulator.folders.locations.replays.operations.list":
1548
1549 type FoldersLocationsReplaysOperationsListCall struct {
1550 s *Service
1551 name string
1552 urlParams_ gensupport.URLParams
1553 ifNoneMatch_ string
1554 ctx_ context.Context
1555 header_ http.Header
1556 }
1557
1558 // List: Lists operations that match the specified filter in the
1559 // request. If the server doesn't support this method, it returns
1560 // `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to
1561 // override the binding to use different resource name schemes, such as
1562 // `users/*/operations`. To override the binding, API services can add a
1563 // binding such as "/v1/{name=users/*}/operations" to their service
1564 // configuration. For backwards compatibility, the default name includes
1565 // the operations collection id, however overriding users must ensure
1566 // the name binding is the parent resource, without the operations
1567 // collection id.
1568 //
1569 // - name: The name of the operation's parent resource.
1570 func (r *FoldersLocationsReplaysOperationsService) List(name string) *FoldersLocationsReplaysOperationsListCall {
1571 c := &FoldersLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1572 c.name = name
1573 return c
1574 }
1575
1576 // Filter sets the optional parameter "filter": The standard list
1577 // filter.
1578 func (c *FoldersLocationsReplaysOperationsListCall) Filter(filter string) *FoldersLocationsReplaysOperationsListCall {
1579 c.urlParams_.Set("filter", filter)
1580 return c
1581 }
1582
1583 // PageSize sets the optional parameter "pageSize": The standard list
1584 // page size.
1585 func (c *FoldersLocationsReplaysOperationsListCall) PageSize(pageSize int64) *FoldersLocationsReplaysOperationsListCall {
1586 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1587 return c
1588 }
1589
1590 // PageToken sets the optional parameter "pageToken": The standard list
1591 // page token.
1592 func (c *FoldersLocationsReplaysOperationsListCall) PageToken(pageToken string) *FoldersLocationsReplaysOperationsListCall {
1593 c.urlParams_.Set("pageToken", pageToken)
1594 return c
1595 }
1596
1597 // Fields allows partial responses to be retrieved. See
1598 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1599 // for more information.
1600 func (c *FoldersLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsReplaysOperationsListCall {
1601 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1602 return c
1603 }
1604
1605 // IfNoneMatch sets the optional parameter which makes the operation
1606 // fail if the object's ETag matches the given value. This is useful for
1607 // getting updates only after the object has changed since the last
1608 // request. Use googleapi.IsNotModified to check whether the response
1609 // error from Do is the result of In-None-Match.
1610 func (c *FoldersLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsReplaysOperationsListCall {
1611 c.ifNoneMatch_ = entityTag
1612 return c
1613 }
1614
1615 // Context sets the context to be used in this call's Do method. Any
1616 // pending HTTP request will be aborted if the provided context is
1617 // canceled.
1618 func (c *FoldersLocationsReplaysOperationsListCall) Context(ctx context.Context) *FoldersLocationsReplaysOperationsListCall {
1619 c.ctx_ = ctx
1620 return c
1621 }
1622
1623 // Header returns an http.Header that can be modified by the caller to
1624 // add HTTP headers to the request.
1625 func (c *FoldersLocationsReplaysOperationsListCall) Header() http.Header {
1626 if c.header_ == nil {
1627 c.header_ = make(http.Header)
1628 }
1629 return c.header_
1630 }
1631
1632 func (c *FoldersLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
1633 reqHeaders := make(http.Header)
1634 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
1635 for k, v := range c.header_ {
1636 reqHeaders[k] = v
1637 }
1638 reqHeaders.Set("User-Agent", c.s.userAgent())
1639 if c.ifNoneMatch_ != "" {
1640 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1641 }
1642 var body io.Reader = nil
1643 c.urlParams_.Set("alt", alt)
1644 c.urlParams_.Set("prettyPrint", "false")
1645 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1646 urls += "?" + c.urlParams_.Encode()
1647 req, err := http.NewRequest("GET", urls, body)
1648 if err != nil {
1649 return nil, err
1650 }
1651 req.Header = reqHeaders
1652 googleapi.Expand(req.URL, map[string]string{
1653 "name": c.name,
1654 })
1655 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1656 }
1657
1658 // Do executes the "policysimulator.folders.locations.replays.operations.list" call.
1659 // Exactly one of *GoogleLongrunningListOperationsResponse or error will
1660 // be non-nil. Any non-2xx status code is an error. Response headers are
1661 // in either
1662 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if
1663 // a response was returned at all) in error.(*googleapi.Error).Header.
1664 // Use googleapi.IsNotModified to check whether the returned error was
1665 // because http.StatusNotModified was returned.
1666 func (c *FoldersLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
1667 gensupport.SetOptions(c.urlParams_, opts...)
1668 res, err := c.doRequest("json")
1669 if res != nil && res.StatusCode == http.StatusNotModified {
1670 if res.Body != nil {
1671 res.Body.Close()
1672 }
1673 return nil, gensupport.WrapError(&googleapi.Error{
1674 Code: res.StatusCode,
1675 Header: res.Header,
1676 })
1677 }
1678 if err != nil {
1679 return nil, err
1680 }
1681 defer googleapi.CloseBody(res)
1682 if err := googleapi.CheckResponse(res); err != nil {
1683 return nil, gensupport.WrapError(err)
1684 }
1685 ret := &GoogleLongrunningListOperationsResponse{
1686 ServerResponse: googleapi.ServerResponse{
1687 Header: res.Header,
1688 HTTPStatusCode: res.StatusCode,
1689 },
1690 }
1691 target := &ret
1692 if err := gensupport.DecodeResponse(target, res); err != nil {
1693 return nil, err
1694 }
1695 return ret, nil
1696 // {
1697 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
1698 // "flatPath": "v1beta1/folders/{foldersId}/locations/{locationsId}/replays/{replaysId}/operations",
1699 // "httpMethod": "GET",
1700 // "id": "policysimulator.folders.locations.replays.operations.list",
1701 // "parameterOrder": [
1702 // "name"
1703 // ],
1704 // "parameters": {
1705 // "filter": {
1706 // "description": "The standard list filter.",
1707 // "location": "query",
1708 // "type": "string"
1709 // },
1710 // "name": {
1711 // "description": "The name of the operation's parent resource.",
1712 // "location": "path",
1713 // "pattern": "^folders/[^/]+/locations/[^/]+/replays/[^/]+/operations$",
1714 // "required": true,
1715 // "type": "string"
1716 // },
1717 // "pageSize": {
1718 // "description": "The standard list page size.",
1719 // "format": "int32",
1720 // "location": "query",
1721 // "type": "integer"
1722 // },
1723 // "pageToken": {
1724 // "description": "The standard list page token.",
1725 // "location": "query",
1726 // "type": "string"
1727 // }
1728 // },
1729 // "path": "v1beta1/{+name}",
1730 // "response": {
1731 // "$ref": "GoogleLongrunningListOperationsResponse"
1732 // },
1733 // "scopes": [
1734 // "https://www.googleapis.com/auth/cloud-platform"
1735 // ]
1736 // }
1737
1738 }
1739
1740 // Pages invokes f for each page of results.
1741 // A non-nil error returned from f will halt the iteration.
1742 // The provided context supersedes any context provided to the Context method.
1743 func (c *FoldersLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
1744 c.ctx_ = ctx
1745 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1746 for {
1747 x, err := c.Do()
1748 if err != nil {
1749 return err
1750 }
1751 if err := f(x); err != nil {
1752 return err
1753 }
1754 if x.NextPageToken == "" {
1755 return nil
1756 }
1757 c.PageToken(x.NextPageToken)
1758 }
1759 }
1760
1761 // method id "policysimulator.operations.get":
1762
1763 type OperationsGetCall struct {
1764 s *Service
1765 name string
1766 urlParams_ gensupport.URLParams
1767 ifNoneMatch_ string
1768 ctx_ context.Context
1769 header_ http.Header
1770 }
1771
1772 // Get: Gets the latest state of a long-running operation. Clients can
1773 // use this method to poll the operation result at intervals as
1774 // recommended by the API service.
1775 //
1776 // - name: The name of the operation resource.
1777 func (r *OperationsService) Get(name string) *OperationsGetCall {
1778 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1779 c.name = name
1780 return c
1781 }
1782
1783 // Fields allows partial responses to be retrieved. See
1784 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1785 // for more information.
1786 func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
1787 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1788 return c
1789 }
1790
1791 // IfNoneMatch sets the optional parameter which makes the operation
1792 // fail if the object's ETag matches the given value. This is useful for
1793 // getting updates only after the object has changed since the last
1794 // request. Use googleapi.IsNotModified to check whether the response
1795 // error from Do is the result of In-None-Match.
1796 func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
1797 c.ifNoneMatch_ = entityTag
1798 return c
1799 }
1800
1801 // Context sets the context to be used in this call's Do method. Any
1802 // pending HTTP request will be aborted if the provided context is
1803 // canceled.
1804 func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
1805 c.ctx_ = ctx
1806 return c
1807 }
1808
1809 // Header returns an http.Header that can be modified by the caller to
1810 // add HTTP headers to the request.
1811 func (c *OperationsGetCall) Header() http.Header {
1812 if c.header_ == nil {
1813 c.header_ = make(http.Header)
1814 }
1815 return c.header_
1816 }
1817
1818 func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
1819 reqHeaders := make(http.Header)
1820 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
1821 for k, v := range c.header_ {
1822 reqHeaders[k] = v
1823 }
1824 reqHeaders.Set("User-Agent", c.s.userAgent())
1825 if c.ifNoneMatch_ != "" {
1826 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1827 }
1828 var body io.Reader = nil
1829 c.urlParams_.Set("alt", alt)
1830 c.urlParams_.Set("prettyPrint", "false")
1831 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
1832 urls += "?" + c.urlParams_.Encode()
1833 req, err := http.NewRequest("GET", urls, body)
1834 if err != nil {
1835 return nil, err
1836 }
1837 req.Header = reqHeaders
1838 googleapi.Expand(req.URL, map[string]string{
1839 "name": c.name,
1840 })
1841 return gensupport.SendRequest(c.ctx_, c.s.client, req)
1842 }
1843
1844 // Do executes the "policysimulator.operations.get" call.
1845 // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
1846 // Any non-2xx status code is an error. Response headers are in either
1847 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
1848 // was returned at all) in error.(*googleapi.Error).Header. Use
1849 // googleapi.IsNotModified to check whether the returned error was
1850 // because http.StatusNotModified was returned.
1851 func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
1852 gensupport.SetOptions(c.urlParams_, opts...)
1853 res, err := c.doRequest("json")
1854 if res != nil && res.StatusCode == http.StatusNotModified {
1855 if res.Body != nil {
1856 res.Body.Close()
1857 }
1858 return nil, gensupport.WrapError(&googleapi.Error{
1859 Code: res.StatusCode,
1860 Header: res.Header,
1861 })
1862 }
1863 if err != nil {
1864 return nil, err
1865 }
1866 defer googleapi.CloseBody(res)
1867 if err := googleapi.CheckResponse(res); err != nil {
1868 return nil, gensupport.WrapError(err)
1869 }
1870 ret := &GoogleLongrunningOperation{
1871 ServerResponse: googleapi.ServerResponse{
1872 Header: res.Header,
1873 HTTPStatusCode: res.StatusCode,
1874 },
1875 }
1876 target := &ret
1877 if err := gensupport.DecodeResponse(target, res); err != nil {
1878 return nil, err
1879 }
1880 return ret, nil
1881 // {
1882 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
1883 // "flatPath": "v1beta1/operations/{operationsId}",
1884 // "httpMethod": "GET",
1885 // "id": "policysimulator.operations.get",
1886 // "parameterOrder": [
1887 // "name"
1888 // ],
1889 // "parameters": {
1890 // "name": {
1891 // "description": "The name of the operation resource.",
1892 // "location": "path",
1893 // "pattern": "^operations/.*$",
1894 // "required": true,
1895 // "type": "string"
1896 // }
1897 // },
1898 // "path": "v1beta1/{+name}",
1899 // "response": {
1900 // "$ref": "GoogleLongrunningOperation"
1901 // },
1902 // "scopes": [
1903 // "https://www.googleapis.com/auth/cloud-platform"
1904 // ]
1905 // }
1906
1907 }
1908
1909 // method id "policysimulator.operations.list":
1910
1911 type OperationsListCall struct {
1912 s *Service
1913 name string
1914 urlParams_ gensupport.URLParams
1915 ifNoneMatch_ string
1916 ctx_ context.Context
1917 header_ http.Header
1918 }
1919
1920 // List: Lists operations that match the specified filter in the
1921 // request. If the server doesn't support this method, it returns
1922 // `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to
1923 // override the binding to use different resource name schemes, such as
1924 // `users/*/operations`. To override the binding, API services can add a
1925 // binding such as "/v1/{name=users/*}/operations" to their service
1926 // configuration. For backwards compatibility, the default name includes
1927 // the operations collection id, however overriding users must ensure
1928 // the name binding is the parent resource, without the operations
1929 // collection id.
1930 //
1931 // - name: The name of the operation's parent resource.
1932 func (r *OperationsService) List(name string) *OperationsListCall {
1933 c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1934 c.name = name
1935 return c
1936 }
1937
1938 // Filter sets the optional parameter "filter": The standard list
1939 // filter.
1940 func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
1941 c.urlParams_.Set("filter", filter)
1942 return c
1943 }
1944
1945 // PageSize sets the optional parameter "pageSize": The standard list
1946 // page size.
1947 func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
1948 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1949 return c
1950 }
1951
1952 // PageToken sets the optional parameter "pageToken": The standard list
1953 // page token.
1954 func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
1955 c.urlParams_.Set("pageToken", pageToken)
1956 return c
1957 }
1958
1959 // Fields allows partial responses to be retrieved. See
1960 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1961 // for more information.
1962 func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
1963 c.urlParams_.Set("fields", googleapi.CombineFields(s))
1964 return c
1965 }
1966
1967 // IfNoneMatch sets the optional parameter which makes the operation
1968 // fail if the object's ETag matches the given value. This is useful for
1969 // getting updates only after the object has changed since the last
1970 // request. Use googleapi.IsNotModified to check whether the response
1971 // error from Do is the result of In-None-Match.
1972 func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
1973 c.ifNoneMatch_ = entityTag
1974 return c
1975 }
1976
1977 // Context sets the context to be used in this call's Do method. Any
1978 // pending HTTP request will be aborted if the provided context is
1979 // canceled.
1980 func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
1981 c.ctx_ = ctx
1982 return c
1983 }
1984
1985 // Header returns an http.Header that can be modified by the caller to
1986 // add HTTP headers to the request.
1987 func (c *OperationsListCall) Header() http.Header {
1988 if c.header_ == nil {
1989 c.header_ = make(http.Header)
1990 }
1991 return c.header_
1992 }
1993
1994 func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
1995 reqHeaders := make(http.Header)
1996 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
1997 for k, v := range c.header_ {
1998 reqHeaders[k] = v
1999 }
2000 reqHeaders.Set("User-Agent", c.s.userAgent())
2001 if c.ifNoneMatch_ != "" {
2002 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2003 }
2004 var body io.Reader = nil
2005 c.urlParams_.Set("alt", alt)
2006 c.urlParams_.Set("prettyPrint", "false")
2007 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2008 urls += "?" + c.urlParams_.Encode()
2009 req, err := http.NewRequest("GET", urls, body)
2010 if err != nil {
2011 return nil, err
2012 }
2013 req.Header = reqHeaders
2014 googleapi.Expand(req.URL, map[string]string{
2015 "name": c.name,
2016 })
2017 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2018 }
2019
2020 // Do executes the "policysimulator.operations.list" call.
2021 // Exactly one of *GoogleLongrunningListOperationsResponse or error will
2022 // be non-nil. Any non-2xx status code is an error. Response headers are
2023 // in either
2024 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if
2025 // a response was returned at all) in error.(*googleapi.Error).Header.
2026 // Use googleapi.IsNotModified to check whether the returned error was
2027 // because http.StatusNotModified was returned.
2028 func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
2029 gensupport.SetOptions(c.urlParams_, opts...)
2030 res, err := c.doRequest("json")
2031 if res != nil && res.StatusCode == http.StatusNotModified {
2032 if res.Body != nil {
2033 res.Body.Close()
2034 }
2035 return nil, gensupport.WrapError(&googleapi.Error{
2036 Code: res.StatusCode,
2037 Header: res.Header,
2038 })
2039 }
2040 if err != nil {
2041 return nil, err
2042 }
2043 defer googleapi.CloseBody(res)
2044 if err := googleapi.CheckResponse(res); err != nil {
2045 return nil, gensupport.WrapError(err)
2046 }
2047 ret := &GoogleLongrunningListOperationsResponse{
2048 ServerResponse: googleapi.ServerResponse{
2049 Header: res.Header,
2050 HTTPStatusCode: res.StatusCode,
2051 },
2052 }
2053 target := &ret
2054 if err := gensupport.DecodeResponse(target, res); err != nil {
2055 return nil, err
2056 }
2057 return ret, nil
2058 // {
2059 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
2060 // "flatPath": "v1beta1/operations",
2061 // "httpMethod": "GET",
2062 // "id": "policysimulator.operations.list",
2063 // "parameterOrder": [
2064 // "name"
2065 // ],
2066 // "parameters": {
2067 // "filter": {
2068 // "description": "The standard list filter.",
2069 // "location": "query",
2070 // "type": "string"
2071 // },
2072 // "name": {
2073 // "description": "The name of the operation's parent resource.",
2074 // "location": "path",
2075 // "pattern": "^operations$",
2076 // "required": true,
2077 // "type": "string"
2078 // },
2079 // "pageSize": {
2080 // "description": "The standard list page size.",
2081 // "format": "int32",
2082 // "location": "query",
2083 // "type": "integer"
2084 // },
2085 // "pageToken": {
2086 // "description": "The standard list page token.",
2087 // "location": "query",
2088 // "type": "string"
2089 // }
2090 // },
2091 // "path": "v1beta1/{+name}",
2092 // "response": {
2093 // "$ref": "GoogleLongrunningListOperationsResponse"
2094 // },
2095 // "scopes": [
2096 // "https://www.googleapis.com/auth/cloud-platform"
2097 // ]
2098 // }
2099
2100 }
2101
2102 // Pages invokes f for each page of results.
2103 // A non-nil error returned from f will halt the iteration.
2104 // The provided context supersedes any context provided to the Context method.
2105 func (c *OperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
2106 c.ctx_ = ctx
2107 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2108 for {
2109 x, err := c.Do()
2110 if err != nil {
2111 return err
2112 }
2113 if err := f(x); err != nil {
2114 return err
2115 }
2116 if x.NextPageToken == "" {
2117 return nil
2118 }
2119 c.PageToken(x.NextPageToken)
2120 }
2121 }
2122
2123 // method id "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get":
2124
2125 type OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
2126 s *Service
2127 name string
2128 urlParams_ gensupport.URLParams
2129 ifNoneMatch_ string
2130 ctx_ context.Context
2131 header_ http.Header
2132 }
2133
2134 // Get: Gets the latest state of a long-running operation. Clients can
2135 // use this method to poll the operation result at intervals as
2136 // recommended by the API service.
2137 //
2138 // - name: The name of the operation resource.
2139 func (r *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2140 c := &OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2141 c.name = name
2142 return c
2143 }
2144
2145 // Fields allows partial responses to be retrieved. See
2146 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2147 // for more information.
2148 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2149 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2150 return c
2151 }
2152
2153 // IfNoneMatch sets the optional parameter which makes the operation
2154 // fail if the object's ETag matches the given value. This is useful for
2155 // getting updates only after the object has changed since the last
2156 // request. Use googleapi.IsNotModified to check whether the response
2157 // error from Do is the result of In-None-Match.
2158 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2159 c.ifNoneMatch_ = entityTag
2160 return c
2161 }
2162
2163 // Context sets the context to be used in this call's Do method. Any
2164 // pending HTTP request will be aborted if the provided context is
2165 // canceled.
2166 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2167 c.ctx_ = ctx
2168 return c
2169 }
2170
2171 // Header returns an http.Header that can be modified by the caller to
2172 // add HTTP headers to the request.
2173 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
2174 if c.header_ == nil {
2175 c.header_ = make(http.Header)
2176 }
2177 return c.header_
2178 }
2179
2180 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2181 reqHeaders := make(http.Header)
2182 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
2183 for k, v := range c.header_ {
2184 reqHeaders[k] = v
2185 }
2186 reqHeaders.Set("User-Agent", c.s.userAgent())
2187 if c.ifNoneMatch_ != "" {
2188 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2189 }
2190 var body io.Reader = nil
2191 c.urlParams_.Set("alt", alt)
2192 c.urlParams_.Set("prettyPrint", "false")
2193 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2194 urls += "?" + c.urlParams_.Encode()
2195 req, err := http.NewRequest("GET", urls, body)
2196 if err != nil {
2197 return nil, err
2198 }
2199 req.Header = reqHeaders
2200 googleapi.Expand(req.URL, map[string]string{
2201 "name": c.name,
2202 })
2203 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2204 }
2205
2206 // Do executes the "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get" call.
2207 // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
2208 // Any non-2xx status code is an error. Response headers are in either
2209 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
2210 // was returned at all) in error.(*googleapi.Error).Header. Use
2211 // googleapi.IsNotModified to check whether the returned error was
2212 // because http.StatusNotModified was returned.
2213 func (c *OrganizationsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2214 gensupport.SetOptions(c.urlParams_, opts...)
2215 res, err := c.doRequest("json")
2216 if res != nil && res.StatusCode == http.StatusNotModified {
2217 if res.Body != nil {
2218 res.Body.Close()
2219 }
2220 return nil, gensupport.WrapError(&googleapi.Error{
2221 Code: res.StatusCode,
2222 Header: res.Header,
2223 })
2224 }
2225 if err != nil {
2226 return nil, err
2227 }
2228 defer googleapi.CloseBody(res)
2229 if err := googleapi.CheckResponse(res); err != nil {
2230 return nil, gensupport.WrapError(err)
2231 }
2232 ret := &GoogleLongrunningOperation{
2233 ServerResponse: googleapi.ServerResponse{
2234 Header: res.Header,
2235 HTTPStatusCode: res.StatusCode,
2236 },
2237 }
2238 target := &ret
2239 if err := gensupport.DecodeResponse(target, res); err != nil {
2240 return nil, err
2241 }
2242 return ret, nil
2243 // {
2244 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
2245 // "flatPath": "v1beta1/organizations/{organizationsId}/locations/{locationsId}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreviewsId}/operations/{operationsId}",
2246 // "httpMethod": "GET",
2247 // "id": "policysimulator.organizations.locations.orgPolicyViolationsPreviews.operations.get",
2248 // "parameterOrder": [
2249 // "name"
2250 // ],
2251 // "parameters": {
2252 // "name": {
2253 // "description": "The name of the operation resource.",
2254 // "location": "path",
2255 // "pattern": "^organizations/[^/]+/locations/[^/]+/orgPolicyViolationsPreviews/[^/]+/operations/.*$",
2256 // "required": true,
2257 // "type": "string"
2258 // }
2259 // },
2260 // "path": "v1beta1/{+name}",
2261 // "response": {
2262 // "$ref": "GoogleLongrunningOperation"
2263 // },
2264 // "scopes": [
2265 // "https://www.googleapis.com/auth/cloud-platform"
2266 // ]
2267 // }
2268
2269 }
2270
2271 // method id "policysimulator.organizations.locations.replays.operations.get":
2272
2273 type OrganizationsLocationsReplaysOperationsGetCall struct {
2274 s *Service
2275 name string
2276 urlParams_ gensupport.URLParams
2277 ifNoneMatch_ string
2278 ctx_ context.Context
2279 header_ http.Header
2280 }
2281
2282 // Get: Gets the latest state of a long-running operation. Clients can
2283 // use this method to poll the operation result at intervals as
2284 // recommended by the API service.
2285 //
2286 // - name: The name of the operation resource.
2287 func (r *OrganizationsLocationsReplaysOperationsService) Get(name string) *OrganizationsLocationsReplaysOperationsGetCall {
2288 c := &OrganizationsLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2289 c.name = name
2290 return c
2291 }
2292
2293 // Fields allows partial responses to be retrieved. See
2294 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2295 // for more information.
2296 func (c *OrganizationsLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysOperationsGetCall {
2297 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2298 return c
2299 }
2300
2301 // IfNoneMatch sets the optional parameter which makes the operation
2302 // fail if the object's ETag matches the given value. This is useful for
2303 // getting updates only after the object has changed since the last
2304 // request. Use googleapi.IsNotModified to check whether the response
2305 // error from Do is the result of In-None-Match.
2306 func (c *OrganizationsLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysOperationsGetCall {
2307 c.ifNoneMatch_ = entityTag
2308 return c
2309 }
2310
2311 // Context sets the context to be used in this call's Do method. Any
2312 // pending HTTP request will be aborted if the provided context is
2313 // canceled.
2314 func (c *OrganizationsLocationsReplaysOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsReplaysOperationsGetCall {
2315 c.ctx_ = ctx
2316 return c
2317 }
2318
2319 // Header returns an http.Header that can be modified by the caller to
2320 // add HTTP headers to the request.
2321 func (c *OrganizationsLocationsReplaysOperationsGetCall) Header() http.Header {
2322 if c.header_ == nil {
2323 c.header_ = make(http.Header)
2324 }
2325 return c.header_
2326 }
2327
2328 func (c *OrganizationsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2329 reqHeaders := make(http.Header)
2330 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
2331 for k, v := range c.header_ {
2332 reqHeaders[k] = v
2333 }
2334 reqHeaders.Set("User-Agent", c.s.userAgent())
2335 if c.ifNoneMatch_ != "" {
2336 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2337 }
2338 var body io.Reader = nil
2339 c.urlParams_.Set("alt", alt)
2340 c.urlParams_.Set("prettyPrint", "false")
2341 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2342 urls += "?" + c.urlParams_.Encode()
2343 req, err := http.NewRequest("GET", urls, body)
2344 if err != nil {
2345 return nil, err
2346 }
2347 req.Header = reqHeaders
2348 googleapi.Expand(req.URL, map[string]string{
2349 "name": c.name,
2350 })
2351 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2352 }
2353
2354 // Do executes the "policysimulator.organizations.locations.replays.operations.get" call.
2355 // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
2356 // Any non-2xx status code is an error. Response headers are in either
2357 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
2358 // was returned at all) in error.(*googleapi.Error).Header. Use
2359 // googleapi.IsNotModified to check whether the returned error was
2360 // because http.StatusNotModified was returned.
2361 func (c *OrganizationsLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2362 gensupport.SetOptions(c.urlParams_, opts...)
2363 res, err := c.doRequest("json")
2364 if res != nil && res.StatusCode == http.StatusNotModified {
2365 if res.Body != nil {
2366 res.Body.Close()
2367 }
2368 return nil, gensupport.WrapError(&googleapi.Error{
2369 Code: res.StatusCode,
2370 Header: res.Header,
2371 })
2372 }
2373 if err != nil {
2374 return nil, err
2375 }
2376 defer googleapi.CloseBody(res)
2377 if err := googleapi.CheckResponse(res); err != nil {
2378 return nil, gensupport.WrapError(err)
2379 }
2380 ret := &GoogleLongrunningOperation{
2381 ServerResponse: googleapi.ServerResponse{
2382 Header: res.Header,
2383 HTTPStatusCode: res.StatusCode,
2384 },
2385 }
2386 target := &ret
2387 if err := gensupport.DecodeResponse(target, res); err != nil {
2388 return nil, err
2389 }
2390 return ret, nil
2391 // {
2392 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
2393 // "flatPath": "v1beta1/organizations/{organizationsId}/locations/{locationsId}/replays/{replaysId}/operations/{operationsId}",
2394 // "httpMethod": "GET",
2395 // "id": "policysimulator.organizations.locations.replays.operations.get",
2396 // "parameterOrder": [
2397 // "name"
2398 // ],
2399 // "parameters": {
2400 // "name": {
2401 // "description": "The name of the operation resource.",
2402 // "location": "path",
2403 // "pattern": "^organizations/[^/]+/locations/[^/]+/replays/[^/]+/operations/.*$",
2404 // "required": true,
2405 // "type": "string"
2406 // }
2407 // },
2408 // "path": "v1beta1/{+name}",
2409 // "response": {
2410 // "$ref": "GoogleLongrunningOperation"
2411 // },
2412 // "scopes": [
2413 // "https://www.googleapis.com/auth/cloud-platform"
2414 // ]
2415 // }
2416
2417 }
2418
2419 // method id "policysimulator.organizations.locations.replays.operations.list":
2420
2421 type OrganizationsLocationsReplaysOperationsListCall struct {
2422 s *Service
2423 name string
2424 urlParams_ gensupport.URLParams
2425 ifNoneMatch_ string
2426 ctx_ context.Context
2427 header_ http.Header
2428 }
2429
2430 // List: Lists operations that match the specified filter in the
2431 // request. If the server doesn't support this method, it returns
2432 // `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to
2433 // override the binding to use different resource name schemes, such as
2434 // `users/*/operations`. To override the binding, API services can add a
2435 // binding such as "/v1/{name=users/*}/operations" to their service
2436 // configuration. For backwards compatibility, the default name includes
2437 // the operations collection id, however overriding users must ensure
2438 // the name binding is the parent resource, without the operations
2439 // collection id.
2440 //
2441 // - name: The name of the operation's parent resource.
2442 func (r *OrganizationsLocationsReplaysOperationsService) List(name string) *OrganizationsLocationsReplaysOperationsListCall {
2443 c := &OrganizationsLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2444 c.name = name
2445 return c
2446 }
2447
2448 // Filter sets the optional parameter "filter": The standard list
2449 // filter.
2450 func (c *OrganizationsLocationsReplaysOperationsListCall) Filter(filter string) *OrganizationsLocationsReplaysOperationsListCall {
2451 c.urlParams_.Set("filter", filter)
2452 return c
2453 }
2454
2455 // PageSize sets the optional parameter "pageSize": The standard list
2456 // page size.
2457 func (c *OrganizationsLocationsReplaysOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsReplaysOperationsListCall {
2458 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2459 return c
2460 }
2461
2462 // PageToken sets the optional parameter "pageToken": The standard list
2463 // page token.
2464 func (c *OrganizationsLocationsReplaysOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsReplaysOperationsListCall {
2465 c.urlParams_.Set("pageToken", pageToken)
2466 return c
2467 }
2468
2469 // Fields allows partial responses to be retrieved. See
2470 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2471 // for more information.
2472 func (c *OrganizationsLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsReplaysOperationsListCall {
2473 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2474 return c
2475 }
2476
2477 // IfNoneMatch sets the optional parameter which makes the operation
2478 // fail if the object's ETag matches the given value. This is useful for
2479 // getting updates only after the object has changed since the last
2480 // request. Use googleapi.IsNotModified to check whether the response
2481 // error from Do is the result of In-None-Match.
2482 func (c *OrganizationsLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsReplaysOperationsListCall {
2483 c.ifNoneMatch_ = entityTag
2484 return c
2485 }
2486
2487 // Context sets the context to be used in this call's Do method. Any
2488 // pending HTTP request will be aborted if the provided context is
2489 // canceled.
2490 func (c *OrganizationsLocationsReplaysOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsReplaysOperationsListCall {
2491 c.ctx_ = ctx
2492 return c
2493 }
2494
2495 // Header returns an http.Header that can be modified by the caller to
2496 // add HTTP headers to the request.
2497 func (c *OrganizationsLocationsReplaysOperationsListCall) Header() http.Header {
2498 if c.header_ == nil {
2499 c.header_ = make(http.Header)
2500 }
2501 return c.header_
2502 }
2503
2504 func (c *OrganizationsLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
2505 reqHeaders := make(http.Header)
2506 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
2507 for k, v := range c.header_ {
2508 reqHeaders[k] = v
2509 }
2510 reqHeaders.Set("User-Agent", c.s.userAgent())
2511 if c.ifNoneMatch_ != "" {
2512 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2513 }
2514 var body io.Reader = nil
2515 c.urlParams_.Set("alt", alt)
2516 c.urlParams_.Set("prettyPrint", "false")
2517 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2518 urls += "?" + c.urlParams_.Encode()
2519 req, err := http.NewRequest("GET", urls, body)
2520 if err != nil {
2521 return nil, err
2522 }
2523 req.Header = reqHeaders
2524 googleapi.Expand(req.URL, map[string]string{
2525 "name": c.name,
2526 })
2527 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2528 }
2529
2530 // Do executes the "policysimulator.organizations.locations.replays.operations.list" call.
2531 // Exactly one of *GoogleLongrunningListOperationsResponse or error will
2532 // be non-nil. Any non-2xx status code is an error. Response headers are
2533 // in either
2534 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if
2535 // a response was returned at all) in error.(*googleapi.Error).Header.
2536 // Use googleapi.IsNotModified to check whether the returned error was
2537 // because http.StatusNotModified was returned.
2538 func (c *OrganizationsLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
2539 gensupport.SetOptions(c.urlParams_, opts...)
2540 res, err := c.doRequest("json")
2541 if res != nil && res.StatusCode == http.StatusNotModified {
2542 if res.Body != nil {
2543 res.Body.Close()
2544 }
2545 return nil, gensupport.WrapError(&googleapi.Error{
2546 Code: res.StatusCode,
2547 Header: res.Header,
2548 })
2549 }
2550 if err != nil {
2551 return nil, err
2552 }
2553 defer googleapi.CloseBody(res)
2554 if err := googleapi.CheckResponse(res); err != nil {
2555 return nil, gensupport.WrapError(err)
2556 }
2557 ret := &GoogleLongrunningListOperationsResponse{
2558 ServerResponse: googleapi.ServerResponse{
2559 Header: res.Header,
2560 HTTPStatusCode: res.StatusCode,
2561 },
2562 }
2563 target := &ret
2564 if err := gensupport.DecodeResponse(target, res); err != nil {
2565 return nil, err
2566 }
2567 return ret, nil
2568 // {
2569 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
2570 // "flatPath": "v1beta1/organizations/{organizationsId}/locations/{locationsId}/replays/{replaysId}/operations",
2571 // "httpMethod": "GET",
2572 // "id": "policysimulator.organizations.locations.replays.operations.list",
2573 // "parameterOrder": [
2574 // "name"
2575 // ],
2576 // "parameters": {
2577 // "filter": {
2578 // "description": "The standard list filter.",
2579 // "location": "query",
2580 // "type": "string"
2581 // },
2582 // "name": {
2583 // "description": "The name of the operation's parent resource.",
2584 // "location": "path",
2585 // "pattern": "^organizations/[^/]+/locations/[^/]+/replays/[^/]+/operations$",
2586 // "required": true,
2587 // "type": "string"
2588 // },
2589 // "pageSize": {
2590 // "description": "The standard list page size.",
2591 // "format": "int32",
2592 // "location": "query",
2593 // "type": "integer"
2594 // },
2595 // "pageToken": {
2596 // "description": "The standard list page token.",
2597 // "location": "query",
2598 // "type": "string"
2599 // }
2600 // },
2601 // "path": "v1beta1/{+name}",
2602 // "response": {
2603 // "$ref": "GoogleLongrunningListOperationsResponse"
2604 // },
2605 // "scopes": [
2606 // "https://www.googleapis.com/auth/cloud-platform"
2607 // ]
2608 // }
2609
2610 }
2611
2612 // Pages invokes f for each page of results.
2613 // A non-nil error returned from f will halt the iteration.
2614 // The provided context supersedes any context provided to the Context method.
2615 func (c *OrganizationsLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
2616 c.ctx_ = ctx
2617 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2618 for {
2619 x, err := c.Do()
2620 if err != nil {
2621 return err
2622 }
2623 if err := f(x); err != nil {
2624 return err
2625 }
2626 if x.NextPageToken == "" {
2627 return nil
2628 }
2629 c.PageToken(x.NextPageToken)
2630 }
2631 }
2632
2633 // method id "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get":
2634
2635 type ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall struct {
2636 s *Service
2637 name string
2638 urlParams_ gensupport.URLParams
2639 ifNoneMatch_ string
2640 ctx_ context.Context
2641 header_ http.Header
2642 }
2643
2644 // Get: Gets the latest state of a long-running operation. Clients can
2645 // use this method to poll the operation result at intervals as
2646 // recommended by the API service.
2647 //
2648 // - name: The name of the operation resource.
2649 func (r *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsService) Get(name string) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2650 c := &ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2651 c.name = name
2652 return c
2653 }
2654
2655 // Fields allows partial responses to be retrieved. See
2656 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2657 // for more information.
2658 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2659 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2660 return c
2661 }
2662
2663 // IfNoneMatch sets the optional parameter which makes the operation
2664 // fail if the object's ETag matches the given value. This is useful for
2665 // getting updates only after the object has changed since the last
2666 // request. Use googleapi.IsNotModified to check whether the response
2667 // error from Do is the result of In-None-Match.
2668 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2669 c.ifNoneMatch_ = entityTag
2670 return c
2671 }
2672
2673 // Context sets the context to be used in this call's Do method. Any
2674 // pending HTTP request will be aborted if the provided context is
2675 // canceled.
2676 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall {
2677 c.ctx_ = ctx
2678 return c
2679 }
2680
2681 // Header returns an http.Header that can be modified by the caller to
2682 // add HTTP headers to the request.
2683 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Header() http.Header {
2684 if c.header_ == nil {
2685 c.header_ = make(http.Header)
2686 }
2687 return c.header_
2688 }
2689
2690 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2691 reqHeaders := make(http.Header)
2692 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
2693 for k, v := range c.header_ {
2694 reqHeaders[k] = v
2695 }
2696 reqHeaders.Set("User-Agent", c.s.userAgent())
2697 if c.ifNoneMatch_ != "" {
2698 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2699 }
2700 var body io.Reader = nil
2701 c.urlParams_.Set("alt", alt)
2702 c.urlParams_.Set("prettyPrint", "false")
2703 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2704 urls += "?" + c.urlParams_.Encode()
2705 req, err := http.NewRequest("GET", urls, body)
2706 if err != nil {
2707 return nil, err
2708 }
2709 req.Header = reqHeaders
2710 googleapi.Expand(req.URL, map[string]string{
2711 "name": c.name,
2712 })
2713 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2714 }
2715
2716 // Do executes the "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get" call.
2717 // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
2718 // Any non-2xx status code is an error. Response headers are in either
2719 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
2720 // was returned at all) in error.(*googleapi.Error).Header. Use
2721 // googleapi.IsNotModified to check whether the returned error was
2722 // because http.StatusNotModified was returned.
2723 func (c *ProjectsLocationsOrgPolicyViolationsPreviewsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2724 gensupport.SetOptions(c.urlParams_, opts...)
2725 res, err := c.doRequest("json")
2726 if res != nil && res.StatusCode == http.StatusNotModified {
2727 if res.Body != nil {
2728 res.Body.Close()
2729 }
2730 return nil, gensupport.WrapError(&googleapi.Error{
2731 Code: res.StatusCode,
2732 Header: res.Header,
2733 })
2734 }
2735 if err != nil {
2736 return nil, err
2737 }
2738 defer googleapi.CloseBody(res)
2739 if err := googleapi.CheckResponse(res); err != nil {
2740 return nil, gensupport.WrapError(err)
2741 }
2742 ret := &GoogleLongrunningOperation{
2743 ServerResponse: googleapi.ServerResponse{
2744 Header: res.Header,
2745 HTTPStatusCode: res.StatusCode,
2746 },
2747 }
2748 target := &ret
2749 if err := gensupport.DecodeResponse(target, res); err != nil {
2750 return nil, err
2751 }
2752 return ret, nil
2753 // {
2754 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
2755 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/orgPolicyViolationsPreviews/{orgPolicyViolationsPreviewsId}/operations/{operationsId}",
2756 // "httpMethod": "GET",
2757 // "id": "policysimulator.projects.locations.orgPolicyViolationsPreviews.operations.get",
2758 // "parameterOrder": [
2759 // "name"
2760 // ],
2761 // "parameters": {
2762 // "name": {
2763 // "description": "The name of the operation resource.",
2764 // "location": "path",
2765 // "pattern": "^projects/[^/]+/locations/[^/]+/orgPolicyViolationsPreviews/[^/]+/operations/.*$",
2766 // "required": true,
2767 // "type": "string"
2768 // }
2769 // },
2770 // "path": "v1beta1/{+name}",
2771 // "response": {
2772 // "$ref": "GoogleLongrunningOperation"
2773 // },
2774 // "scopes": [
2775 // "https://www.googleapis.com/auth/cloud-platform"
2776 // ]
2777 // }
2778
2779 }
2780
2781 // method id "policysimulator.projects.locations.replays.operations.get":
2782
2783 type ProjectsLocationsReplaysOperationsGetCall struct {
2784 s *Service
2785 name string
2786 urlParams_ gensupport.URLParams
2787 ifNoneMatch_ string
2788 ctx_ context.Context
2789 header_ http.Header
2790 }
2791
2792 // Get: Gets the latest state of a long-running operation. Clients can
2793 // use this method to poll the operation result at intervals as
2794 // recommended by the API service.
2795 //
2796 // - name: The name of the operation resource.
2797 func (r *ProjectsLocationsReplaysOperationsService) Get(name string) *ProjectsLocationsReplaysOperationsGetCall {
2798 c := &ProjectsLocationsReplaysOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2799 c.name = name
2800 return c
2801 }
2802
2803 // Fields allows partial responses to be retrieved. See
2804 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2805 // for more information.
2806 func (c *ProjectsLocationsReplaysOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysOperationsGetCall {
2807 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2808 return c
2809 }
2810
2811 // IfNoneMatch sets the optional parameter which makes the operation
2812 // fail if the object's ETag matches the given value. This is useful for
2813 // getting updates only after the object has changed since the last
2814 // request. Use googleapi.IsNotModified to check whether the response
2815 // error from Do is the result of In-None-Match.
2816 func (c *ProjectsLocationsReplaysOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysOperationsGetCall {
2817 c.ifNoneMatch_ = entityTag
2818 return c
2819 }
2820
2821 // Context sets the context to be used in this call's Do method. Any
2822 // pending HTTP request will be aborted if the provided context is
2823 // canceled.
2824 func (c *ProjectsLocationsReplaysOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsReplaysOperationsGetCall {
2825 c.ctx_ = ctx
2826 return c
2827 }
2828
2829 // Header returns an http.Header that can be modified by the caller to
2830 // add HTTP headers to the request.
2831 func (c *ProjectsLocationsReplaysOperationsGetCall) Header() http.Header {
2832 if c.header_ == nil {
2833 c.header_ = make(http.Header)
2834 }
2835 return c.header_
2836 }
2837
2838 func (c *ProjectsLocationsReplaysOperationsGetCall) doRequest(alt string) (*http.Response, error) {
2839 reqHeaders := make(http.Header)
2840 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
2841 for k, v := range c.header_ {
2842 reqHeaders[k] = v
2843 }
2844 reqHeaders.Set("User-Agent", c.s.userAgent())
2845 if c.ifNoneMatch_ != "" {
2846 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2847 }
2848 var body io.Reader = nil
2849 c.urlParams_.Set("alt", alt)
2850 c.urlParams_.Set("prettyPrint", "false")
2851 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
2852 urls += "?" + c.urlParams_.Encode()
2853 req, err := http.NewRequest("GET", urls, body)
2854 if err != nil {
2855 return nil, err
2856 }
2857 req.Header = reqHeaders
2858 googleapi.Expand(req.URL, map[string]string{
2859 "name": c.name,
2860 })
2861 return gensupport.SendRequest(c.ctx_, c.s.client, req)
2862 }
2863
2864 // Do executes the "policysimulator.projects.locations.replays.operations.get" call.
2865 // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
2866 // Any non-2xx status code is an error. Response headers are in either
2867 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
2868 // was returned at all) in error.(*googleapi.Error).Header. Use
2869 // googleapi.IsNotModified to check whether the returned error was
2870 // because http.StatusNotModified was returned.
2871 func (c *ProjectsLocationsReplaysOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
2872 gensupport.SetOptions(c.urlParams_, opts...)
2873 res, err := c.doRequest("json")
2874 if res != nil && res.StatusCode == http.StatusNotModified {
2875 if res.Body != nil {
2876 res.Body.Close()
2877 }
2878 return nil, gensupport.WrapError(&googleapi.Error{
2879 Code: res.StatusCode,
2880 Header: res.Header,
2881 })
2882 }
2883 if err != nil {
2884 return nil, err
2885 }
2886 defer googleapi.CloseBody(res)
2887 if err := googleapi.CheckResponse(res); err != nil {
2888 return nil, gensupport.WrapError(err)
2889 }
2890 ret := &GoogleLongrunningOperation{
2891 ServerResponse: googleapi.ServerResponse{
2892 Header: res.Header,
2893 HTTPStatusCode: res.StatusCode,
2894 },
2895 }
2896 target := &ret
2897 if err := gensupport.DecodeResponse(target, res); err != nil {
2898 return nil, err
2899 }
2900 return ret, nil
2901 // {
2902 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
2903 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/replays/{replaysId}/operations/{operationsId}",
2904 // "httpMethod": "GET",
2905 // "id": "policysimulator.projects.locations.replays.operations.get",
2906 // "parameterOrder": [
2907 // "name"
2908 // ],
2909 // "parameters": {
2910 // "name": {
2911 // "description": "The name of the operation resource.",
2912 // "location": "path",
2913 // "pattern": "^projects/[^/]+/locations/[^/]+/replays/[^/]+/operations/.*$",
2914 // "required": true,
2915 // "type": "string"
2916 // }
2917 // },
2918 // "path": "v1beta1/{+name}",
2919 // "response": {
2920 // "$ref": "GoogleLongrunningOperation"
2921 // },
2922 // "scopes": [
2923 // "https://www.googleapis.com/auth/cloud-platform"
2924 // ]
2925 // }
2926
2927 }
2928
2929 // method id "policysimulator.projects.locations.replays.operations.list":
2930
2931 type ProjectsLocationsReplaysOperationsListCall struct {
2932 s *Service
2933 name string
2934 urlParams_ gensupport.URLParams
2935 ifNoneMatch_ string
2936 ctx_ context.Context
2937 header_ http.Header
2938 }
2939
2940 // List: Lists operations that match the specified filter in the
2941 // request. If the server doesn't support this method, it returns
2942 // `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to
2943 // override the binding to use different resource name schemes, such as
2944 // `users/*/operations`. To override the binding, API services can add a
2945 // binding such as "/v1/{name=users/*}/operations" to their service
2946 // configuration. For backwards compatibility, the default name includes
2947 // the operations collection id, however overriding users must ensure
2948 // the name binding is the parent resource, without the operations
2949 // collection id.
2950 //
2951 // - name: The name of the operation's parent resource.
2952 func (r *ProjectsLocationsReplaysOperationsService) List(name string) *ProjectsLocationsReplaysOperationsListCall {
2953 c := &ProjectsLocationsReplaysOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2954 c.name = name
2955 return c
2956 }
2957
2958 // Filter sets the optional parameter "filter": The standard list
2959 // filter.
2960 func (c *ProjectsLocationsReplaysOperationsListCall) Filter(filter string) *ProjectsLocationsReplaysOperationsListCall {
2961 c.urlParams_.Set("filter", filter)
2962 return c
2963 }
2964
2965 // PageSize sets the optional parameter "pageSize": The standard list
2966 // page size.
2967 func (c *ProjectsLocationsReplaysOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsReplaysOperationsListCall {
2968 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2969 return c
2970 }
2971
2972 // PageToken sets the optional parameter "pageToken": The standard list
2973 // page token.
2974 func (c *ProjectsLocationsReplaysOperationsListCall) PageToken(pageToken string) *ProjectsLocationsReplaysOperationsListCall {
2975 c.urlParams_.Set("pageToken", pageToken)
2976 return c
2977 }
2978
2979 // Fields allows partial responses to be retrieved. See
2980 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2981 // for more information.
2982 func (c *ProjectsLocationsReplaysOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsReplaysOperationsListCall {
2983 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2984 return c
2985 }
2986
2987 // IfNoneMatch sets the optional parameter which makes the operation
2988 // fail if the object's ETag matches the given value. This is useful for
2989 // getting updates only after the object has changed since the last
2990 // request. Use googleapi.IsNotModified to check whether the response
2991 // error from Do is the result of In-None-Match.
2992 func (c *ProjectsLocationsReplaysOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsReplaysOperationsListCall {
2993 c.ifNoneMatch_ = entityTag
2994 return c
2995 }
2996
2997 // Context sets the context to be used in this call's Do method. Any
2998 // pending HTTP request will be aborted if the provided context is
2999 // canceled.
3000 func (c *ProjectsLocationsReplaysOperationsListCall) Context(ctx context.Context) *ProjectsLocationsReplaysOperationsListCall {
3001 c.ctx_ = ctx
3002 return c
3003 }
3004
3005 // Header returns an http.Header that can be modified by the caller to
3006 // add HTTP headers to the request.
3007 func (c *ProjectsLocationsReplaysOperationsListCall) Header() http.Header {
3008 if c.header_ == nil {
3009 c.header_ = make(http.Header)
3010 }
3011 return c.header_
3012 }
3013
3014 func (c *ProjectsLocationsReplaysOperationsListCall) doRequest(alt string) (*http.Response, error) {
3015 reqHeaders := make(http.Header)
3016 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+internal.Version)
3017 for k, v := range c.header_ {
3018 reqHeaders[k] = v
3019 }
3020 reqHeaders.Set("User-Agent", c.s.userAgent())
3021 if c.ifNoneMatch_ != "" {
3022 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3023 }
3024 var body io.Reader = nil
3025 c.urlParams_.Set("alt", alt)
3026 c.urlParams_.Set("prettyPrint", "false")
3027 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}")
3028 urls += "?" + c.urlParams_.Encode()
3029 req, err := http.NewRequest("GET", urls, body)
3030 if err != nil {
3031 return nil, err
3032 }
3033 req.Header = reqHeaders
3034 googleapi.Expand(req.URL, map[string]string{
3035 "name": c.name,
3036 })
3037 return gensupport.SendRequest(c.ctx_, c.s.client, req)
3038 }
3039
3040 // Do executes the "policysimulator.projects.locations.replays.operations.list" call.
3041 // Exactly one of *GoogleLongrunningListOperationsResponse or error will
3042 // be non-nil. Any non-2xx status code is an error. Response headers are
3043 // in either
3044 // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if
3045 // a response was returned at all) in error.(*googleapi.Error).Header.
3046 // Use googleapi.IsNotModified to check whether the returned error was
3047 // because http.StatusNotModified was returned.
3048 func (c *ProjectsLocationsReplaysOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
3049 gensupport.SetOptions(c.urlParams_, opts...)
3050 res, err := c.doRequest("json")
3051 if res != nil && res.StatusCode == http.StatusNotModified {
3052 if res.Body != nil {
3053 res.Body.Close()
3054 }
3055 return nil, gensupport.WrapError(&googleapi.Error{
3056 Code: res.StatusCode,
3057 Header: res.Header,
3058 })
3059 }
3060 if err != nil {
3061 return nil, err
3062 }
3063 defer googleapi.CloseBody(res)
3064 if err := googleapi.CheckResponse(res); err != nil {
3065 return nil, gensupport.WrapError(err)
3066 }
3067 ret := &GoogleLongrunningListOperationsResponse{
3068 ServerResponse: googleapi.ServerResponse{
3069 Header: res.Header,
3070 HTTPStatusCode: res.StatusCode,
3071 },
3072 }
3073 target := &ret
3074 if err := gensupport.DecodeResponse(target, res); err != nil {
3075 return nil, err
3076 }
3077 return ret, nil
3078 // {
3079 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. To override the binding, API services can add a binding such as `\"/v1/{name=users/*}/operations\"` to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
3080 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/replays/{replaysId}/operations",
3081 // "httpMethod": "GET",
3082 // "id": "policysimulator.projects.locations.replays.operations.list",
3083 // "parameterOrder": [
3084 // "name"
3085 // ],
3086 // "parameters": {
3087 // "filter": {
3088 // "description": "The standard list filter.",
3089 // "location": "query",
3090 // "type": "string"
3091 // },
3092 // "name": {
3093 // "description": "The name of the operation's parent resource.",
3094 // "location": "path",
3095 // "pattern": "^projects/[^/]+/locations/[^/]+/replays/[^/]+/operations$",
3096 // "required": true,
3097 // "type": "string"
3098 // },
3099 // "pageSize": {
3100 // "description": "The standard list page size.",
3101 // "format": "int32",
3102 // "location": "query",
3103 // "type": "integer"
3104 // },
3105 // "pageToken": {
3106 // "description": "The standard list page token.",
3107 // "location": "query",
3108 // "type": "string"
3109 // }
3110 // },
3111 // "path": "v1beta1/{+name}",
3112 // "response": {
3113 // "$ref": "GoogleLongrunningListOperationsResponse"
3114 // },
3115 // "scopes": [
3116 // "https://www.googleapis.com/auth/cloud-platform"
3117 // ]
3118 // }
3119
3120 }
3121
3122 // Pages invokes f for each page of results.
3123 // A non-nil error returned from f will halt the iteration.
3124 // The provided context supersedes any context provided to the Context method.
3125 func (c *ProjectsLocationsReplaysOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
3126 c.ctx_ = ctx
3127 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3128 for {
3129 x, err := c.Do()
3130 if err != nil {
3131 return err
3132 }
3133 if err := f(x); err != nil {
3134 return err
3135 }
3136 if x.NextPageToken == "" {
3137 return nil
3138 }
3139 c.PageToken(x.NextPageToken)
3140 }
3141 }