1// Copyright 2020 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 firebaserules provides access to the Firebase Rules API. 8// 9// For product documentation, see: https://firebase.google.com/docs/storage/security 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/firebaserules/v1" 16// ... 17// ctx := context.Background() 18// firebaserulesService, err := firebaserules.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// firebaserulesService, err := firebaserules.NewService(ctx, option.WithScopes(firebaserules.FirebaseReadonlyScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// firebaserulesService, err := firebaserules.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// firebaserulesService, err := firebaserules.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package firebaserules // import "google.golang.org/api/firebaserules/v1" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61) 62 63// Always reference these packages, just in case the auto-generated code 64// below doesn't. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "firebaserules:v1" 79const apiName = "firebaserules" 80const apiVersion = "v1" 81const basePath = "https://firebaserules.googleapis.com/" 82const mtlsBasePath = "https://firebaserules.mtls.googleapis.com/" 83 84// OAuth2 scopes used by this API. 85const ( 86 // View and manage your data across Google Cloud Platform services 87 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 88 89 // View and administer all your Firebase data and settings 90 FirebaseScope = "https://www.googleapis.com/auth/firebase" 91 92 // View all your Firebase data and settings 93 FirebaseReadonlyScope = "https://www.googleapis.com/auth/firebase.readonly" 94) 95 96// NewService creates a new Service. 97func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 98 scopesOption := option.WithScopes( 99 "https://www.googleapis.com/auth/cloud-platform", 100 "https://www.googleapis.com/auth/firebase", 101 "https://www.googleapis.com/auth/firebase.readonly", 102 ) 103 // NOTE: prepend, so we don't override user-specified scopes. 104 opts = append([]option.ClientOption{scopesOption}, opts...) 105 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 106 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 107 client, endpoint, err := htransport.NewClient(ctx, opts...) 108 if err != nil { 109 return nil, err 110 } 111 s, err := New(client) 112 if err != nil { 113 return nil, err 114 } 115 if endpoint != "" { 116 s.BasePath = endpoint 117 } 118 return s, nil 119} 120 121// New creates a new Service. It uses the provided http.Client for requests. 122// 123// Deprecated: please use NewService instead. 124// To provide a custom HTTP client, use option.WithHTTPClient. 125// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 126func New(client *http.Client) (*Service, error) { 127 if client == nil { 128 return nil, errors.New("client is nil") 129 } 130 s := &Service{client: client, BasePath: basePath} 131 s.Projects = NewProjectsService(s) 132 return s, nil 133} 134 135type Service struct { 136 client *http.Client 137 BasePath string // API endpoint base URL 138 UserAgent string // optional additional User-Agent fragment 139 140 Projects *ProjectsService 141} 142 143func (s *Service) userAgent() string { 144 if s.UserAgent == "" { 145 return googleapi.UserAgent 146 } 147 return googleapi.UserAgent + " " + s.UserAgent 148} 149 150func NewProjectsService(s *Service) *ProjectsService { 151 rs := &ProjectsService{s: s} 152 rs.Releases = NewProjectsReleasesService(s) 153 rs.Rulesets = NewProjectsRulesetsService(s) 154 return rs 155} 156 157type ProjectsService struct { 158 s *Service 159 160 Releases *ProjectsReleasesService 161 162 Rulesets *ProjectsRulesetsService 163} 164 165func NewProjectsReleasesService(s *Service) *ProjectsReleasesService { 166 rs := &ProjectsReleasesService{s: s} 167 return rs 168} 169 170type ProjectsReleasesService struct { 171 s *Service 172} 173 174func NewProjectsRulesetsService(s *Service) *ProjectsRulesetsService { 175 rs := &ProjectsRulesetsService{s: s} 176 return rs 177} 178 179type ProjectsRulesetsService struct { 180 s *Service 181} 182 183// Arg: Arg matchers for the mock function. 184type Arg struct { 185 // AnyValue: Argument matches any value provided. 186 AnyValue *Empty `json:"anyValue,omitempty"` 187 188 // ExactValue: Argument exactly matches value provided. 189 ExactValue interface{} `json:"exactValue,omitempty"` 190 191 // ForceSendFields is a list of field names (e.g. "AnyValue") to 192 // unconditionally include in API requests. By default, fields with 193 // empty values are omitted from API requests. However, any non-pointer, 194 // non-interface field appearing in ForceSendFields will be sent to the 195 // server regardless of whether the field is empty or not. This may be 196 // used to include empty fields in Patch requests. 197 ForceSendFields []string `json:"-"` 198 199 // NullFields is a list of field names (e.g. "AnyValue") to include in 200 // API requests with the JSON null value. By default, fields with empty 201 // values are omitted from API requests. However, any field with an 202 // empty value appearing in NullFields will be sent to the server as 203 // null. It is an error if a field in this list has a non-empty value. 204 // This may be used to include null fields in Patch requests. 205 NullFields []string `json:"-"` 206} 207 208func (s *Arg) MarshalJSON() ([]byte, error) { 209 type NoMethod Arg 210 raw := NoMethod(*s) 211 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 212} 213 214// Empty: A generic empty message that you can re-use to avoid defining 215// duplicated 216// empty messages in your APIs. A typical example is to use it as the 217// request 218// or the response type of an API method. For instance: 219// 220// service Foo { 221// rpc Bar(google.protobuf.Empty) returns 222// (google.protobuf.Empty); 223// } 224// 225// The JSON representation for `Empty` is empty JSON object `{}`. 226type Empty struct { 227 // ServerResponse contains the HTTP response code and headers from the 228 // server. 229 googleapi.ServerResponse `json:"-"` 230} 231 232// ExpressionReport: Describes where in a file an expression is found 233// and what it was 234// evaluated to over the course of its use. 235type ExpressionReport struct { 236 // Children: Subexpressions 237 Children []*ExpressionReport `json:"children,omitempty"` 238 239 // SourcePosition: Position of expression in original rules source. 240 SourcePosition *SourcePosition `json:"sourcePosition,omitempty"` 241 242 // Values: Values that this expression evaluated to when encountered. 243 Values []*ValueCount `json:"values,omitempty"` 244 245 // ForceSendFields is a list of field names (e.g. "Children") to 246 // unconditionally include in API requests. By default, fields with 247 // empty values are omitted from API requests. However, any non-pointer, 248 // non-interface field appearing in ForceSendFields will be sent to the 249 // server regardless of whether the field is empty or not. This may be 250 // used to include empty fields in Patch requests. 251 ForceSendFields []string `json:"-"` 252 253 // NullFields is a list of field names (e.g. "Children") to include in 254 // API requests with the JSON null value. By default, fields with empty 255 // values are omitted from API requests. However, any field with an 256 // empty value appearing in NullFields will be sent to the server as 257 // null. It is an error if a field in this list has a non-empty value. 258 // This may be used to include null fields in Patch requests. 259 NullFields []string `json:"-"` 260} 261 262func (s *ExpressionReport) MarshalJSON() ([]byte, error) { 263 type NoMethod ExpressionReport 264 raw := NoMethod(*s) 265 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 266} 267 268// File: `File` containing source content. 269type File struct { 270 // Content: Textual Content. 271 Content string `json:"content,omitempty"` 272 273 // Fingerprint: Fingerprint (e.g. github sha) associated with the 274 // `File`. 275 Fingerprint string `json:"fingerprint,omitempty"` 276 277 // Name: File name. 278 Name string `json:"name,omitempty"` 279 280 // ForceSendFields is a list of field names (e.g. "Content") to 281 // unconditionally include in API requests. By default, fields with 282 // empty values are omitted from API requests. However, any non-pointer, 283 // non-interface field appearing in ForceSendFields will be sent to the 284 // server regardless of whether the field is empty or not. This may be 285 // used to include empty fields in Patch requests. 286 ForceSendFields []string `json:"-"` 287 288 // NullFields is a list of field names (e.g. "Content") to include in 289 // API requests with the JSON null value. By default, fields with empty 290 // values are omitted from API requests. However, any field with an 291 // empty value appearing in NullFields will be sent to the server as 292 // null. It is an error if a field in this list has a non-empty value. 293 // This may be used to include null fields in Patch requests. 294 NullFields []string `json:"-"` 295} 296 297func (s *File) MarshalJSON() ([]byte, error) { 298 type NoMethod File 299 raw := NoMethod(*s) 300 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 301} 302 303// FunctionCall: Represents a service-defined function call that was 304// invoked during test 305// execution. 306type FunctionCall struct { 307 // Args: The arguments that were provided to the function. 308 Args []interface{} `json:"args,omitempty"` 309 310 // Function: Name of the function invoked. 311 Function string `json:"function,omitempty"` 312 313 // ForceSendFields is a list of field names (e.g. "Args") to 314 // unconditionally include in API requests. By default, fields with 315 // empty values are omitted from API requests. However, any non-pointer, 316 // non-interface field appearing in ForceSendFields will be sent to the 317 // server regardless of whether the field is empty or not. This may be 318 // used to include empty fields in Patch requests. 319 ForceSendFields []string `json:"-"` 320 321 // NullFields is a list of field names (e.g. "Args") to include in API 322 // requests with the JSON null value. By default, fields with empty 323 // values are omitted from API requests. However, any field with an 324 // empty value appearing in NullFields will be sent to the server as 325 // null. It is an error if a field in this list has a non-empty value. 326 // This may be used to include null fields in Patch requests. 327 NullFields []string `json:"-"` 328} 329 330func (s *FunctionCall) MarshalJSON() ([]byte, error) { 331 type NoMethod FunctionCall 332 raw := NoMethod(*s) 333 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 334} 335 336// FunctionMock: Mock function definition. 337// 338// Mocks must refer to a function declared by the target service. The 339// type of 340// the function args and result will be inferred at test time. If either 341// the 342// arg or result values are not compatible with function type 343// declaration, the 344// request will be considered invalid. 345// 346// More than one `FunctionMock` may be provided for a given function 347// name so 348// long as the `Arg` matchers are distinct. There may be only one 349// function 350// for a given overload where all `Arg` values are `Arg.any_value`. 351type FunctionMock struct { 352 // Args: The list of `Arg` values to match. The order in which the 353 // arguments are 354 // provided is the order in which they must appear in the 355 // function 356 // invocation. 357 Args []*Arg `json:"args,omitempty"` 358 359 // Function: The name of the function. 360 // 361 // The function name must match one provided by a service declaration. 362 Function string `json:"function,omitempty"` 363 364 // Result: The mock result of the function call. 365 Result *Result `json:"result,omitempty"` 366 367 // ForceSendFields is a list of field names (e.g. "Args") to 368 // unconditionally include in API requests. By default, fields with 369 // empty values are omitted from API requests. However, any non-pointer, 370 // non-interface field appearing in ForceSendFields will be sent to the 371 // server regardless of whether the field is empty or not. This may be 372 // used to include empty fields in Patch requests. 373 ForceSendFields []string `json:"-"` 374 375 // NullFields is a list of field names (e.g. "Args") to include in API 376 // requests with the JSON null value. By default, fields with empty 377 // values are omitted from API requests. However, any field with an 378 // empty value appearing in NullFields will be sent to the server as 379 // null. It is an error if a field in this list has a non-empty value. 380 // This may be used to include null fields in Patch requests. 381 NullFields []string `json:"-"` 382} 383 384func (s *FunctionMock) MarshalJSON() ([]byte, error) { 385 type NoMethod FunctionMock 386 raw := NoMethod(*s) 387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 388} 389 390// GetReleaseExecutableResponse: The response for 391// FirebaseRulesService.GetReleaseExecutable 392type GetReleaseExecutableResponse struct { 393 // Executable: Executable view of the `Ruleset` referenced by the 394 // `Release`. 395 Executable string `json:"executable,omitempty"` 396 397 // ExecutableVersion: The Rules runtime version of the executable. 398 // 399 // Possible values: 400 // "RELEASE_EXECUTABLE_VERSION_UNSPECIFIED" - Executable format 401 // unspecified. 402 // Defaults to FIREBASE_RULES_EXECUTABLE_V1 403 // "FIREBASE_RULES_EXECUTABLE_V1" - Firebase Rules syntax 'rules2' 404 // executable versions: 405 // Custom AST for use with Java clients. 406 // "FIREBASE_RULES_EXECUTABLE_V2" - CEL-based executable for use with 407 // C++ clients. 408 ExecutableVersion string `json:"executableVersion,omitempty"` 409 410 // Language: `Language` used to generate the executable bytes. 411 // 412 // Possible values: 413 // "LANGUAGE_UNSPECIFIED" - Language unspecified. Defaults to 414 // FIREBASE_RULES. 415 // "FIREBASE_RULES" - Firebase Rules language. 416 // "EVENT_FLOW_TRIGGERS" - Event Flow triggers. 417 Language string `json:"language,omitempty"` 418 419 // RulesetName: `Ruleset` name associated with the `Release` executable. 420 RulesetName string `json:"rulesetName,omitempty"` 421 422 // SyncTime: Optional, indicates the freshness of the result. The 423 // response is 424 // guaranteed to be the latest within an interval up to the 425 // sync_time (inclusive). 426 SyncTime string `json:"syncTime,omitempty"` 427 428 // UpdateTime: Timestamp for the most recent `Release.update_time`. 429 UpdateTime string `json:"updateTime,omitempty"` 430 431 // ServerResponse contains the HTTP response code and headers from the 432 // server. 433 googleapi.ServerResponse `json:"-"` 434 435 // ForceSendFields is a list of field names (e.g. "Executable") to 436 // unconditionally include in API requests. By default, fields with 437 // empty values are omitted from API requests. However, any non-pointer, 438 // non-interface field appearing in ForceSendFields will be sent to the 439 // server regardless of whether the field is empty or not. This may be 440 // used to include empty fields in Patch requests. 441 ForceSendFields []string `json:"-"` 442 443 // NullFields is a list of field names (e.g. "Executable") to include in 444 // API requests with the JSON null value. By default, fields with empty 445 // values are omitted from API requests. However, any field with an 446 // empty value appearing in NullFields will be sent to the server as 447 // null. It is an error if a field in this list has a non-empty value. 448 // This may be used to include null fields in Patch requests. 449 NullFields []string `json:"-"` 450} 451 452func (s *GetReleaseExecutableResponse) MarshalJSON() ([]byte, error) { 453 type NoMethod GetReleaseExecutableResponse 454 raw := NoMethod(*s) 455 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 456} 457 458// Issue: Issues include warnings, errors, and deprecation notices. 459type Issue struct { 460 // Description: Short error description. 461 Description string `json:"description,omitempty"` 462 463 // Severity: The severity of the issue. 464 // 465 // Possible values: 466 // "SEVERITY_UNSPECIFIED" - An unspecified severity. 467 // "DEPRECATION" - Deprecation issue for statements and method that 468 // may no longer be 469 // supported or maintained. 470 // "WARNING" - Warnings such as: unused variables. 471 // "ERROR" - Errors such as: unmatched curly braces or variable 472 // redefinition. 473 Severity string `json:"severity,omitempty"` 474 475 // SourcePosition: Position of the issue in the `Source`. 476 SourcePosition *SourcePosition `json:"sourcePosition,omitempty"` 477 478 // ForceSendFields is a list of field names (e.g. "Description") to 479 // unconditionally include in API requests. By default, fields with 480 // empty values are omitted from API requests. However, any non-pointer, 481 // non-interface field appearing in ForceSendFields will be sent to the 482 // server regardless of whether the field is empty or not. This may be 483 // used to include empty fields in Patch requests. 484 ForceSendFields []string `json:"-"` 485 486 // NullFields is a list of field names (e.g. "Description") to include 487 // in API requests with the JSON null value. By default, fields with 488 // empty values are omitted from API requests. However, any field with 489 // an empty value appearing in NullFields will be sent to the server as 490 // null. It is an error if a field in this list has a non-empty value. 491 // This may be used to include null fields in Patch requests. 492 NullFields []string `json:"-"` 493} 494 495func (s *Issue) MarshalJSON() ([]byte, error) { 496 type NoMethod Issue 497 raw := NoMethod(*s) 498 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 499} 500 501// ListReleasesResponse: The response for 502// FirebaseRulesService.ListReleases. 503type ListReleasesResponse struct { 504 // NextPageToken: The pagination token to retrieve the next page of 505 // results. If the value is 506 // empty, no further results remain. 507 NextPageToken string `json:"nextPageToken,omitempty"` 508 509 // Releases: List of `Release` instances. 510 Releases []*Release `json:"releases,omitempty"` 511 512 // ServerResponse contains the HTTP response code and headers from the 513 // server. 514 googleapi.ServerResponse `json:"-"` 515 516 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 517 // unconditionally include in API requests. By default, fields with 518 // empty values are omitted from API requests. However, any non-pointer, 519 // non-interface field appearing in ForceSendFields will be sent to the 520 // server regardless of whether the field is empty or not. This may be 521 // used to include empty fields in Patch requests. 522 ForceSendFields []string `json:"-"` 523 524 // NullFields is a list of field names (e.g. "NextPageToken") to include 525 // in API requests with the JSON null value. By default, fields with 526 // empty values are omitted from API requests. However, any field with 527 // an empty value appearing in NullFields will be sent to the server as 528 // null. It is an error if a field in this list has a non-empty value. 529 // This may be used to include null fields in Patch requests. 530 NullFields []string `json:"-"` 531} 532 533func (s *ListReleasesResponse) MarshalJSON() ([]byte, error) { 534 type NoMethod ListReleasesResponse 535 raw := NoMethod(*s) 536 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 537} 538 539// ListRulesetsResponse: The response for 540// FirebaseRulesService.ListRulesets. 541type ListRulesetsResponse struct { 542 // NextPageToken: The pagination token to retrieve the next page of 543 // results. If the value is 544 // empty, no further results remain. 545 NextPageToken string `json:"nextPageToken,omitempty"` 546 547 // Rulesets: List of `Ruleset` instances. 548 Rulesets []*Ruleset `json:"rulesets,omitempty"` 549 550 // ServerResponse contains the HTTP response code and headers from the 551 // server. 552 googleapi.ServerResponse `json:"-"` 553 554 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 555 // unconditionally include in API requests. By default, fields with 556 // empty values are omitted from API requests. However, any non-pointer, 557 // non-interface field appearing in ForceSendFields will be sent to the 558 // server regardless of whether the field is empty or not. This may be 559 // used to include empty fields in Patch requests. 560 ForceSendFields []string `json:"-"` 561 562 // NullFields is a list of field names (e.g. "NextPageToken") to include 563 // in API requests with the JSON null value. By default, fields with 564 // empty values are omitted from API requests. However, any field with 565 // an empty value appearing in NullFields will be sent to the server as 566 // null. It is an error if a field in this list has a non-empty value. 567 // This may be used to include null fields in Patch requests. 568 NullFields []string `json:"-"` 569} 570 571func (s *ListRulesetsResponse) MarshalJSON() ([]byte, error) { 572 type NoMethod ListRulesetsResponse 573 raw := NoMethod(*s) 574 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 575} 576 577// Metadata: Metadata for a Ruleset. 578type Metadata struct { 579 // Services: Services that this ruleset has declarations for 580 // (e.g., 581 // "cloud.firestore"). There may be 0+ of these. 582 Services []string `json:"services,omitempty"` 583 584 // ForceSendFields is a list of field names (e.g. "Services") to 585 // unconditionally include in API requests. By default, fields with 586 // empty values are omitted from API requests. However, any non-pointer, 587 // non-interface field appearing in ForceSendFields will be sent to the 588 // server regardless of whether the field is empty or not. This may be 589 // used to include empty fields in Patch requests. 590 ForceSendFields []string `json:"-"` 591 592 // NullFields is a list of field names (e.g. "Services") to include in 593 // API requests with the JSON null value. By default, fields with empty 594 // values are omitted from API requests. However, any field with an 595 // empty value appearing in NullFields will be sent to the server as 596 // null. It is an error if a field in this list has a non-empty value. 597 // This may be used to include null fields in Patch requests. 598 NullFields []string `json:"-"` 599} 600 601func (s *Metadata) MarshalJSON() ([]byte, error) { 602 type NoMethod Metadata 603 raw := NoMethod(*s) 604 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 605} 606 607// Release: `Release` is a named reference to a `Ruleset`. Once a 608// `Release` refers to a 609// `Ruleset`, rules-enabled services will be able to enforce the 610// `Ruleset`. 611type Release struct { 612 // CreateTime: Time the release was created. 613 // Output only. 614 CreateTime string `json:"createTime,omitempty"` 615 616 // Name: Resource name for the `Release`. 617 // 618 // `Release` names may be structured `app1/prod/v2` or flat 619 // `app1_prod_v2` 620 // which affords developers a great deal of flexibility in mapping the 621 // name 622 // to the style that best fits their existing development practices. 623 // For 624 // example, a name could refer to an environment, an app, a version, or 625 // some 626 // combination of three. 627 // 628 // In the table below, for the project name `projects/foo`, the 629 // following 630 // relative release paths show how flat and structured names might be 631 // chosen 632 // to match a desired development / deployment strategy. 633 // 634 // Use Case | Flat Name | Structured 635 // Name 636 // -------------|---------------------|---------------- 637 // Environments 638 // | releases/qa | releases/qa 639 // Apps | releases/app1_qa | releases/app1/qa 640 // Versions | releases/app1_v2_qa | releases/app1/v2/qa 641 // 642 // The delimiter between the release name path elements can be almost 643 // anything 644 // and it should work equally well with the release name list filter, 645 // but in 646 // many ways the structured paths provide a clearer picture of 647 // the 648 // relationship between `Release` instances. 649 // 650 // Format: `projects/{project_id}/releases/{release_id}` 651 Name string `json:"name,omitempty"` 652 653 // RulesetName: Name of the `Ruleset` referred to by this `Release`. The 654 // `Ruleset` must 655 // exist the `Release` to be created. 656 RulesetName string `json:"rulesetName,omitempty"` 657 658 // UpdateTime: Time the release was updated. 659 // Output only. 660 UpdateTime string `json:"updateTime,omitempty"` 661 662 // ServerResponse contains the HTTP response code and headers from the 663 // server. 664 googleapi.ServerResponse `json:"-"` 665 666 // ForceSendFields is a list of field names (e.g. "CreateTime") to 667 // unconditionally include in API requests. By default, fields with 668 // empty values are omitted from API requests. However, any non-pointer, 669 // non-interface field appearing in ForceSendFields will be sent to the 670 // server regardless of whether the field is empty or not. This may be 671 // used to include empty fields in Patch requests. 672 ForceSendFields []string `json:"-"` 673 674 // NullFields is a list of field names (e.g. "CreateTime") to include in 675 // API requests with the JSON null value. By default, fields with empty 676 // values are omitted from API requests. However, any field with an 677 // empty value appearing in NullFields will be sent to the server as 678 // null. It is an error if a field in this list has a non-empty value. 679 // This may be used to include null fields in Patch requests. 680 NullFields []string `json:"-"` 681} 682 683func (s *Release) MarshalJSON() ([]byte, error) { 684 type NoMethod Release 685 raw := NoMethod(*s) 686 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 687} 688 689// Result: Possible result values from the function mock invocation. 690type Result struct { 691 // Undefined: The result is undefined, meaning the result could not be 692 // computed. 693 Undefined *Empty `json:"undefined,omitempty"` 694 695 // Value: The result is an actual value. The type of the value must 696 // match that 697 // of the type declared by the service. 698 Value interface{} `json:"value,omitempty"` 699 700 // ForceSendFields is a list of field names (e.g. "Undefined") to 701 // unconditionally include in API requests. By default, fields with 702 // empty values are omitted from API requests. However, any non-pointer, 703 // non-interface field appearing in ForceSendFields will be sent to the 704 // server regardless of whether the field is empty or not. This may be 705 // used to include empty fields in Patch requests. 706 ForceSendFields []string `json:"-"` 707 708 // NullFields is a list of field names (e.g. "Undefined") to include in 709 // API requests with the JSON null value. By default, fields with empty 710 // values are omitted from API requests. However, any field with an 711 // empty value appearing in NullFields will be sent to the server as 712 // null. It is an error if a field in this list has a non-empty value. 713 // This may be used to include null fields in Patch requests. 714 NullFields []string `json:"-"` 715} 716 717func (s *Result) MarshalJSON() ([]byte, error) { 718 type NoMethod Result 719 raw := NoMethod(*s) 720 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 721} 722 723// Ruleset: `Ruleset` is an immutable copy of `Source` with a globally 724// unique identifier 725// and a creation time. 726type Ruleset struct { 727 // CreateTime: Time the `Ruleset` was created. 728 // Output only. 729 CreateTime string `json:"createTime,omitempty"` 730 731 // Metadata: The metadata for this ruleset. 732 // Output only. 733 Metadata *Metadata `json:"metadata,omitempty"` 734 735 // Name: Name of the `Ruleset`. The ruleset_id is auto generated by the 736 // service. 737 // Format: `projects/{project_id}/rulesets/{ruleset_id}` 738 // Output only. 739 Name string `json:"name,omitempty"` 740 741 // Source: `Source` for the `Ruleset`. 742 Source *Source `json:"source,omitempty"` 743 744 // ServerResponse contains the HTTP response code and headers from the 745 // server. 746 googleapi.ServerResponse `json:"-"` 747 748 // ForceSendFields is a list of field names (e.g. "CreateTime") to 749 // unconditionally include in API requests. By default, fields with 750 // empty values are omitted from API requests. However, any non-pointer, 751 // non-interface field appearing in ForceSendFields will be sent to the 752 // server regardless of whether the field is empty or not. This may be 753 // used to include empty fields in Patch requests. 754 ForceSendFields []string `json:"-"` 755 756 // NullFields is a list of field names (e.g. "CreateTime") to include in 757 // API requests with the JSON null value. By default, fields with empty 758 // values are omitted from API requests. However, any field with an 759 // empty value appearing in NullFields will be sent to the server as 760 // null. It is an error if a field in this list has a non-empty value. 761 // This may be used to include null fields in Patch requests. 762 NullFields []string `json:"-"` 763} 764 765func (s *Ruleset) MarshalJSON() ([]byte, error) { 766 type NoMethod Ruleset 767 raw := NoMethod(*s) 768 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 769} 770 771// Source: `Source` is one or more `File` messages comprising a logical 772// set of rules. 773type Source struct { 774 // Files: `File` set constituting the `Source` bundle. 775 Files []*File `json:"files,omitempty"` 776 777 // ForceSendFields is a list of field names (e.g. "Files") to 778 // unconditionally include in API requests. By default, fields with 779 // empty values are omitted from API requests. However, any non-pointer, 780 // non-interface field appearing in ForceSendFields will be sent to the 781 // server regardless of whether the field is empty or not. This may be 782 // used to include empty fields in Patch requests. 783 ForceSendFields []string `json:"-"` 784 785 // NullFields is a list of field names (e.g. "Files") to include in API 786 // requests with the JSON null value. By default, fields with empty 787 // values are omitted from API requests. However, any field with an 788 // empty value appearing in NullFields will be sent to the server as 789 // null. It is an error if a field in this list has a non-empty value. 790 // This may be used to include null fields in Patch requests. 791 NullFields []string `json:"-"` 792} 793 794func (s *Source) MarshalJSON() ([]byte, error) { 795 type NoMethod Source 796 raw := NoMethod(*s) 797 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 798} 799 800// SourcePosition: Position in the `Source` content including its line, 801// column number, and an 802// index of the `File` in the `Source` message. Used for debug purposes. 803type SourcePosition struct { 804 // Column: First column on the source line associated with the source 805 // fragment. 806 Column int64 `json:"column,omitempty"` 807 808 // CurrentOffset: Start position relative to the beginning of the file. 809 CurrentOffset int64 `json:"currentOffset,omitempty"` 810 811 // EndOffset: End position relative to the beginning of the file. 812 EndOffset int64 `json:"endOffset,omitempty"` 813 814 // FileName: Name of the `File`. 815 FileName string `json:"fileName,omitempty"` 816 817 // Line: Line number of the source fragment. 1-based. 818 Line int64 `json:"line,omitempty"` 819 820 // ForceSendFields is a list of field names (e.g. "Column") to 821 // unconditionally include in API requests. By default, fields with 822 // empty values are omitted from API requests. However, any non-pointer, 823 // non-interface field appearing in ForceSendFields will be sent to the 824 // server regardless of whether the field is empty or not. This may be 825 // used to include empty fields in Patch requests. 826 ForceSendFields []string `json:"-"` 827 828 // NullFields is a list of field names (e.g. "Column") to include in API 829 // requests with the JSON null value. By default, fields with empty 830 // values are omitted from API requests. However, any field with an 831 // empty value appearing in NullFields will be sent to the server as 832 // null. It is an error if a field in this list has a non-empty value. 833 // This may be used to include null fields in Patch requests. 834 NullFields []string `json:"-"` 835} 836 837func (s *SourcePosition) MarshalJSON() ([]byte, error) { 838 type NoMethod SourcePosition 839 raw := NoMethod(*s) 840 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 841} 842 843// TestCase: `TestCase` messages provide the request context and an 844// expectation as to 845// whether the given context will be allowed or denied. Test cases may 846// specify 847// the `request`, `resource`, and `function_mocks` to mock a function 848// call to 849// a service-provided function. 850// 851// The `request` object represents context present at request-time. 852// 853// The `resource` is the value of the target resource as it appears 854// in 855// persistent storage before the request is executed. 856type TestCase struct { 857 // Expectation: Test expectation. 858 // 859 // Possible values: 860 // "EXPECTATION_UNSPECIFIED" - Unspecified expectation. 861 // "ALLOW" - Expect an allowed result. 862 // "DENY" - Expect a denied result. 863 Expectation string `json:"expectation,omitempty"` 864 865 // ExpressionReportLevel: Specifies what should be included in the 866 // response. 867 // 868 // Possible values: 869 // "LEVEL_UNSPECIFIED" - No level has been specified. Defaults to 870 // "NONE" behavior. 871 // "NONE" - Do not include any additional information. 872 // "FULL" - Include detailed reporting on expressions evaluated. 873 // "VISITED" - Only include the expressions that were visited during 874 // evaluation. 875 ExpressionReportLevel string `json:"expressionReportLevel,omitempty"` 876 877 // FunctionMocks: Optional function mocks for service-defined functions. 878 // If not set, any 879 // service defined function is expected to return an error, which may or 880 // may 881 // not influence the test outcome. 882 FunctionMocks []*FunctionMock `json:"functionMocks,omitempty"` 883 884 // PathEncoding: Specifies whether paths (such as request.path) are 885 // encoded and how. 886 // 887 // Possible values: 888 // "ENCODING_UNSPECIFIED" - No encoding has been specified. Defaults 889 // to "URL_ENCODED" behavior. 890 // "URL_ENCODED" - Treats path segments as URL encoded but with 891 // non-encoded separators 892 // ("/"). This is the default behavior. 893 // "PLAIN" - Treats total path as non-URL encoded e.g. raw. 894 PathEncoding string `json:"pathEncoding,omitempty"` 895 896 // Request: Request context. 897 // 898 // The exact format of the request context is service-dependent. See 899 // the 900 // appropriate service documentation for information about the 901 // supported 902 // fields and types on the request. Minimally, all services support 903 // the 904 // following fields and types: 905 // 906 // Request field | Type 907 // ---------------|----------------- 908 // auth.uid | `string` 909 // auth.token | `map<string, string>` 910 // headers | `map<string, string>` 911 // method | `string` 912 // params | `map<string, string>` 913 // path | `string` 914 // time | `google.protobuf.Timestamp` 915 // 916 // If the request value is not well-formed for the service, the request 917 // will 918 // be rejected as an invalid argument. 919 Request interface{} `json:"request,omitempty"` 920 921 // Resource: Optional resource value as it appears in persistent storage 922 // before the 923 // request is fulfilled. 924 // 925 // The resource type depends on the `request.path` value. 926 Resource interface{} `json:"resource,omitempty"` 927 928 // ForceSendFields is a list of field names (e.g. "Expectation") to 929 // unconditionally include in API requests. By default, fields with 930 // empty values are omitted from API requests. However, any non-pointer, 931 // non-interface field appearing in ForceSendFields will be sent to the 932 // server regardless of whether the field is empty or not. This may be 933 // used to include empty fields in Patch requests. 934 ForceSendFields []string `json:"-"` 935 936 // NullFields is a list of field names (e.g. "Expectation") to include 937 // in API requests with the JSON null value. By default, fields with 938 // empty values are omitted from API requests. However, any field with 939 // an empty value appearing in NullFields will be sent to the server as 940 // null. It is an error if a field in this list has a non-empty value. 941 // This may be used to include null fields in Patch requests. 942 NullFields []string `json:"-"` 943} 944 945func (s *TestCase) MarshalJSON() ([]byte, error) { 946 type NoMethod TestCase 947 raw := NoMethod(*s) 948 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 949} 950 951// TestResult: Test result message containing the state of the test as 952// well as a 953// description and source position for test failures. 954type TestResult struct { 955 // DebugMessages: Debug messages related to test execution issues 956 // encountered during 957 // evaluation. 958 // 959 // Debug messages may be related to too many or too few invocations 960 // of 961 // function mocks or to runtime errors that occur during 962 // evaluation. 963 // 964 // For example: ```Unable to read variable [name: "resource"]``` 965 DebugMessages []string `json:"debugMessages,omitempty"` 966 967 // ErrorPosition: Position in the `Source` or `Ruleset` where the 968 // principle runtime error 969 // occurs. 970 // 971 // Evaluation of an expression may result in an error. Rules are deny 972 // by 973 // default, so a `DENY` expectation when an error is generated is 974 // valid. 975 // When there is a `DENY` with an error, the `SourcePosition` is 976 // returned. 977 // 978 // E.g. `error_position { line: 19 column: 37 }` 979 ErrorPosition *SourcePosition `json:"errorPosition,omitempty"` 980 981 // ExpressionReports: The mapping from expression in the ruleset AST to 982 // the values they were 983 // evaluated to. Partially-nested to mirror AST structure. Note that 984 // this 985 // field is actually tracking expressions and not permission statements 986 // in 987 // contrast to the "visited_expressions" field above. Literal 988 // expressions 989 // are omitted. 990 ExpressionReports []*ExpressionReport `json:"expressionReports,omitempty"` 991 992 // FunctionCalls: The set of function calls made to service-defined 993 // methods. 994 // 995 // Function calls are included in the order in which they are 996 // encountered 997 // during evaluation, are provided for both mocked and unmocked 998 // functions, 999 // and included on the response regardless of the test `state`. 1000 FunctionCalls []*FunctionCall `json:"functionCalls,omitempty"` 1001 1002 // State: State of the test. 1003 // 1004 // Possible values: 1005 // "STATE_UNSPECIFIED" - Test state is not set. 1006 // "SUCCESS" - Test is a success. 1007 // "FAILURE" - Test is a failure. 1008 State string `json:"state,omitempty"` 1009 1010 // VisitedExpressions: The set of visited permission expressions for a 1011 // given test. This returns 1012 // the positions and evaluation results of all visited 1013 // permission 1014 // expressions which were relevant to the test case, e.g. 1015 // ``` 1016 // match /path { 1017 // allow read if: <expr> 1018 // } 1019 // ``` 1020 // For a detailed report of the intermediate evaluation states, see 1021 // the 1022 // `expression_reports` field 1023 VisitedExpressions []*VisitedExpression `json:"visitedExpressions,omitempty"` 1024 1025 // ForceSendFields is a list of field names (e.g. "DebugMessages") to 1026 // unconditionally include in API requests. By default, fields with 1027 // empty values are omitted from API requests. However, any non-pointer, 1028 // non-interface field appearing in ForceSendFields will be sent to the 1029 // server regardless of whether the field is empty or not. This may be 1030 // used to include empty fields in Patch requests. 1031 ForceSendFields []string `json:"-"` 1032 1033 // NullFields is a list of field names (e.g. "DebugMessages") to include 1034 // in API requests with the JSON null value. By default, fields with 1035 // empty values are omitted from API requests. However, any field with 1036 // an empty value appearing in NullFields will be sent to the server as 1037 // null. It is an error if a field in this list has a non-empty value. 1038 // This may be used to include null fields in Patch requests. 1039 NullFields []string `json:"-"` 1040} 1041 1042func (s *TestResult) MarshalJSON() ([]byte, error) { 1043 type NoMethod TestResult 1044 raw := NoMethod(*s) 1045 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1046} 1047 1048// TestRulesetRequest: The request for FirebaseRulesService.TestRuleset. 1049type TestRulesetRequest struct { 1050 // Source: Optional `Source` to be checked for correctness. 1051 // 1052 // This field must not be set when the resource name refers to a 1053 // `Ruleset`. 1054 Source *Source `json:"source,omitempty"` 1055 1056 // TestSuite: Inline `TestSuite` to run. 1057 TestSuite *TestSuite `json:"testSuite,omitempty"` 1058 1059 // ForceSendFields is a list of field names (e.g. "Source") to 1060 // unconditionally include in API requests. By default, fields with 1061 // empty values are omitted from API requests. However, any non-pointer, 1062 // non-interface field appearing in ForceSendFields will be sent to the 1063 // server regardless of whether the field is empty or not. This may be 1064 // used to include empty fields in Patch requests. 1065 ForceSendFields []string `json:"-"` 1066 1067 // NullFields is a list of field names (e.g. "Source") to include in API 1068 // requests with the JSON null value. By default, fields with empty 1069 // values are omitted from API requests. However, any field with an 1070 // empty value appearing in NullFields will be sent to the server as 1071 // null. It is an error if a field in this list has a non-empty value. 1072 // This may be used to include null fields in Patch requests. 1073 NullFields []string `json:"-"` 1074} 1075 1076func (s *TestRulesetRequest) MarshalJSON() ([]byte, error) { 1077 type NoMethod TestRulesetRequest 1078 raw := NoMethod(*s) 1079 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1080} 1081 1082// TestRulesetResponse: The response for 1083// FirebaseRulesService.TestRuleset. 1084type TestRulesetResponse struct { 1085 // Issues: Syntactic and semantic `Source` issues of varying severity. 1086 // Issues of 1087 // `ERROR` severity will prevent tests from executing. 1088 Issues []*Issue `json:"issues,omitempty"` 1089 1090 // TestResults: The set of test results given the test cases in the 1091 // `TestSuite`. 1092 // The results will appear in the same order as the test cases appear in 1093 // the 1094 // `TestSuite`. 1095 TestResults []*TestResult `json:"testResults,omitempty"` 1096 1097 // ServerResponse contains the HTTP response code and headers from the 1098 // server. 1099 googleapi.ServerResponse `json:"-"` 1100 1101 // ForceSendFields is a list of field names (e.g. "Issues") to 1102 // unconditionally include in API requests. By default, fields with 1103 // empty values are omitted from API requests. However, any non-pointer, 1104 // non-interface field appearing in ForceSendFields will be sent to the 1105 // server regardless of whether the field is empty or not. This may be 1106 // used to include empty fields in Patch requests. 1107 ForceSendFields []string `json:"-"` 1108 1109 // NullFields is a list of field names (e.g. "Issues") to include in API 1110 // requests with the JSON null value. By default, fields with empty 1111 // values are omitted from API requests. However, any field with an 1112 // empty value appearing in NullFields will be sent to the server as 1113 // null. It is an error if a field in this list has a non-empty value. 1114 // This may be used to include null fields in Patch requests. 1115 NullFields []string `json:"-"` 1116} 1117 1118func (s *TestRulesetResponse) MarshalJSON() ([]byte, error) { 1119 type NoMethod TestRulesetResponse 1120 raw := NoMethod(*s) 1121 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1122} 1123 1124// TestSuite: `TestSuite` is a collection of `TestCase` instances that 1125// validate the logical 1126// correctness of a `Ruleset`. The `TestSuite` may be referenced in-line 1127// within 1128// a `TestRuleset` invocation or as part of a `Release` object as a 1129// pre-release 1130// check. 1131type TestSuite struct { 1132 // TestCases: Collection of test cases associated with the `TestSuite`. 1133 TestCases []*TestCase `json:"testCases,omitempty"` 1134 1135 // ForceSendFields is a list of field names (e.g. "TestCases") to 1136 // unconditionally include in API requests. By default, fields with 1137 // empty values are omitted from API requests. However, any non-pointer, 1138 // non-interface field appearing in ForceSendFields will be sent to the 1139 // server regardless of whether the field is empty or not. This may be 1140 // used to include empty fields in Patch requests. 1141 ForceSendFields []string `json:"-"` 1142 1143 // NullFields is a list of field names (e.g. "TestCases") to include in 1144 // API requests with the JSON null value. By default, fields with empty 1145 // values are omitted from API requests. However, any field with an 1146 // empty value appearing in NullFields will be sent to the server as 1147 // null. It is an error if a field in this list has a non-empty value. 1148 // This may be used to include null fields in Patch requests. 1149 NullFields []string `json:"-"` 1150} 1151 1152func (s *TestSuite) MarshalJSON() ([]byte, error) { 1153 type NoMethod TestSuite 1154 raw := NoMethod(*s) 1155 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1156} 1157 1158// UpdateReleaseRequest: The request for 1159// FirebaseRulesService.UpdateReleasePatch. 1160type UpdateReleaseRequest struct { 1161 // Release: `Release` to update. 1162 Release *Release `json:"release,omitempty"` 1163 1164 // UpdateMask: Specifies which fields to update. 1165 UpdateMask string `json:"updateMask,omitempty"` 1166 1167 // ForceSendFields is a list of field names (e.g. "Release") to 1168 // unconditionally include in API requests. By default, fields with 1169 // empty values are omitted from API requests. However, any non-pointer, 1170 // non-interface field appearing in ForceSendFields will be sent to the 1171 // server regardless of whether the field is empty or not. This may be 1172 // used to include empty fields in Patch requests. 1173 ForceSendFields []string `json:"-"` 1174 1175 // NullFields is a list of field names (e.g. "Release") to include in 1176 // API requests with the JSON null value. By default, fields with empty 1177 // values are omitted from API requests. However, any field with an 1178 // empty value appearing in NullFields will be sent to the server as 1179 // null. It is an error if a field in this list has a non-empty value. 1180 // This may be used to include null fields in Patch requests. 1181 NullFields []string `json:"-"` 1182} 1183 1184func (s *UpdateReleaseRequest) MarshalJSON() ([]byte, error) { 1185 type NoMethod UpdateReleaseRequest 1186 raw := NoMethod(*s) 1187 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1188} 1189 1190// ValueCount: Tuple for how many times an Expression was evaluated to a 1191// particular 1192// ExpressionValue. 1193type ValueCount struct { 1194 // Count: The amount of times that expression returned. 1195 Count int64 `json:"count,omitempty"` 1196 1197 // Value: The return value of the expression 1198 Value interface{} `json:"value,omitempty"` 1199 1200 // ForceSendFields is a list of field names (e.g. "Count") to 1201 // unconditionally include in API requests. By default, fields with 1202 // empty values are omitted from API requests. However, any non-pointer, 1203 // non-interface field appearing in ForceSendFields will be sent to the 1204 // server regardless of whether the field is empty or not. This may be 1205 // used to include empty fields in Patch requests. 1206 ForceSendFields []string `json:"-"` 1207 1208 // NullFields is a list of field names (e.g. "Count") to include in API 1209 // requests with the JSON null value. By default, fields with empty 1210 // values are omitted from API requests. However, any field with an 1211 // empty value appearing in NullFields will be sent to the server as 1212 // null. It is an error if a field in this list has a non-empty value. 1213 // This may be used to include null fields in Patch requests. 1214 NullFields []string `json:"-"` 1215} 1216 1217func (s *ValueCount) MarshalJSON() ([]byte, error) { 1218 type NoMethod ValueCount 1219 raw := NoMethod(*s) 1220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1221} 1222 1223// VisitedExpression: Store the position and access outcome for an 1224// expression visited in rules. 1225type VisitedExpression struct { 1226 // SourcePosition: Position in the `Source` or `Ruleset` where an 1227 // expression was visited. 1228 SourcePosition *SourcePosition `json:"sourcePosition,omitempty"` 1229 1230 // Value: The evaluated value for the visited expression, e.g. 1231 // true/false 1232 Value interface{} `json:"value,omitempty"` 1233 1234 // ForceSendFields is a list of field names (e.g. "SourcePosition") to 1235 // unconditionally include in API requests. By default, fields with 1236 // empty values are omitted from API requests. However, any non-pointer, 1237 // non-interface field appearing in ForceSendFields will be sent to the 1238 // server regardless of whether the field is empty or not. This may be 1239 // used to include empty fields in Patch requests. 1240 ForceSendFields []string `json:"-"` 1241 1242 // NullFields is a list of field names (e.g. "SourcePosition") to 1243 // include in API requests with the JSON null value. By default, fields 1244 // with empty values are omitted from API requests. However, any field 1245 // with an empty value appearing in NullFields will be sent to the 1246 // server as null. It is an error if a field in this list has a 1247 // non-empty value. This may be used to include null fields in Patch 1248 // requests. 1249 NullFields []string `json:"-"` 1250} 1251 1252func (s *VisitedExpression) MarshalJSON() ([]byte, error) { 1253 type NoMethod VisitedExpression 1254 raw := NoMethod(*s) 1255 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1256} 1257 1258// method id "firebaserules.projects.test": 1259 1260type ProjectsTestCall struct { 1261 s *Service 1262 name string 1263 testrulesetrequest *TestRulesetRequest 1264 urlParams_ gensupport.URLParams 1265 ctx_ context.Context 1266 header_ http.Header 1267} 1268 1269// Test: Test `Source` for syntactic and semantic correctness. Issues 1270// present, if 1271// any, will be returned to the caller with a description, severity, 1272// and 1273// source location. 1274// 1275// The test method may be executed with `Source` or a `Ruleset` 1276// name. 1277// Passing `Source` is useful for unit testing new rules. Passing a 1278// `Ruleset` 1279// name is useful for regression testing an existing rule. 1280// 1281// The following is an example of `Source` that permits users to upload 1282// images 1283// to a bucket bearing their user id and matching the correct 1284// metadata: 1285// 1286// _*Example*_ 1287// 1288// // Users are allowed to subscribe and unsubscribe to the blog. 1289// service firebase.storage { 1290// match /users/{userId}/images/{imageName} { 1291// allow write: if userId == request.auth.uid 1292// && (imageName.matches('*.png$') 1293// || imageName.matches('*.jpg$')) 1294// && resource.mimeType.matches('^image/') 1295// } 1296// } 1297func (r *ProjectsService) Test(name string, testrulesetrequest *TestRulesetRequest) *ProjectsTestCall { 1298 c := &ProjectsTestCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1299 c.name = name 1300 c.testrulesetrequest = testrulesetrequest 1301 return c 1302} 1303 1304// Fields allows partial responses to be retrieved. See 1305// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1306// for more information. 1307func (c *ProjectsTestCall) Fields(s ...googleapi.Field) *ProjectsTestCall { 1308 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1309 return c 1310} 1311 1312// Context sets the context to be used in this call's Do method. Any 1313// pending HTTP request will be aborted if the provided context is 1314// canceled. 1315func (c *ProjectsTestCall) Context(ctx context.Context) *ProjectsTestCall { 1316 c.ctx_ = ctx 1317 return c 1318} 1319 1320// Header returns an http.Header that can be modified by the caller to 1321// add HTTP headers to the request. 1322func (c *ProjectsTestCall) Header() http.Header { 1323 if c.header_ == nil { 1324 c.header_ = make(http.Header) 1325 } 1326 return c.header_ 1327} 1328 1329func (c *ProjectsTestCall) doRequest(alt string) (*http.Response, error) { 1330 reqHeaders := make(http.Header) 1331 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 1332 for k, v := range c.header_ { 1333 reqHeaders[k] = v 1334 } 1335 reqHeaders.Set("User-Agent", c.s.userAgent()) 1336 var body io.Reader = nil 1337 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testrulesetrequest) 1338 if err != nil { 1339 return nil, err 1340 } 1341 reqHeaders.Set("Content-Type", "application/json") 1342 c.urlParams_.Set("alt", alt) 1343 c.urlParams_.Set("prettyPrint", "false") 1344 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:test") 1345 urls += "?" + c.urlParams_.Encode() 1346 req, err := http.NewRequest("POST", urls, body) 1347 if err != nil { 1348 return nil, err 1349 } 1350 req.Header = reqHeaders 1351 googleapi.Expand(req.URL, map[string]string{ 1352 "name": c.name, 1353 }) 1354 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1355} 1356 1357// Do executes the "firebaserules.projects.test" call. 1358// Exactly one of *TestRulesetResponse or error will be non-nil. Any 1359// non-2xx status code is an error. Response headers are in either 1360// *TestRulesetResponse.ServerResponse.Header or (if a response was 1361// returned at all) in error.(*googleapi.Error).Header. Use 1362// googleapi.IsNotModified to check whether the returned error was 1363// because http.StatusNotModified was returned. 1364func (c *ProjectsTestCall) Do(opts ...googleapi.CallOption) (*TestRulesetResponse, error) { 1365 gensupport.SetOptions(c.urlParams_, opts...) 1366 res, err := c.doRequest("json") 1367 if res != nil && res.StatusCode == http.StatusNotModified { 1368 if res.Body != nil { 1369 res.Body.Close() 1370 } 1371 return nil, &googleapi.Error{ 1372 Code: res.StatusCode, 1373 Header: res.Header, 1374 } 1375 } 1376 if err != nil { 1377 return nil, err 1378 } 1379 defer googleapi.CloseBody(res) 1380 if err := googleapi.CheckResponse(res); err != nil { 1381 return nil, err 1382 } 1383 ret := &TestRulesetResponse{ 1384 ServerResponse: googleapi.ServerResponse{ 1385 Header: res.Header, 1386 HTTPStatusCode: res.StatusCode, 1387 }, 1388 } 1389 target := &ret 1390 if err := gensupport.DecodeResponse(target, res); err != nil { 1391 return nil, err 1392 } 1393 return ret, nil 1394 // { 1395 // "description": "Test `Source` for syntactic and semantic correctness. Issues present, if\nany, will be returned to the caller with a description, severity, and\nsource location.\n\nThe test method may be executed with `Source` or a `Ruleset` name.\nPassing `Source` is useful for unit testing new rules. Passing a `Ruleset`\nname is useful for regression testing an existing rule.\n\nThe following is an example of `Source` that permits users to upload images\nto a bucket bearing their user id and matching the correct metadata:\n\n_*Example*_\n\n // Users are allowed to subscribe and unsubscribe to the blog.\n service firebase.storage {\n match /users/{userId}/images/{imageName} {\n allow write: if userId == request.auth.uid\n \u0026\u0026 (imageName.matches('*.png$')\n || imageName.matches('*.jpg$'))\n \u0026\u0026 resource.mimeType.matches('^image/')\n }\n }", 1396 // "flatPath": "v1/projects/{projectsId}:test", 1397 // "httpMethod": "POST", 1398 // "id": "firebaserules.projects.test", 1399 // "parameterOrder": [ 1400 // "name" 1401 // ], 1402 // "parameters": { 1403 // "name": { 1404 // "description": "Tests may either provide `source` or a `Ruleset` resource name.\n\nFor tests against `source`, the resource name must refer to the project:\nFormat: `projects/{project_id}`\n\nFor tests against a `Ruleset`, this must be the `Ruleset` resource name:\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", 1405 // "location": "path", 1406 // "pattern": "^projects/.*$", 1407 // "required": true, 1408 // "type": "string" 1409 // } 1410 // }, 1411 // "path": "v1/{+name}:test", 1412 // "request": { 1413 // "$ref": "TestRulesetRequest" 1414 // }, 1415 // "response": { 1416 // "$ref": "TestRulesetResponse" 1417 // }, 1418 // "scopes": [ 1419 // "https://www.googleapis.com/auth/cloud-platform", 1420 // "https://www.googleapis.com/auth/firebase", 1421 // "https://www.googleapis.com/auth/firebase.readonly" 1422 // ] 1423 // } 1424 1425} 1426 1427// method id "firebaserules.projects.releases.create": 1428 1429type ProjectsReleasesCreateCall struct { 1430 s *Service 1431 name string 1432 release *Release 1433 urlParams_ gensupport.URLParams 1434 ctx_ context.Context 1435 header_ http.Header 1436} 1437 1438// Create: Create a `Release`. 1439// 1440// Release names should reflect the developer's deployment practices. 1441// For 1442// example, the release name may include the environment name, 1443// application 1444// name, application version, or any other name meaningful to the 1445// developer. 1446// Once a `Release` refers to a `Ruleset`, the rules can be enforced 1447// by 1448// Firebase Rules-enabled services. 1449// 1450// More than one `Release` may be 'live' concurrently. Consider the 1451// following 1452// three `Release` names for `projects/foo` and the `Ruleset` to which 1453// they 1454// refer. 1455// 1456// Release Name | Ruleset 1457// Name 1458// --------------------------------|------------- 1459// projects/foo/relea 1460// ses/prod | 1461// projects/foo/rulesets/uuid123 1462// projects/foo/releases/prod/beta | 1463// projects/foo/rulesets/uuid123 1464// projects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456 1465// 1466// The table reflects the `Ruleset` rollout in progress. The `prod` 1467// and 1468// `prod/beta` releases refer to the same `Ruleset`. However, 1469// `prod/v23` 1470// refers to a new `Ruleset`. The `Ruleset` reference for a `Release` 1471// may be 1472// updated using the UpdateRelease method. 1473func (r *ProjectsReleasesService) Create(name string, release *Release) *ProjectsReleasesCreateCall { 1474 c := &ProjectsReleasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1475 c.name = name 1476 c.release = release 1477 return c 1478} 1479 1480// Fields allows partial responses to be retrieved. See 1481// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1482// for more information. 1483func (c *ProjectsReleasesCreateCall) Fields(s ...googleapi.Field) *ProjectsReleasesCreateCall { 1484 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1485 return c 1486} 1487 1488// Context sets the context to be used in this call's Do method. Any 1489// pending HTTP request will be aborted if the provided context is 1490// canceled. 1491func (c *ProjectsReleasesCreateCall) Context(ctx context.Context) *ProjectsReleasesCreateCall { 1492 c.ctx_ = ctx 1493 return c 1494} 1495 1496// Header returns an http.Header that can be modified by the caller to 1497// add HTTP headers to the request. 1498func (c *ProjectsReleasesCreateCall) Header() http.Header { 1499 if c.header_ == nil { 1500 c.header_ = make(http.Header) 1501 } 1502 return c.header_ 1503} 1504 1505func (c *ProjectsReleasesCreateCall) doRequest(alt string) (*http.Response, error) { 1506 reqHeaders := make(http.Header) 1507 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 1508 for k, v := range c.header_ { 1509 reqHeaders[k] = v 1510 } 1511 reqHeaders.Set("User-Agent", c.s.userAgent()) 1512 var body io.Reader = nil 1513 body, err := googleapi.WithoutDataWrapper.JSONReader(c.release) 1514 if err != nil { 1515 return nil, err 1516 } 1517 reqHeaders.Set("Content-Type", "application/json") 1518 c.urlParams_.Set("alt", alt) 1519 c.urlParams_.Set("prettyPrint", "false") 1520 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/releases") 1521 urls += "?" + c.urlParams_.Encode() 1522 req, err := http.NewRequest("POST", urls, body) 1523 if err != nil { 1524 return nil, err 1525 } 1526 req.Header = reqHeaders 1527 googleapi.Expand(req.URL, map[string]string{ 1528 "name": c.name, 1529 }) 1530 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1531} 1532 1533// Do executes the "firebaserules.projects.releases.create" call. 1534// Exactly one of *Release or error will be non-nil. Any non-2xx status 1535// code is an error. Response headers are in either 1536// *Release.ServerResponse.Header or (if a response was returned at all) 1537// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1538// check whether the returned error was because http.StatusNotModified 1539// was returned. 1540func (c *ProjectsReleasesCreateCall) Do(opts ...googleapi.CallOption) (*Release, error) { 1541 gensupport.SetOptions(c.urlParams_, opts...) 1542 res, err := c.doRequest("json") 1543 if res != nil && res.StatusCode == http.StatusNotModified { 1544 if res.Body != nil { 1545 res.Body.Close() 1546 } 1547 return nil, &googleapi.Error{ 1548 Code: res.StatusCode, 1549 Header: res.Header, 1550 } 1551 } 1552 if err != nil { 1553 return nil, err 1554 } 1555 defer googleapi.CloseBody(res) 1556 if err := googleapi.CheckResponse(res); err != nil { 1557 return nil, err 1558 } 1559 ret := &Release{ 1560 ServerResponse: googleapi.ServerResponse{ 1561 Header: res.Header, 1562 HTTPStatusCode: res.StatusCode, 1563 }, 1564 } 1565 target := &ret 1566 if err := gensupport.DecodeResponse(target, res); err != nil { 1567 return nil, err 1568 } 1569 return ret, nil 1570 // { 1571 // "description": "Create a `Release`.\n\nRelease names should reflect the developer's deployment practices. For\nexample, the release name may include the environment name, application\nname, application version, or any other name meaningful to the developer.\nOnce a `Release` refers to a `Ruleset`, the rules can be enforced by\nFirebase Rules-enabled services.\n\nMore than one `Release` may be 'live' concurrently. Consider the following\nthree `Release` names for `projects/foo` and the `Ruleset` to which they\nrefer.\n\nRelease Name | Ruleset Name\n--------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/uuid123\nprojects/foo/releases/prod/beta | projects/foo/rulesets/uuid123\nprojects/foo/releases/prod/v23 | projects/foo/rulesets/uuid456\n\nThe table reflects the `Ruleset` rollout in progress. The `prod` and\n`prod/beta` releases refer to the same `Ruleset`. However, `prod/v23`\nrefers to a new `Ruleset`. The `Ruleset` reference for a `Release` may be\nupdated using the UpdateRelease method.", 1572 // "flatPath": "v1/projects/{projectsId}/releases", 1573 // "httpMethod": "POST", 1574 // "id": "firebaserules.projects.releases.create", 1575 // "parameterOrder": [ 1576 // "name" 1577 // ], 1578 // "parameters": { 1579 // "name": { 1580 // "description": "Resource name for the project which owns this `Release`.\n\nFormat: `projects/{project_id}`", 1581 // "location": "path", 1582 // "pattern": "^projects/[^/]+$", 1583 // "required": true, 1584 // "type": "string" 1585 // } 1586 // }, 1587 // "path": "v1/{+name}/releases", 1588 // "request": { 1589 // "$ref": "Release" 1590 // }, 1591 // "response": { 1592 // "$ref": "Release" 1593 // }, 1594 // "scopes": [ 1595 // "https://www.googleapis.com/auth/cloud-platform", 1596 // "https://www.googleapis.com/auth/firebase" 1597 // ] 1598 // } 1599 1600} 1601 1602// method id "firebaserules.projects.releases.delete": 1603 1604type ProjectsReleasesDeleteCall struct { 1605 s *Service 1606 name string 1607 urlParams_ gensupport.URLParams 1608 ctx_ context.Context 1609 header_ http.Header 1610} 1611 1612// Delete: Delete a `Release` by resource name. 1613func (r *ProjectsReleasesService) Delete(name string) *ProjectsReleasesDeleteCall { 1614 c := &ProjectsReleasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1615 c.name = name 1616 return c 1617} 1618 1619// Fields allows partial responses to be retrieved. See 1620// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1621// for more information. 1622func (c *ProjectsReleasesDeleteCall) Fields(s ...googleapi.Field) *ProjectsReleasesDeleteCall { 1623 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1624 return c 1625} 1626 1627// Context sets the context to be used in this call's Do method. Any 1628// pending HTTP request will be aborted if the provided context is 1629// canceled. 1630func (c *ProjectsReleasesDeleteCall) Context(ctx context.Context) *ProjectsReleasesDeleteCall { 1631 c.ctx_ = ctx 1632 return c 1633} 1634 1635// Header returns an http.Header that can be modified by the caller to 1636// add HTTP headers to the request. 1637func (c *ProjectsReleasesDeleteCall) Header() http.Header { 1638 if c.header_ == nil { 1639 c.header_ = make(http.Header) 1640 } 1641 return c.header_ 1642} 1643 1644func (c *ProjectsReleasesDeleteCall) doRequest(alt string) (*http.Response, error) { 1645 reqHeaders := make(http.Header) 1646 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 1647 for k, v := range c.header_ { 1648 reqHeaders[k] = v 1649 } 1650 reqHeaders.Set("User-Agent", c.s.userAgent()) 1651 var body io.Reader = nil 1652 c.urlParams_.Set("alt", alt) 1653 c.urlParams_.Set("prettyPrint", "false") 1654 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1655 urls += "?" + c.urlParams_.Encode() 1656 req, err := http.NewRequest("DELETE", urls, body) 1657 if err != nil { 1658 return nil, err 1659 } 1660 req.Header = reqHeaders 1661 googleapi.Expand(req.URL, map[string]string{ 1662 "name": c.name, 1663 }) 1664 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1665} 1666 1667// Do executes the "firebaserules.projects.releases.delete" call. 1668// Exactly one of *Empty or error will be non-nil. Any non-2xx status 1669// code is an error. Response headers are in either 1670// *Empty.ServerResponse.Header or (if a response was returned at all) 1671// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1672// check whether the returned error was because http.StatusNotModified 1673// was returned. 1674func (c *ProjectsReleasesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 1675 gensupport.SetOptions(c.urlParams_, opts...) 1676 res, err := c.doRequest("json") 1677 if res != nil && res.StatusCode == http.StatusNotModified { 1678 if res.Body != nil { 1679 res.Body.Close() 1680 } 1681 return nil, &googleapi.Error{ 1682 Code: res.StatusCode, 1683 Header: res.Header, 1684 } 1685 } 1686 if err != nil { 1687 return nil, err 1688 } 1689 defer googleapi.CloseBody(res) 1690 if err := googleapi.CheckResponse(res); err != nil { 1691 return nil, err 1692 } 1693 ret := &Empty{ 1694 ServerResponse: googleapi.ServerResponse{ 1695 Header: res.Header, 1696 HTTPStatusCode: res.StatusCode, 1697 }, 1698 } 1699 target := &ret 1700 if err := gensupport.DecodeResponse(target, res); err != nil { 1701 return nil, err 1702 } 1703 return ret, nil 1704 // { 1705 // "description": "Delete a `Release` by resource name.", 1706 // "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", 1707 // "httpMethod": "DELETE", 1708 // "id": "firebaserules.projects.releases.delete", 1709 // "parameterOrder": [ 1710 // "name" 1711 // ], 1712 // "parameters": { 1713 // "name": { 1714 // "description": "Resource name for the `Release` to delete.\n\nFormat: `projects/{project_id}/releases/{release_id}`", 1715 // "location": "path", 1716 // "pattern": "^projects/[^/]+/releases/.*$", 1717 // "required": true, 1718 // "type": "string" 1719 // } 1720 // }, 1721 // "path": "v1/{+name}", 1722 // "response": { 1723 // "$ref": "Empty" 1724 // }, 1725 // "scopes": [ 1726 // "https://www.googleapis.com/auth/cloud-platform", 1727 // "https://www.googleapis.com/auth/firebase" 1728 // ] 1729 // } 1730 1731} 1732 1733// method id "firebaserules.projects.releases.get": 1734 1735type ProjectsReleasesGetCall struct { 1736 s *Service 1737 name string 1738 urlParams_ gensupport.URLParams 1739 ifNoneMatch_ string 1740 ctx_ context.Context 1741 header_ http.Header 1742} 1743 1744// Get: Get a `Release` by name. 1745func (r *ProjectsReleasesService) Get(name string) *ProjectsReleasesGetCall { 1746 c := &ProjectsReleasesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1747 c.name = name 1748 return c 1749} 1750 1751// Fields allows partial responses to be retrieved. See 1752// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1753// for more information. 1754func (c *ProjectsReleasesGetCall) Fields(s ...googleapi.Field) *ProjectsReleasesGetCall { 1755 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1756 return c 1757} 1758 1759// IfNoneMatch sets the optional parameter which makes the operation 1760// fail if the object's ETag matches the given value. This is useful for 1761// getting updates only after the object has changed since the last 1762// request. Use googleapi.IsNotModified to check whether the response 1763// error from Do is the result of In-None-Match. 1764func (c *ProjectsReleasesGetCall) IfNoneMatch(entityTag string) *ProjectsReleasesGetCall { 1765 c.ifNoneMatch_ = entityTag 1766 return c 1767} 1768 1769// Context sets the context to be used in this call's Do method. Any 1770// pending HTTP request will be aborted if the provided context is 1771// canceled. 1772func (c *ProjectsReleasesGetCall) Context(ctx context.Context) *ProjectsReleasesGetCall { 1773 c.ctx_ = ctx 1774 return c 1775} 1776 1777// Header returns an http.Header that can be modified by the caller to 1778// add HTTP headers to the request. 1779func (c *ProjectsReleasesGetCall) Header() http.Header { 1780 if c.header_ == nil { 1781 c.header_ = make(http.Header) 1782 } 1783 return c.header_ 1784} 1785 1786func (c *ProjectsReleasesGetCall) doRequest(alt string) (*http.Response, error) { 1787 reqHeaders := make(http.Header) 1788 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 1789 for k, v := range c.header_ { 1790 reqHeaders[k] = v 1791 } 1792 reqHeaders.Set("User-Agent", c.s.userAgent()) 1793 if c.ifNoneMatch_ != "" { 1794 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1795 } 1796 var body io.Reader = nil 1797 c.urlParams_.Set("alt", alt) 1798 c.urlParams_.Set("prettyPrint", "false") 1799 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 1800 urls += "?" + c.urlParams_.Encode() 1801 req, err := http.NewRequest("GET", urls, body) 1802 if err != nil { 1803 return nil, err 1804 } 1805 req.Header = reqHeaders 1806 googleapi.Expand(req.URL, map[string]string{ 1807 "name": c.name, 1808 }) 1809 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1810} 1811 1812// Do executes the "firebaserules.projects.releases.get" call. 1813// Exactly one of *Release or error will be non-nil. Any non-2xx status 1814// code is an error. Response headers are in either 1815// *Release.ServerResponse.Header or (if a response was returned at all) 1816// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1817// check whether the returned error was because http.StatusNotModified 1818// was returned. 1819func (c *ProjectsReleasesGetCall) Do(opts ...googleapi.CallOption) (*Release, error) { 1820 gensupport.SetOptions(c.urlParams_, opts...) 1821 res, err := c.doRequest("json") 1822 if res != nil && res.StatusCode == http.StatusNotModified { 1823 if res.Body != nil { 1824 res.Body.Close() 1825 } 1826 return nil, &googleapi.Error{ 1827 Code: res.StatusCode, 1828 Header: res.Header, 1829 } 1830 } 1831 if err != nil { 1832 return nil, err 1833 } 1834 defer googleapi.CloseBody(res) 1835 if err := googleapi.CheckResponse(res); err != nil { 1836 return nil, err 1837 } 1838 ret := &Release{ 1839 ServerResponse: googleapi.ServerResponse{ 1840 Header: res.Header, 1841 HTTPStatusCode: res.StatusCode, 1842 }, 1843 } 1844 target := &ret 1845 if err := gensupport.DecodeResponse(target, res); err != nil { 1846 return nil, err 1847 } 1848 return ret, nil 1849 // { 1850 // "description": "Get a `Release` by name.", 1851 // "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", 1852 // "httpMethod": "GET", 1853 // "id": "firebaserules.projects.releases.get", 1854 // "parameterOrder": [ 1855 // "name" 1856 // ], 1857 // "parameters": { 1858 // "name": { 1859 // "description": "Resource name of the `Release`.\n\nFormat: `projects/{project_id}/releases/{release_id}`", 1860 // "location": "path", 1861 // "pattern": "^projects/[^/]+/releases/.*$", 1862 // "required": true, 1863 // "type": "string" 1864 // } 1865 // }, 1866 // "path": "v1/{+name}", 1867 // "response": { 1868 // "$ref": "Release" 1869 // }, 1870 // "scopes": [ 1871 // "https://www.googleapis.com/auth/cloud-platform", 1872 // "https://www.googleapis.com/auth/firebase", 1873 // "https://www.googleapis.com/auth/firebase.readonly" 1874 // ] 1875 // } 1876 1877} 1878 1879// method id "firebaserules.projects.releases.getExecutable": 1880 1881type ProjectsReleasesGetExecutableCall struct { 1882 s *Service 1883 name string 1884 urlParams_ gensupport.URLParams 1885 ifNoneMatch_ string 1886 ctx_ context.Context 1887 header_ http.Header 1888} 1889 1890// GetExecutable: Get the `Release` executable to use when enforcing 1891// rules. 1892func (r *ProjectsReleasesService) GetExecutable(name string) *ProjectsReleasesGetExecutableCall { 1893 c := &ProjectsReleasesGetExecutableCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1894 c.name = name 1895 return c 1896} 1897 1898// ExecutableVersion sets the optional parameter "executableVersion": 1899// The requested runtime executable version. 1900// Defaults to FIREBASE_RULES_EXECUTABLE_V1. 1901// 1902// Possible values: 1903// "RELEASE_EXECUTABLE_VERSION_UNSPECIFIED" 1904// "FIREBASE_RULES_EXECUTABLE_V1" 1905// "FIREBASE_RULES_EXECUTABLE_V2" 1906func (c *ProjectsReleasesGetExecutableCall) ExecutableVersion(executableVersion string) *ProjectsReleasesGetExecutableCall { 1907 c.urlParams_.Set("executableVersion", executableVersion) 1908 return c 1909} 1910 1911// Fields allows partial responses to be retrieved. See 1912// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1913// for more information. 1914func (c *ProjectsReleasesGetExecutableCall) Fields(s ...googleapi.Field) *ProjectsReleasesGetExecutableCall { 1915 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1916 return c 1917} 1918 1919// IfNoneMatch sets the optional parameter which makes the operation 1920// fail if the object's ETag matches the given value. This is useful for 1921// getting updates only after the object has changed since the last 1922// request. Use googleapi.IsNotModified to check whether the response 1923// error from Do is the result of In-None-Match. 1924func (c *ProjectsReleasesGetExecutableCall) IfNoneMatch(entityTag string) *ProjectsReleasesGetExecutableCall { 1925 c.ifNoneMatch_ = entityTag 1926 return c 1927} 1928 1929// Context sets the context to be used in this call's Do method. Any 1930// pending HTTP request will be aborted if the provided context is 1931// canceled. 1932func (c *ProjectsReleasesGetExecutableCall) Context(ctx context.Context) *ProjectsReleasesGetExecutableCall { 1933 c.ctx_ = ctx 1934 return c 1935} 1936 1937// Header returns an http.Header that can be modified by the caller to 1938// add HTTP headers to the request. 1939func (c *ProjectsReleasesGetExecutableCall) Header() http.Header { 1940 if c.header_ == nil { 1941 c.header_ = make(http.Header) 1942 } 1943 return c.header_ 1944} 1945 1946func (c *ProjectsReleasesGetExecutableCall) doRequest(alt string) (*http.Response, error) { 1947 reqHeaders := make(http.Header) 1948 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 1949 for k, v := range c.header_ { 1950 reqHeaders[k] = v 1951 } 1952 reqHeaders.Set("User-Agent", c.s.userAgent()) 1953 if c.ifNoneMatch_ != "" { 1954 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1955 } 1956 var body io.Reader = nil 1957 c.urlParams_.Set("alt", alt) 1958 c.urlParams_.Set("prettyPrint", "false") 1959 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:getExecutable") 1960 urls += "?" + c.urlParams_.Encode() 1961 req, err := http.NewRequest("GET", urls, body) 1962 if err != nil { 1963 return nil, err 1964 } 1965 req.Header = reqHeaders 1966 googleapi.Expand(req.URL, map[string]string{ 1967 "name": c.name, 1968 }) 1969 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1970} 1971 1972// Do executes the "firebaserules.projects.releases.getExecutable" call. 1973// Exactly one of *GetReleaseExecutableResponse or error will be 1974// non-nil. Any non-2xx status code is an error. Response headers are in 1975// either *GetReleaseExecutableResponse.ServerResponse.Header or (if a 1976// response was returned at all) in error.(*googleapi.Error).Header. Use 1977// googleapi.IsNotModified to check whether the returned error was 1978// because http.StatusNotModified was returned. 1979func (c *ProjectsReleasesGetExecutableCall) Do(opts ...googleapi.CallOption) (*GetReleaseExecutableResponse, error) { 1980 gensupport.SetOptions(c.urlParams_, opts...) 1981 res, err := c.doRequest("json") 1982 if res != nil && res.StatusCode == http.StatusNotModified { 1983 if res.Body != nil { 1984 res.Body.Close() 1985 } 1986 return nil, &googleapi.Error{ 1987 Code: res.StatusCode, 1988 Header: res.Header, 1989 } 1990 } 1991 if err != nil { 1992 return nil, err 1993 } 1994 defer googleapi.CloseBody(res) 1995 if err := googleapi.CheckResponse(res); err != nil { 1996 return nil, err 1997 } 1998 ret := &GetReleaseExecutableResponse{ 1999 ServerResponse: googleapi.ServerResponse{ 2000 Header: res.Header, 2001 HTTPStatusCode: res.StatusCode, 2002 }, 2003 } 2004 target := &ret 2005 if err := gensupport.DecodeResponse(target, res); err != nil { 2006 return nil, err 2007 } 2008 return ret, nil 2009 // { 2010 // "description": "Get the `Release` executable to use when enforcing rules.", 2011 // "flatPath": "v1/projects/{projectsId}/releases/{releasesId}:getExecutable", 2012 // "httpMethod": "GET", 2013 // "id": "firebaserules.projects.releases.getExecutable", 2014 // "parameterOrder": [ 2015 // "name" 2016 // ], 2017 // "parameters": { 2018 // "executableVersion": { 2019 // "description": "The requested runtime executable version.\nDefaults to FIREBASE_RULES_EXECUTABLE_V1.", 2020 // "enum": [ 2021 // "RELEASE_EXECUTABLE_VERSION_UNSPECIFIED", 2022 // "FIREBASE_RULES_EXECUTABLE_V1", 2023 // "FIREBASE_RULES_EXECUTABLE_V2" 2024 // ], 2025 // "location": "query", 2026 // "type": "string" 2027 // }, 2028 // "name": { 2029 // "description": "Resource name of the `Release`.\n\nFormat: `projects/{project_id}/releases/{release_id}`", 2030 // "location": "path", 2031 // "pattern": "^projects/[^/]+/releases/.*$", 2032 // "required": true, 2033 // "type": "string" 2034 // } 2035 // }, 2036 // "path": "v1/{+name}:getExecutable", 2037 // "response": { 2038 // "$ref": "GetReleaseExecutableResponse" 2039 // }, 2040 // "scopes": [ 2041 // "https://www.googleapis.com/auth/cloud-platform", 2042 // "https://www.googleapis.com/auth/firebase", 2043 // "https://www.googleapis.com/auth/firebase.readonly" 2044 // ] 2045 // } 2046 2047} 2048 2049// method id "firebaserules.projects.releases.list": 2050 2051type ProjectsReleasesListCall struct { 2052 s *Service 2053 name string 2054 urlParams_ gensupport.URLParams 2055 ifNoneMatch_ string 2056 ctx_ context.Context 2057 header_ http.Header 2058} 2059 2060// List: List the `Release` values for a project. This list may 2061// optionally be 2062// filtered by `Release` name, `Ruleset` name, `TestSuite` name, or 2063// any 2064// combination thereof. 2065func (r *ProjectsReleasesService) List(name string) *ProjectsReleasesListCall { 2066 c := &ProjectsReleasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2067 c.name = name 2068 return c 2069} 2070 2071// Filter sets the optional parameter "filter": `Release` filter. The 2072// list method supports filters with restrictions on the 2073// `Release.name`, `Release.ruleset_name`, and 2074// `Release.test_suite_name`. 2075// 2076// Example 1: A filter of 'name=prod*' might return `Release`s with 2077// names 2078// within 'projects/foo' prefixed with 'prod': 2079// 2080// Name | Ruleset 2081// Name 2082// ------------------------------|------------- 2083// projects/foo/release 2084// s/prod | 2085// projects/foo/rulesets/uuid1234 2086// projects/foo/releases/prod/v1 | 2087// projects/foo/rulesets/uuid1234 2088// projects/foo/releases/prod/v2 | 2089// projects/foo/rulesets/uuid8888 2090// 2091// Example 2: A filter of `name=prod* ruleset_name=uuid1234` would 2092// return only 2093// `Release` instances for 'projects/foo' with names prefixed with 2094// 'prod' 2095// referring to the same `Ruleset` name of 'uuid1234': 2096// 2097// Name | Ruleset 2098// Name 2099// ------------------------------|------------- 2100// projects/foo/release 2101// s/prod | projects/foo/rulesets/1234 2102// projects/foo/releases/prod/v1 | projects/foo/rulesets/1234 2103// 2104// In the examples, the filter parameters refer to the search filters 2105// are 2106// relative to the project. Fully qualified prefixed may also be used. 2107// e.g. 2108// `test_suite_name=projects/foo/testsuites/uuid1` 2109func (c *ProjectsReleasesListCall) Filter(filter string) *ProjectsReleasesListCall { 2110 c.urlParams_.Set("filter", filter) 2111 return c 2112} 2113 2114// PageSize sets the optional parameter "pageSize": Page size to load. 2115// Maximum of 100. Defaults to 10. 2116// Note: `page_size` is just a hint and the service may choose to load 2117// fewer 2118// than `page_size` results due to the size of the output. To traverse 2119// all of 2120// the releases, the caller should iterate until the `page_token` on 2121// the 2122// response is empty. 2123func (c *ProjectsReleasesListCall) PageSize(pageSize int64) *ProjectsReleasesListCall { 2124 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2125 return c 2126} 2127 2128// PageToken sets the optional parameter "pageToken": Next page token 2129// for the next batch of `Release` instances. 2130func (c *ProjectsReleasesListCall) PageToken(pageToken string) *ProjectsReleasesListCall { 2131 c.urlParams_.Set("pageToken", pageToken) 2132 return c 2133} 2134 2135// Fields allows partial responses to be retrieved. See 2136// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2137// for more information. 2138func (c *ProjectsReleasesListCall) Fields(s ...googleapi.Field) *ProjectsReleasesListCall { 2139 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2140 return c 2141} 2142 2143// IfNoneMatch sets the optional parameter which makes the operation 2144// fail if the object's ETag matches the given value. This is useful for 2145// getting updates only after the object has changed since the last 2146// request. Use googleapi.IsNotModified to check whether the response 2147// error from Do is the result of In-None-Match. 2148func (c *ProjectsReleasesListCall) IfNoneMatch(entityTag string) *ProjectsReleasesListCall { 2149 c.ifNoneMatch_ = entityTag 2150 return c 2151} 2152 2153// Context sets the context to be used in this call's Do method. Any 2154// pending HTTP request will be aborted if the provided context is 2155// canceled. 2156func (c *ProjectsReleasesListCall) Context(ctx context.Context) *ProjectsReleasesListCall { 2157 c.ctx_ = ctx 2158 return c 2159} 2160 2161// Header returns an http.Header that can be modified by the caller to 2162// add HTTP headers to the request. 2163func (c *ProjectsReleasesListCall) Header() http.Header { 2164 if c.header_ == nil { 2165 c.header_ = make(http.Header) 2166 } 2167 return c.header_ 2168} 2169 2170func (c *ProjectsReleasesListCall) doRequest(alt string) (*http.Response, error) { 2171 reqHeaders := make(http.Header) 2172 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2173 for k, v := range c.header_ { 2174 reqHeaders[k] = v 2175 } 2176 reqHeaders.Set("User-Agent", c.s.userAgent()) 2177 if c.ifNoneMatch_ != "" { 2178 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2179 } 2180 var body io.Reader = nil 2181 c.urlParams_.Set("alt", alt) 2182 c.urlParams_.Set("prettyPrint", "false") 2183 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/releases") 2184 urls += "?" + c.urlParams_.Encode() 2185 req, err := http.NewRequest("GET", urls, body) 2186 if err != nil { 2187 return nil, err 2188 } 2189 req.Header = reqHeaders 2190 googleapi.Expand(req.URL, map[string]string{ 2191 "name": c.name, 2192 }) 2193 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2194} 2195 2196// Do executes the "firebaserules.projects.releases.list" call. 2197// Exactly one of *ListReleasesResponse or error will be non-nil. Any 2198// non-2xx status code is an error. Response headers are in either 2199// *ListReleasesResponse.ServerResponse.Header or (if a response was 2200// returned at all) in error.(*googleapi.Error).Header. Use 2201// googleapi.IsNotModified to check whether the returned error was 2202// because http.StatusNotModified was returned. 2203func (c *ProjectsReleasesListCall) Do(opts ...googleapi.CallOption) (*ListReleasesResponse, error) { 2204 gensupport.SetOptions(c.urlParams_, opts...) 2205 res, err := c.doRequest("json") 2206 if res != nil && res.StatusCode == http.StatusNotModified { 2207 if res.Body != nil { 2208 res.Body.Close() 2209 } 2210 return nil, &googleapi.Error{ 2211 Code: res.StatusCode, 2212 Header: res.Header, 2213 } 2214 } 2215 if err != nil { 2216 return nil, err 2217 } 2218 defer googleapi.CloseBody(res) 2219 if err := googleapi.CheckResponse(res); err != nil { 2220 return nil, err 2221 } 2222 ret := &ListReleasesResponse{ 2223 ServerResponse: googleapi.ServerResponse{ 2224 Header: res.Header, 2225 HTTPStatusCode: res.StatusCode, 2226 }, 2227 } 2228 target := &ret 2229 if err := gensupport.DecodeResponse(target, res); err != nil { 2230 return nil, err 2231 } 2232 return ret, nil 2233 // { 2234 // "description": "List the `Release` values for a project. This list may optionally be\nfiltered by `Release` name, `Ruleset` name, `TestSuite` name, or any\ncombination thereof.", 2235 // "flatPath": "v1/projects/{projectsId}/releases", 2236 // "httpMethod": "GET", 2237 // "id": "firebaserules.projects.releases.list", 2238 // "parameterOrder": [ 2239 // "name" 2240 // ], 2241 // "parameters": { 2242 // "filter": { 2243 // "description": "`Release` filter. The list method supports filters with restrictions on the\n`Release.name`, `Release.ruleset_name`, and `Release.test_suite_name`.\n\nExample 1: A filter of 'name=prod*' might return `Release`s with names\nwithin 'projects/foo' prefixed with 'prod':\n\nName | Ruleset Name\n------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/uuid1234\nprojects/foo/releases/prod/v1 | projects/foo/rulesets/uuid1234\nprojects/foo/releases/prod/v2 | projects/foo/rulesets/uuid8888\n\nExample 2: A filter of `name=prod* ruleset_name=uuid1234` would return only\n`Release` instances for 'projects/foo' with names prefixed with 'prod'\nreferring to the same `Ruleset` name of 'uuid1234':\n\nName | Ruleset Name\n------------------------------|-------------\nprojects/foo/releases/prod | projects/foo/rulesets/1234\nprojects/foo/releases/prod/v1 | projects/foo/rulesets/1234\n\nIn the examples, the filter parameters refer to the search filters are\nrelative to the project. Fully qualified prefixed may also be used. e.g.\n`test_suite_name=projects/foo/testsuites/uuid1`", 2244 // "location": "query", 2245 // "type": "string" 2246 // }, 2247 // "name": { 2248 // "description": "Resource name for the project.\n\nFormat: `projects/{project_id}`", 2249 // "location": "path", 2250 // "pattern": "^projects/[^/]+$", 2251 // "required": true, 2252 // "type": "string" 2253 // }, 2254 // "pageSize": { 2255 // "description": "Page size to load. Maximum of 100. Defaults to 10.\nNote: `page_size` is just a hint and the service may choose to load fewer\nthan `page_size` results due to the size of the output. To traverse all of\nthe releases, the caller should iterate until the `page_token` on the\nresponse is empty.", 2256 // "format": "int32", 2257 // "location": "query", 2258 // "type": "integer" 2259 // }, 2260 // "pageToken": { 2261 // "description": "Next page token for the next batch of `Release` instances.", 2262 // "location": "query", 2263 // "type": "string" 2264 // } 2265 // }, 2266 // "path": "v1/{+name}/releases", 2267 // "response": { 2268 // "$ref": "ListReleasesResponse" 2269 // }, 2270 // "scopes": [ 2271 // "https://www.googleapis.com/auth/cloud-platform", 2272 // "https://www.googleapis.com/auth/firebase", 2273 // "https://www.googleapis.com/auth/firebase.readonly" 2274 // ] 2275 // } 2276 2277} 2278 2279// Pages invokes f for each page of results. 2280// A non-nil error returned from f will halt the iteration. 2281// The provided context supersedes any context provided to the Context method. 2282func (c *ProjectsReleasesListCall) Pages(ctx context.Context, f func(*ListReleasesResponse) error) error { 2283 c.ctx_ = ctx 2284 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2285 for { 2286 x, err := c.Do() 2287 if err != nil { 2288 return err 2289 } 2290 if err := f(x); err != nil { 2291 return err 2292 } 2293 if x.NextPageToken == "" { 2294 return nil 2295 } 2296 c.PageToken(x.NextPageToken) 2297 } 2298} 2299 2300// method id "firebaserules.projects.releases.patch": 2301 2302type ProjectsReleasesPatchCall struct { 2303 s *Service 2304 name string 2305 updatereleaserequest *UpdateReleaseRequest 2306 urlParams_ gensupport.URLParams 2307 ctx_ context.Context 2308 header_ http.Header 2309} 2310 2311// Patch: Update a `Release` via PATCH. 2312// 2313// Only updates to the `ruleset_name` and `test_suite_name` fields will 2314// be 2315// honored. `Release` rename is not supported. To create a `Release` use 2316// the 2317// CreateRelease method. 2318func (r *ProjectsReleasesService) Patch(name string, updatereleaserequest *UpdateReleaseRequest) *ProjectsReleasesPatchCall { 2319 c := &ProjectsReleasesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2320 c.name = name 2321 c.updatereleaserequest = updatereleaserequest 2322 return c 2323} 2324 2325// Fields allows partial responses to be retrieved. See 2326// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2327// for more information. 2328func (c *ProjectsReleasesPatchCall) Fields(s ...googleapi.Field) *ProjectsReleasesPatchCall { 2329 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2330 return c 2331} 2332 2333// Context sets the context to be used in this call's Do method. Any 2334// pending HTTP request will be aborted if the provided context is 2335// canceled. 2336func (c *ProjectsReleasesPatchCall) Context(ctx context.Context) *ProjectsReleasesPatchCall { 2337 c.ctx_ = ctx 2338 return c 2339} 2340 2341// Header returns an http.Header that can be modified by the caller to 2342// add HTTP headers to the request. 2343func (c *ProjectsReleasesPatchCall) Header() http.Header { 2344 if c.header_ == nil { 2345 c.header_ = make(http.Header) 2346 } 2347 return c.header_ 2348} 2349 2350func (c *ProjectsReleasesPatchCall) doRequest(alt string) (*http.Response, error) { 2351 reqHeaders := make(http.Header) 2352 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2353 for k, v := range c.header_ { 2354 reqHeaders[k] = v 2355 } 2356 reqHeaders.Set("User-Agent", c.s.userAgent()) 2357 var body io.Reader = nil 2358 body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatereleaserequest) 2359 if err != nil { 2360 return nil, err 2361 } 2362 reqHeaders.Set("Content-Type", "application/json") 2363 c.urlParams_.Set("alt", alt) 2364 c.urlParams_.Set("prettyPrint", "false") 2365 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2366 urls += "?" + c.urlParams_.Encode() 2367 req, err := http.NewRequest("PATCH", urls, body) 2368 if err != nil { 2369 return nil, err 2370 } 2371 req.Header = reqHeaders 2372 googleapi.Expand(req.URL, map[string]string{ 2373 "name": c.name, 2374 }) 2375 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2376} 2377 2378// Do executes the "firebaserules.projects.releases.patch" call. 2379// Exactly one of *Release or error will be non-nil. Any non-2xx status 2380// code is an error. Response headers are in either 2381// *Release.ServerResponse.Header or (if a response was returned at all) 2382// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2383// check whether the returned error was because http.StatusNotModified 2384// was returned. 2385func (c *ProjectsReleasesPatchCall) Do(opts ...googleapi.CallOption) (*Release, error) { 2386 gensupport.SetOptions(c.urlParams_, opts...) 2387 res, err := c.doRequest("json") 2388 if res != nil && res.StatusCode == http.StatusNotModified { 2389 if res.Body != nil { 2390 res.Body.Close() 2391 } 2392 return nil, &googleapi.Error{ 2393 Code: res.StatusCode, 2394 Header: res.Header, 2395 } 2396 } 2397 if err != nil { 2398 return nil, err 2399 } 2400 defer googleapi.CloseBody(res) 2401 if err := googleapi.CheckResponse(res); err != nil { 2402 return nil, err 2403 } 2404 ret := &Release{ 2405 ServerResponse: googleapi.ServerResponse{ 2406 Header: res.Header, 2407 HTTPStatusCode: res.StatusCode, 2408 }, 2409 } 2410 target := &ret 2411 if err := gensupport.DecodeResponse(target, res); err != nil { 2412 return nil, err 2413 } 2414 return ret, nil 2415 // { 2416 // "description": "Update a `Release` via PATCH.\n\nOnly updates to the `ruleset_name` and `test_suite_name` fields will be\nhonored. `Release` rename is not supported. To create a `Release` use the\nCreateRelease method.", 2417 // "flatPath": "v1/projects/{projectsId}/releases/{releasesId}", 2418 // "httpMethod": "PATCH", 2419 // "id": "firebaserules.projects.releases.patch", 2420 // "parameterOrder": [ 2421 // "name" 2422 // ], 2423 // "parameters": { 2424 // "name": { 2425 // "description": "Resource name for the project which owns this `Release`.\n\nFormat: `projects/{project_id}`", 2426 // "location": "path", 2427 // "pattern": "^projects/[^/]+/releases/.*$", 2428 // "required": true, 2429 // "type": "string" 2430 // } 2431 // }, 2432 // "path": "v1/{+name}", 2433 // "request": { 2434 // "$ref": "UpdateReleaseRequest" 2435 // }, 2436 // "response": { 2437 // "$ref": "Release" 2438 // }, 2439 // "scopes": [ 2440 // "https://www.googleapis.com/auth/cloud-platform", 2441 // "https://www.googleapis.com/auth/firebase" 2442 // ] 2443 // } 2444 2445} 2446 2447// method id "firebaserules.projects.rulesets.create": 2448 2449type ProjectsRulesetsCreateCall struct { 2450 s *Service 2451 name string 2452 ruleset *Ruleset 2453 urlParams_ gensupport.URLParams 2454 ctx_ context.Context 2455 header_ http.Header 2456} 2457 2458// Create: Create a `Ruleset` from `Source`. 2459// 2460// The `Ruleset` is given a unique generated name which is returned to 2461// the 2462// caller. `Source` containing syntactic or semantics errors will result 2463// in an 2464// error response indicating the first error encountered. For a detailed 2465// view 2466// of `Source` issues, use TestRuleset. 2467func (r *ProjectsRulesetsService) Create(name string, ruleset *Ruleset) *ProjectsRulesetsCreateCall { 2468 c := &ProjectsRulesetsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2469 c.name = name 2470 c.ruleset = ruleset 2471 return c 2472} 2473 2474// Fields allows partial responses to be retrieved. See 2475// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2476// for more information. 2477func (c *ProjectsRulesetsCreateCall) Fields(s ...googleapi.Field) *ProjectsRulesetsCreateCall { 2478 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2479 return c 2480} 2481 2482// Context sets the context to be used in this call's Do method. Any 2483// pending HTTP request will be aborted if the provided context is 2484// canceled. 2485func (c *ProjectsRulesetsCreateCall) Context(ctx context.Context) *ProjectsRulesetsCreateCall { 2486 c.ctx_ = ctx 2487 return c 2488} 2489 2490// Header returns an http.Header that can be modified by the caller to 2491// add HTTP headers to the request. 2492func (c *ProjectsRulesetsCreateCall) Header() http.Header { 2493 if c.header_ == nil { 2494 c.header_ = make(http.Header) 2495 } 2496 return c.header_ 2497} 2498 2499func (c *ProjectsRulesetsCreateCall) doRequest(alt string) (*http.Response, error) { 2500 reqHeaders := make(http.Header) 2501 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2502 for k, v := range c.header_ { 2503 reqHeaders[k] = v 2504 } 2505 reqHeaders.Set("User-Agent", c.s.userAgent()) 2506 var body io.Reader = nil 2507 body, err := googleapi.WithoutDataWrapper.JSONReader(c.ruleset) 2508 if err != nil { 2509 return nil, err 2510 } 2511 reqHeaders.Set("Content-Type", "application/json") 2512 c.urlParams_.Set("alt", alt) 2513 c.urlParams_.Set("prettyPrint", "false") 2514 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/rulesets") 2515 urls += "?" + c.urlParams_.Encode() 2516 req, err := http.NewRequest("POST", urls, body) 2517 if err != nil { 2518 return nil, err 2519 } 2520 req.Header = reqHeaders 2521 googleapi.Expand(req.URL, map[string]string{ 2522 "name": c.name, 2523 }) 2524 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2525} 2526 2527// Do executes the "firebaserules.projects.rulesets.create" call. 2528// Exactly one of *Ruleset or error will be non-nil. Any non-2xx status 2529// code is an error. Response headers are in either 2530// *Ruleset.ServerResponse.Header or (if a response was returned at all) 2531// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2532// check whether the returned error was because http.StatusNotModified 2533// was returned. 2534func (c *ProjectsRulesetsCreateCall) Do(opts ...googleapi.CallOption) (*Ruleset, error) { 2535 gensupport.SetOptions(c.urlParams_, opts...) 2536 res, err := c.doRequest("json") 2537 if res != nil && res.StatusCode == http.StatusNotModified { 2538 if res.Body != nil { 2539 res.Body.Close() 2540 } 2541 return nil, &googleapi.Error{ 2542 Code: res.StatusCode, 2543 Header: res.Header, 2544 } 2545 } 2546 if err != nil { 2547 return nil, err 2548 } 2549 defer googleapi.CloseBody(res) 2550 if err := googleapi.CheckResponse(res); err != nil { 2551 return nil, err 2552 } 2553 ret := &Ruleset{ 2554 ServerResponse: googleapi.ServerResponse{ 2555 Header: res.Header, 2556 HTTPStatusCode: res.StatusCode, 2557 }, 2558 } 2559 target := &ret 2560 if err := gensupport.DecodeResponse(target, res); err != nil { 2561 return nil, err 2562 } 2563 return ret, nil 2564 // { 2565 // "description": "Create a `Ruleset` from `Source`.\n\nThe `Ruleset` is given a unique generated name which is returned to the\ncaller. `Source` containing syntactic or semantics errors will result in an\nerror response indicating the first error encountered. For a detailed view\nof `Source` issues, use TestRuleset.", 2566 // "flatPath": "v1/projects/{projectsId}/rulesets", 2567 // "httpMethod": "POST", 2568 // "id": "firebaserules.projects.rulesets.create", 2569 // "parameterOrder": [ 2570 // "name" 2571 // ], 2572 // "parameters": { 2573 // "name": { 2574 // "description": "Resource name for Project which owns this `Ruleset`.\n\nFormat: `projects/{project_id}`", 2575 // "location": "path", 2576 // "pattern": "^projects/[^/]+$", 2577 // "required": true, 2578 // "type": "string" 2579 // } 2580 // }, 2581 // "path": "v1/{+name}/rulesets", 2582 // "request": { 2583 // "$ref": "Ruleset" 2584 // }, 2585 // "response": { 2586 // "$ref": "Ruleset" 2587 // }, 2588 // "scopes": [ 2589 // "https://www.googleapis.com/auth/cloud-platform", 2590 // "https://www.googleapis.com/auth/firebase" 2591 // ] 2592 // } 2593 2594} 2595 2596// method id "firebaserules.projects.rulesets.delete": 2597 2598type ProjectsRulesetsDeleteCall struct { 2599 s *Service 2600 name string 2601 urlParams_ gensupport.URLParams 2602 ctx_ context.Context 2603 header_ http.Header 2604} 2605 2606// Delete: Delete a `Ruleset` by resource name. 2607// 2608// If the `Ruleset` is referenced by a `Release` the operation will 2609// fail. 2610func (r *ProjectsRulesetsService) Delete(name string) *ProjectsRulesetsDeleteCall { 2611 c := &ProjectsRulesetsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2612 c.name = name 2613 return c 2614} 2615 2616// Fields allows partial responses to be retrieved. See 2617// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2618// for more information. 2619func (c *ProjectsRulesetsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRulesetsDeleteCall { 2620 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2621 return c 2622} 2623 2624// Context sets the context to be used in this call's Do method. Any 2625// pending HTTP request will be aborted if the provided context is 2626// canceled. 2627func (c *ProjectsRulesetsDeleteCall) Context(ctx context.Context) *ProjectsRulesetsDeleteCall { 2628 c.ctx_ = ctx 2629 return c 2630} 2631 2632// Header returns an http.Header that can be modified by the caller to 2633// add HTTP headers to the request. 2634func (c *ProjectsRulesetsDeleteCall) Header() http.Header { 2635 if c.header_ == nil { 2636 c.header_ = make(http.Header) 2637 } 2638 return c.header_ 2639} 2640 2641func (c *ProjectsRulesetsDeleteCall) doRequest(alt string) (*http.Response, error) { 2642 reqHeaders := make(http.Header) 2643 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2644 for k, v := range c.header_ { 2645 reqHeaders[k] = v 2646 } 2647 reqHeaders.Set("User-Agent", c.s.userAgent()) 2648 var body io.Reader = nil 2649 c.urlParams_.Set("alt", alt) 2650 c.urlParams_.Set("prettyPrint", "false") 2651 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2652 urls += "?" + c.urlParams_.Encode() 2653 req, err := http.NewRequest("DELETE", urls, body) 2654 if err != nil { 2655 return nil, err 2656 } 2657 req.Header = reqHeaders 2658 googleapi.Expand(req.URL, map[string]string{ 2659 "name": c.name, 2660 }) 2661 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2662} 2663 2664// Do executes the "firebaserules.projects.rulesets.delete" call. 2665// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2666// code is an error. Response headers are in either 2667// *Empty.ServerResponse.Header or (if a response was returned at all) 2668// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2669// check whether the returned error was because http.StatusNotModified 2670// was returned. 2671func (c *ProjectsRulesetsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2672 gensupport.SetOptions(c.urlParams_, opts...) 2673 res, err := c.doRequest("json") 2674 if res != nil && res.StatusCode == http.StatusNotModified { 2675 if res.Body != nil { 2676 res.Body.Close() 2677 } 2678 return nil, &googleapi.Error{ 2679 Code: res.StatusCode, 2680 Header: res.Header, 2681 } 2682 } 2683 if err != nil { 2684 return nil, err 2685 } 2686 defer googleapi.CloseBody(res) 2687 if err := googleapi.CheckResponse(res); err != nil { 2688 return nil, err 2689 } 2690 ret := &Empty{ 2691 ServerResponse: googleapi.ServerResponse{ 2692 Header: res.Header, 2693 HTTPStatusCode: res.StatusCode, 2694 }, 2695 } 2696 target := &ret 2697 if err := gensupport.DecodeResponse(target, res); err != nil { 2698 return nil, err 2699 } 2700 return ret, nil 2701 // { 2702 // "description": "Delete a `Ruleset` by resource name.\n\nIf the `Ruleset` is referenced by a `Release` the operation will fail.", 2703 // "flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}", 2704 // "httpMethod": "DELETE", 2705 // "id": "firebaserules.projects.rulesets.delete", 2706 // "parameterOrder": [ 2707 // "name" 2708 // ], 2709 // "parameters": { 2710 // "name": { 2711 // "description": "Resource name for the ruleset to delete.\n\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", 2712 // "location": "path", 2713 // "pattern": "^projects/[^/]+/rulesets/[^/]+$", 2714 // "required": true, 2715 // "type": "string" 2716 // } 2717 // }, 2718 // "path": "v1/{+name}", 2719 // "response": { 2720 // "$ref": "Empty" 2721 // }, 2722 // "scopes": [ 2723 // "https://www.googleapis.com/auth/cloud-platform", 2724 // "https://www.googleapis.com/auth/firebase" 2725 // ] 2726 // } 2727 2728} 2729 2730// method id "firebaserules.projects.rulesets.get": 2731 2732type ProjectsRulesetsGetCall struct { 2733 s *Service 2734 name string 2735 urlParams_ gensupport.URLParams 2736 ifNoneMatch_ string 2737 ctx_ context.Context 2738 header_ http.Header 2739} 2740 2741// Get: Get a `Ruleset` by name including the full `Source` contents. 2742func (r *ProjectsRulesetsService) Get(name string) *ProjectsRulesetsGetCall { 2743 c := &ProjectsRulesetsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2744 c.name = name 2745 return c 2746} 2747 2748// Fields allows partial responses to be retrieved. See 2749// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2750// for more information. 2751func (c *ProjectsRulesetsGetCall) Fields(s ...googleapi.Field) *ProjectsRulesetsGetCall { 2752 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2753 return c 2754} 2755 2756// IfNoneMatch sets the optional parameter which makes the operation 2757// fail if the object's ETag matches the given value. This is useful for 2758// getting updates only after the object has changed since the last 2759// request. Use googleapi.IsNotModified to check whether the response 2760// error from Do is the result of In-None-Match. 2761func (c *ProjectsRulesetsGetCall) IfNoneMatch(entityTag string) *ProjectsRulesetsGetCall { 2762 c.ifNoneMatch_ = entityTag 2763 return c 2764} 2765 2766// Context sets the context to be used in this call's Do method. Any 2767// pending HTTP request will be aborted if the provided context is 2768// canceled. 2769func (c *ProjectsRulesetsGetCall) Context(ctx context.Context) *ProjectsRulesetsGetCall { 2770 c.ctx_ = ctx 2771 return c 2772} 2773 2774// Header returns an http.Header that can be modified by the caller to 2775// add HTTP headers to the request. 2776func (c *ProjectsRulesetsGetCall) Header() http.Header { 2777 if c.header_ == nil { 2778 c.header_ = make(http.Header) 2779 } 2780 return c.header_ 2781} 2782 2783func (c *ProjectsRulesetsGetCall) doRequest(alt string) (*http.Response, error) { 2784 reqHeaders := make(http.Header) 2785 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2786 for k, v := range c.header_ { 2787 reqHeaders[k] = v 2788 } 2789 reqHeaders.Set("User-Agent", c.s.userAgent()) 2790 if c.ifNoneMatch_ != "" { 2791 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2792 } 2793 var body io.Reader = nil 2794 c.urlParams_.Set("alt", alt) 2795 c.urlParams_.Set("prettyPrint", "false") 2796 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 2797 urls += "?" + c.urlParams_.Encode() 2798 req, err := http.NewRequest("GET", urls, body) 2799 if err != nil { 2800 return nil, err 2801 } 2802 req.Header = reqHeaders 2803 googleapi.Expand(req.URL, map[string]string{ 2804 "name": c.name, 2805 }) 2806 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2807} 2808 2809// Do executes the "firebaserules.projects.rulesets.get" call. 2810// Exactly one of *Ruleset or error will be non-nil. Any non-2xx status 2811// code is an error. Response headers are in either 2812// *Ruleset.ServerResponse.Header or (if a response was returned at all) 2813// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2814// check whether the returned error was because http.StatusNotModified 2815// was returned. 2816func (c *ProjectsRulesetsGetCall) Do(opts ...googleapi.CallOption) (*Ruleset, error) { 2817 gensupport.SetOptions(c.urlParams_, opts...) 2818 res, err := c.doRequest("json") 2819 if res != nil && res.StatusCode == http.StatusNotModified { 2820 if res.Body != nil { 2821 res.Body.Close() 2822 } 2823 return nil, &googleapi.Error{ 2824 Code: res.StatusCode, 2825 Header: res.Header, 2826 } 2827 } 2828 if err != nil { 2829 return nil, err 2830 } 2831 defer googleapi.CloseBody(res) 2832 if err := googleapi.CheckResponse(res); err != nil { 2833 return nil, err 2834 } 2835 ret := &Ruleset{ 2836 ServerResponse: googleapi.ServerResponse{ 2837 Header: res.Header, 2838 HTTPStatusCode: res.StatusCode, 2839 }, 2840 } 2841 target := &ret 2842 if err := gensupport.DecodeResponse(target, res); err != nil { 2843 return nil, err 2844 } 2845 return ret, nil 2846 // { 2847 // "description": "Get a `Ruleset` by name including the full `Source` contents.", 2848 // "flatPath": "v1/projects/{projectsId}/rulesets/{rulesetsId}", 2849 // "httpMethod": "GET", 2850 // "id": "firebaserules.projects.rulesets.get", 2851 // "parameterOrder": [ 2852 // "name" 2853 // ], 2854 // "parameters": { 2855 // "name": { 2856 // "description": "Resource name for the ruleset to get.\n\nFormat: `projects/{project_id}/rulesets/{ruleset_id}`", 2857 // "location": "path", 2858 // "pattern": "^projects/[^/]+/rulesets/[^/]+$", 2859 // "required": true, 2860 // "type": "string" 2861 // } 2862 // }, 2863 // "path": "v1/{+name}", 2864 // "response": { 2865 // "$ref": "Ruleset" 2866 // }, 2867 // "scopes": [ 2868 // "https://www.googleapis.com/auth/cloud-platform", 2869 // "https://www.googleapis.com/auth/firebase", 2870 // "https://www.googleapis.com/auth/firebase.readonly" 2871 // ] 2872 // } 2873 2874} 2875 2876// method id "firebaserules.projects.rulesets.list": 2877 2878type ProjectsRulesetsListCall struct { 2879 s *Service 2880 name string 2881 urlParams_ gensupport.URLParams 2882 ifNoneMatch_ string 2883 ctx_ context.Context 2884 header_ http.Header 2885} 2886 2887// List: List `Ruleset` metadata only and optionally filter the results 2888// by `Ruleset` 2889// name. 2890// 2891// The full `Source` contents of a `Ruleset` may be retrieved 2892// with 2893// GetRuleset. 2894func (r *ProjectsRulesetsService) List(name string) *ProjectsRulesetsListCall { 2895 c := &ProjectsRulesetsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2896 c.name = name 2897 return c 2898} 2899 2900// Filter sets the optional parameter "filter": `Ruleset` filter. The 2901// list method supports filters with restrictions 2902// on 2903// `Ruleset.name`. 2904// 2905// Filters on `Ruleset.create_time` should use the `date` function 2906// which 2907// parses strings that conform to the RFC 3339 date/time 2908// specifications. 2909// 2910// Example: `create_time > date("2017-01-01T00:00:00Z") AND name=UUID-*` 2911func (c *ProjectsRulesetsListCall) Filter(filter string) *ProjectsRulesetsListCall { 2912 c.urlParams_.Set("filter", filter) 2913 return c 2914} 2915 2916// PageSize sets the optional parameter "pageSize": Page size to load. 2917// Maximum of 100. Defaults to 10. 2918// Note: `page_size` is just a hint and the service may choose to load 2919// less 2920// than `page_size` due to the size of the output. To traverse all of 2921// the 2922// releases, caller should iterate until the `page_token` is empty. 2923func (c *ProjectsRulesetsListCall) PageSize(pageSize int64) *ProjectsRulesetsListCall { 2924 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 2925 return c 2926} 2927 2928// PageToken sets the optional parameter "pageToken": Next page token 2929// for loading the next batch of `Ruleset` instances. 2930func (c *ProjectsRulesetsListCall) PageToken(pageToken string) *ProjectsRulesetsListCall { 2931 c.urlParams_.Set("pageToken", pageToken) 2932 return c 2933} 2934 2935// Fields allows partial responses to be retrieved. See 2936// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2937// for more information. 2938func (c *ProjectsRulesetsListCall) Fields(s ...googleapi.Field) *ProjectsRulesetsListCall { 2939 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2940 return c 2941} 2942 2943// IfNoneMatch sets the optional parameter which makes the operation 2944// fail if the object's ETag matches the given value. This is useful for 2945// getting updates only after the object has changed since the last 2946// request. Use googleapi.IsNotModified to check whether the response 2947// error from Do is the result of In-None-Match. 2948func (c *ProjectsRulesetsListCall) IfNoneMatch(entityTag string) *ProjectsRulesetsListCall { 2949 c.ifNoneMatch_ = entityTag 2950 return c 2951} 2952 2953// Context sets the context to be used in this call's Do method. Any 2954// pending HTTP request will be aborted if the provided context is 2955// canceled. 2956func (c *ProjectsRulesetsListCall) Context(ctx context.Context) *ProjectsRulesetsListCall { 2957 c.ctx_ = ctx 2958 return c 2959} 2960 2961// Header returns an http.Header that can be modified by the caller to 2962// add HTTP headers to the request. 2963func (c *ProjectsRulesetsListCall) Header() http.Header { 2964 if c.header_ == nil { 2965 c.header_ = make(http.Header) 2966 } 2967 return c.header_ 2968} 2969 2970func (c *ProjectsRulesetsListCall) doRequest(alt string) (*http.Response, error) { 2971 reqHeaders := make(http.Header) 2972 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") 2973 for k, v := range c.header_ { 2974 reqHeaders[k] = v 2975 } 2976 reqHeaders.Set("User-Agent", c.s.userAgent()) 2977 if c.ifNoneMatch_ != "" { 2978 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2979 } 2980 var body io.Reader = nil 2981 c.urlParams_.Set("alt", alt) 2982 c.urlParams_.Set("prettyPrint", "false") 2983 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/rulesets") 2984 urls += "?" + c.urlParams_.Encode() 2985 req, err := http.NewRequest("GET", urls, body) 2986 if err != nil { 2987 return nil, err 2988 } 2989 req.Header = reqHeaders 2990 googleapi.Expand(req.URL, map[string]string{ 2991 "name": c.name, 2992 }) 2993 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2994} 2995 2996// Do executes the "firebaserules.projects.rulesets.list" call. 2997// Exactly one of *ListRulesetsResponse or error will be non-nil. Any 2998// non-2xx status code is an error. Response headers are in either 2999// *ListRulesetsResponse.ServerResponse.Header or (if a response was 3000// returned at all) in error.(*googleapi.Error).Header. Use 3001// googleapi.IsNotModified to check whether the returned error was 3002// because http.StatusNotModified was returned. 3003func (c *ProjectsRulesetsListCall) Do(opts ...googleapi.CallOption) (*ListRulesetsResponse, error) { 3004 gensupport.SetOptions(c.urlParams_, opts...) 3005 res, err := c.doRequest("json") 3006 if res != nil && res.StatusCode == http.StatusNotModified { 3007 if res.Body != nil { 3008 res.Body.Close() 3009 } 3010 return nil, &googleapi.Error{ 3011 Code: res.StatusCode, 3012 Header: res.Header, 3013 } 3014 } 3015 if err != nil { 3016 return nil, err 3017 } 3018 defer googleapi.CloseBody(res) 3019 if err := googleapi.CheckResponse(res); err != nil { 3020 return nil, err 3021 } 3022 ret := &ListRulesetsResponse{ 3023 ServerResponse: googleapi.ServerResponse{ 3024 Header: res.Header, 3025 HTTPStatusCode: res.StatusCode, 3026 }, 3027 } 3028 target := &ret 3029 if err := gensupport.DecodeResponse(target, res); err != nil { 3030 return nil, err 3031 } 3032 return ret, nil 3033 // { 3034 // "description": "List `Ruleset` metadata only and optionally filter the results by `Ruleset`\nname.\n\nThe full `Source` contents of a `Ruleset` may be retrieved with\nGetRuleset.", 3035 // "flatPath": "v1/projects/{projectsId}/rulesets", 3036 // "httpMethod": "GET", 3037 // "id": "firebaserules.projects.rulesets.list", 3038 // "parameterOrder": [ 3039 // "name" 3040 // ], 3041 // "parameters": { 3042 // "filter": { 3043 // "description": "`Ruleset` filter. The list method supports filters with restrictions on\n`Ruleset.name`.\n\nFilters on `Ruleset.create_time` should use the `date` function which\nparses strings that conform to the RFC 3339 date/time specifications.\n\nExample: `create_time \u003e date(\"2017-01-01T00:00:00Z\") AND name=UUID-*`", 3044 // "location": "query", 3045 // "type": "string" 3046 // }, 3047 // "name": { 3048 // "description": "Resource name for the project.\n\nFormat: `projects/{project_id}`", 3049 // "location": "path", 3050 // "pattern": "^projects/[^/]+$", 3051 // "required": true, 3052 // "type": "string" 3053 // }, 3054 // "pageSize": { 3055 // "description": "Page size to load. Maximum of 100. Defaults to 10.\nNote: `page_size` is just a hint and the service may choose to load less\nthan `page_size` due to the size of the output. To traverse all of the\nreleases, caller should iterate until the `page_token` is empty.", 3056 // "format": "int32", 3057 // "location": "query", 3058 // "type": "integer" 3059 // }, 3060 // "pageToken": { 3061 // "description": "Next page token for loading the next batch of `Ruleset` instances.", 3062 // "location": "query", 3063 // "type": "string" 3064 // } 3065 // }, 3066 // "path": "v1/{+name}/rulesets", 3067 // "response": { 3068 // "$ref": "ListRulesetsResponse" 3069 // }, 3070 // "scopes": [ 3071 // "https://www.googleapis.com/auth/cloud-platform", 3072 // "https://www.googleapis.com/auth/firebase", 3073 // "https://www.googleapis.com/auth/firebase.readonly" 3074 // ] 3075 // } 3076 3077} 3078 3079// Pages invokes f for each page of results. 3080// A non-nil error returned from f will halt the iteration. 3081// The provided context supersedes any context provided to the Context method. 3082func (c *ProjectsRulesetsListCall) Pages(ctx context.Context, f func(*ListRulesetsResponse) error) error { 3083 c.ctx_ = ctx 3084 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3085 for { 3086 x, err := c.Do() 3087 if err != nil { 3088 return err 3089 } 3090 if err := f(x); err != nil { 3091 return err 3092 } 3093 if x.NextPageToken == "" { 3094 return nil 3095 } 3096 c.PageToken(x.NextPageToken) 3097 } 3098} 3099