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