1 // Copyright 2024 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 firestore provides access to the Cloud Firestore API. 8 // 9 // This package is DEPRECATED. Use package cloud.google.com/go/firestore instead. 10 // 11 // For product documentation, see: https://cloud.google.com/firestore 12 // 13 // # Library status 14 // 15 // These client libraries are officially supported by Google. However, this 16 // library is considered complete and is in maintenance mode. This means 17 // that we will address critical bugs and security issues but will not add 18 // any new features. 19 // 20 // When possible, we recommend using our newer 21 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 22 // that are still actively being worked and iterated on. 23 // 24 // # Creating a client 25 // 26 // Usage example: 27 // 28 // import "google.golang.org/api/firestore/v1beta1" 29 // ... 30 // ctx := context.Background() 31 // firestoreService, err := firestore.NewService(ctx) 32 // 33 // In this example, Google Application Default Credentials are used for 34 // authentication. For information on how to create and obtain Application 35 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 36 // 37 // # Other authentication options 38 // 39 // By default, all available scopes (see "Constants") are used to authenticate. 40 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 41 // 42 // firestoreService, err := firestore.NewService(ctx, option.WithScopes(firestore.DatastoreScope)) 43 // 44 // To use an API key for authentication (note: some APIs do not support API 45 // keys), use [google.golang.org/api/option.WithAPIKey]: 46 // 47 // firestoreService, err := firestore.NewService(ctx, option.WithAPIKey("AIza...")) 48 // 49 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 50 // flow, use [google.golang.org/api/option.WithTokenSource]: 51 // 52 // config := &oauth2.Config{...} 53 // // ... 54 // token, err := config.Exchange(ctx, ...) 55 // firestoreService, err := firestore.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 56 // 57 // See [google.golang.org/api/option.ClientOption] for details on options. 58 package firestore // import "google.golang.org/api/firestore/v1beta1" 59 60 import ( 61 "bytes" 62 "context" 63 "encoding/json" 64 "errors" 65 "fmt" 66 "io" 67 "net/http" 68 "net/url" 69 "strconv" 70 "strings" 71 72 googleapi "google.golang.org/api/googleapi" 73 internal "google.golang.org/api/internal" 74 gensupport "google.golang.org/api/internal/gensupport" 75 option "google.golang.org/api/option" 76 internaloption "google.golang.org/api/option/internaloption" 77 htransport "google.golang.org/api/transport/http" 78 ) 79 80 // Always reference these packages, just in case the auto-generated code 81 // below doesn't. 82 var _ = bytes.NewBuffer 83 var _ = strconv.Itoa 84 var _ = fmt.Sprintf 85 var _ = json.NewDecoder 86 var _ = io.Copy 87 var _ = url.Parse 88 var _ = gensupport.MarshalJSON 89 var _ = googleapi.Version 90 var _ = errors.New 91 var _ = strings.Replace 92 var _ = context.Canceled 93 var _ = internaloption.WithDefaultEndpoint 94 var _ = internal.Version 95 96 const apiId = "firestore:v1beta1" 97 const apiName = "firestore" 98 const apiVersion = "v1beta1" 99 const basePath = "https://firestore.googleapis.com/" 100 const basePathTemplate = "https://firestore.UNIVERSE_DOMAIN/" 101 const mtlsBasePath = "https://firestore.mtls.googleapis.com/" 102 103 // OAuth2 scopes used by this API. 104 const ( 105 // See, edit, configure, and delete your Google Cloud data and see the email 106 // address for your Google Account. 107 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 108 109 // View and manage your Google Cloud Datastore data 110 DatastoreScope = "https://www.googleapis.com/auth/datastore" 111 ) 112 113 // NewService creates a new Service. 114 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 115 scopesOption := internaloption.WithDefaultScopes( 116 "https://www.googleapis.com/auth/cloud-platform", 117 "https://www.googleapis.com/auth/datastore", 118 ) 119 // NOTE: prepend, so we don't override user-specified scopes. 120 opts = append([]option.ClientOption{scopesOption}, opts...) 121 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 122 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 123 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 124 opts = append(opts, internaloption.EnableNewAuthLibrary()) 125 client, endpoint, err := htransport.NewClient(ctx, opts...) 126 if err != nil { 127 return nil, err 128 } 129 s, err := New(client) 130 if err != nil { 131 return nil, err 132 } 133 if endpoint != "" { 134 s.BasePath = endpoint 135 } 136 return s, nil 137 } 138 139 // New creates a new Service. It uses the provided http.Client for requests. 140 // 141 // Deprecated: please use NewService instead. 142 // To provide a custom HTTP client, use option.WithHTTPClient. 143 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 144 func New(client *http.Client) (*Service, error) { 145 if client == nil { 146 return nil, errors.New("client is nil") 147 } 148 s := &Service{client: client, BasePath: basePath} 149 s.Projects = NewProjectsService(s) 150 return s, nil 151 } 152 153 type Service struct { 154 client *http.Client 155 BasePath string // API endpoint base URL 156 UserAgent string // optional additional User-Agent fragment 157 158 Projects *ProjectsService 159 } 160 161 func (s *Service) userAgent() string { 162 if s.UserAgent == "" { 163 return googleapi.UserAgent 164 } 165 return googleapi.UserAgent + " " + s.UserAgent 166 } 167 168 func NewProjectsService(s *Service) *ProjectsService { 169 rs := &ProjectsService{s: s} 170 rs.Databases = NewProjectsDatabasesService(s) 171 return rs 172 } 173 174 type ProjectsService struct { 175 s *Service 176 177 Databases *ProjectsDatabasesService 178 } 179 180 func NewProjectsDatabasesService(s *Service) *ProjectsDatabasesService { 181 rs := &ProjectsDatabasesService{s: s} 182 rs.Documents = NewProjectsDatabasesDocumentsService(s) 183 rs.Indexes = NewProjectsDatabasesIndexesService(s) 184 return rs 185 } 186 187 type ProjectsDatabasesService struct { 188 s *Service 189 190 Documents *ProjectsDatabasesDocumentsService 191 192 Indexes *ProjectsDatabasesIndexesService 193 } 194 195 func NewProjectsDatabasesDocumentsService(s *Service) *ProjectsDatabasesDocumentsService { 196 rs := &ProjectsDatabasesDocumentsService{s: s} 197 return rs 198 } 199 200 type ProjectsDatabasesDocumentsService struct { 201 s *Service 202 } 203 204 func NewProjectsDatabasesIndexesService(s *Service) *ProjectsDatabasesIndexesService { 205 rs := &ProjectsDatabasesIndexesService{s: s} 206 return rs 207 } 208 209 type ProjectsDatabasesIndexesService struct { 210 s *Service 211 } 212 213 // Aggregation: Defines an aggregation that produces a single result. 214 type Aggregation struct { 215 // Alias: Optional. Optional name of the field to store the result of the 216 // aggregation into. If not provided, Firestore will pick a default name 217 // following the format `field_`. For example: ``` AGGREGATE COUNT_UP_TO(1) AS 218 // count_up_to_1, COUNT_UP_TO(2), COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) 219 // OVER ( ... ); ``` becomes: ``` AGGREGATE COUNT_UP_TO(1) AS count_up_to_1, 220 // COUNT_UP_TO(2) AS field_1, COUNT_UP_TO(3) AS count_up_to_3, COUNT(*) AS 221 // field_2 OVER ( ... ); ``` Requires: * Must be unique across all aggregation 222 // aliases. * Conform to document field name limitations. 223 Alias string `json:"alias,omitempty"` 224 // Avg: Average aggregator. 225 Avg *Avg `json:"avg,omitempty"` 226 // Count: Count aggregator. 227 Count *Count `json:"count,omitempty"` 228 // Sum: Sum aggregator. 229 Sum *Sum `json:"sum,omitempty"` 230 // ForceSendFields is a list of field names (e.g. "Alias") to unconditionally 231 // include in API requests. By default, fields with empty or default values are 232 // omitted from API requests. See 233 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 234 // details. 235 ForceSendFields []string `json:"-"` 236 // NullFields is a list of field names (e.g. "Alias") to include in API 237 // requests with the JSON null value. By default, fields with empty values are 238 // omitted from API requests. See 239 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 240 NullFields []string `json:"-"` 241 } 242 243 func (s *Aggregation) MarshalJSON() ([]byte, error) { 244 type NoMethod Aggregation 245 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 246 } 247 248 // AggregationResult: The result of a single bucket from a Firestore 249 // aggregation query. The keys of `aggregate_fields` are the same for all 250 // results in an aggregation query, unlike document queries which can have 251 // different fields present for each result. 252 type AggregationResult struct { 253 // AggregateFields: The result of the aggregation functions, ex: `COUNT(*) AS 254 // total_docs`. The key is the alias assigned to the aggregation function on 255 // input and the size of this map equals the number of aggregation functions in 256 // the query. 257 AggregateFields map[string]Value `json:"aggregateFields,omitempty"` 258 // ForceSendFields is a list of field names (e.g. "AggregateFields") to 259 // unconditionally include in API requests. By default, fields with empty or 260 // default values are omitted from API requests. See 261 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 262 // details. 263 ForceSendFields []string `json:"-"` 264 // NullFields is a list of field names (e.g. "AggregateFields") to include in 265 // API requests with the JSON null value. By default, fields with empty values 266 // are omitted from API requests. See 267 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 268 NullFields []string `json:"-"` 269 } 270 271 func (s *AggregationResult) MarshalJSON() ([]byte, error) { 272 type NoMethod AggregationResult 273 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 274 } 275 276 // ArrayValue: An array value. 277 type ArrayValue struct { 278 // Values: Values in the array. 279 Values []*Value `json:"values,omitempty"` 280 // ForceSendFields is a list of field names (e.g. "Values") to unconditionally 281 // include in API requests. By default, fields with empty or default values are 282 // omitted from API requests. See 283 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 284 // details. 285 ForceSendFields []string `json:"-"` 286 // NullFields is a list of field names (e.g. "Values") to include in API 287 // requests with the JSON null value. By default, fields with empty values are 288 // omitted from API requests. See 289 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 290 NullFields []string `json:"-"` 291 } 292 293 func (s *ArrayValue) MarshalJSON() ([]byte, error) { 294 type NoMethod ArrayValue 295 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 296 } 297 298 // Avg: Average of the values of the requested field. * Only numeric values 299 // will be aggregated. All non-numeric values including `NULL` are skipped. * 300 // If the aggregated values contain `NaN`, returns `NaN`. Infinity math follows 301 // IEEE-754 standards. * If the aggregated value set is empty, returns `NULL`. 302 // * Always returns the result as a double. 303 type Avg struct { 304 // Field: The field to aggregate on. 305 Field *FieldReference `json:"field,omitempty"` 306 // ForceSendFields is a list of field names (e.g. "Field") to unconditionally 307 // include in API requests. By default, fields with empty or default values are 308 // omitted from API requests. See 309 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 310 // details. 311 ForceSendFields []string `json:"-"` 312 // NullFields is a list of field names (e.g. "Field") to include in API 313 // requests with the JSON null value. By default, fields with empty values are 314 // omitted from API requests. See 315 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 316 NullFields []string `json:"-"` 317 } 318 319 func (s *Avg) MarshalJSON() ([]byte, error) { 320 type NoMethod Avg 321 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 322 } 323 324 // BatchGetDocumentsRequest: The request for Firestore.BatchGetDocuments. 325 type BatchGetDocumentsRequest struct { 326 // Documents: The names of the documents to retrieve. In the format: 327 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 328 // The request will fail if any of the document is not a child resource of the 329 // given `database`. Duplicate names will be elided. 330 Documents []string `json:"documents,omitempty"` 331 // Mask: The fields to return. If not set, returns all fields. If a document 332 // has a field that is not present in this mask, that field will not be 333 // returned in the response. 334 Mask *DocumentMask `json:"mask,omitempty"` 335 // NewTransaction: Starts a new transaction and reads the documents. Defaults 336 // to a read-only transaction. The new transaction ID will be returned as the 337 // first response in the stream. 338 NewTransaction *TransactionOptions `json:"newTransaction,omitempty"` 339 // ReadTime: Reads documents as they were at the given time. This must be a 340 // microsecond precision timestamp within the past one hour, or if 341 // Point-in-Time Recovery is enabled, can additionally be a whole minute 342 // timestamp within the past 7 days. 343 ReadTime string `json:"readTime,omitempty"` 344 // Transaction: Reads documents in a transaction. 345 Transaction string `json:"transaction,omitempty"` 346 // ForceSendFields is a list of field names (e.g. "Documents") to 347 // unconditionally include in API requests. By default, fields with empty or 348 // default values are omitted from API requests. See 349 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 350 // details. 351 ForceSendFields []string `json:"-"` 352 // NullFields is a list of field names (e.g. "Documents") to include in API 353 // requests with the JSON null value. By default, fields with empty values are 354 // omitted from API requests. See 355 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 356 NullFields []string `json:"-"` 357 } 358 359 func (s *BatchGetDocumentsRequest) MarshalJSON() ([]byte, error) { 360 type NoMethod BatchGetDocumentsRequest 361 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 362 } 363 364 // BatchGetDocumentsResponse: The streamed response for 365 // Firestore.BatchGetDocuments. 366 type BatchGetDocumentsResponse struct { 367 // Found: A document that was requested. 368 Found *Document `json:"found,omitempty"` 369 // Missing: A document name that was requested but does not exist. In the 370 // format: 371 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 372 Missing string `json:"missing,omitempty"` 373 // ReadTime: The time at which the document was read. This may be monotically 374 // increasing, in this case the previous documents in the result stream are 375 // guaranteed not to have changed between their read_time and this one. 376 ReadTime string `json:"readTime,omitempty"` 377 // Transaction: The transaction that was started as part of this request. Will 378 // only be set in the first response, and only if 379 // BatchGetDocumentsRequest.new_transaction was set in the request. 380 Transaction string `json:"transaction,omitempty"` 381 382 // ServerResponse contains the HTTP response code and headers from the server. 383 googleapi.ServerResponse `json:"-"` 384 // ForceSendFields is a list of field names (e.g. "Found") to unconditionally 385 // include in API requests. By default, fields with empty or default values are 386 // omitted from API requests. See 387 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 388 // details. 389 ForceSendFields []string `json:"-"` 390 // NullFields is a list of field names (e.g. "Found") to include in API 391 // requests with the JSON null value. By default, fields with empty values are 392 // omitted from API requests. See 393 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 394 NullFields []string `json:"-"` 395 } 396 397 func (s *BatchGetDocumentsResponse) MarshalJSON() ([]byte, error) { 398 type NoMethod BatchGetDocumentsResponse 399 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 400 } 401 402 // BatchWriteRequest: The request for Firestore.BatchWrite. 403 type BatchWriteRequest struct { 404 // Labels: Labels associated with this batch write. 405 Labels map[string]string `json:"labels,omitempty"` 406 // Writes: The writes to apply. Method does not apply writes atomically and 407 // does not guarantee ordering. Each write succeeds or fails independently. You 408 // cannot write to the same document more than once per request. 409 Writes []*Write `json:"writes,omitempty"` 410 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 411 // include in API requests. By default, fields with empty or default values are 412 // omitted from API requests. See 413 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 414 // details. 415 ForceSendFields []string `json:"-"` 416 // NullFields is a list of field names (e.g. "Labels") to include in API 417 // requests with the JSON null value. By default, fields with empty values are 418 // omitted from API requests. See 419 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 420 NullFields []string `json:"-"` 421 } 422 423 func (s *BatchWriteRequest) MarshalJSON() ([]byte, error) { 424 type NoMethod BatchWriteRequest 425 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 426 } 427 428 // BatchWriteResponse: The response from Firestore.BatchWrite. 429 type BatchWriteResponse struct { 430 // Status: The status of applying the writes. This i-th write status 431 // corresponds to the i-th write in the request. 432 Status []*Status `json:"status,omitempty"` 433 // WriteResults: The result of applying the writes. This i-th write result 434 // corresponds to the i-th write in the request. 435 WriteResults []*WriteResult `json:"writeResults,omitempty"` 436 437 // ServerResponse contains the HTTP response code and headers from the server. 438 googleapi.ServerResponse `json:"-"` 439 // ForceSendFields is a list of field names (e.g. "Status") to unconditionally 440 // include in API requests. By default, fields with empty or default values are 441 // omitted from API requests. See 442 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 443 // details. 444 ForceSendFields []string `json:"-"` 445 // NullFields is a list of field names (e.g. "Status") to include in API 446 // requests with the JSON null value. By default, fields with empty values are 447 // omitted from API requests. See 448 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 449 NullFields []string `json:"-"` 450 } 451 452 func (s *BatchWriteResponse) MarshalJSON() ([]byte, error) { 453 type NoMethod BatchWriteResponse 454 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 455 } 456 457 // BeginTransactionRequest: The request for Firestore.BeginTransaction. 458 type BeginTransactionRequest struct { 459 // Options: The options for the transaction. Defaults to a read-write 460 // transaction. 461 Options *TransactionOptions `json:"options,omitempty"` 462 // ForceSendFields is a list of field names (e.g. "Options") to unconditionally 463 // include in API requests. By default, fields with empty or default values are 464 // omitted from API requests. See 465 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 466 // details. 467 ForceSendFields []string `json:"-"` 468 // NullFields is a list of field names (e.g. "Options") to include in API 469 // requests with the JSON null value. By default, fields with empty values are 470 // omitted from API requests. See 471 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 472 NullFields []string `json:"-"` 473 } 474 475 func (s *BeginTransactionRequest) MarshalJSON() ([]byte, error) { 476 type NoMethod BeginTransactionRequest 477 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 478 } 479 480 // BeginTransactionResponse: The response for Firestore.BeginTransaction. 481 type BeginTransactionResponse struct { 482 // Transaction: The transaction that was started. 483 Transaction string `json:"transaction,omitempty"` 484 485 // ServerResponse contains the HTTP response code and headers from the server. 486 googleapi.ServerResponse `json:"-"` 487 // ForceSendFields is a list of field names (e.g. "Transaction") to 488 // unconditionally include in API requests. By default, fields with empty or 489 // default values are omitted from API requests. See 490 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 491 // details. 492 ForceSendFields []string `json:"-"` 493 // NullFields is a list of field names (e.g. "Transaction") to include in API 494 // requests with the JSON null value. By default, fields with empty values are 495 // omitted from API requests. See 496 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 497 NullFields []string `json:"-"` 498 } 499 500 func (s *BeginTransactionResponse) MarshalJSON() ([]byte, error) { 501 type NoMethod BeginTransactionResponse 502 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 503 } 504 505 // BitSequence: A sequence of bits, encoded in a byte array. Each byte in the 506 // `bitmap` byte array stores 8 bits of the sequence. The only exception is the 507 // last byte, which may store 8 _or fewer_ bits. The `padding` defines the 508 // number of bits of the last byte to be ignored as "padding". The values of 509 // these "padding" bits are unspecified and must be ignored. To retrieve the 510 // first bit, bit 0, calculate: `(bitmap[0] & 0x01) != 0`. To retrieve the 511 // second bit, bit 1, calculate: `(bitmap[0] & 0x02) != 0`. To retrieve the 512 // third bit, bit 2, calculate: `(bitmap[0] & 0x04) != 0`. To retrieve the 513 // fourth bit, bit 3, calculate: `(bitmap[0] & 0x08) != 0`. To retrieve bit n, 514 // calculate: `(bitmap[n / 8] & (0x01 << (n % 8))) != 0`. The "size" of a 515 // `BitSequence` (the number of bits it contains) is calculated by this 516 // formula: `(bitmap.length * 8) - padding`. 517 type BitSequence struct { 518 // Bitmap: The bytes that encode the bit sequence. May have a length of zero. 519 Bitmap string `json:"bitmap,omitempty"` 520 // Padding: The number of bits of the last byte in `bitmap` to ignore as 521 // "padding". If the length of `bitmap` is zero, then this value must be `0`. 522 // Otherwise, this value must be between 0 and 7, inclusive. 523 Padding int64 `json:"padding,omitempty"` 524 // ForceSendFields is a list of field names (e.g. "Bitmap") to unconditionally 525 // include in API requests. By default, fields with empty or default values are 526 // omitted from API requests. See 527 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 528 // details. 529 ForceSendFields []string `json:"-"` 530 // NullFields is a list of field names (e.g. "Bitmap") to include in API 531 // requests with the JSON null value. By default, fields with empty values are 532 // omitted from API requests. See 533 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 534 NullFields []string `json:"-"` 535 } 536 537 func (s *BitSequence) MarshalJSON() ([]byte, error) { 538 type NoMethod BitSequence 539 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 540 } 541 542 // BloomFilter: A bloom filter (https://en.wikipedia.org/wiki/Bloom_filter). 543 // The bloom filter hashes the entries with MD5 and treats the resulting 544 // 128-bit hash as 2 distinct 64-bit hash values, interpreted as unsigned 545 // integers using 2's complement encoding. These two hash values, named `h1` 546 // and `h2`, are then used to compute the `hash_count` hash values using the 547 // formula, starting at `i=0`: h(i) = h1 + (i * h2) These resulting values are 548 // then taken modulo the number of bits in the bloom filter to get the bits of 549 // the bloom filter to test for the given entry. 550 type BloomFilter struct { 551 // Bits: The bloom filter data. 552 Bits *BitSequence `json:"bits,omitempty"` 553 // HashCount: The number of hashes used by the algorithm. 554 HashCount int64 `json:"hashCount,omitempty"` 555 // ForceSendFields is a list of field names (e.g. "Bits") to unconditionally 556 // include in API requests. By default, fields with empty or default values are 557 // omitted from API requests. See 558 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 559 // details. 560 ForceSendFields []string `json:"-"` 561 // NullFields is a list of field names (e.g. "Bits") to include in API requests 562 // with the JSON null value. By default, fields with empty values are omitted 563 // from API requests. See 564 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 565 NullFields []string `json:"-"` 566 } 567 568 func (s *BloomFilter) MarshalJSON() ([]byte, error) { 569 type NoMethod BloomFilter 570 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 571 } 572 573 // CollectionSelector: A selection of a collection, such as `messages as m1`. 574 type CollectionSelector struct { 575 // AllDescendants: When false, selects only collections that are immediate 576 // children of the `parent` specified in the containing `RunQueryRequest`. When 577 // true, selects all descendant collections. 578 AllDescendants bool `json:"allDescendants,omitempty"` 579 // CollectionId: The collection ID. When set, selects only collections with 580 // this ID. 581 CollectionId string `json:"collectionId,omitempty"` 582 // ForceSendFields is a list of field names (e.g. "AllDescendants") to 583 // unconditionally include in API requests. By default, fields with empty or 584 // default values are omitted from API requests. See 585 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 586 // details. 587 ForceSendFields []string `json:"-"` 588 // NullFields is a list of field names (e.g. "AllDescendants") to include in 589 // API requests with the JSON null value. By default, fields with empty values 590 // are omitted from API requests. See 591 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 592 NullFields []string `json:"-"` 593 } 594 595 func (s *CollectionSelector) MarshalJSON() ([]byte, error) { 596 type NoMethod CollectionSelector 597 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 598 } 599 600 // CommitRequest: The request for Firestore.Commit. 601 type CommitRequest struct { 602 // Transaction: If set, applies all writes in this transaction, and commits it. 603 Transaction string `json:"transaction,omitempty"` 604 // Writes: The writes to apply. Always executed atomically and in order. 605 Writes []*Write `json:"writes,omitempty"` 606 // ForceSendFields is a list of field names (e.g. "Transaction") to 607 // unconditionally include in API requests. By default, fields with empty or 608 // default values are omitted from API requests. See 609 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 610 // details. 611 ForceSendFields []string `json:"-"` 612 // NullFields is a list of field names (e.g. "Transaction") to include in API 613 // requests with the JSON null value. By default, fields with empty values are 614 // omitted from API requests. See 615 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 616 NullFields []string `json:"-"` 617 } 618 619 func (s *CommitRequest) MarshalJSON() ([]byte, error) { 620 type NoMethod CommitRequest 621 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 622 } 623 624 // CommitResponse: The response for Firestore.Commit. 625 type CommitResponse struct { 626 // CommitTime: The time at which the commit occurred. Any read with an equal or 627 // greater `read_time` is guaranteed to see the effects of the commit. 628 CommitTime string `json:"commitTime,omitempty"` 629 // WriteResults: The result of applying the writes. This i-th write result 630 // corresponds to the i-th write in the request. 631 WriteResults []*WriteResult `json:"writeResults,omitempty"` 632 633 // ServerResponse contains the HTTP response code and headers from the server. 634 googleapi.ServerResponse `json:"-"` 635 // ForceSendFields is a list of field names (e.g. "CommitTime") to 636 // unconditionally include in API requests. By default, fields with empty or 637 // default values are omitted from API requests. See 638 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 639 // details. 640 ForceSendFields []string `json:"-"` 641 // NullFields is a list of field names (e.g. "CommitTime") to include in API 642 // requests with the JSON null value. By default, fields with empty values are 643 // omitted from API requests. See 644 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 645 NullFields []string `json:"-"` 646 } 647 648 func (s *CommitResponse) MarshalJSON() ([]byte, error) { 649 type NoMethod CommitResponse 650 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 651 } 652 653 // CompositeFilter: A filter that merges multiple other filters using the given 654 // operator. 655 type CompositeFilter struct { 656 // Filters: The list of filters to combine. Requires: * At least one filter is 657 // present. 658 Filters []*Filter `json:"filters,omitempty"` 659 // Op: The operator for combining multiple filters. 660 // 661 // Possible values: 662 // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used. 663 // "AND" - Documents are required to satisfy all of the combined filters. 664 // "OR" - Documents are required to satisfy at least one of the combined 665 // filters. 666 Op string `json:"op,omitempty"` 667 // ForceSendFields is a list of field names (e.g. "Filters") to unconditionally 668 // include in API requests. By default, fields with empty or default values are 669 // omitted from API requests. See 670 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 671 // details. 672 ForceSendFields []string `json:"-"` 673 // NullFields is a list of field names (e.g. "Filters") to include in API 674 // requests with the JSON null value. By default, fields with empty values are 675 // omitted from API requests. See 676 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 677 NullFields []string `json:"-"` 678 } 679 680 func (s *CompositeFilter) MarshalJSON() ([]byte, error) { 681 type NoMethod CompositeFilter 682 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 683 } 684 685 // Count: Count of documents that match the query. The `COUNT(*)` aggregation 686 // function operates on the entire document so it does not require a field 687 // reference. 688 type Count struct { 689 // UpTo: Optional. Optional constraint on the maximum number of documents to 690 // count. This provides a way to set an upper bound on the number of documents 691 // to scan, limiting latency, and cost. Unspecified is interpreted as no bound. 692 // High-Level Example: ``` AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k 693 // ); ``` Requires: * Must be greater than zero when present. 694 UpTo int64 `json:"upTo,omitempty,string"` 695 // ForceSendFields is a list of field names (e.g. "UpTo") to unconditionally 696 // include in API requests. By default, fields with empty or default values are 697 // omitted from API requests. See 698 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 699 // details. 700 ForceSendFields []string `json:"-"` 701 // NullFields is a list of field names (e.g. "UpTo") to include in API requests 702 // with the JSON null value. By default, fields with empty values are omitted 703 // from API requests. See 704 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 705 NullFields []string `json:"-"` 706 } 707 708 func (s *Count) MarshalJSON() ([]byte, error) { 709 type NoMethod Count 710 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 711 } 712 713 // Cursor: A position in a query result set. 714 type Cursor struct { 715 // Before: If the position is just before or just after the given values, 716 // relative to the sort order defined by the query. 717 Before bool `json:"before,omitempty"` 718 // Values: The values that represent a position, in the order they appear in 719 // the order by clause of a query. Can contain fewer values than specified in 720 // the order by clause. 721 Values []*Value `json:"values,omitempty"` 722 // ForceSendFields is a list of field names (e.g. "Before") to unconditionally 723 // include in API requests. By default, fields with empty or default values are 724 // omitted from API requests. See 725 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 726 // details. 727 ForceSendFields []string `json:"-"` 728 // NullFields is a list of field names (e.g. "Before") to include in API 729 // requests with the JSON null value. By default, fields with empty values are 730 // omitted from API requests. See 731 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 732 NullFields []string `json:"-"` 733 } 734 735 func (s *Cursor) MarshalJSON() ([]byte, error) { 736 type NoMethod Cursor 737 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 738 } 739 740 // Document: A Firestore document. Must not exceed 1 MiB - 4 bytes. 741 type Document struct { 742 // CreateTime: Output only. The time at which the document was created. This 743 // value increases monotonically when a document is deleted then recreated. It 744 // can also be compared to values from other documents and the `read_time` of a 745 // query. 746 CreateTime string `json:"createTime,omitempty"` 747 // Fields: The document's fields. The map keys represent field names. Field 748 // names matching the regular expression `__.*__` are reserved. Reserved field 749 // names are forbidden except in certain documented contexts. The field names, 750 // represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. Field 751 // paths may be used in other contexts to refer to structured fields defined 752 // here. For `map_value`, the field path is represented by a dot-delimited 753 // (`.`) string of segments. Each segment is either a simple field name 754 // (defined below) or a quoted field name. For example, the structured field 755 // "foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be 756 // represented by the field path `` foo.`x&y` ``. A simple field name contains 757 // only characters `a` to `z`, `A` to `Z`, `0` to `9`, or `_`, and must not 758 // start with `0` to `9`. For example, `foo_bar_17`. A quoted field name starts 759 // and ends with `` ` `` and may contain any character. Some characters, 760 // including `` ` ``, must be escaped using a `\`. For example, `` `x&y` `` 761 // represents `x&y` and `` `bak\`tik` `` represents `` bak`tik ``. 762 Fields map[string]Value `json:"fields,omitempty"` 763 // Name: The resource name of the document, for example 764 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 765 Name string `json:"name,omitempty"` 766 // UpdateTime: Output only. The time at which the document was last changed. 767 // This value is initially set to the `create_time` then increases 768 // monotonically with each change to the document. It can also be compared to 769 // values from other documents and the `read_time` of a query. 770 UpdateTime string `json:"updateTime,omitempty"` 771 772 // ServerResponse contains the HTTP response code and headers from the server. 773 googleapi.ServerResponse `json:"-"` 774 // ForceSendFields is a list of field names (e.g. "CreateTime") to 775 // unconditionally include in API requests. By default, fields with empty or 776 // default values are omitted from API requests. See 777 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 778 // details. 779 ForceSendFields []string `json:"-"` 780 // NullFields is a list of field names (e.g. "CreateTime") to include in API 781 // requests with the JSON null value. By default, fields with empty values are 782 // omitted from API requests. See 783 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 784 NullFields []string `json:"-"` 785 } 786 787 func (s *Document) MarshalJSON() ([]byte, error) { 788 type NoMethod Document 789 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 790 } 791 792 // DocumentChange: A Document has changed. May be the result of multiple 793 // writes, including deletes, that ultimately resulted in a new value for the 794 // Document. Multiple DocumentChange messages may be returned for the same 795 // logical change, if multiple targets are affected. For PipelineQueryTargets, 796 // `document` will be in the new pipeline format, For a Listen stream with both 797 // QueryTargets and PipelineQueryTargets present, if a document matches both 798 // types of queries, then a separate DocumentChange messages will be sent out 799 // one for each set. 800 type DocumentChange struct { 801 // Document: The new state of the Document. If `mask` is set, contains only 802 // fields that were updated or added. 803 Document *Document `json:"document,omitempty"` 804 // RemovedTargetIds: A set of target IDs for targets that no longer match this 805 // document. 806 RemovedTargetIds []int64 `json:"removedTargetIds,omitempty"` 807 // TargetIds: A set of target IDs of targets that match this document. 808 TargetIds []int64 `json:"targetIds,omitempty"` 809 // ForceSendFields is a list of field names (e.g. "Document") to 810 // unconditionally include in API requests. By default, fields with empty or 811 // default values are omitted from API requests. See 812 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 813 // details. 814 ForceSendFields []string `json:"-"` 815 // NullFields is a list of field names (e.g. "Document") to include in API 816 // requests with the JSON null value. By default, fields with empty values are 817 // omitted from API requests. See 818 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 819 NullFields []string `json:"-"` 820 } 821 822 func (s *DocumentChange) MarshalJSON() ([]byte, error) { 823 type NoMethod DocumentChange 824 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 825 } 826 827 // DocumentDelete: A Document has been deleted. May be the result of multiple 828 // writes, including updates, the last of which deleted the Document. Multiple 829 // DocumentDelete messages may be returned for the same logical delete, if 830 // multiple targets are affected. 831 type DocumentDelete struct { 832 // Document: The resource name of the Document that was deleted. 833 Document string `json:"document,omitempty"` 834 // ReadTime: The read timestamp at which the delete was observed. Greater or 835 // equal to the `commit_time` of the delete. 836 ReadTime string `json:"readTime,omitempty"` 837 // RemovedTargetIds: A set of target IDs for targets that previously matched 838 // this entity. 839 RemovedTargetIds []int64 `json:"removedTargetIds,omitempty"` 840 // ForceSendFields is a list of field names (e.g. "Document") to 841 // unconditionally include in API requests. By default, fields with empty or 842 // default values are omitted from API requests. See 843 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 844 // details. 845 ForceSendFields []string `json:"-"` 846 // NullFields is a list of field names (e.g. "Document") to include in API 847 // requests with the JSON null value. By default, fields with empty values are 848 // omitted from API requests. See 849 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 850 NullFields []string `json:"-"` 851 } 852 853 func (s *DocumentDelete) MarshalJSON() ([]byte, error) { 854 type NoMethod DocumentDelete 855 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 856 } 857 858 // DocumentMask: A set of field paths on a document. Used to restrict a get or 859 // update operation on a document to a subset of its fields. This is different 860 // from standard field masks, as this is always scoped to a Document, and takes 861 // in account the dynamic nature of Value. 862 type DocumentMask struct { 863 // FieldPaths: The list of field paths in the mask. See Document.fields for a 864 // field path syntax reference. 865 FieldPaths []string `json:"fieldPaths,omitempty"` 866 // ForceSendFields is a list of field names (e.g. "FieldPaths") to 867 // unconditionally include in API requests. By default, fields with empty or 868 // default values are omitted from API requests. See 869 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 870 // details. 871 ForceSendFields []string `json:"-"` 872 // NullFields is a list of field names (e.g. "FieldPaths") to include in API 873 // requests with the JSON null value. By default, fields with empty values are 874 // omitted from API requests. See 875 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 876 NullFields []string `json:"-"` 877 } 878 879 func (s *DocumentMask) MarshalJSON() ([]byte, error) { 880 type NoMethod DocumentMask 881 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 882 } 883 884 // DocumentRemove: A Document has been removed from the view of the targets. 885 // Sent if the document is no longer relevant to a target and is out of view. 886 // Can be sent instead of a DocumentDelete or a DocumentChange if the server 887 // can not send the new value of the document. Multiple DocumentRemove messages 888 // may be returned for the same logical write or delete, if multiple targets 889 // are affected. 890 type DocumentRemove struct { 891 // Document: The resource name of the Document that has gone out of view. 892 Document string `json:"document,omitempty"` 893 // ReadTime: The read timestamp at which the remove was observed. Greater or 894 // equal to the `commit_time` of the change/delete/remove. 895 ReadTime string `json:"readTime,omitempty"` 896 // RemovedTargetIds: A set of target IDs for targets that previously matched 897 // this document. 898 RemovedTargetIds []int64 `json:"removedTargetIds,omitempty"` 899 // ForceSendFields is a list of field names (e.g. "Document") to 900 // unconditionally include in API requests. By default, fields with empty or 901 // default values are omitted from API requests. See 902 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 903 // details. 904 ForceSendFields []string `json:"-"` 905 // NullFields is a list of field names (e.g. "Document") to include in API 906 // requests with the JSON null value. By default, fields with empty values are 907 // omitted from API requests. See 908 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 909 NullFields []string `json:"-"` 910 } 911 912 func (s *DocumentRemove) MarshalJSON() ([]byte, error) { 913 type NoMethod DocumentRemove 914 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 915 } 916 917 // DocumentTransform: A transformation of a document. 918 type DocumentTransform struct { 919 // Document: The name of the document to transform. 920 Document string `json:"document,omitempty"` 921 // FieldTransforms: The list of transformations to apply to the fields of the 922 // document, in order. This must not be empty. 923 FieldTransforms []*FieldTransform `json:"fieldTransforms,omitempty"` 924 // ForceSendFields is a list of field names (e.g. "Document") to 925 // unconditionally include in API requests. By default, fields with empty or 926 // default values are omitted from API requests. See 927 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 928 // details. 929 ForceSendFields []string `json:"-"` 930 // NullFields is a list of field names (e.g. "Document") to include in API 931 // requests with the JSON null value. By default, fields with empty values are 932 // omitted from API requests. See 933 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 934 NullFields []string `json:"-"` 935 } 936 937 func (s *DocumentTransform) MarshalJSON() ([]byte, error) { 938 type NoMethod DocumentTransform 939 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 940 } 941 942 // DocumentsTarget: A target specified by a set of documents names. 943 type DocumentsTarget struct { 944 // Documents: The names of the documents to retrieve. In the format: 945 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 946 // The request will fail if any of the document is not a child resource of the 947 // given `database`. Duplicate names will be elided. 948 Documents []string `json:"documents,omitempty"` 949 // ForceSendFields is a list of field names (e.g. "Documents") to 950 // unconditionally include in API requests. By default, fields with empty or 951 // default values are omitted from API requests. See 952 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 953 // details. 954 ForceSendFields []string `json:"-"` 955 // NullFields is a list of field names (e.g. "Documents") to include in API 956 // requests with the JSON null value. By default, fields with empty values are 957 // omitted from API requests. See 958 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 959 NullFields []string `json:"-"` 960 } 961 962 func (s *DocumentsTarget) MarshalJSON() ([]byte, error) { 963 type NoMethod DocumentsTarget 964 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 965 } 966 967 // Empty: A generic empty message that you can re-use to avoid defining 968 // duplicated empty messages in your APIs. A typical example is to use it as 969 // the request or the response type of an API method. For instance: service Foo 970 // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } 971 type Empty struct { 972 // ServerResponse contains the HTTP response code and headers from the server. 973 googleapi.ServerResponse `json:"-"` 974 } 975 976 // ExecutionStats: Execution statistics for the query. 977 type ExecutionStats struct { 978 // DebugStats: Debugging statistics from the execution of the query. Note that 979 // the debugging stats are subject to change as Firestore evolves. It could 980 // include: { "indexes_entries_scanned": "1000", "documents_scanned": "20", 981 // "billing_details" : { "documents_billable": "20", "index_entries_billable": 982 // "1000", "min_query_cost": "0" } } 983 DebugStats googleapi.RawMessage `json:"debugStats,omitempty"` 984 // ExecutionDuration: Total time to execute the query in the backend. 985 ExecutionDuration string `json:"executionDuration,omitempty"` 986 // ReadOperations: Total billable read operations. 987 ReadOperations int64 `json:"readOperations,omitempty,string"` 988 // ResultsReturned: Total number of results returned, including documents, 989 // projections, aggregation results, keys. 990 ResultsReturned int64 `json:"resultsReturned,omitempty,string"` 991 // ForceSendFields is a list of field names (e.g. "DebugStats") to 992 // unconditionally include in API requests. By default, fields with empty or 993 // default values are omitted from API requests. See 994 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 995 // details. 996 ForceSendFields []string `json:"-"` 997 // NullFields is a list of field names (e.g. "DebugStats") to include in API 998 // requests with the JSON null value. By default, fields with empty values are 999 // omitted from API requests. See 1000 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1001 NullFields []string `json:"-"` 1002 } 1003 1004 func (s *ExecutionStats) MarshalJSON() ([]byte, error) { 1005 type NoMethod ExecutionStats 1006 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1007 } 1008 1009 // ExistenceFilter: A digest of all the documents that match a given target. 1010 type ExistenceFilter struct { 1011 // Count: The total count of documents that match target_id. If different from 1012 // the count of documents in the client that match, the client must manually 1013 // determine which documents no longer match the target. The client can use the 1014 // `unchanged_names` bloom filter to assist with this determination by testing 1015 // ALL the document names against the filter; if the document name is NOT in 1016 // the filter, it means the document no longer matches the target. 1017 Count int64 `json:"count,omitempty"` 1018 // TargetId: The target ID to which this filter applies. 1019 TargetId int64 `json:"targetId,omitempty"` 1020 // UnchangedNames: A bloom filter that, despite its name, contains the UTF-8 1021 // byte encodings of the resource names of ALL the documents that match 1022 // target_id, in the form 1023 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 1024 // This bloom filter may be omitted at the server's discretion, such as if it 1025 // is deemed that the client will not make use of it or if it is too 1026 // computationally expensive to calculate or transmit. Clients must gracefully 1027 // handle this field being absent by falling back to the logic used before this 1028 // field existed; that is, re-add the target without a resume token to figure 1029 // out which documents in the client's cache are out of sync. 1030 UnchangedNames *BloomFilter `json:"unchangedNames,omitempty"` 1031 // ForceSendFields is a list of field names (e.g. "Count") to unconditionally 1032 // include in API requests. By default, fields with empty or default values are 1033 // omitted from API requests. See 1034 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1035 // details. 1036 ForceSendFields []string `json:"-"` 1037 // NullFields is a list of field names (e.g. "Count") to include in API 1038 // requests with the JSON null value. By default, fields with empty values are 1039 // omitted from API requests. See 1040 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1041 NullFields []string `json:"-"` 1042 } 1043 1044 func (s *ExistenceFilter) MarshalJSON() ([]byte, error) { 1045 type NoMethod ExistenceFilter 1046 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1047 } 1048 1049 // ExplainMetrics: Explain metrics for the query. 1050 type ExplainMetrics struct { 1051 // ExecutionStats: Aggregated stats from the execution of the query. Only 1052 // present when ExplainOptions.analyze is set to true. 1053 ExecutionStats *ExecutionStats `json:"executionStats,omitempty"` 1054 // PlanSummary: Planning phase information for the query. 1055 PlanSummary *PlanSummary `json:"planSummary,omitempty"` 1056 // ForceSendFields is a list of field names (e.g. "ExecutionStats") to 1057 // unconditionally include in API requests. By default, fields with empty or 1058 // default values are omitted from API requests. See 1059 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1060 // details. 1061 ForceSendFields []string `json:"-"` 1062 // NullFields is a list of field names (e.g. "ExecutionStats") to include in 1063 // API requests with the JSON null value. By default, fields with empty values 1064 // are omitted from API requests. See 1065 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1066 NullFields []string `json:"-"` 1067 } 1068 1069 func (s *ExplainMetrics) MarshalJSON() ([]byte, error) { 1070 type NoMethod ExplainMetrics 1071 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1072 } 1073 1074 // ExplainOptions: Explain options for the query. 1075 type ExplainOptions struct { 1076 // Analyze: Optional. Whether to execute this query. When false (the default), 1077 // the query will be planned, returning only metrics from the planning stages. 1078 // When true, the query will be planned and executed, returning the full query 1079 // results along with both planning and execution stage metrics. 1080 Analyze bool `json:"analyze,omitempty"` 1081 // ForceSendFields is a list of field names (e.g. "Analyze") to unconditionally 1082 // include in API requests. By default, fields with empty or default values are 1083 // omitted from API requests. See 1084 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1085 // details. 1086 ForceSendFields []string `json:"-"` 1087 // NullFields is a list of field names (e.g. "Analyze") to include in API 1088 // requests with the JSON null value. By default, fields with empty values are 1089 // omitted from API requests. See 1090 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1091 NullFields []string `json:"-"` 1092 } 1093 1094 func (s *ExplainOptions) MarshalJSON() ([]byte, error) { 1095 type NoMethod ExplainOptions 1096 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1097 } 1098 1099 // FieldFilter: A filter on a specific field. 1100 type FieldFilter struct { 1101 // Field: The field to filter by. 1102 Field *FieldReference `json:"field,omitempty"` 1103 // Op: The operator to filter by. 1104 // 1105 // Possible values: 1106 // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used. 1107 // "LESS_THAN" - The given `field` is less than the given `value`. Requires: 1108 // * That `field` come first in `order_by`. 1109 // "LESS_THAN_OR_EQUAL" - The given `field` is less than or equal to the 1110 // given `value`. Requires: * That `field` come first in `order_by`. 1111 // "GREATER_THAN" - The given `field` is greater than the given `value`. 1112 // Requires: * That `field` come first in `order_by`. 1113 // "GREATER_THAN_OR_EQUAL" - The given `field` is greater than or equal to 1114 // the given `value`. Requires: * That `field` come first in `order_by`. 1115 // "EQUAL" - The given `field` is equal to the given `value`. 1116 // "NOT_EQUAL" - The given `field` is not equal to the given `value`. 1117 // Requires: * No other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. 1118 // * That `field` comes first in the `order_by`. 1119 // "ARRAY_CONTAINS" - The given `field` is an array that contains the given 1120 // `value`. 1121 // "IN" - The given `field` is equal to at least one value in the given 1122 // array. Requires: * That `value` is a non-empty `ArrayValue`, subject to 1123 // disjunction limits. * No `NOT_IN` filters in the same query. 1124 // "ARRAY_CONTAINS_ANY" - The given `field` is an array that contains any of 1125 // the values in the given array. Requires: * That `value` is a non-empty 1126 // `ArrayValue`, subject to disjunction limits. * No other `ARRAY_CONTAINS_ANY` 1127 // filters within the same disjunction. * No `NOT_IN` filters in the same 1128 // query. 1129 // "NOT_IN" - The value of the `field` is not in the given array. Requires: * 1130 // That `value` is a non-empty `ArrayValue` with at most 10 values. * No other 1131 // `OR`, `IN`, `ARRAY_CONTAINS_ANY`, `NOT_IN`, `NOT_EQUAL`, `IS_NOT_NULL`, or 1132 // `IS_NOT_NAN`. * That `field` comes first in the `order_by`. 1133 Op string `json:"op,omitempty"` 1134 // Value: The value to compare to. 1135 Value *Value `json:"value,omitempty"` 1136 // ForceSendFields is a list of field names (e.g. "Field") to unconditionally 1137 // include in API requests. By default, fields with empty or default values are 1138 // omitted from API requests. See 1139 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1140 // details. 1141 ForceSendFields []string `json:"-"` 1142 // NullFields is a list of field names (e.g. "Field") to include in API 1143 // requests with the JSON null value. By default, fields with empty values are 1144 // omitted from API requests. See 1145 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1146 NullFields []string `json:"-"` 1147 } 1148 1149 func (s *FieldFilter) MarshalJSON() ([]byte, error) { 1150 type NoMethod FieldFilter 1151 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1152 } 1153 1154 // FieldReference: A reference to a field in a document, ex: 1155 // `stats.operations`. 1156 type FieldReference struct { 1157 // FieldPath: A reference to a field in a document. Requires: * MUST be a 1158 // dot-delimited (`.`) string of segments, where each segment conforms to 1159 // document field name limitations. 1160 FieldPath string `json:"fieldPath,omitempty"` 1161 // ForceSendFields is a list of field names (e.g. "FieldPath") to 1162 // unconditionally include in API requests. By default, fields with empty or 1163 // default values are omitted from API requests. See 1164 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1165 // details. 1166 ForceSendFields []string `json:"-"` 1167 // NullFields is a list of field names (e.g. "FieldPath") to include in API 1168 // requests with the JSON null value. By default, fields with empty values are 1169 // omitted from API requests. See 1170 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1171 NullFields []string `json:"-"` 1172 } 1173 1174 func (s *FieldReference) MarshalJSON() ([]byte, error) { 1175 type NoMethod FieldReference 1176 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1177 } 1178 1179 // FieldTransform: A transformation of a field of the document. 1180 type FieldTransform struct { 1181 // AppendMissingElements: Append the given elements in order if they are not 1182 // already present in the current field value. If the field is not an array, or 1183 // if the field does not yet exist, it is first set to the empty array. 1184 // Equivalent numbers of different types (e.g. 3L and 3.0) are considered equal 1185 // when checking if a value is missing. NaN is equal to NaN, and Null is equal 1186 // to Null. If the input contains multiple equivalent values, only the first 1187 // will be considered. The corresponding transform_result will be the null 1188 // value. 1189 AppendMissingElements *ArrayValue `json:"appendMissingElements,omitempty"` 1190 // FieldPath: The path of the field. See Document.fields for the field path 1191 // syntax reference. 1192 FieldPath string `json:"fieldPath,omitempty"` 1193 // Increment: Adds the given value to the field's current value. This must be 1194 // an integer or a double value. If the field is not an integer or double, or 1195 // if the field does not yet exist, the transformation will set the field to 1196 // the given value. If either of the given value or the current field value are 1197 // doubles, both values will be interpreted as doubles. Double arithmetic and 1198 // representation of double values follow IEEE 754 semantics. If there is 1199 // positive/negative integer overflow, the field is resolved to the largest 1200 // magnitude positive/negative integer. 1201 Increment *Value `json:"increment,omitempty"` 1202 // Maximum: Sets the field to the maximum of its current value and the given 1203 // value. This must be an integer or a double value. If the field is not an 1204 // integer or double, or if the field does not yet exist, the transformation 1205 // will set the field to the given value. If a maximum operation is applied 1206 // where the field and the input value are of mixed types (that is - one is an 1207 // integer and one is a double) the field takes on the type of the larger 1208 // operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not 1209 // change. 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value 1210 // and zero input value is always the stored value. The maximum of any numeric 1211 // value x and NaN is NaN. 1212 Maximum *Value `json:"maximum,omitempty"` 1213 // Minimum: Sets the field to the minimum of its current value and the given 1214 // value. This must be an integer or a double value. If the field is not an 1215 // integer or double, or if the field does not yet exist, the transformation 1216 // will set the field to the input value. If a minimum operation is applied 1217 // where the field and the input value are of mixed types (that is - one is an 1218 // integer and one is a double) the field takes on the type of the smaller 1219 // operand. If the operands are equivalent (e.g. 3 and 3.0), the field does not 1220 // change. 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value 1221 // and zero input value is always the stored value. The minimum of any numeric 1222 // value x and NaN is NaN. 1223 Minimum *Value `json:"minimum,omitempty"` 1224 // RemoveAllFromArray: Remove all of the given elements from the array in the 1225 // field. If the field is not an array, or if the field does not yet exist, it 1226 // is set to the empty array. Equivalent numbers of the different types (e.g. 1227 // 3L and 3.0) are considered equal when deciding whether an element should be 1228 // removed. NaN is equal to NaN, and Null is equal to Null. This will remove 1229 // all equivalent values if there are duplicates. The corresponding 1230 // transform_result will be the null value. 1231 RemoveAllFromArray *ArrayValue `json:"removeAllFromArray,omitempty"` 1232 // SetToServerValue: Sets the field to the given server value. 1233 // 1234 // Possible values: 1235 // "SERVER_VALUE_UNSPECIFIED" - Unspecified. This value must not be used. 1236 // "REQUEST_TIME" - The time at which the server processed the request, with 1237 // millisecond precision. If used on multiple fields (same or different 1238 // documents) in a transaction, all the fields will get the same server 1239 // timestamp. 1240 SetToServerValue string `json:"setToServerValue,omitempty"` 1241 // ForceSendFields is a list of field names (e.g. "AppendMissingElements") to 1242 // unconditionally include in API requests. By default, fields with empty or 1243 // default values are omitted from API requests. See 1244 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1245 // details. 1246 ForceSendFields []string `json:"-"` 1247 // NullFields is a list of field names (e.g. "AppendMissingElements") to 1248 // include in API requests with the JSON null value. By default, fields with 1249 // empty values are omitted from API requests. See 1250 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1251 NullFields []string `json:"-"` 1252 } 1253 1254 func (s *FieldTransform) MarshalJSON() ([]byte, error) { 1255 type NoMethod FieldTransform 1256 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1257 } 1258 1259 // Filter: A filter. 1260 type Filter struct { 1261 // CompositeFilter: A composite filter. 1262 CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"` 1263 // FieldFilter: A filter on a document field. 1264 FieldFilter *FieldFilter `json:"fieldFilter,omitempty"` 1265 // UnaryFilter: A filter that takes exactly one argument. 1266 UnaryFilter *UnaryFilter `json:"unaryFilter,omitempty"` 1267 // ForceSendFields is a list of field names (e.g. "CompositeFilter") to 1268 // unconditionally include in API requests. By default, fields with empty or 1269 // default values are omitted from API requests. See 1270 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1271 // details. 1272 ForceSendFields []string `json:"-"` 1273 // NullFields is a list of field names (e.g. "CompositeFilter") to include in 1274 // API requests with the JSON null value. By default, fields with empty values 1275 // are omitted from API requests. See 1276 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1277 NullFields []string `json:"-"` 1278 } 1279 1280 func (s *Filter) MarshalJSON() ([]byte, error) { 1281 type NoMethod Filter 1282 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1283 } 1284 1285 // FindNearest: Nearest Neighbors search config. 1286 type FindNearest struct { 1287 // DistanceMeasure: Required. The distance measure to use, required. 1288 // 1289 // Possible values: 1290 // "DISTANCE_MEASURE_UNSPECIFIED" - Should not be set. 1291 // "EUCLIDEAN" - Measures the EUCLIDEAN distance between the vectors. See 1292 // [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn more 1293 // "COSINE" - Compares vectors based on the angle between them, which allows 1294 // you to measure similarity that isn't based on the vectors magnitude. We 1295 // recommend using DOT_PRODUCT with unit normalized vectors instead of COSINE 1296 // distance, which is mathematically equivalent with better performance. See 1297 // [Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to 1298 // learn more. 1299 // "DOT_PRODUCT" - Similar to cosine but is affected by the magnitude of the 1300 // vectors. See [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to 1301 // learn more. 1302 DistanceMeasure string `json:"distanceMeasure,omitempty"` 1303 // Limit: Required. The number of nearest neighbors to return. Must be a 1304 // positive integer of no more than 1000. 1305 Limit int64 `json:"limit,omitempty"` 1306 // QueryVector: Required. The query vector that we are searching on. Must be a 1307 // vector of no more than 2048 dimensions. 1308 QueryVector *Value `json:"queryVector,omitempty"` 1309 // VectorField: Required. An indexed vector field to search upon. Only 1310 // documents which contain vectors whose dimensionality match the query_vector 1311 // can be returned. 1312 VectorField *FieldReference `json:"vectorField,omitempty"` 1313 // ForceSendFields is a list of field names (e.g. "DistanceMeasure") to 1314 // unconditionally include in API requests. By default, fields with empty or 1315 // default values are omitted from API requests. See 1316 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1317 // details. 1318 ForceSendFields []string `json:"-"` 1319 // NullFields is a list of field names (e.g. "DistanceMeasure") to include in 1320 // API requests with the JSON null value. By default, fields with empty values 1321 // are omitted from API requests. See 1322 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1323 NullFields []string `json:"-"` 1324 } 1325 1326 func (s *FindNearest) MarshalJSON() ([]byte, error) { 1327 type NoMethod FindNearest 1328 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1329 } 1330 1331 // GoogleFirestoreAdminV1CreateDatabaseMetadata: Metadata related to the create 1332 // database operation. 1333 type GoogleFirestoreAdminV1CreateDatabaseMetadata struct { 1334 } 1335 1336 // GoogleFirestoreAdminV1DeleteDatabaseMetadata: Metadata related to the delete 1337 // database operation. 1338 type GoogleFirestoreAdminV1DeleteDatabaseMetadata struct { 1339 } 1340 1341 // GoogleFirestoreAdminV1Progress: Describes the progress of the operation. 1342 // Unit of work is generic and must be interpreted based on where Progress is 1343 // used. 1344 type GoogleFirestoreAdminV1Progress struct { 1345 // CompletedWork: The amount of work completed. 1346 CompletedWork int64 `json:"completedWork,omitempty,string"` 1347 // EstimatedWork: The amount of work estimated. 1348 EstimatedWork int64 `json:"estimatedWork,omitempty,string"` 1349 // ForceSendFields is a list of field names (e.g. "CompletedWork") to 1350 // unconditionally include in API requests. By default, fields with empty or 1351 // default values are omitted from API requests. See 1352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1353 // details. 1354 ForceSendFields []string `json:"-"` 1355 // NullFields is a list of field names (e.g. "CompletedWork") to include in API 1356 // requests with the JSON null value. By default, fields with empty values are 1357 // omitted from API requests. See 1358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1359 NullFields []string `json:"-"` 1360 } 1361 1362 func (s *GoogleFirestoreAdminV1Progress) MarshalJSON() ([]byte, error) { 1363 type NoMethod GoogleFirestoreAdminV1Progress 1364 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1365 } 1366 1367 // GoogleFirestoreAdminV1RestoreDatabaseMetadata: Metadata for the long-running 1368 // operation from the RestoreDatabase request. 1369 type GoogleFirestoreAdminV1RestoreDatabaseMetadata struct { 1370 // Backup: The name of the backup restoring from. 1371 Backup string `json:"backup,omitempty"` 1372 // Database: The name of the database being restored to. 1373 Database string `json:"database,omitempty"` 1374 // EndTime: The time the restore finished, unset for ongoing restores. 1375 EndTime string `json:"endTime,omitempty"` 1376 // OperationState: The operation state of the restore. 1377 // 1378 // Possible values: 1379 // "OPERATION_STATE_UNSPECIFIED" - Unspecified. 1380 // "INITIALIZING" - Request is being prepared for processing. 1381 // "PROCESSING" - Request is actively being processed. 1382 // "CANCELLING" - Request is in the process of being cancelled after user 1383 // called google.longrunning.Operations.CancelOperation on the operation. 1384 // "FINALIZING" - Request has been processed and is in its finalization 1385 // stage. 1386 // "SUCCESSFUL" - Request has completed successfully. 1387 // "FAILED" - Request has finished being processed, but encountered an error. 1388 // "CANCELLED" - Request has finished being cancelled after user called 1389 // google.longrunning.Operations.CancelOperation. 1390 OperationState string `json:"operationState,omitempty"` 1391 // ProgressPercentage: How far along the restore is as an estimated percentage 1392 // of remaining time. 1393 ProgressPercentage *GoogleFirestoreAdminV1Progress `json:"progressPercentage,omitempty"` 1394 // StartTime: The time the restore was started. 1395 StartTime string `json:"startTime,omitempty"` 1396 // ForceSendFields is a list of field names (e.g. "Backup") to unconditionally 1397 // include in API requests. By default, fields with empty or default values are 1398 // omitted from API requests. See 1399 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1400 // details. 1401 ForceSendFields []string `json:"-"` 1402 // NullFields is a list of field names (e.g. "Backup") to include in API 1403 // requests with the JSON null value. By default, fields with empty values are 1404 // omitted from API requests. See 1405 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1406 NullFields []string `json:"-"` 1407 } 1408 1409 func (s *GoogleFirestoreAdminV1RestoreDatabaseMetadata) MarshalJSON() ([]byte, error) { 1410 type NoMethod GoogleFirestoreAdminV1RestoreDatabaseMetadata 1411 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1412 } 1413 1414 // GoogleFirestoreAdminV1UpdateDatabaseMetadata: Metadata related to the update 1415 // database operation. 1416 type GoogleFirestoreAdminV1UpdateDatabaseMetadata struct { 1417 } 1418 1419 // GoogleFirestoreAdminV1beta1ExportDocumentsMetadata: Metadata for 1420 // ExportDocuments operations. 1421 type GoogleFirestoreAdminV1beta1ExportDocumentsMetadata struct { 1422 // CollectionIds: Which collection ids are being exported. 1423 CollectionIds []string `json:"collectionIds,omitempty"` 1424 // EndTime: The time the operation ended, either successfully or otherwise. 1425 // Unset if the operation is still active. 1426 EndTime string `json:"endTime,omitempty"` 1427 // OperationState: The state of the export operation. 1428 // 1429 // Possible values: 1430 // "STATE_UNSPECIFIED" - Unspecified. 1431 // "INITIALIZING" - Request is being prepared for processing. 1432 // "PROCESSING" - Request is actively being processed. 1433 // "CANCELLING" - Request is in the process of being cancelled after user 1434 // called google.longrunning.Operations.CancelOperation on the operation. 1435 // "FINALIZING" - Request has been processed and is in its finalization 1436 // stage. 1437 // "SUCCESSFUL" - Request has completed successfully. 1438 // "FAILED" - Request has finished being processed, but encountered an error. 1439 // "CANCELLED" - Request has finished being cancelled after user called 1440 // google.longrunning.Operations.CancelOperation. 1441 OperationState string `json:"operationState,omitempty"` 1442 // OutputUriPrefix: Where the entities are being exported to. 1443 OutputUriPrefix string `json:"outputUriPrefix,omitempty"` 1444 // ProgressBytes: An estimate of the number of bytes processed. 1445 ProgressBytes *GoogleFirestoreAdminV1beta1Progress `json:"progressBytes,omitempty"` 1446 // ProgressDocuments: An estimate of the number of documents processed. 1447 ProgressDocuments *GoogleFirestoreAdminV1beta1Progress `json:"progressDocuments,omitempty"` 1448 // StartTime: The time that work began on the operation. 1449 StartTime string `json:"startTime,omitempty"` 1450 // ForceSendFields is a list of field names (e.g. "CollectionIds") to 1451 // unconditionally include in API requests. By default, fields with empty or 1452 // default values are omitted from API requests. See 1453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1454 // details. 1455 ForceSendFields []string `json:"-"` 1456 // NullFields is a list of field names (e.g. "CollectionIds") to include in API 1457 // requests with the JSON null value. By default, fields with empty values are 1458 // omitted from API requests. See 1459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1460 NullFields []string `json:"-"` 1461 } 1462 1463 func (s *GoogleFirestoreAdminV1beta1ExportDocumentsMetadata) MarshalJSON() ([]byte, error) { 1464 type NoMethod GoogleFirestoreAdminV1beta1ExportDocumentsMetadata 1465 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1466 } 1467 1468 // GoogleFirestoreAdminV1beta1ExportDocumentsRequest: The request for 1469 // FirestoreAdmin.ExportDocuments. 1470 type GoogleFirestoreAdminV1beta1ExportDocumentsRequest struct { 1471 // CollectionIds: Which collection ids to export. Unspecified means all 1472 // collections. 1473 CollectionIds []string `json:"collectionIds,omitempty"` 1474 // OutputUriPrefix: The output URI. Currently only supports Google Cloud 1475 // Storage URIs of the form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where 1476 // `BUCKET_NAME` is the name of the Google Cloud Storage bucket and 1477 // `NAMESPACE_PATH` is an optional Google Cloud Storage namespace path. When 1478 // choosing a name, be sure to consider Google Cloud Storage naming guidelines: 1479 // https://cloud.google.com/storage/docs/naming. If the URI is a bucket 1480 // (without a namespace path), a prefix will be generated based on the start 1481 // time. 1482 OutputUriPrefix string `json:"outputUriPrefix,omitempty"` 1483 // ForceSendFields is a list of field names (e.g. "CollectionIds") to 1484 // unconditionally include in API requests. By default, fields with empty or 1485 // default values are omitted from API requests. See 1486 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1487 // details. 1488 ForceSendFields []string `json:"-"` 1489 // NullFields is a list of field names (e.g. "CollectionIds") to include in API 1490 // requests with the JSON null value. By default, fields with empty values are 1491 // omitted from API requests. See 1492 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1493 NullFields []string `json:"-"` 1494 } 1495 1496 func (s *GoogleFirestoreAdminV1beta1ExportDocumentsRequest) MarshalJSON() ([]byte, error) { 1497 type NoMethod GoogleFirestoreAdminV1beta1ExportDocumentsRequest 1498 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1499 } 1500 1501 // GoogleFirestoreAdminV1beta1ExportDocumentsResponse: Returned in the 1502 // google.longrunning.Operation response field. 1503 type GoogleFirestoreAdminV1beta1ExportDocumentsResponse struct { 1504 // OutputUriPrefix: Location of the output files. This can be used to begin an 1505 // import into Cloud Firestore (this project or another project) after the 1506 // operation completes successfully. 1507 OutputUriPrefix string `json:"outputUriPrefix,omitempty"` 1508 // ForceSendFields is a list of field names (e.g. "OutputUriPrefix") to 1509 // unconditionally include in API requests. By default, fields with empty or 1510 // default values are omitted from API requests. See 1511 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1512 // details. 1513 ForceSendFields []string `json:"-"` 1514 // NullFields is a list of field names (e.g. "OutputUriPrefix") to include in 1515 // API requests with the JSON null value. By default, fields with empty values 1516 // are omitted from API requests. See 1517 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1518 NullFields []string `json:"-"` 1519 } 1520 1521 func (s *GoogleFirestoreAdminV1beta1ExportDocumentsResponse) MarshalJSON() ([]byte, error) { 1522 type NoMethod GoogleFirestoreAdminV1beta1ExportDocumentsResponse 1523 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1524 } 1525 1526 // GoogleFirestoreAdminV1beta1ImportDocumentsMetadata: Metadata for 1527 // ImportDocuments operations. 1528 type GoogleFirestoreAdminV1beta1ImportDocumentsMetadata struct { 1529 // CollectionIds: Which collection ids are being imported. 1530 CollectionIds []string `json:"collectionIds,omitempty"` 1531 // EndTime: The time the operation ended, either successfully or otherwise. 1532 // Unset if the operation is still active. 1533 EndTime string `json:"endTime,omitempty"` 1534 // InputUriPrefix: The location of the documents being imported. 1535 InputUriPrefix string `json:"inputUriPrefix,omitempty"` 1536 // OperationState: The state of the import operation. 1537 // 1538 // Possible values: 1539 // "STATE_UNSPECIFIED" - Unspecified. 1540 // "INITIALIZING" - Request is being prepared for processing. 1541 // "PROCESSING" - Request is actively being processed. 1542 // "CANCELLING" - Request is in the process of being cancelled after user 1543 // called google.longrunning.Operations.CancelOperation on the operation. 1544 // "FINALIZING" - Request has been processed and is in its finalization 1545 // stage. 1546 // "SUCCESSFUL" - Request has completed successfully. 1547 // "FAILED" - Request has finished being processed, but encountered an error. 1548 // "CANCELLED" - Request has finished being cancelled after user called 1549 // google.longrunning.Operations.CancelOperation. 1550 OperationState string `json:"operationState,omitempty"` 1551 // ProgressBytes: An estimate of the number of bytes processed. 1552 ProgressBytes *GoogleFirestoreAdminV1beta1Progress `json:"progressBytes,omitempty"` 1553 // ProgressDocuments: An estimate of the number of documents processed. 1554 ProgressDocuments *GoogleFirestoreAdminV1beta1Progress `json:"progressDocuments,omitempty"` 1555 // StartTime: The time that work began on the operation. 1556 StartTime string `json:"startTime,omitempty"` 1557 // ForceSendFields is a list of field names (e.g. "CollectionIds") to 1558 // unconditionally include in API requests. By default, fields with empty or 1559 // default values are omitted from API requests. See 1560 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1561 // details. 1562 ForceSendFields []string `json:"-"` 1563 // NullFields is a list of field names (e.g. "CollectionIds") to include in API 1564 // requests with the JSON null value. By default, fields with empty values are 1565 // omitted from API requests. See 1566 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1567 NullFields []string `json:"-"` 1568 } 1569 1570 func (s *GoogleFirestoreAdminV1beta1ImportDocumentsMetadata) MarshalJSON() ([]byte, error) { 1571 type NoMethod GoogleFirestoreAdminV1beta1ImportDocumentsMetadata 1572 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1573 } 1574 1575 // GoogleFirestoreAdminV1beta1ImportDocumentsRequest: The request for 1576 // FirestoreAdmin.ImportDocuments. 1577 type GoogleFirestoreAdminV1beta1ImportDocumentsRequest struct { 1578 // CollectionIds: Which collection ids to import. Unspecified means all 1579 // collections included in the import. 1580 CollectionIds []string `json:"collectionIds,omitempty"` 1581 // InputUriPrefix: Location of the exported files. This must match the 1582 // output_uri_prefix of an ExportDocumentsResponse from an export that has 1583 // completed successfully. See: 1584 // google.firestore.admin.v1beta1.ExportDocumentsResponse.output_uri_prefix. 1585 InputUriPrefix string `json:"inputUriPrefix,omitempty"` 1586 // ForceSendFields is a list of field names (e.g. "CollectionIds") to 1587 // unconditionally include in API requests. By default, fields with empty or 1588 // default values are omitted from API requests. See 1589 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1590 // details. 1591 ForceSendFields []string `json:"-"` 1592 // NullFields is a list of field names (e.g. "CollectionIds") to include in API 1593 // requests with the JSON null value. By default, fields with empty values are 1594 // omitted from API requests. See 1595 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1596 NullFields []string `json:"-"` 1597 } 1598 1599 func (s *GoogleFirestoreAdminV1beta1ImportDocumentsRequest) MarshalJSON() ([]byte, error) { 1600 type NoMethod GoogleFirestoreAdminV1beta1ImportDocumentsRequest 1601 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1602 } 1603 1604 // GoogleFirestoreAdminV1beta1Index: An index definition. 1605 type GoogleFirestoreAdminV1beta1Index struct { 1606 // CollectionId: The collection ID to which this index applies. Required. 1607 CollectionId string `json:"collectionId,omitempty"` 1608 // Fields: The fields to index. 1609 Fields []*GoogleFirestoreAdminV1beta1IndexField `json:"fields,omitempty"` 1610 // Name: The resource name of the index. Output only. 1611 Name string `json:"name,omitempty"` 1612 // State: The state of the index. Output only. 1613 // 1614 // Possible values: 1615 // "STATE_UNSPECIFIED" - The state is unspecified. 1616 // "CREATING" - The index is being created. There is an active long-running 1617 // operation for the index. The index is updated when writing a document. Some 1618 // index data may exist. 1619 // "READY" - The index is ready to be used. The index is updated when writing 1620 // a document. The index is fully populated from all stored documents it 1621 // applies to. 1622 // "ERROR" - The index was being created, but something went wrong. There is 1623 // no active long-running operation for the index, and the most recently 1624 // finished long-running operation failed. The index is not updated when 1625 // writing a document. Some index data may exist. 1626 State string `json:"state,omitempty"` 1627 1628 // ServerResponse contains the HTTP response code and headers from the server. 1629 googleapi.ServerResponse `json:"-"` 1630 // ForceSendFields is a list of field names (e.g. "CollectionId") to 1631 // unconditionally include in API requests. By default, fields with empty or 1632 // default values are omitted from API requests. See 1633 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1634 // details. 1635 ForceSendFields []string `json:"-"` 1636 // NullFields is a list of field names (e.g. "CollectionId") to include in API 1637 // requests with the JSON null value. By default, fields with empty values are 1638 // omitted from API requests. See 1639 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1640 NullFields []string `json:"-"` 1641 } 1642 1643 func (s *GoogleFirestoreAdminV1beta1Index) MarshalJSON() ([]byte, error) { 1644 type NoMethod GoogleFirestoreAdminV1beta1Index 1645 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1646 } 1647 1648 // GoogleFirestoreAdminV1beta1IndexField: A field of an index. 1649 type GoogleFirestoreAdminV1beta1IndexField struct { 1650 // FieldPath: The path of the field. Must match the field path specification 1651 // described by google.firestore.v1beta1.Document.fields. Special field path 1652 // `__name__` may be used by itself or at the end of a path. `__type__` may be 1653 // used only at the end of path. 1654 FieldPath string `json:"fieldPath,omitempty"` 1655 // Mode: The field's mode. 1656 // 1657 // Possible values: 1658 // "MODE_UNSPECIFIED" - The mode is unspecified. 1659 // "ASCENDING" - The field's values are indexed so as to support sequencing 1660 // in ascending order and also query by <, >, <=, >=, and =. 1661 // "DESCENDING" - The field's values are indexed so as to support sequencing 1662 // in descending order and also query by <, >, <=, >=, and =. 1663 // "ARRAY_CONTAINS" - The field's array values are indexed so as to support 1664 // membership using ARRAY_CONTAINS queries. 1665 Mode string `json:"mode,omitempty"` 1666 // ForceSendFields is a list of field names (e.g. "FieldPath") to 1667 // unconditionally include in API requests. By default, fields with empty or 1668 // default values are omitted from API requests. See 1669 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1670 // details. 1671 ForceSendFields []string `json:"-"` 1672 // NullFields is a list of field names (e.g. "FieldPath") to include in API 1673 // requests with the JSON null value. By default, fields with empty values are 1674 // omitted from API requests. See 1675 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1676 NullFields []string `json:"-"` 1677 } 1678 1679 func (s *GoogleFirestoreAdminV1beta1IndexField) MarshalJSON() ([]byte, error) { 1680 type NoMethod GoogleFirestoreAdminV1beta1IndexField 1681 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1682 } 1683 1684 // GoogleFirestoreAdminV1beta1IndexOperationMetadata: Metadata for index 1685 // operations. This metadata populates the metadata field of 1686 // google.longrunning.Operation. 1687 type GoogleFirestoreAdminV1beta1IndexOperationMetadata struct { 1688 // Cancelled: True if the [google.longrunning.Operation] was cancelled. If the 1689 // cancellation is in progress, cancelled will be true but 1690 // google.longrunning.Operation.done will be false. 1691 Cancelled bool `json:"cancelled,omitempty"` 1692 // DocumentProgress: Progress of the existing operation, measured in number of 1693 // documents. 1694 DocumentProgress *GoogleFirestoreAdminV1beta1Progress `json:"documentProgress,omitempty"` 1695 // EndTime: The time the operation ended, either successfully or otherwise. 1696 // Unset if the operation is still active. 1697 EndTime string `json:"endTime,omitempty"` 1698 // Index: The index resource that this operation is acting on. For example: 1699 // `projects/{project_id}/databases/{database_id}/indexes/{index_id}` 1700 Index string `json:"index,omitempty"` 1701 // OperationType: The type of index operation. 1702 // 1703 // Possible values: 1704 // "OPERATION_TYPE_UNSPECIFIED" - Unspecified. Never set by server. 1705 // "CREATING_INDEX" - The operation is creating the index. Initiated by a 1706 // `CreateIndex` call. 1707 OperationType string `json:"operationType,omitempty"` 1708 // StartTime: The time that work began on the operation. 1709 StartTime string `json:"startTime,omitempty"` 1710 // ForceSendFields is a list of field names (e.g. "Cancelled") to 1711 // unconditionally include in API requests. By default, fields with empty or 1712 // default values are omitted from API requests. See 1713 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1714 // details. 1715 ForceSendFields []string `json:"-"` 1716 // NullFields is a list of field names (e.g. "Cancelled") to include in API 1717 // requests with the JSON null value. By default, fields with empty values are 1718 // omitted from API requests. See 1719 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1720 NullFields []string `json:"-"` 1721 } 1722 1723 func (s *GoogleFirestoreAdminV1beta1IndexOperationMetadata) MarshalJSON() ([]byte, error) { 1724 type NoMethod GoogleFirestoreAdminV1beta1IndexOperationMetadata 1725 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1726 } 1727 1728 // GoogleFirestoreAdminV1beta1ListIndexesResponse: The response for 1729 // FirestoreAdmin.ListIndexes. 1730 type GoogleFirestoreAdminV1beta1ListIndexesResponse struct { 1731 // Indexes: The indexes. 1732 Indexes []*GoogleFirestoreAdminV1beta1Index `json:"indexes,omitempty"` 1733 // NextPageToken: The standard List next-page token. 1734 NextPageToken string `json:"nextPageToken,omitempty"` 1735 1736 // ServerResponse contains the HTTP response code and headers from the server. 1737 googleapi.ServerResponse `json:"-"` 1738 // ForceSendFields is a list of field names (e.g. "Indexes") to unconditionally 1739 // include in API requests. By default, fields with empty or default values are 1740 // omitted from API requests. See 1741 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1742 // details. 1743 ForceSendFields []string `json:"-"` 1744 // NullFields is a list of field names (e.g. "Indexes") to include in API 1745 // requests with the JSON null value. By default, fields with empty values are 1746 // omitted from API requests. See 1747 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1748 NullFields []string `json:"-"` 1749 } 1750 1751 func (s *GoogleFirestoreAdminV1beta1ListIndexesResponse) MarshalJSON() ([]byte, error) { 1752 type NoMethod GoogleFirestoreAdminV1beta1ListIndexesResponse 1753 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1754 } 1755 1756 // GoogleFirestoreAdminV1beta1LocationMetadata: The metadata message for 1757 // google.cloud.location.Location.metadata. 1758 type GoogleFirestoreAdminV1beta1LocationMetadata struct { 1759 } 1760 1761 // GoogleFirestoreAdminV1beta1Progress: Measures the progress of a particular 1762 // metric. 1763 type GoogleFirestoreAdminV1beta1Progress struct { 1764 // WorkCompleted: An estimate of how much work has been completed. Note that 1765 // this may be greater than `work_estimated`. 1766 WorkCompleted int64 `json:"workCompleted,omitempty,string"` 1767 // WorkEstimated: An estimate of how much work needs to be performed. Zero if 1768 // the work estimate is unavailable. May change as work progresses. 1769 WorkEstimated int64 `json:"workEstimated,omitempty,string"` 1770 // ForceSendFields is a list of field names (e.g. "WorkCompleted") to 1771 // unconditionally include in API requests. By default, fields with empty or 1772 // default values are omitted from API requests. See 1773 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1774 // details. 1775 ForceSendFields []string `json:"-"` 1776 // NullFields is a list of field names (e.g. "WorkCompleted") to include in API 1777 // requests with the JSON null value. By default, fields with empty values are 1778 // omitted from API requests. See 1779 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1780 NullFields []string `json:"-"` 1781 } 1782 1783 func (s *GoogleFirestoreAdminV1beta1Progress) MarshalJSON() ([]byte, error) { 1784 type NoMethod GoogleFirestoreAdminV1beta1Progress 1785 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1786 } 1787 1788 // GoogleLongrunningOperation: This resource represents a long-running 1789 // operation that is the result of a network API call. 1790 type GoogleLongrunningOperation struct { 1791 // Done: If the value is `false`, it means the operation is still in progress. 1792 // If `true`, the operation is completed, and either `error` or `response` is 1793 // available. 1794 Done bool `json:"done,omitempty"` 1795 // Error: The error result of the operation in case of failure or cancellation. 1796 Error *Status `json:"error,omitempty"` 1797 // Metadata: Service-specific metadata associated with the operation. It 1798 // typically contains progress information and common metadata such as create 1799 // time. Some services might not provide such metadata. Any method that returns 1800 // a long-running operation should document the metadata type, if any. 1801 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1802 // Name: The server-assigned name, which is only unique within the same service 1803 // that originally returns it. If you use the default HTTP mapping, the `name` 1804 // should be a resource name ending with `operations/{unique_id}`. 1805 Name string `json:"name,omitempty"` 1806 // Response: The normal, successful response of the operation. If the original 1807 // method returns no data on success, such as `Delete`, the response is 1808 // `google.protobuf.Empty`. If the original method is standard 1809 // `Get`/`Create`/`Update`, the response should be the resource. For other 1810 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 1811 // original method name. For example, if the original method name is 1812 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 1813 Response googleapi.RawMessage `json:"response,omitempty"` 1814 1815 // ServerResponse contains the HTTP response code and headers from the server. 1816 googleapi.ServerResponse `json:"-"` 1817 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 1818 // include in API requests. By default, fields with empty or default values are 1819 // omitted from API requests. See 1820 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1821 // details. 1822 ForceSendFields []string `json:"-"` 1823 // NullFields is a list of field names (e.g. "Done") to include in API requests 1824 // with the JSON null value. By default, fields with empty values are omitted 1825 // from API requests. See 1826 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1827 NullFields []string `json:"-"` 1828 } 1829 1830 func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { 1831 type NoMethod GoogleLongrunningOperation 1832 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1833 } 1834 1835 // LatLng: An object that represents a latitude/longitude pair. This is 1836 // expressed as a pair of doubles to represent degrees latitude and degrees 1837 // longitude. Unless specified otherwise, this object must conform to the WGS84 1838 // standard. Values must be within normalized ranges. 1839 type LatLng struct { 1840 // Latitude: The latitude in degrees. It must be in the range [-90.0, +90.0]. 1841 Latitude float64 `json:"latitude,omitempty"` 1842 // Longitude: The longitude in degrees. It must be in the range [-180.0, 1843 // +180.0]. 1844 Longitude float64 `json:"longitude,omitempty"` 1845 // ForceSendFields is a list of field names (e.g. "Latitude") to 1846 // unconditionally include in API requests. By default, fields with empty or 1847 // default values are omitted from API requests. See 1848 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1849 // details. 1850 ForceSendFields []string `json:"-"` 1851 // NullFields is a list of field names (e.g. "Latitude") to include in API 1852 // requests with the JSON null value. By default, fields with empty values are 1853 // omitted from API requests. See 1854 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1855 NullFields []string `json:"-"` 1856 } 1857 1858 func (s *LatLng) MarshalJSON() ([]byte, error) { 1859 type NoMethod LatLng 1860 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1861 } 1862 1863 func (s *LatLng) UnmarshalJSON(data []byte) error { 1864 type NoMethod LatLng 1865 var s1 struct { 1866 Latitude gensupport.JSONFloat64 `json:"latitude"` 1867 Longitude gensupport.JSONFloat64 `json:"longitude"` 1868 *NoMethod 1869 } 1870 s1.NoMethod = (*NoMethod)(s) 1871 if err := json.Unmarshal(data, &s1); err != nil { 1872 return err 1873 } 1874 s.Latitude = float64(s1.Latitude) 1875 s.Longitude = float64(s1.Longitude) 1876 return nil 1877 } 1878 1879 // ListCollectionIdsRequest: The request for Firestore.ListCollectionIds. 1880 type ListCollectionIdsRequest struct { 1881 // PageSize: The maximum number of results to return. 1882 PageSize int64 `json:"pageSize,omitempty"` 1883 // PageToken: A page token. Must be a value from ListCollectionIdsResponse. 1884 PageToken string `json:"pageToken,omitempty"` 1885 // ReadTime: Reads documents as they were at the given time. This must be a 1886 // microsecond precision timestamp within the past one hour, or if 1887 // Point-in-Time Recovery is enabled, can additionally be a whole minute 1888 // timestamp within the past 7 days. 1889 ReadTime string `json:"readTime,omitempty"` 1890 // ForceSendFields is a list of field names (e.g. "PageSize") to 1891 // unconditionally include in API requests. By default, fields with empty or 1892 // default values are omitted from API requests. See 1893 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1894 // details. 1895 ForceSendFields []string `json:"-"` 1896 // NullFields is a list of field names (e.g. "PageSize") to include in API 1897 // requests with the JSON null value. By default, fields with empty values are 1898 // omitted from API requests. See 1899 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1900 NullFields []string `json:"-"` 1901 } 1902 1903 func (s *ListCollectionIdsRequest) MarshalJSON() ([]byte, error) { 1904 type NoMethod ListCollectionIdsRequest 1905 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1906 } 1907 1908 // ListCollectionIdsResponse: The response from Firestore.ListCollectionIds. 1909 type ListCollectionIdsResponse struct { 1910 // CollectionIds: The collection ids. 1911 CollectionIds []string `json:"collectionIds,omitempty"` 1912 // NextPageToken: A page token that may be used to continue the list. 1913 NextPageToken string `json:"nextPageToken,omitempty"` 1914 1915 // ServerResponse contains the HTTP response code and headers from the server. 1916 googleapi.ServerResponse `json:"-"` 1917 // ForceSendFields is a list of field names (e.g. "CollectionIds") to 1918 // unconditionally include in API requests. By default, fields with empty or 1919 // default values are omitted from API requests. See 1920 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1921 // details. 1922 ForceSendFields []string `json:"-"` 1923 // NullFields is a list of field names (e.g. "CollectionIds") to include in API 1924 // requests with the JSON null value. By default, fields with empty values are 1925 // omitted from API requests. See 1926 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1927 NullFields []string `json:"-"` 1928 } 1929 1930 func (s *ListCollectionIdsResponse) MarshalJSON() ([]byte, error) { 1931 type NoMethod ListCollectionIdsResponse 1932 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1933 } 1934 1935 // ListDocumentsResponse: The response for Firestore.ListDocuments. 1936 type ListDocumentsResponse struct { 1937 // Documents: The Documents found. 1938 Documents []*Document `json:"documents,omitempty"` 1939 // NextPageToken: A token to retrieve the next page of documents. If this field 1940 // is omitted, there are no subsequent pages. 1941 NextPageToken string `json:"nextPageToken,omitempty"` 1942 1943 // ServerResponse contains the HTTP response code and headers from the server. 1944 googleapi.ServerResponse `json:"-"` 1945 // ForceSendFields is a list of field names (e.g. "Documents") to 1946 // unconditionally include in API requests. By default, fields with empty or 1947 // default values are omitted from API requests. See 1948 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1949 // details. 1950 ForceSendFields []string `json:"-"` 1951 // NullFields is a list of field names (e.g. "Documents") to include in API 1952 // requests with the JSON null value. By default, fields with empty values are 1953 // omitted from API requests. See 1954 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1955 NullFields []string `json:"-"` 1956 } 1957 1958 func (s *ListDocumentsResponse) MarshalJSON() ([]byte, error) { 1959 type NoMethod ListDocumentsResponse 1960 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1961 } 1962 1963 // ListenRequest: A request for Firestore.Listen 1964 type ListenRequest struct { 1965 // AddTarget: A target to add to this stream. 1966 AddTarget *Target `json:"addTarget,omitempty"` 1967 // Labels: Labels associated with this target change. 1968 Labels map[string]string `json:"labels,omitempty"` 1969 // RemoveTarget: The ID of a target to remove from this stream. 1970 RemoveTarget int64 `json:"removeTarget,omitempty"` 1971 // ForceSendFields is a list of field names (e.g. "AddTarget") to 1972 // unconditionally include in API requests. By default, fields with empty or 1973 // default values are omitted from API requests. See 1974 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 1975 // details. 1976 ForceSendFields []string `json:"-"` 1977 // NullFields is a list of field names (e.g. "AddTarget") to include in API 1978 // requests with the JSON null value. By default, fields with empty values are 1979 // omitted from API requests. See 1980 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 1981 NullFields []string `json:"-"` 1982 } 1983 1984 func (s *ListenRequest) MarshalJSON() ([]byte, error) { 1985 type NoMethod ListenRequest 1986 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 1987 } 1988 1989 // ListenResponse: The response for Firestore.Listen. 1990 type ListenResponse struct { 1991 // DocumentChange: A Document has changed. 1992 DocumentChange *DocumentChange `json:"documentChange,omitempty"` 1993 // DocumentDelete: A Document has been deleted. 1994 DocumentDelete *DocumentDelete `json:"documentDelete,omitempty"` 1995 // DocumentRemove: A Document has been removed from a target (because it is no 1996 // longer relevant to that target). 1997 DocumentRemove *DocumentRemove `json:"documentRemove,omitempty"` 1998 // Filter: A filter to apply to the set of documents previously returned for 1999 // the given target. Returned when documents may have been removed from the 2000 // given target, but the exact documents are unknown. 2001 Filter *ExistenceFilter `json:"filter,omitempty"` 2002 // TargetChange: Targets have changed. 2003 TargetChange *TargetChange `json:"targetChange,omitempty"` 2004 2005 // ServerResponse contains the HTTP response code and headers from the server. 2006 googleapi.ServerResponse `json:"-"` 2007 // ForceSendFields is a list of field names (e.g. "DocumentChange") to 2008 // unconditionally include in API requests. By default, fields with empty or 2009 // default values are omitted from API requests. See 2010 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2011 // details. 2012 ForceSendFields []string `json:"-"` 2013 // NullFields is a list of field names (e.g. "DocumentChange") to include in 2014 // API requests with the JSON null value. By default, fields with empty values 2015 // are omitted from API requests. See 2016 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2017 NullFields []string `json:"-"` 2018 } 2019 2020 func (s *ListenResponse) MarshalJSON() ([]byte, error) { 2021 type NoMethod ListenResponse 2022 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2023 } 2024 2025 // MapValue: A map value. 2026 type MapValue struct { 2027 // Fields: The map's fields. The map keys represent field names. Field names 2028 // matching the regular expression `__.*__` are reserved. Reserved field names 2029 // are forbidden except in certain documented contexts. The map keys, 2030 // represented as UTF-8, must not exceed 1,500 bytes and cannot be empty. 2031 Fields map[string]Value `json:"fields,omitempty"` 2032 // ForceSendFields is a list of field names (e.g. "Fields") to unconditionally 2033 // include in API requests. By default, fields with empty or default values are 2034 // omitted from API requests. See 2035 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2036 // details. 2037 ForceSendFields []string `json:"-"` 2038 // NullFields is a list of field names (e.g. "Fields") to include in API 2039 // requests with the JSON null value. By default, fields with empty values are 2040 // omitted from API requests. See 2041 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2042 NullFields []string `json:"-"` 2043 } 2044 2045 func (s *MapValue) MarshalJSON() ([]byte, error) { 2046 type NoMethod MapValue 2047 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2048 } 2049 2050 // Order: An order on a field. 2051 type Order struct { 2052 // Direction: The direction to order by. Defaults to `ASCENDING`. 2053 // 2054 // Possible values: 2055 // "DIRECTION_UNSPECIFIED" - Unspecified. 2056 // "ASCENDING" - Ascending. 2057 // "DESCENDING" - Descending. 2058 Direction string `json:"direction,omitempty"` 2059 // Field: The field to order by. 2060 Field *FieldReference `json:"field,omitempty"` 2061 // ForceSendFields is a list of field names (e.g. "Direction") to 2062 // unconditionally include in API requests. By default, fields with empty or 2063 // default values are omitted from API requests. See 2064 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2065 // details. 2066 ForceSendFields []string `json:"-"` 2067 // NullFields is a list of field names (e.g. "Direction") to include in API 2068 // requests with the JSON null value. By default, fields with empty values are 2069 // omitted from API requests. See 2070 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2071 NullFields []string `json:"-"` 2072 } 2073 2074 func (s *Order) MarshalJSON() ([]byte, error) { 2075 type NoMethod Order 2076 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2077 } 2078 2079 // PartitionQueryRequest: The request for Firestore.PartitionQuery. 2080 type PartitionQueryRequest struct { 2081 // PageSize: The maximum number of partitions to return in this call, subject 2082 // to `partition_count`. For example, if `partition_count` = 10 and `page_size` 2083 // = 8, the first call to PartitionQuery will return up to 8 partitions and a 2084 // `next_page_token` if more results exist. A second call to PartitionQuery 2085 // will return up to 2 partitions, to complete the total of 10 specified in 2086 // `partition_count`. 2087 PageSize int64 `json:"pageSize,omitempty"` 2088 // PageToken: The `next_page_token` value returned from a previous call to 2089 // PartitionQuery that may be used to get an additional set of results. There 2090 // are no ordering guarantees between sets of results. Thus, using multiple 2091 // sets of results will require merging the different result sets. For example, 2092 // two subsequent calls using a page_token may return: * cursor B, cursor M, 2093 // cursor Q * cursor A, cursor U, cursor W To obtain a complete result set 2094 // ordered with respect to the results of the query supplied to PartitionQuery, 2095 // the results sets should be merged: cursor A, cursor B, cursor M, cursor Q, 2096 // cursor U, cursor W 2097 PageToken string `json:"pageToken,omitempty"` 2098 // PartitionCount: The desired maximum number of partition points. The 2099 // partitions may be returned across multiple pages of results. The number must 2100 // be positive. The actual number of partitions returned may be fewer. For 2101 // example, this may be set to one fewer than the number of parallel queries to 2102 // be run, or in running a data pipeline job, one fewer than the number of 2103 // workers or compute instances available. 2104 PartitionCount int64 `json:"partitionCount,omitempty,string"` 2105 // ReadTime: Reads documents as they were at the given time. This must be a 2106 // microsecond precision timestamp within the past one hour, or if 2107 // Point-in-Time Recovery is enabled, can additionally be a whole minute 2108 // timestamp within the past 7 days. 2109 ReadTime string `json:"readTime,omitempty"` 2110 // StructuredQuery: A structured query. Query must specify collection with all 2111 // descendants and be ordered by name ascending. Other filters, order bys, 2112 // limits, offsets, and start/end cursors are not supported. 2113 StructuredQuery *StructuredQuery `json:"structuredQuery,omitempty"` 2114 // ForceSendFields is a list of field names (e.g. "PageSize") to 2115 // unconditionally include in API requests. By default, fields with empty or 2116 // default values are omitted from API requests. See 2117 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2118 // details. 2119 ForceSendFields []string `json:"-"` 2120 // NullFields is a list of field names (e.g. "PageSize") to include in API 2121 // requests with the JSON null value. By default, fields with empty values are 2122 // omitted from API requests. See 2123 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2124 NullFields []string `json:"-"` 2125 } 2126 2127 func (s *PartitionQueryRequest) MarshalJSON() ([]byte, error) { 2128 type NoMethod PartitionQueryRequest 2129 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2130 } 2131 2132 // PartitionQueryResponse: The response for Firestore.PartitionQuery. 2133 type PartitionQueryResponse struct { 2134 // NextPageToken: A page token that may be used to request an additional set of 2135 // results, up to the number specified by `partition_count` in the 2136 // PartitionQuery request. If blank, there are no more results. 2137 NextPageToken string `json:"nextPageToken,omitempty"` 2138 // Partitions: Partition results. Each partition is a split point that can be 2139 // used by RunQuery as a starting or end point for the query results. The 2140 // RunQuery requests must be made with the same query supplied to this 2141 // PartitionQuery request. The partition cursors will be ordered according to 2142 // same ordering as the results of the query supplied to PartitionQuery. For 2143 // example, if a PartitionQuery request returns partition cursors A and B, 2144 // running the following three queries will return the entire result set of the 2145 // original query: * query, end_at A * query, start_at A, end_at B * query, 2146 // start_at B An empty result may indicate that the query has too few results 2147 // to be partitioned, or that the query is not yet supported for partitioning. 2148 Partitions []*Cursor `json:"partitions,omitempty"` 2149 2150 // ServerResponse contains the HTTP response code and headers from the server. 2151 googleapi.ServerResponse `json:"-"` 2152 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2153 // unconditionally include in API requests. By default, fields with empty or 2154 // default values are omitted from API requests. See 2155 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2156 // details. 2157 ForceSendFields []string `json:"-"` 2158 // NullFields is a list of field names (e.g. "NextPageToken") to include in API 2159 // requests with the JSON null value. By default, fields with empty values are 2160 // omitted from API requests. See 2161 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2162 NullFields []string `json:"-"` 2163 } 2164 2165 func (s *PartitionQueryResponse) MarshalJSON() ([]byte, error) { 2166 type NoMethod PartitionQueryResponse 2167 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2168 } 2169 2170 // PlanSummary: Planning phase information for the query. 2171 type PlanSummary struct { 2172 // IndexesUsed: The indexes selected for the query. For example: [ 2173 // {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, 2174 // {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} ] 2175 IndexesUsed []googleapi.RawMessage `json:"indexesUsed,omitempty"` 2176 // ForceSendFields is a list of field names (e.g. "IndexesUsed") to 2177 // unconditionally include in API requests. By default, fields with empty or 2178 // default values are omitted from API requests. See 2179 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2180 // details. 2181 ForceSendFields []string `json:"-"` 2182 // NullFields is a list of field names (e.g. "IndexesUsed") to include in API 2183 // requests with the JSON null value. By default, fields with empty values are 2184 // omitted from API requests. See 2185 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2186 NullFields []string `json:"-"` 2187 } 2188 2189 func (s *PlanSummary) MarshalJSON() ([]byte, error) { 2190 type NoMethod PlanSummary 2191 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2192 } 2193 2194 // Precondition: A precondition on a document, used for conditional operations. 2195 type Precondition struct { 2196 // Exists: When set to `true`, the target document must exist. When set to 2197 // `false`, the target document must not exist. 2198 Exists bool `json:"exists,omitempty"` 2199 // UpdateTime: When set, the target document must exist and have been last 2200 // updated at that time. Timestamp must be microsecond aligned. 2201 UpdateTime string `json:"updateTime,omitempty"` 2202 // ForceSendFields is a list of field names (e.g. "Exists") to unconditionally 2203 // include in API requests. By default, fields with empty or default values are 2204 // omitted from API requests. See 2205 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2206 // details. 2207 ForceSendFields []string `json:"-"` 2208 // NullFields is a list of field names (e.g. "Exists") to include in API 2209 // requests with the JSON null value. By default, fields with empty values are 2210 // omitted from API requests. See 2211 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2212 NullFields []string `json:"-"` 2213 } 2214 2215 func (s *Precondition) MarshalJSON() ([]byte, error) { 2216 type NoMethod Precondition 2217 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2218 } 2219 2220 // Projection: The projection of document's fields to return. 2221 type Projection struct { 2222 // Fields: The fields to return. If empty, all fields are returned. To only 2223 // return the name of the document, use `['__name__']`. 2224 Fields []*FieldReference `json:"fields,omitempty"` 2225 // ForceSendFields is a list of field names (e.g. "Fields") to unconditionally 2226 // include in API requests. By default, fields with empty or default values are 2227 // omitted from API requests. See 2228 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2229 // details. 2230 ForceSendFields []string `json:"-"` 2231 // NullFields is a list of field names (e.g. "Fields") to include in API 2232 // requests with the JSON null value. By default, fields with empty values are 2233 // omitted from API requests. See 2234 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2235 NullFields []string `json:"-"` 2236 } 2237 2238 func (s *Projection) MarshalJSON() ([]byte, error) { 2239 type NoMethod Projection 2240 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2241 } 2242 2243 // QueryTarget: A target specified by a query. 2244 type QueryTarget struct { 2245 // Parent: The parent resource name. In the format: 2246 // `projects/{project_id}/databases/{database_id}/documents` or 2247 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 2248 // For example: `projects/my-project/databases/my-database/documents` or 2249 // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` 2250 Parent string `json:"parent,omitempty"` 2251 // StructuredQuery: A structured query. 2252 StructuredQuery *StructuredQuery `json:"structuredQuery,omitempty"` 2253 // ForceSendFields is a list of field names (e.g. "Parent") to unconditionally 2254 // include in API requests. By default, fields with empty or default values are 2255 // omitted from API requests. See 2256 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2257 // details. 2258 ForceSendFields []string `json:"-"` 2259 // NullFields is a list of field names (e.g. "Parent") to include in API 2260 // requests with the JSON null value. By default, fields with empty values are 2261 // omitted from API requests. See 2262 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2263 NullFields []string `json:"-"` 2264 } 2265 2266 func (s *QueryTarget) MarshalJSON() ([]byte, error) { 2267 type NoMethod QueryTarget 2268 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2269 } 2270 2271 // ReadOnly: Options for a transaction that can only be used to read documents. 2272 type ReadOnly struct { 2273 // ReadTime: Reads documents at the given time. This must be a microsecond 2274 // precision timestamp within the past one hour, or if Point-in-Time Recovery 2275 // is enabled, can additionally be a whole minute timestamp within the past 7 2276 // days. 2277 ReadTime string `json:"readTime,omitempty"` 2278 // ForceSendFields is a list of field names (e.g. "ReadTime") to 2279 // unconditionally include in API requests. By default, fields with empty or 2280 // default values are omitted from API requests. See 2281 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2282 // details. 2283 ForceSendFields []string `json:"-"` 2284 // NullFields is a list of field names (e.g. "ReadTime") to include in API 2285 // requests with the JSON null value. By default, fields with empty values are 2286 // omitted from API requests. See 2287 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2288 NullFields []string `json:"-"` 2289 } 2290 2291 func (s *ReadOnly) MarshalJSON() ([]byte, error) { 2292 type NoMethod ReadOnly 2293 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2294 } 2295 2296 // ReadWrite: Options for a transaction that can be used to read and write 2297 // documents. Firestore does not allow 3rd party auth requests to create 2298 // read-write. transactions. 2299 type ReadWrite struct { 2300 // RetryTransaction: An optional transaction to retry. 2301 RetryTransaction string `json:"retryTransaction,omitempty"` 2302 // ForceSendFields is a list of field names (e.g. "RetryTransaction") to 2303 // unconditionally include in API requests. By default, fields with empty or 2304 // default values are omitted from API requests. See 2305 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2306 // details. 2307 ForceSendFields []string `json:"-"` 2308 // NullFields is a list of field names (e.g. "RetryTransaction") to include in 2309 // API requests with the JSON null value. By default, fields with empty values 2310 // are omitted from API requests. See 2311 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2312 NullFields []string `json:"-"` 2313 } 2314 2315 func (s *ReadWrite) MarshalJSON() ([]byte, error) { 2316 type NoMethod ReadWrite 2317 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2318 } 2319 2320 // RollbackRequest: The request for Firestore.Rollback. 2321 type RollbackRequest struct { 2322 // Transaction: Required. The transaction to roll back. 2323 Transaction string `json:"transaction,omitempty"` 2324 // ForceSendFields is a list of field names (e.g. "Transaction") to 2325 // unconditionally include in API requests. By default, fields with empty or 2326 // default values are omitted from API requests. See 2327 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2328 // details. 2329 ForceSendFields []string `json:"-"` 2330 // NullFields is a list of field names (e.g. "Transaction") to include in API 2331 // requests with the JSON null value. By default, fields with empty values are 2332 // omitted from API requests. See 2333 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2334 NullFields []string `json:"-"` 2335 } 2336 2337 func (s *RollbackRequest) MarshalJSON() ([]byte, error) { 2338 type NoMethod RollbackRequest 2339 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2340 } 2341 2342 // RunAggregationQueryRequest: The request for Firestore.RunAggregationQuery. 2343 type RunAggregationQueryRequest struct { 2344 // ExplainOptions: Optional. Explain options for the query. If set, additional 2345 // query statistics will be returned. If not, only query results will be 2346 // returned. 2347 ExplainOptions *ExplainOptions `json:"explainOptions,omitempty"` 2348 // NewTransaction: Starts a new transaction as part of the query, defaulting to 2349 // read-only. The new transaction ID will be returned as the first response in 2350 // the stream. 2351 NewTransaction *TransactionOptions `json:"newTransaction,omitempty"` 2352 // ReadTime: Executes the query at the given timestamp. This must be a 2353 // microsecond precision timestamp within the past one hour, or if 2354 // Point-in-Time Recovery is enabled, can additionally be a whole minute 2355 // timestamp within the past 7 days. 2356 ReadTime string `json:"readTime,omitempty"` 2357 // StructuredAggregationQuery: An aggregation query. 2358 StructuredAggregationQuery *StructuredAggregationQuery `json:"structuredAggregationQuery,omitempty"` 2359 // Transaction: Run the aggregation within an already active transaction. The 2360 // value here is the opaque transaction ID to execute the query in. 2361 Transaction string `json:"transaction,omitempty"` 2362 // ForceSendFields is a list of field names (e.g. "ExplainOptions") to 2363 // unconditionally include in API requests. By default, fields with empty or 2364 // default values are omitted from API requests. See 2365 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2366 // details. 2367 ForceSendFields []string `json:"-"` 2368 // NullFields is a list of field names (e.g. "ExplainOptions") to include in 2369 // API requests with the JSON null value. By default, fields with empty values 2370 // are omitted from API requests. See 2371 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2372 NullFields []string `json:"-"` 2373 } 2374 2375 func (s *RunAggregationQueryRequest) MarshalJSON() ([]byte, error) { 2376 type NoMethod RunAggregationQueryRequest 2377 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2378 } 2379 2380 // RunAggregationQueryResponse: The response for Firestore.RunAggregationQuery. 2381 type RunAggregationQueryResponse struct { 2382 // ExplainMetrics: Query explain metrics. This is only present when the 2383 // RunAggregationQueryRequest.explain_options is provided, and it is sent only 2384 // once with the last response in the stream. 2385 ExplainMetrics *ExplainMetrics `json:"explainMetrics,omitempty"` 2386 // ReadTime: The time at which the aggregate result was computed. This is 2387 // always monotonically increasing; in this case, the previous 2388 // AggregationResult in the result stream are guaranteed not to have changed 2389 // between their `read_time` and this one. If the query returns no results, a 2390 // response with `read_time` and no `result` will be sent, and this represents 2391 // the time at which the query was run. 2392 ReadTime string `json:"readTime,omitempty"` 2393 // Result: A single aggregation result. Not present when reporting partial 2394 // progress. 2395 Result *AggregationResult `json:"result,omitempty"` 2396 // Transaction: The transaction that was started as part of this request. Only 2397 // present on the first response when the request requested to start a new 2398 // transaction. 2399 Transaction string `json:"transaction,omitempty"` 2400 2401 // ServerResponse contains the HTTP response code and headers from the server. 2402 googleapi.ServerResponse `json:"-"` 2403 // ForceSendFields is a list of field names (e.g. "ExplainMetrics") to 2404 // unconditionally include in API requests. By default, fields with empty or 2405 // default values are omitted from API requests. See 2406 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2407 // details. 2408 ForceSendFields []string `json:"-"` 2409 // NullFields is a list of field names (e.g. "ExplainMetrics") to include in 2410 // API requests with the JSON null value. By default, fields with empty values 2411 // are omitted from API requests. See 2412 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2413 NullFields []string `json:"-"` 2414 } 2415 2416 func (s *RunAggregationQueryResponse) MarshalJSON() ([]byte, error) { 2417 type NoMethod RunAggregationQueryResponse 2418 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2419 } 2420 2421 // RunQueryRequest: The request for Firestore.RunQuery. 2422 type RunQueryRequest struct { 2423 // ExplainOptions: Optional. Explain options for the query. If set, additional 2424 // query statistics will be returned. If not, only query results will be 2425 // returned. 2426 ExplainOptions *ExplainOptions `json:"explainOptions,omitempty"` 2427 // NewTransaction: Starts a new transaction and reads the documents. Defaults 2428 // to a read-only transaction. The new transaction ID will be returned as the 2429 // first response in the stream. 2430 NewTransaction *TransactionOptions `json:"newTransaction,omitempty"` 2431 // ReadTime: Reads documents as they were at the given time. This must be a 2432 // microsecond precision timestamp within the past one hour, or if 2433 // Point-in-Time Recovery is enabled, can additionally be a whole minute 2434 // timestamp within the past 7 days. 2435 ReadTime string `json:"readTime,omitempty"` 2436 // StructuredQuery: A structured query. 2437 StructuredQuery *StructuredQuery `json:"structuredQuery,omitempty"` 2438 // Transaction: Run the query within an already active transaction. The value 2439 // here is the opaque transaction ID to execute the query in. 2440 Transaction string `json:"transaction,omitempty"` 2441 // ForceSendFields is a list of field names (e.g. "ExplainOptions") to 2442 // unconditionally include in API requests. By default, fields with empty or 2443 // default values are omitted from API requests. See 2444 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2445 // details. 2446 ForceSendFields []string `json:"-"` 2447 // NullFields is a list of field names (e.g. "ExplainOptions") to include in 2448 // API requests with the JSON null value. By default, fields with empty values 2449 // are omitted from API requests. See 2450 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2451 NullFields []string `json:"-"` 2452 } 2453 2454 func (s *RunQueryRequest) MarshalJSON() ([]byte, error) { 2455 type NoMethod RunQueryRequest 2456 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2457 } 2458 2459 // RunQueryResponse: The response for Firestore.RunQuery. 2460 type RunQueryResponse struct { 2461 // Document: A query result, not set when reporting partial progress. 2462 Document *Document `json:"document,omitempty"` 2463 // Done: If present, Firestore has completely finished the request and no more 2464 // documents will be returned. 2465 Done bool `json:"done,omitempty"` 2466 // ExplainMetrics: Query explain metrics. This is only present when the 2467 // RunQueryRequest.explain_options is provided, and it is sent only once with 2468 // the last response in the stream. 2469 ExplainMetrics *ExplainMetrics `json:"explainMetrics,omitempty"` 2470 // ReadTime: The time at which the document was read. This may be monotonically 2471 // increasing; in this case, the previous documents in the result stream are 2472 // guaranteed not to have changed between their `read_time` and this one. If 2473 // the query returns no results, a response with `read_time` and no `document` 2474 // will be sent, and this represents the time at which the query was run. 2475 ReadTime string `json:"readTime,omitempty"` 2476 // SkippedResults: The number of results that have been skipped due to an 2477 // offset between the last response and the current response. 2478 SkippedResults int64 `json:"skippedResults,omitempty"` 2479 // Transaction: The transaction that was started as part of this request. Can 2480 // only be set in the first response, and only if 2481 // RunQueryRequest.new_transaction was set in the request. If set, no other 2482 // fields will be set in this response. 2483 Transaction string `json:"transaction,omitempty"` 2484 2485 // ServerResponse contains the HTTP response code and headers from the server. 2486 googleapi.ServerResponse `json:"-"` 2487 // ForceSendFields is a list of field names (e.g. "Document") to 2488 // unconditionally include in API requests. By default, fields with empty or 2489 // default values are omitted from API requests. See 2490 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2491 // details. 2492 ForceSendFields []string `json:"-"` 2493 // NullFields is a list of field names (e.g. "Document") to include in API 2494 // requests with the JSON null value. By default, fields with empty values are 2495 // omitted from API requests. See 2496 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2497 NullFields []string `json:"-"` 2498 } 2499 2500 func (s *RunQueryResponse) MarshalJSON() ([]byte, error) { 2501 type NoMethod RunQueryResponse 2502 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2503 } 2504 2505 // Status: The `Status` type defines a logical error model that is suitable for 2506 // different programming environments, including REST APIs and RPC APIs. It is 2507 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 2508 // pieces of data: error code, error message, and error details. You can find 2509 // out more about this error model and how to work with it in the API Design 2510 // Guide (https://cloud.google.com/apis/design/errors). 2511 type Status struct { 2512 // Code: The status code, which should be an enum value of google.rpc.Code. 2513 Code int64 `json:"code,omitempty"` 2514 // Details: A list of messages that carry the error details. There is a common 2515 // set of message types for APIs to use. 2516 Details []googleapi.RawMessage `json:"details,omitempty"` 2517 // Message: A developer-facing error message, which should be in English. Any 2518 // user-facing error message should be localized and sent in the 2519 // google.rpc.Status.details field, or localized by the client. 2520 Message string `json:"message,omitempty"` 2521 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 2522 // include in API requests. By default, fields with empty or default values are 2523 // omitted from API requests. See 2524 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2525 // details. 2526 ForceSendFields []string `json:"-"` 2527 // NullFields is a list of field names (e.g. "Code") to include in API requests 2528 // with the JSON null value. By default, fields with empty values are omitted 2529 // from API requests. See 2530 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2531 NullFields []string `json:"-"` 2532 } 2533 2534 func (s *Status) MarshalJSON() ([]byte, error) { 2535 type NoMethod Status 2536 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2537 } 2538 2539 // StructuredAggregationQuery: Firestore query for running an aggregation over 2540 // a StructuredQuery. 2541 type StructuredAggregationQuery struct { 2542 // Aggregations: Optional. Series of aggregations to apply over the results of 2543 // the `structured_query`. Requires: * A minimum of one and maximum of five 2544 // aggregations per query. 2545 Aggregations []*Aggregation `json:"aggregations,omitempty"` 2546 // StructuredQuery: Nested structured query. 2547 StructuredQuery *StructuredQuery `json:"structuredQuery,omitempty"` 2548 // ForceSendFields is a list of field names (e.g. "Aggregations") to 2549 // unconditionally include in API requests. By default, fields with empty or 2550 // default values are omitted from API requests. See 2551 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2552 // details. 2553 ForceSendFields []string `json:"-"` 2554 // NullFields is a list of field names (e.g. "Aggregations") to include in API 2555 // requests with the JSON null value. By default, fields with empty values are 2556 // omitted from API requests. See 2557 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2558 NullFields []string `json:"-"` 2559 } 2560 2561 func (s *StructuredAggregationQuery) MarshalJSON() ([]byte, error) { 2562 type NoMethod StructuredAggregationQuery 2563 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2564 } 2565 2566 // StructuredQuery: A Firestore query. The query stages are executed in the 2567 // following order: 1. from 2. where 3. select 4. order_by + start_at + end_at 2568 // 5. offset 6. limit 2569 type StructuredQuery struct { 2570 // EndAt: A potential prefix of a position in the result set to end the query 2571 // at. This is similar to `START_AT` but with it controlling the end position 2572 // rather than the start position. Requires: * The number of values cannot be 2573 // greater than the number of fields specified in the `ORDER BY` clause. 2574 EndAt *Cursor `json:"endAt,omitempty"` 2575 // FindNearest: Optional. A potential nearest neighbors search. Applies after 2576 // all other filters and ordering. Finds the closest vector embeddings to the 2577 // given query vector. 2578 FindNearest *FindNearest `json:"findNearest,omitempty"` 2579 // From: The collections to query. 2580 From []*CollectionSelector `json:"from,omitempty"` 2581 // Limit: The maximum number of results to return. Applies after all other 2582 // constraints. Requires: * The value must be greater than or equal to zero if 2583 // specified. 2584 Limit int64 `json:"limit,omitempty"` 2585 // Offset: The number of documents to skip before returning the first result. 2586 // This applies after the constraints specified by the `WHERE`, `START AT`, & 2587 // `END AT` but before the `LIMIT` clause. Requires: * The value must be 2588 // greater than or equal to zero if specified. 2589 Offset int64 `json:"offset,omitempty"` 2590 // OrderBy: The order to apply to the query results. Firestore allows callers 2591 // to provide a full ordering, a partial ordering, or no ordering at all. In 2592 // all cases, Firestore guarantees a stable ordering through the following 2593 // rules: * The `order_by` is required to reference all fields used with an 2594 // inequality filter. * All fields that are required to be in the `order_by` 2595 // but are not already present are appended in lexicographical ordering of the 2596 // field name. * If an order on `__name__` is not specified, it is appended by 2597 // default. Fields are appended with the same sort direction as the last order 2598 // specified, or 'ASCENDING' if no order was specified. For example: * `ORDER 2599 // BY a` becomes `ORDER BY a ASC, __name__ ASC` * `ORDER BY a DESC` becomes 2600 // `ORDER BY a DESC, __name__ DESC` * `WHERE a > 1` becomes `WHERE a > 1 ORDER 2601 // BY a ASC, __name__ ASC` * `WHERE __name__ > ... AND a > 1` becomes `WHERE 2602 // __name__ > ... AND a > 1 ORDER BY a ASC, __name__ ASC` 2603 OrderBy []*Order `json:"orderBy,omitempty"` 2604 // Select: Optional sub-set of the fields to return. This acts as a 2605 // DocumentMask over the documents returned from a query. When not set, assumes 2606 // that the caller wants all fields returned. 2607 Select *Projection `json:"select,omitempty"` 2608 // StartAt: A potential prefix of a position in the result set to start the 2609 // query at. The ordering of the result set is based on the `ORDER BY` clause 2610 // of the original query. ``` SELECT * FROM k WHERE a = 1 AND b > 2 ORDER BY b 2611 // ASC, __name__ ASC; ``` This query's results are ordered by `(b ASC, __name__ 2612 // ASC)`. Cursors can reference either the full ordering or a prefix of the 2613 // location, though it cannot reference more fields than what are in the 2614 // provided `ORDER BY`. Continuing off the example above, attaching the 2615 // following start cursors will have varying impact: - `START BEFORE (2, 2616 // /k/123)`: start the query right before `a = 1 AND b > 2 AND __name__ > 2617 // /k/123`. - `START AFTER (10)`: start the query right after `a = 1 AND b > 2618 // 10`. Unlike `OFFSET` which requires scanning over the first N results to 2619 // skip, a start cursor allows the query to begin at a logical position. This 2620 // position is not required to match an actual result, it will scan forward 2621 // from this position to find the next document. Requires: * The number of 2622 // values cannot be greater than the number of fields specified in the `ORDER 2623 // BY` clause. 2624 StartAt *Cursor `json:"startAt,omitempty"` 2625 // Where: The filter to apply. 2626 Where *Filter `json:"where,omitempty"` 2627 // ForceSendFields is a list of field names (e.g. "EndAt") to unconditionally 2628 // include in API requests. By default, fields with empty or default values are 2629 // omitted from API requests. See 2630 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2631 // details. 2632 ForceSendFields []string `json:"-"` 2633 // NullFields is a list of field names (e.g. "EndAt") to include in API 2634 // requests with the JSON null value. By default, fields with empty values are 2635 // omitted from API requests. See 2636 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2637 NullFields []string `json:"-"` 2638 } 2639 2640 func (s *StructuredQuery) MarshalJSON() ([]byte, error) { 2641 type NoMethod StructuredQuery 2642 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2643 } 2644 2645 // Sum: Sum of the values of the requested field. * Only numeric values will be 2646 // aggregated. All non-numeric values including `NULL` are skipped. * If the 2647 // aggregated values contain `NaN`, returns `NaN`. Infinity math follows 2648 // IEEE-754 standards. * If the aggregated value set is empty, returns 0. * 2649 // Returns a 64-bit integer if all aggregated numbers are integers and the sum 2650 // result does not overflow. Otherwise, the result is returned as a double. 2651 // Note that even if all the aggregated values are integers, the result is 2652 // returned as a double if it cannot fit within a 64-bit signed integer. When 2653 // this occurs, the returned value will lose precision. * When underflow 2654 // occurs, floating-point aggregation is non-deterministic. This means that 2655 // running the same query repeatedly without any changes to the underlying 2656 // values could produce slightly different results each time. In those cases, 2657 // values should be stored as integers over floating-point numbers. 2658 type Sum struct { 2659 // Field: The field to aggregate on. 2660 Field *FieldReference `json:"field,omitempty"` 2661 // ForceSendFields is a list of field names (e.g. "Field") to unconditionally 2662 // include in API requests. By default, fields with empty or default values are 2663 // omitted from API requests. See 2664 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2665 // details. 2666 ForceSendFields []string `json:"-"` 2667 // NullFields is a list of field names (e.g. "Field") to include in API 2668 // requests with the JSON null value. By default, fields with empty values are 2669 // omitted from API requests. See 2670 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2671 NullFields []string `json:"-"` 2672 } 2673 2674 func (s *Sum) MarshalJSON() ([]byte, error) { 2675 type NoMethod Sum 2676 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2677 } 2678 2679 // Target: A specification of a set of documents to listen to. 2680 type Target struct { 2681 // Documents: A target specified by a set of document names. 2682 Documents *DocumentsTarget `json:"documents,omitempty"` 2683 // ExpectedCount: The number of documents that last matched the query at the 2684 // resume token or read time. This value is only relevant when a `resume_type` 2685 // is provided. This value being present and greater than zero signals that the 2686 // client wants `ExistenceFilter.unchanged_names` to be included in the 2687 // response. 2688 ExpectedCount int64 `json:"expectedCount,omitempty"` 2689 // Once: If the target should be removed once it is current and consistent. 2690 Once bool `json:"once,omitempty"` 2691 // Query: A target specified by a query. 2692 Query *QueryTarget `json:"query,omitempty"` 2693 // ReadTime: Start listening after a specific `read_time`. The client must know 2694 // the state of matching documents at this time. 2695 ReadTime string `json:"readTime,omitempty"` 2696 // ResumeToken: A resume token from a prior TargetChange for an identical 2697 // target. Using a resume token with a different target is unsupported and may 2698 // fail. 2699 ResumeToken string `json:"resumeToken,omitempty"` 2700 // TargetId: The target ID that identifies the target on the stream. Must be a 2701 // positive number and non-zero. If `target_id` is 0 (or unspecified), the 2702 // server will assign an ID for this target and return that in a 2703 // `TargetChange::ADD` event. Once a target with `target_id=0` is added, all 2704 // subsequent targets must also have `target_id=0`. If an `AddTarget` request 2705 // with `target_id != 0` is sent to the server after a target with 2706 // `target_id=0` is added, the server will immediately send a response with a 2707 // `TargetChange::Remove` event. Note that if the client sends multiple 2708 // `AddTarget` requests without an ID, the order of IDs returned in 2709 // `TargetChage.target_ids` are undefined. Therefore, clients should provide a 2710 // target ID instead of relying on the server to assign one. If `target_id` is 2711 // non-zero, there must not be an existing active target on this stream with 2712 // the same ID. 2713 TargetId int64 `json:"targetId,omitempty"` 2714 // ForceSendFields is a list of field names (e.g. "Documents") to 2715 // unconditionally include in API requests. By default, fields with empty or 2716 // default values are omitted from API requests. See 2717 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2718 // details. 2719 ForceSendFields []string `json:"-"` 2720 // NullFields is a list of field names (e.g. "Documents") to include in API 2721 // requests with the JSON null value. By default, fields with empty values are 2722 // omitted from API requests. See 2723 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2724 NullFields []string `json:"-"` 2725 } 2726 2727 func (s *Target) MarshalJSON() ([]byte, error) { 2728 type NoMethod Target 2729 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2730 } 2731 2732 // TargetChange: Targets being watched have changed. 2733 type TargetChange struct { 2734 // Cause: The error that resulted in this change, if applicable. 2735 Cause *Status `json:"cause,omitempty"` 2736 // ReadTime: The consistent `read_time` for the given `target_ids` (omitted 2737 // when the target_ids are not at a consistent snapshot). The stream is 2738 // guaranteed to send a `read_time` with `target_ids` empty whenever the entire 2739 // stream reaches a new consistent snapshot. ADD, CURRENT, and RESET messages 2740 // are guaranteed to (eventually) result in a new consistent snapshot (while 2741 // NO_CHANGE and REMOVE messages are not). For a given stream, `read_time` is 2742 // guaranteed to be monotonically increasing. 2743 ReadTime string `json:"readTime,omitempty"` 2744 // ResumeToken: A token that can be used to resume the stream for the given 2745 // `target_ids`, or all targets if `target_ids` is empty. Not set on every 2746 // target change. 2747 ResumeToken string `json:"resumeToken,omitempty"` 2748 // TargetChangeType: The type of change that occurred. 2749 // 2750 // Possible values: 2751 // "NO_CHANGE" - No change has occurred. Used only to send an updated 2752 // `resume_token`. 2753 // "ADD" - The targets have been added. 2754 // "REMOVE" - The targets have been removed. 2755 // "CURRENT" - The targets reflect all changes committed before the targets 2756 // were added to the stream. This will be sent after or with a `read_time` that 2757 // is greater than or equal to the time at which the targets were added. 2758 // Listeners can wait for this change if read-after-write semantics are 2759 // desired. 2760 // "RESET" - The targets have been reset, and a new initial state for the 2761 // targets will be returned in subsequent changes. After the initial state is 2762 // complete, `CURRENT` will be returned even if the target was previously 2763 // indicated to be `CURRENT`. 2764 TargetChangeType string `json:"targetChangeType,omitempty"` 2765 // TargetIds: The target IDs of targets that have changed. If empty, the change 2766 // applies to all targets. The order of the target IDs is not defined. 2767 TargetIds []int64 `json:"targetIds,omitempty"` 2768 // ForceSendFields is a list of field names (e.g. "Cause") to unconditionally 2769 // include in API requests. By default, fields with empty or default values are 2770 // omitted from API requests. See 2771 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2772 // details. 2773 ForceSendFields []string `json:"-"` 2774 // NullFields is a list of field names (e.g. "Cause") to include in API 2775 // requests with the JSON null value. By default, fields with empty values are 2776 // omitted from API requests. See 2777 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2778 NullFields []string `json:"-"` 2779 } 2780 2781 func (s *TargetChange) MarshalJSON() ([]byte, error) { 2782 type NoMethod TargetChange 2783 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2784 } 2785 2786 // TransactionOptions: Options for creating a new transaction. 2787 type TransactionOptions struct { 2788 // ReadOnly: The transaction can only be used for read operations. 2789 ReadOnly *ReadOnly `json:"readOnly,omitempty"` 2790 // ReadWrite: The transaction can be used for both read and write operations. 2791 ReadWrite *ReadWrite `json:"readWrite,omitempty"` 2792 // ForceSendFields is a list of field names (e.g. "ReadOnly") to 2793 // unconditionally include in API requests. By default, fields with empty or 2794 // default values are omitted from API requests. See 2795 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2796 // details. 2797 ForceSendFields []string `json:"-"` 2798 // NullFields is a list of field names (e.g. "ReadOnly") to include in API 2799 // requests with the JSON null value. By default, fields with empty values are 2800 // omitted from API requests. See 2801 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2802 NullFields []string `json:"-"` 2803 } 2804 2805 func (s *TransactionOptions) MarshalJSON() ([]byte, error) { 2806 type NoMethod TransactionOptions 2807 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2808 } 2809 2810 // UnaryFilter: A filter with a single operand. 2811 type UnaryFilter struct { 2812 // Field: The field to which to apply the operator. 2813 Field *FieldReference `json:"field,omitempty"` 2814 // Op: The unary operator to apply. 2815 // 2816 // Possible values: 2817 // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used. 2818 // "IS_NAN" - The given `field` is equal to `NaN`. 2819 // "IS_NULL" - The given `field` is equal to `NULL`. 2820 // "IS_NOT_NAN" - The given `field` is not equal to `NaN`. Requires: * No 2821 // other `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. * That `field` 2822 // comes first in the `order_by`. 2823 // "IS_NOT_NULL" - The given `field` is not equal to `NULL`. Requires: * A 2824 // single `NOT_EQUAL`, `NOT_IN`, `IS_NOT_NULL`, or `IS_NOT_NAN`. * That `field` 2825 // comes first in the `order_by`. 2826 Op string `json:"op,omitempty"` 2827 // ForceSendFields is a list of field names (e.g. "Field") to unconditionally 2828 // include in API requests. By default, fields with empty or default values are 2829 // omitted from API requests. See 2830 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2831 // details. 2832 ForceSendFields []string `json:"-"` 2833 // NullFields is a list of field names (e.g. "Field") to include in API 2834 // requests with the JSON null value. By default, fields with empty values are 2835 // omitted from API requests. See 2836 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2837 NullFields []string `json:"-"` 2838 } 2839 2840 func (s *UnaryFilter) MarshalJSON() ([]byte, error) { 2841 type NoMethod UnaryFilter 2842 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2843 } 2844 2845 // Value: A message that can hold any of the supported value types. 2846 type Value struct { 2847 // ArrayValue: An array value. Cannot directly contain another array value, 2848 // though can contain a map which contains another array. 2849 ArrayValue *ArrayValue `json:"arrayValue,omitempty"` 2850 // BooleanValue: A boolean value. 2851 BooleanValue bool `json:"booleanValue,omitempty"` 2852 // BytesValue: A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 2853 // 1,500 bytes are considered by queries. 2854 BytesValue string `json:"bytesValue,omitempty"` 2855 // DoubleValue: A double value. 2856 DoubleValue float64 `json:"doubleValue,omitempty"` 2857 // GeoPointValue: A geo point value representing a point on the surface of 2858 // Earth. 2859 GeoPointValue *LatLng `json:"geoPointValue,omitempty"` 2860 // IntegerValue: An integer value. 2861 IntegerValue int64 `json:"integerValue,omitempty,string"` 2862 // MapValue: A map value. 2863 MapValue *MapValue `json:"mapValue,omitempty"` 2864 // NullValue: A null value. 2865 // 2866 // Possible values: 2867 // "NULL_VALUE" - Null value. 2868 NullValue string `json:"nullValue,omitempty"` 2869 // ReferenceValue: A reference to a document. For example: 2870 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 2871 ReferenceValue string `json:"referenceValue,omitempty"` 2872 // StringValue: A string value. The string, represented as UTF-8, must not 2873 // exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 2874 // representation are considered by queries. 2875 StringValue string `json:"stringValue,omitempty"` 2876 // TimestampValue: A timestamp value. Precise only to microseconds. When 2877 // stored, any additional precision is rounded down. 2878 TimestampValue string `json:"timestampValue,omitempty"` 2879 // ForceSendFields is a list of field names (e.g. "ArrayValue") to 2880 // unconditionally include in API requests. By default, fields with empty or 2881 // default values are omitted from API requests. See 2882 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2883 // details. 2884 ForceSendFields []string `json:"-"` 2885 // NullFields is a list of field names (e.g. "ArrayValue") to include in API 2886 // requests with the JSON null value. By default, fields with empty values are 2887 // omitted from API requests. See 2888 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2889 NullFields []string `json:"-"` 2890 } 2891 2892 func (s *Value) MarshalJSON() ([]byte, error) { 2893 type NoMethod Value 2894 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2895 } 2896 2897 func (s *Value) UnmarshalJSON(data []byte) error { 2898 type NoMethod Value 2899 var s1 struct { 2900 DoubleValue gensupport.JSONFloat64 `json:"doubleValue"` 2901 *NoMethod 2902 } 2903 s1.NoMethod = (*NoMethod)(s) 2904 if err := json.Unmarshal(data, &s1); err != nil { 2905 return err 2906 } 2907 s.DoubleValue = float64(s1.DoubleValue) 2908 return nil 2909 } 2910 2911 // Write: A write on a document. 2912 type Write struct { 2913 // CurrentDocument: An optional precondition on the document. The write will 2914 // fail if this is set and not met by the target document. 2915 CurrentDocument *Precondition `json:"currentDocument,omitempty"` 2916 // Delete: A document name to delete. In the format: 2917 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 2918 Delete string `json:"delete,omitempty"` 2919 // Transform: Applies a transformation to a document. 2920 Transform *DocumentTransform `json:"transform,omitempty"` 2921 // Update: A document to write. 2922 Update *Document `json:"update,omitempty"` 2923 // UpdateMask: The fields to update in this write. This field can be set only 2924 // when the operation is `update`. If the mask is not set for an `update` and 2925 // the document exists, any existing data will be overwritten. If the mask is 2926 // set and the document on the server has fields not covered by the mask, they 2927 // are left unchanged. Fields referenced in the mask, but not present in the 2928 // input document, are deleted from the document on the server. The field paths 2929 // in this mask must not contain a reserved field name. 2930 UpdateMask *DocumentMask `json:"updateMask,omitempty"` 2931 // UpdateTransforms: The transforms to perform after update. This field can be 2932 // set only when the operation is `update`. If present, this write is 2933 // equivalent to performing `update` and `transform` to the same document 2934 // atomically and in order. 2935 UpdateTransforms []*FieldTransform `json:"updateTransforms,omitempty"` 2936 // ForceSendFields is a list of field names (e.g. "CurrentDocument") to 2937 // unconditionally include in API requests. By default, fields with empty or 2938 // default values are omitted from API requests. See 2939 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2940 // details. 2941 ForceSendFields []string `json:"-"` 2942 // NullFields is a list of field names (e.g. "CurrentDocument") to include in 2943 // API requests with the JSON null value. By default, fields with empty values 2944 // are omitted from API requests. See 2945 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2946 NullFields []string `json:"-"` 2947 } 2948 2949 func (s *Write) MarshalJSON() ([]byte, error) { 2950 type NoMethod Write 2951 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2952 } 2953 2954 // WriteRequest: The request for Firestore.Write. The first request creates a 2955 // stream, or resumes an existing one from a token. When creating a new stream, 2956 // the server replies with a response containing only an ID and a token, to use 2957 // in the next request. When resuming a stream, the server first streams any 2958 // responses later than the given token, then a response containing only an 2959 // up-to-date token, to use in the next request. 2960 type WriteRequest struct { 2961 // Labels: Labels associated with this write request. 2962 Labels map[string]string `json:"labels,omitempty"` 2963 // StreamId: The ID of the write stream to resume. This may only be set in the 2964 // first message. When left empty, a new write stream will be created. 2965 StreamId string `json:"streamId,omitempty"` 2966 // StreamToken: A stream token that was previously sent by the server. The 2967 // client should set this field to the token from the most recent WriteResponse 2968 // it has received. This acknowledges that the client has received responses up 2969 // to this token. After sending this token, earlier tokens may not be used 2970 // anymore. The server may close the stream if there are too many 2971 // unacknowledged responses. Leave this field unset when creating a new stream. 2972 // To resume a stream at a specific point, set this field and the `stream_id` 2973 // field. Leave this field unset when creating a new stream. 2974 StreamToken string `json:"streamToken,omitempty"` 2975 // Writes: The writes to apply. Always executed atomically and in order. This 2976 // must be empty on the first request. This may be empty on the last request. 2977 // This must not be empty on all other requests. 2978 Writes []*Write `json:"writes,omitempty"` 2979 // ForceSendFields is a list of field names (e.g. "Labels") to unconditionally 2980 // include in API requests. By default, fields with empty or default values are 2981 // omitted from API requests. See 2982 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 2983 // details. 2984 ForceSendFields []string `json:"-"` 2985 // NullFields is a list of field names (e.g. "Labels") to include in API 2986 // requests with the JSON null value. By default, fields with empty values are 2987 // omitted from API requests. See 2988 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 2989 NullFields []string `json:"-"` 2990 } 2991 2992 func (s *WriteRequest) MarshalJSON() ([]byte, error) { 2993 type NoMethod WriteRequest 2994 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 2995 } 2996 2997 // WriteResponse: The response for Firestore.Write. 2998 type WriteResponse struct { 2999 // CommitTime: The time at which the commit occurred. Any read with an equal or 3000 // greater `read_time` is guaranteed to see the effects of the write. 3001 CommitTime string `json:"commitTime,omitempty"` 3002 // StreamId: The ID of the stream. Only set on the first message, when a new 3003 // stream was created. 3004 StreamId string `json:"streamId,omitempty"` 3005 // StreamToken: A token that represents the position of this response in the 3006 // stream. This can be used by a client to resume the stream at this point. 3007 // This field is always set. 3008 StreamToken string `json:"streamToken,omitempty"` 3009 // WriteResults: The result of applying the writes. This i-th write result 3010 // corresponds to the i-th write in the request. 3011 WriteResults []*WriteResult `json:"writeResults,omitempty"` 3012 3013 // ServerResponse contains the HTTP response code and headers from the server. 3014 googleapi.ServerResponse `json:"-"` 3015 // ForceSendFields is a list of field names (e.g. "CommitTime") to 3016 // unconditionally include in API requests. By default, fields with empty or 3017 // default values are omitted from API requests. See 3018 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3019 // details. 3020 ForceSendFields []string `json:"-"` 3021 // NullFields is a list of field names (e.g. "CommitTime") to include in API 3022 // requests with the JSON null value. By default, fields with empty values are 3023 // omitted from API requests. See 3024 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3025 NullFields []string `json:"-"` 3026 } 3027 3028 func (s *WriteResponse) MarshalJSON() ([]byte, error) { 3029 type NoMethod WriteResponse 3030 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3031 } 3032 3033 // WriteResult: The result of applying a write. 3034 type WriteResult struct { 3035 // TransformResults: The results of applying each 3036 // DocumentTransform.FieldTransform, in the same order. 3037 TransformResults []*Value `json:"transformResults,omitempty"` 3038 // UpdateTime: The last update time of the document after applying the write. 3039 // Not set after a `delete`. If the write did not actually change the document, 3040 // this will be the previous update_time. 3041 UpdateTime string `json:"updateTime,omitempty"` 3042 // ForceSendFields is a list of field names (e.g. "TransformResults") to 3043 // unconditionally include in API requests. By default, fields with empty or 3044 // default values are omitted from API requests. See 3045 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 3046 // details. 3047 ForceSendFields []string `json:"-"` 3048 // NullFields is a list of field names (e.g. "TransformResults") to include in 3049 // API requests with the JSON null value. By default, fields with empty values 3050 // are omitted from API requests. See 3051 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 3052 NullFields []string `json:"-"` 3053 } 3054 3055 func (s *WriteResult) MarshalJSON() ([]byte, error) { 3056 type NoMethod WriteResult 3057 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 3058 } 3059 3060 type ProjectsDatabasesExportDocumentsCall struct { 3061 s *Service 3062 name string 3063 googlefirestoreadminv1beta1exportdocumentsrequest *GoogleFirestoreAdminV1beta1ExportDocumentsRequest 3064 urlParams_ gensupport.URLParams 3065 ctx_ context.Context 3066 header_ http.Header 3067 } 3068 3069 // ExportDocuments: Exports a copy of all or a subset of documents from Google 3070 // Cloud Firestore to another storage system, such as Google Cloud Storage. 3071 // Recent updates to documents may not be reflected in the export. The export 3072 // occurs in the background and its progress can be monitored and managed via 3073 // the Operation resource that is created. The output of an export may only be 3074 // used once the associated operation is done. If an export operation is 3075 // cancelled before completion it may leave partial data behind in Google Cloud 3076 // Storage. 3077 // 3078 // - name: Database to export. Should be of the form: 3079 // `projects/{project_id}/databases/{database_id}`. 3080 func (r *ProjectsDatabasesService) ExportDocuments(name string, googlefirestoreadminv1beta1exportdocumentsrequest *GoogleFirestoreAdminV1beta1ExportDocumentsRequest) *ProjectsDatabasesExportDocumentsCall { 3081 c := &ProjectsDatabasesExportDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3082 c.name = name 3083 c.googlefirestoreadminv1beta1exportdocumentsrequest = googlefirestoreadminv1beta1exportdocumentsrequest 3084 return c 3085 } 3086 3087 // Fields allows partial responses to be retrieved. See 3088 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3089 // details. 3090 func (c *ProjectsDatabasesExportDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesExportDocumentsCall { 3091 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3092 return c 3093 } 3094 3095 // Context sets the context to be used in this call's Do method. 3096 func (c *ProjectsDatabasesExportDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesExportDocumentsCall { 3097 c.ctx_ = ctx 3098 return c 3099 } 3100 3101 // Header returns a http.Header that can be modified by the caller to add 3102 // headers to the request. 3103 func (c *ProjectsDatabasesExportDocumentsCall) Header() http.Header { 3104 if c.header_ == nil { 3105 c.header_ = make(http.Header) 3106 } 3107 return c.header_ 3108 } 3109 3110 func (c *ProjectsDatabasesExportDocumentsCall) doRequest(alt string) (*http.Response, error) { 3111 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3112 var body io.Reader = nil 3113 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta1exportdocumentsrequest) 3114 if err != nil { 3115 return nil, err 3116 } 3117 c.urlParams_.Set("alt", alt) 3118 c.urlParams_.Set("prettyPrint", "false") 3119 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:exportDocuments") 3120 urls += "?" + c.urlParams_.Encode() 3121 req, err := http.NewRequest("POST", urls, body) 3122 if err != nil { 3123 return nil, err 3124 } 3125 req.Header = reqHeaders 3126 googleapi.Expand(req.URL, map[string]string{ 3127 "name": c.name, 3128 }) 3129 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3130 } 3131 3132 // Do executes the "firestore.projects.databases.exportDocuments" call. 3133 // Any non-2xx status code is an error. Response headers are in either 3134 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 3135 // returned at all) in error.(*googleapi.Error).Header. Use 3136 // googleapi.IsNotModified to check whether the returned error was because 3137 // http.StatusNotModified was returned. 3138 func (c *ProjectsDatabasesExportDocumentsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 3139 gensupport.SetOptions(c.urlParams_, opts...) 3140 res, err := c.doRequest("json") 3141 if res != nil && res.StatusCode == http.StatusNotModified { 3142 if res.Body != nil { 3143 res.Body.Close() 3144 } 3145 return nil, gensupport.WrapError(&googleapi.Error{ 3146 Code: res.StatusCode, 3147 Header: res.Header, 3148 }) 3149 } 3150 if err != nil { 3151 return nil, err 3152 } 3153 defer googleapi.CloseBody(res) 3154 if err := googleapi.CheckResponse(res); err != nil { 3155 return nil, gensupport.WrapError(err) 3156 } 3157 ret := &GoogleLongrunningOperation{ 3158 ServerResponse: googleapi.ServerResponse{ 3159 Header: res.Header, 3160 HTTPStatusCode: res.StatusCode, 3161 }, 3162 } 3163 target := &ret 3164 if err := gensupport.DecodeResponse(target, res); err != nil { 3165 return nil, err 3166 } 3167 return ret, nil 3168 } 3169 3170 type ProjectsDatabasesImportDocumentsCall struct { 3171 s *Service 3172 name string 3173 googlefirestoreadminv1beta1importdocumentsrequest *GoogleFirestoreAdminV1beta1ImportDocumentsRequest 3174 urlParams_ gensupport.URLParams 3175 ctx_ context.Context 3176 header_ http.Header 3177 } 3178 3179 // ImportDocuments: Imports documents into Google Cloud Firestore. Existing 3180 // documents with the same name are overwritten. The import occurs in the 3181 // background and its progress can be monitored and managed via the Operation 3182 // resource that is created. If an ImportDocuments operation is cancelled, it 3183 // is possible that a subset of the data has already been imported to Cloud 3184 // Firestore. 3185 // 3186 // - name: Database to import into. Should be of the form: 3187 // `projects/{project_id}/databases/{database_id}`. 3188 func (r *ProjectsDatabasesService) ImportDocuments(name string, googlefirestoreadminv1beta1importdocumentsrequest *GoogleFirestoreAdminV1beta1ImportDocumentsRequest) *ProjectsDatabasesImportDocumentsCall { 3189 c := &ProjectsDatabasesImportDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3190 c.name = name 3191 c.googlefirestoreadminv1beta1importdocumentsrequest = googlefirestoreadminv1beta1importdocumentsrequest 3192 return c 3193 } 3194 3195 // Fields allows partial responses to be retrieved. See 3196 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3197 // details. 3198 func (c *ProjectsDatabasesImportDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesImportDocumentsCall { 3199 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3200 return c 3201 } 3202 3203 // Context sets the context to be used in this call's Do method. 3204 func (c *ProjectsDatabasesImportDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesImportDocumentsCall { 3205 c.ctx_ = ctx 3206 return c 3207 } 3208 3209 // Header returns a http.Header that can be modified by the caller to add 3210 // headers to the request. 3211 func (c *ProjectsDatabasesImportDocumentsCall) Header() http.Header { 3212 if c.header_ == nil { 3213 c.header_ = make(http.Header) 3214 } 3215 return c.header_ 3216 } 3217 3218 func (c *ProjectsDatabasesImportDocumentsCall) doRequest(alt string) (*http.Response, error) { 3219 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3220 var body io.Reader = nil 3221 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta1importdocumentsrequest) 3222 if err != nil { 3223 return nil, err 3224 } 3225 c.urlParams_.Set("alt", alt) 3226 c.urlParams_.Set("prettyPrint", "false") 3227 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:importDocuments") 3228 urls += "?" + c.urlParams_.Encode() 3229 req, err := http.NewRequest("POST", urls, body) 3230 if err != nil { 3231 return nil, err 3232 } 3233 req.Header = reqHeaders 3234 googleapi.Expand(req.URL, map[string]string{ 3235 "name": c.name, 3236 }) 3237 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3238 } 3239 3240 // Do executes the "firestore.projects.databases.importDocuments" call. 3241 // Any non-2xx status code is an error. Response headers are in either 3242 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 3243 // returned at all) in error.(*googleapi.Error).Header. Use 3244 // googleapi.IsNotModified to check whether the returned error was because 3245 // http.StatusNotModified was returned. 3246 func (c *ProjectsDatabasesImportDocumentsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 3247 gensupport.SetOptions(c.urlParams_, opts...) 3248 res, err := c.doRequest("json") 3249 if res != nil && res.StatusCode == http.StatusNotModified { 3250 if res.Body != nil { 3251 res.Body.Close() 3252 } 3253 return nil, gensupport.WrapError(&googleapi.Error{ 3254 Code: res.StatusCode, 3255 Header: res.Header, 3256 }) 3257 } 3258 if err != nil { 3259 return nil, err 3260 } 3261 defer googleapi.CloseBody(res) 3262 if err := googleapi.CheckResponse(res); err != nil { 3263 return nil, gensupport.WrapError(err) 3264 } 3265 ret := &GoogleLongrunningOperation{ 3266 ServerResponse: googleapi.ServerResponse{ 3267 Header: res.Header, 3268 HTTPStatusCode: res.StatusCode, 3269 }, 3270 } 3271 target := &ret 3272 if err := gensupport.DecodeResponse(target, res); err != nil { 3273 return nil, err 3274 } 3275 return ret, nil 3276 } 3277 3278 type ProjectsDatabasesDocumentsBatchGetCall struct { 3279 s *Service 3280 database string 3281 batchgetdocumentsrequest *BatchGetDocumentsRequest 3282 urlParams_ gensupport.URLParams 3283 ctx_ context.Context 3284 header_ http.Header 3285 } 3286 3287 // BatchGet: Gets multiple documents. Documents returned by this method are not 3288 // guaranteed to be returned in the same order that they were requested. 3289 // 3290 // - database: The database name. In the format: 3291 // `projects/{project_id}/databases/{database_id}`. 3292 func (r *ProjectsDatabasesDocumentsService) BatchGet(database string, batchgetdocumentsrequest *BatchGetDocumentsRequest) *ProjectsDatabasesDocumentsBatchGetCall { 3293 c := &ProjectsDatabasesDocumentsBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3294 c.database = database 3295 c.batchgetdocumentsrequest = batchgetdocumentsrequest 3296 return c 3297 } 3298 3299 // Fields allows partial responses to be retrieved. See 3300 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3301 // details. 3302 func (c *ProjectsDatabasesDocumentsBatchGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsBatchGetCall { 3303 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3304 return c 3305 } 3306 3307 // Context sets the context to be used in this call's Do method. 3308 func (c *ProjectsDatabasesDocumentsBatchGetCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsBatchGetCall { 3309 c.ctx_ = ctx 3310 return c 3311 } 3312 3313 // Header returns a http.Header that can be modified by the caller to add 3314 // headers to the request. 3315 func (c *ProjectsDatabasesDocumentsBatchGetCall) Header() http.Header { 3316 if c.header_ == nil { 3317 c.header_ = make(http.Header) 3318 } 3319 return c.header_ 3320 } 3321 3322 func (c *ProjectsDatabasesDocumentsBatchGetCall) doRequest(alt string) (*http.Response, error) { 3323 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3324 var body io.Reader = nil 3325 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchgetdocumentsrequest) 3326 if err != nil { 3327 return nil, err 3328 } 3329 c.urlParams_.Set("alt", alt) 3330 c.urlParams_.Set("prettyPrint", "false") 3331 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+database}/documents:batchGet") 3332 urls += "?" + c.urlParams_.Encode() 3333 req, err := http.NewRequest("POST", urls, body) 3334 if err != nil { 3335 return nil, err 3336 } 3337 req.Header = reqHeaders 3338 googleapi.Expand(req.URL, map[string]string{ 3339 "database": c.database, 3340 }) 3341 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3342 } 3343 3344 // Do executes the "firestore.projects.databases.documents.batchGet" call. 3345 // Any non-2xx status code is an error. Response headers are in either 3346 // *BatchGetDocumentsResponse.ServerResponse.Header or (if a response was 3347 // returned at all) in error.(*googleapi.Error).Header. Use 3348 // googleapi.IsNotModified to check whether the returned error was because 3349 // http.StatusNotModified was returned. 3350 func (c *ProjectsDatabasesDocumentsBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetDocumentsResponse, error) { 3351 gensupport.SetOptions(c.urlParams_, opts...) 3352 res, err := c.doRequest("json") 3353 if res != nil && res.StatusCode == http.StatusNotModified { 3354 if res.Body != nil { 3355 res.Body.Close() 3356 } 3357 return nil, gensupport.WrapError(&googleapi.Error{ 3358 Code: res.StatusCode, 3359 Header: res.Header, 3360 }) 3361 } 3362 if err != nil { 3363 return nil, err 3364 } 3365 defer googleapi.CloseBody(res) 3366 if err := googleapi.CheckResponse(res); err != nil { 3367 return nil, gensupport.WrapError(err) 3368 } 3369 ret := &BatchGetDocumentsResponse{ 3370 ServerResponse: googleapi.ServerResponse{ 3371 Header: res.Header, 3372 HTTPStatusCode: res.StatusCode, 3373 }, 3374 } 3375 target := &ret 3376 if err := gensupport.DecodeResponse(target, res); err != nil { 3377 return nil, err 3378 } 3379 return ret, nil 3380 } 3381 3382 type ProjectsDatabasesDocumentsBatchWriteCall struct { 3383 s *Service 3384 database string 3385 batchwriterequest *BatchWriteRequest 3386 urlParams_ gensupport.URLParams 3387 ctx_ context.Context 3388 header_ http.Header 3389 } 3390 3391 // BatchWrite: Applies a batch of write operations. The BatchWrite method does 3392 // not apply the write operations atomically and can apply them out of order. 3393 // Method does not allow more than one write per document. Each write succeeds 3394 // or fails independently. See the BatchWriteResponse for the success status of 3395 // each write. If you require an atomically applied set of writes, use Commit 3396 // instead. 3397 // 3398 // - database: The database name. In the format: 3399 // `projects/{project_id}/databases/{database_id}`. 3400 func (r *ProjectsDatabasesDocumentsService) BatchWrite(database string, batchwriterequest *BatchWriteRequest) *ProjectsDatabasesDocumentsBatchWriteCall { 3401 c := &ProjectsDatabasesDocumentsBatchWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3402 c.database = database 3403 c.batchwriterequest = batchwriterequest 3404 return c 3405 } 3406 3407 // Fields allows partial responses to be retrieved. See 3408 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3409 // details. 3410 func (c *ProjectsDatabasesDocumentsBatchWriteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsBatchWriteCall { 3411 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3412 return c 3413 } 3414 3415 // Context sets the context to be used in this call's Do method. 3416 func (c *ProjectsDatabasesDocumentsBatchWriteCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsBatchWriteCall { 3417 c.ctx_ = ctx 3418 return c 3419 } 3420 3421 // Header returns a http.Header that can be modified by the caller to add 3422 // headers to the request. 3423 func (c *ProjectsDatabasesDocumentsBatchWriteCall) Header() http.Header { 3424 if c.header_ == nil { 3425 c.header_ = make(http.Header) 3426 } 3427 return c.header_ 3428 } 3429 3430 func (c *ProjectsDatabasesDocumentsBatchWriteCall) doRequest(alt string) (*http.Response, error) { 3431 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3432 var body io.Reader = nil 3433 body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchwriterequest) 3434 if err != nil { 3435 return nil, err 3436 } 3437 c.urlParams_.Set("alt", alt) 3438 c.urlParams_.Set("prettyPrint", "false") 3439 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+database}/documents:batchWrite") 3440 urls += "?" + c.urlParams_.Encode() 3441 req, err := http.NewRequest("POST", urls, body) 3442 if err != nil { 3443 return nil, err 3444 } 3445 req.Header = reqHeaders 3446 googleapi.Expand(req.URL, map[string]string{ 3447 "database": c.database, 3448 }) 3449 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3450 } 3451 3452 // Do executes the "firestore.projects.databases.documents.batchWrite" call. 3453 // Any non-2xx status code is an error. Response headers are in either 3454 // *BatchWriteResponse.ServerResponse.Header or (if a response was returned at 3455 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3456 // check whether the returned error was because http.StatusNotModified was 3457 // returned. 3458 func (c *ProjectsDatabasesDocumentsBatchWriteCall) Do(opts ...googleapi.CallOption) (*BatchWriteResponse, error) { 3459 gensupport.SetOptions(c.urlParams_, opts...) 3460 res, err := c.doRequest("json") 3461 if res != nil && res.StatusCode == http.StatusNotModified { 3462 if res.Body != nil { 3463 res.Body.Close() 3464 } 3465 return nil, gensupport.WrapError(&googleapi.Error{ 3466 Code: res.StatusCode, 3467 Header: res.Header, 3468 }) 3469 } 3470 if err != nil { 3471 return nil, err 3472 } 3473 defer googleapi.CloseBody(res) 3474 if err := googleapi.CheckResponse(res); err != nil { 3475 return nil, gensupport.WrapError(err) 3476 } 3477 ret := &BatchWriteResponse{ 3478 ServerResponse: googleapi.ServerResponse{ 3479 Header: res.Header, 3480 HTTPStatusCode: res.StatusCode, 3481 }, 3482 } 3483 target := &ret 3484 if err := gensupport.DecodeResponse(target, res); err != nil { 3485 return nil, err 3486 } 3487 return ret, nil 3488 } 3489 3490 type ProjectsDatabasesDocumentsBeginTransactionCall struct { 3491 s *Service 3492 database string 3493 begintransactionrequest *BeginTransactionRequest 3494 urlParams_ gensupport.URLParams 3495 ctx_ context.Context 3496 header_ http.Header 3497 } 3498 3499 // BeginTransaction: Starts a new transaction. 3500 // 3501 // - database: The database name. In the format: 3502 // `projects/{project_id}/databases/{database_id}`. 3503 func (r *ProjectsDatabasesDocumentsService) BeginTransaction(database string, begintransactionrequest *BeginTransactionRequest) *ProjectsDatabasesDocumentsBeginTransactionCall { 3504 c := &ProjectsDatabasesDocumentsBeginTransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3505 c.database = database 3506 c.begintransactionrequest = begintransactionrequest 3507 return c 3508 } 3509 3510 // Fields allows partial responses to be retrieved. See 3511 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3512 // details. 3513 func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsBeginTransactionCall { 3514 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3515 return c 3516 } 3517 3518 // Context sets the context to be used in this call's Do method. 3519 func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsBeginTransactionCall { 3520 c.ctx_ = ctx 3521 return c 3522 } 3523 3524 // Header returns a http.Header that can be modified by the caller to add 3525 // headers to the request. 3526 func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Header() http.Header { 3527 if c.header_ == nil { 3528 c.header_ = make(http.Header) 3529 } 3530 return c.header_ 3531 } 3532 3533 func (c *ProjectsDatabasesDocumentsBeginTransactionCall) doRequest(alt string) (*http.Response, error) { 3534 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3535 var body io.Reader = nil 3536 body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest) 3537 if err != nil { 3538 return nil, err 3539 } 3540 c.urlParams_.Set("alt", alt) 3541 c.urlParams_.Set("prettyPrint", "false") 3542 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+database}/documents:beginTransaction") 3543 urls += "?" + c.urlParams_.Encode() 3544 req, err := http.NewRequest("POST", urls, body) 3545 if err != nil { 3546 return nil, err 3547 } 3548 req.Header = reqHeaders 3549 googleapi.Expand(req.URL, map[string]string{ 3550 "database": c.database, 3551 }) 3552 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3553 } 3554 3555 // Do executes the "firestore.projects.databases.documents.beginTransaction" call. 3556 // Any non-2xx status code is an error. Response headers are in either 3557 // *BeginTransactionResponse.ServerResponse.Header or (if a response was 3558 // returned at all) in error.(*googleapi.Error).Header. Use 3559 // googleapi.IsNotModified to check whether the returned error was because 3560 // http.StatusNotModified was returned. 3561 func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Do(opts ...googleapi.CallOption) (*BeginTransactionResponse, error) { 3562 gensupport.SetOptions(c.urlParams_, opts...) 3563 res, err := c.doRequest("json") 3564 if res != nil && res.StatusCode == http.StatusNotModified { 3565 if res.Body != nil { 3566 res.Body.Close() 3567 } 3568 return nil, gensupport.WrapError(&googleapi.Error{ 3569 Code: res.StatusCode, 3570 Header: res.Header, 3571 }) 3572 } 3573 if err != nil { 3574 return nil, err 3575 } 3576 defer googleapi.CloseBody(res) 3577 if err := googleapi.CheckResponse(res); err != nil { 3578 return nil, gensupport.WrapError(err) 3579 } 3580 ret := &BeginTransactionResponse{ 3581 ServerResponse: googleapi.ServerResponse{ 3582 Header: res.Header, 3583 HTTPStatusCode: res.StatusCode, 3584 }, 3585 } 3586 target := &ret 3587 if err := gensupport.DecodeResponse(target, res); err != nil { 3588 return nil, err 3589 } 3590 return ret, nil 3591 } 3592 3593 type ProjectsDatabasesDocumentsCommitCall struct { 3594 s *Service 3595 database string 3596 commitrequest *CommitRequest 3597 urlParams_ gensupport.URLParams 3598 ctx_ context.Context 3599 header_ http.Header 3600 } 3601 3602 // Commit: Commits a transaction, while optionally updating documents. 3603 // 3604 // - database: The database name. In the format: 3605 // `projects/{project_id}/databases/{database_id}`. 3606 func (r *ProjectsDatabasesDocumentsService) Commit(database string, commitrequest *CommitRequest) *ProjectsDatabasesDocumentsCommitCall { 3607 c := &ProjectsDatabasesDocumentsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3608 c.database = database 3609 c.commitrequest = commitrequest 3610 return c 3611 } 3612 3613 // Fields allows partial responses to be retrieved. See 3614 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3615 // details. 3616 func (c *ProjectsDatabasesDocumentsCommitCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsCommitCall { 3617 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3618 return c 3619 } 3620 3621 // Context sets the context to be used in this call's Do method. 3622 func (c *ProjectsDatabasesDocumentsCommitCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsCommitCall { 3623 c.ctx_ = ctx 3624 return c 3625 } 3626 3627 // Header returns a http.Header that can be modified by the caller to add 3628 // headers to the request. 3629 func (c *ProjectsDatabasesDocumentsCommitCall) Header() http.Header { 3630 if c.header_ == nil { 3631 c.header_ = make(http.Header) 3632 } 3633 return c.header_ 3634 } 3635 3636 func (c *ProjectsDatabasesDocumentsCommitCall) doRequest(alt string) (*http.Response, error) { 3637 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3638 var body io.Reader = nil 3639 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest) 3640 if err != nil { 3641 return nil, err 3642 } 3643 c.urlParams_.Set("alt", alt) 3644 c.urlParams_.Set("prettyPrint", "false") 3645 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+database}/documents:commit") 3646 urls += "?" + c.urlParams_.Encode() 3647 req, err := http.NewRequest("POST", urls, body) 3648 if err != nil { 3649 return nil, err 3650 } 3651 req.Header = reqHeaders 3652 googleapi.Expand(req.URL, map[string]string{ 3653 "database": c.database, 3654 }) 3655 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3656 } 3657 3658 // Do executes the "firestore.projects.databases.documents.commit" call. 3659 // Any non-2xx status code is an error. Response headers are in either 3660 // *CommitResponse.ServerResponse.Header or (if a response was returned at all) 3661 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3662 // whether the returned error was because http.StatusNotModified was returned. 3663 func (c *ProjectsDatabasesDocumentsCommitCall) Do(opts ...googleapi.CallOption) (*CommitResponse, error) { 3664 gensupport.SetOptions(c.urlParams_, opts...) 3665 res, err := c.doRequest("json") 3666 if res != nil && res.StatusCode == http.StatusNotModified { 3667 if res.Body != nil { 3668 res.Body.Close() 3669 } 3670 return nil, gensupport.WrapError(&googleapi.Error{ 3671 Code: res.StatusCode, 3672 Header: res.Header, 3673 }) 3674 } 3675 if err != nil { 3676 return nil, err 3677 } 3678 defer googleapi.CloseBody(res) 3679 if err := googleapi.CheckResponse(res); err != nil { 3680 return nil, gensupport.WrapError(err) 3681 } 3682 ret := &CommitResponse{ 3683 ServerResponse: googleapi.ServerResponse{ 3684 Header: res.Header, 3685 HTTPStatusCode: res.StatusCode, 3686 }, 3687 } 3688 target := &ret 3689 if err := gensupport.DecodeResponse(target, res); err != nil { 3690 return nil, err 3691 } 3692 return ret, nil 3693 } 3694 3695 type ProjectsDatabasesDocumentsCreateDocumentCall struct { 3696 s *Service 3697 parent string 3698 collectionId string 3699 document *Document 3700 urlParams_ gensupport.URLParams 3701 ctx_ context.Context 3702 header_ http.Header 3703 } 3704 3705 // CreateDocument: Creates a new document. 3706 // 3707 // - collectionId: The collection ID, relative to `parent`, to list. For 3708 // example: `chatrooms`. 3709 // - parent: The parent resource. For example: 3710 // `projects/{project_id}/databases/{database_id}/documents` or 3711 // `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroo 3712 // m_id}`. 3713 func (r *ProjectsDatabasesDocumentsService) CreateDocument(parent string, collectionId string, document *Document) *ProjectsDatabasesDocumentsCreateDocumentCall { 3714 c := &ProjectsDatabasesDocumentsCreateDocumentCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3715 c.parent = parent 3716 c.collectionId = collectionId 3717 c.document = document 3718 return c 3719 } 3720 3721 // DocumentId sets the optional parameter "documentId": The client-assigned 3722 // document ID to use for this document. If not specified, an ID will be 3723 // assigned by the service. 3724 func (c *ProjectsDatabasesDocumentsCreateDocumentCall) DocumentId(documentId string) *ProjectsDatabasesDocumentsCreateDocumentCall { 3725 c.urlParams_.Set("documentId", documentId) 3726 return c 3727 } 3728 3729 // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The list of 3730 // field paths in the mask. See Document.fields for a field path syntax 3731 // reference. 3732 func (c *ProjectsDatabasesDocumentsCreateDocumentCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsCreateDocumentCall { 3733 c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...)) 3734 return c 3735 } 3736 3737 // Fields allows partial responses to be retrieved. See 3738 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3739 // details. 3740 func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsCreateDocumentCall { 3741 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3742 return c 3743 } 3744 3745 // Context sets the context to be used in this call's Do method. 3746 func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsCreateDocumentCall { 3747 c.ctx_ = ctx 3748 return c 3749 } 3750 3751 // Header returns a http.Header that can be modified by the caller to add 3752 // headers to the request. 3753 func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Header() http.Header { 3754 if c.header_ == nil { 3755 c.header_ = make(http.Header) 3756 } 3757 return c.header_ 3758 } 3759 3760 func (c *ProjectsDatabasesDocumentsCreateDocumentCall) doRequest(alt string) (*http.Response, error) { 3761 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 3762 var body io.Reader = nil 3763 body, err := googleapi.WithoutDataWrapper.JSONReader(c.document) 3764 if err != nil { 3765 return nil, err 3766 } 3767 c.urlParams_.Set("alt", alt) 3768 c.urlParams_.Set("prettyPrint", "false") 3769 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/{collectionId}") 3770 urls += "?" + c.urlParams_.Encode() 3771 req, err := http.NewRequest("POST", urls, body) 3772 if err != nil { 3773 return nil, err 3774 } 3775 req.Header = reqHeaders 3776 googleapi.Expand(req.URL, map[string]string{ 3777 "parent": c.parent, 3778 "collectionId": c.collectionId, 3779 }) 3780 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3781 } 3782 3783 // Do executes the "firestore.projects.databases.documents.createDocument" call. 3784 // Any non-2xx status code is an error. Response headers are in either 3785 // *Document.ServerResponse.Header or (if a response was returned at all) in 3786 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3787 // whether the returned error was because http.StatusNotModified was returned. 3788 func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Do(opts ...googleapi.CallOption) (*Document, error) { 3789 gensupport.SetOptions(c.urlParams_, opts...) 3790 res, err := c.doRequest("json") 3791 if res != nil && res.StatusCode == http.StatusNotModified { 3792 if res.Body != nil { 3793 res.Body.Close() 3794 } 3795 return nil, gensupport.WrapError(&googleapi.Error{ 3796 Code: res.StatusCode, 3797 Header: res.Header, 3798 }) 3799 } 3800 if err != nil { 3801 return nil, err 3802 } 3803 defer googleapi.CloseBody(res) 3804 if err := googleapi.CheckResponse(res); err != nil { 3805 return nil, gensupport.WrapError(err) 3806 } 3807 ret := &Document{ 3808 ServerResponse: googleapi.ServerResponse{ 3809 Header: res.Header, 3810 HTTPStatusCode: res.StatusCode, 3811 }, 3812 } 3813 target := &ret 3814 if err := gensupport.DecodeResponse(target, res); err != nil { 3815 return nil, err 3816 } 3817 return ret, nil 3818 } 3819 3820 type ProjectsDatabasesDocumentsDeleteCall struct { 3821 s *Service 3822 name string 3823 urlParams_ gensupport.URLParams 3824 ctx_ context.Context 3825 header_ http.Header 3826 } 3827 3828 // Delete: Deletes a document. 3829 // 3830 // - name: The resource name of the Document to delete. In the format: 3831 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 3832 func (r *ProjectsDatabasesDocumentsService) Delete(name string) *ProjectsDatabasesDocumentsDeleteCall { 3833 c := &ProjectsDatabasesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3834 c.name = name 3835 return c 3836 } 3837 3838 // CurrentDocumentExists sets the optional parameter "currentDocument.exists": 3839 // When set to `true`, the target document must exist. When set to `false`, the 3840 // target document must not exist. 3841 func (c *ProjectsDatabasesDocumentsDeleteCall) CurrentDocumentExists(currentDocumentExists bool) *ProjectsDatabasesDocumentsDeleteCall { 3842 c.urlParams_.Set("currentDocument.exists", fmt.Sprint(currentDocumentExists)) 3843 return c 3844 } 3845 3846 // CurrentDocumentUpdateTime sets the optional parameter 3847 // "currentDocument.updateTime": When set, the target document must exist and 3848 // have been last updated at that time. Timestamp must be microsecond aligned. 3849 func (c *ProjectsDatabasesDocumentsDeleteCall) CurrentDocumentUpdateTime(currentDocumentUpdateTime string) *ProjectsDatabasesDocumentsDeleteCall { 3850 c.urlParams_.Set("currentDocument.updateTime", currentDocumentUpdateTime) 3851 return c 3852 } 3853 3854 // Fields allows partial responses to be retrieved. See 3855 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3856 // details. 3857 func (c *ProjectsDatabasesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsDeleteCall { 3858 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3859 return c 3860 } 3861 3862 // Context sets the context to be used in this call's Do method. 3863 func (c *ProjectsDatabasesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsDeleteCall { 3864 c.ctx_ = ctx 3865 return c 3866 } 3867 3868 // Header returns a http.Header that can be modified by the caller to add 3869 // headers to the request. 3870 func (c *ProjectsDatabasesDocumentsDeleteCall) Header() http.Header { 3871 if c.header_ == nil { 3872 c.header_ = make(http.Header) 3873 } 3874 return c.header_ 3875 } 3876 3877 func (c *ProjectsDatabasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) { 3878 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 3879 var body io.Reader = nil 3880 c.urlParams_.Set("alt", alt) 3881 c.urlParams_.Set("prettyPrint", "false") 3882 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 3883 urls += "?" + c.urlParams_.Encode() 3884 req, err := http.NewRequest("DELETE", urls, body) 3885 if err != nil { 3886 return nil, err 3887 } 3888 req.Header = reqHeaders 3889 googleapi.Expand(req.URL, map[string]string{ 3890 "name": c.name, 3891 }) 3892 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3893 } 3894 3895 // Do executes the "firestore.projects.databases.documents.delete" call. 3896 // Any non-2xx status code is an error. Response headers are in either 3897 // *Empty.ServerResponse.Header or (if a response was returned at all) in 3898 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 3899 // whether the returned error was because http.StatusNotModified was returned. 3900 func (c *ProjectsDatabasesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3901 gensupport.SetOptions(c.urlParams_, opts...) 3902 res, err := c.doRequest("json") 3903 if res != nil && res.StatusCode == http.StatusNotModified { 3904 if res.Body != nil { 3905 res.Body.Close() 3906 } 3907 return nil, gensupport.WrapError(&googleapi.Error{ 3908 Code: res.StatusCode, 3909 Header: res.Header, 3910 }) 3911 } 3912 if err != nil { 3913 return nil, err 3914 } 3915 defer googleapi.CloseBody(res) 3916 if err := googleapi.CheckResponse(res); err != nil { 3917 return nil, gensupport.WrapError(err) 3918 } 3919 ret := &Empty{ 3920 ServerResponse: googleapi.ServerResponse{ 3921 Header: res.Header, 3922 HTTPStatusCode: res.StatusCode, 3923 }, 3924 } 3925 target := &ret 3926 if err := gensupport.DecodeResponse(target, res); err != nil { 3927 return nil, err 3928 } 3929 return ret, nil 3930 } 3931 3932 type ProjectsDatabasesDocumentsGetCall struct { 3933 s *Service 3934 name string 3935 urlParams_ gensupport.URLParams 3936 ifNoneMatch_ string 3937 ctx_ context.Context 3938 header_ http.Header 3939 } 3940 3941 // Get: Gets a single document. 3942 // 3943 // - name: The resource name of the Document to get. In the format: 3944 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 3945 func (r *ProjectsDatabasesDocumentsService) Get(name string) *ProjectsDatabasesDocumentsGetCall { 3946 c := &ProjectsDatabasesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3947 c.name = name 3948 return c 3949 } 3950 3951 // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The list of 3952 // field paths in the mask. See Document.fields for a field path syntax 3953 // reference. 3954 func (c *ProjectsDatabasesDocumentsGetCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsGetCall { 3955 c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...)) 3956 return c 3957 } 3958 3959 // ReadTime sets the optional parameter "readTime": Reads the version of the 3960 // document at the given time. This must be a microsecond precision timestamp 3961 // within the past one hour, or if Point-in-Time Recovery is enabled, can 3962 // additionally be a whole minute timestamp within the past 7 days. 3963 func (c *ProjectsDatabasesDocumentsGetCall) ReadTime(readTime string) *ProjectsDatabasesDocumentsGetCall { 3964 c.urlParams_.Set("readTime", readTime) 3965 return c 3966 } 3967 3968 // Transaction sets the optional parameter "transaction": Reads the document in 3969 // a transaction. 3970 func (c *ProjectsDatabasesDocumentsGetCall) Transaction(transaction string) *ProjectsDatabasesDocumentsGetCall { 3971 c.urlParams_.Set("transaction", transaction) 3972 return c 3973 } 3974 3975 // Fields allows partial responses to be retrieved. See 3976 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 3977 // details. 3978 func (c *ProjectsDatabasesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsGetCall { 3979 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3980 return c 3981 } 3982 3983 // IfNoneMatch sets an optional parameter which makes the operation fail if the 3984 // object's ETag matches the given value. This is useful for getting updates 3985 // only after the object has changed since the last request. 3986 func (c *ProjectsDatabasesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesDocumentsGetCall { 3987 c.ifNoneMatch_ = entityTag 3988 return c 3989 } 3990 3991 // Context sets the context to be used in this call's Do method. 3992 func (c *ProjectsDatabasesDocumentsGetCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsGetCall { 3993 c.ctx_ = ctx 3994 return c 3995 } 3996 3997 // Header returns a http.Header that can be modified by the caller to add 3998 // headers to the request. 3999 func (c *ProjectsDatabasesDocumentsGetCall) Header() http.Header { 4000 if c.header_ == nil { 4001 c.header_ = make(http.Header) 4002 } 4003 return c.header_ 4004 } 4005 4006 func (c *ProjectsDatabasesDocumentsGetCall) doRequest(alt string) (*http.Response, error) { 4007 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4008 if c.ifNoneMatch_ != "" { 4009 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4010 } 4011 var body io.Reader = nil 4012 c.urlParams_.Set("alt", alt) 4013 c.urlParams_.Set("prettyPrint", "false") 4014 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4015 urls += "?" + c.urlParams_.Encode() 4016 req, err := http.NewRequest("GET", urls, body) 4017 if err != nil { 4018 return nil, err 4019 } 4020 req.Header = reqHeaders 4021 googleapi.Expand(req.URL, map[string]string{ 4022 "name": c.name, 4023 }) 4024 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4025 } 4026 4027 // Do executes the "firestore.projects.databases.documents.get" call. 4028 // Any non-2xx status code is an error. Response headers are in either 4029 // *Document.ServerResponse.Header or (if a response was returned at all) in 4030 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4031 // whether the returned error was because http.StatusNotModified was returned. 4032 func (c *ProjectsDatabasesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*Document, error) { 4033 gensupport.SetOptions(c.urlParams_, opts...) 4034 res, err := c.doRequest("json") 4035 if res != nil && res.StatusCode == http.StatusNotModified { 4036 if res.Body != nil { 4037 res.Body.Close() 4038 } 4039 return nil, gensupport.WrapError(&googleapi.Error{ 4040 Code: res.StatusCode, 4041 Header: res.Header, 4042 }) 4043 } 4044 if err != nil { 4045 return nil, err 4046 } 4047 defer googleapi.CloseBody(res) 4048 if err := googleapi.CheckResponse(res); err != nil { 4049 return nil, gensupport.WrapError(err) 4050 } 4051 ret := &Document{ 4052 ServerResponse: googleapi.ServerResponse{ 4053 Header: res.Header, 4054 HTTPStatusCode: res.StatusCode, 4055 }, 4056 } 4057 target := &ret 4058 if err := gensupport.DecodeResponse(target, res); err != nil { 4059 return nil, err 4060 } 4061 return ret, nil 4062 } 4063 4064 type ProjectsDatabasesDocumentsListCall struct { 4065 s *Service 4066 parent string 4067 collectionId string 4068 urlParams_ gensupport.URLParams 4069 ifNoneMatch_ string 4070 ctx_ context.Context 4071 header_ http.Header 4072 } 4073 4074 // List: Lists documents. 4075 // 4076 // - collectionId: Optional. The collection ID, relative to `parent`, to list. 4077 // For example: `chatrooms` or `messages`. This is optional, and when not 4078 // provided, Firestore will list documents from all collections under the 4079 // provided `parent`. 4080 // - parent: The parent resource name. In the format: 4081 // `projects/{project_id}/databases/{database_id}/documents` or 4082 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 4083 // For example: `projects/my-project/databases/my-database/documents` or 4084 // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`. 4085 func (r *ProjectsDatabasesDocumentsService) List(parent string, collectionId string) *ProjectsDatabasesDocumentsListCall { 4086 c := &ProjectsDatabasesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4087 c.parent = parent 4088 c.collectionId = collectionId 4089 return c 4090 } 4091 4092 // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The list of 4093 // field paths in the mask. See Document.fields for a field path syntax 4094 // reference. 4095 func (c *ProjectsDatabasesDocumentsListCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsListCall { 4096 c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...)) 4097 return c 4098 } 4099 4100 // OrderBy sets the optional parameter "orderBy": The optional ordering of the 4101 // documents to return. For example: `priority desc, __name__ desc`. This 4102 // mirrors the `ORDER BY` used in Firestore queries but in a string 4103 // representation. When absent, documents are ordered based on `__name__ ASC`. 4104 func (c *ProjectsDatabasesDocumentsListCall) OrderBy(orderBy string) *ProjectsDatabasesDocumentsListCall { 4105 c.urlParams_.Set("orderBy", orderBy) 4106 return c 4107 } 4108 4109 // PageSize sets the optional parameter "pageSize": The maximum number of 4110 // documents to return in a single response. Firestore may return fewer than 4111 // this value. 4112 func (c *ProjectsDatabasesDocumentsListCall) PageSize(pageSize int64) *ProjectsDatabasesDocumentsListCall { 4113 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4114 return c 4115 } 4116 4117 // PageToken sets the optional parameter "pageToken": A page token, received 4118 // from a previous `ListDocuments` response. Provide this to retrieve the 4119 // subsequent page. When paginating, all other parameters (with the exception 4120 // of `page_size`) must match the values set in the request that generated the 4121 // page token. 4122 func (c *ProjectsDatabasesDocumentsListCall) PageToken(pageToken string) *ProjectsDatabasesDocumentsListCall { 4123 c.urlParams_.Set("pageToken", pageToken) 4124 return c 4125 } 4126 4127 // ReadTime sets the optional parameter "readTime": Perform the read at the 4128 // provided time. This must be a microsecond precision timestamp within the 4129 // past one hour, or if Point-in-Time Recovery is enabled, can additionally be 4130 // a whole minute timestamp within the past 7 days. 4131 func (c *ProjectsDatabasesDocumentsListCall) ReadTime(readTime string) *ProjectsDatabasesDocumentsListCall { 4132 c.urlParams_.Set("readTime", readTime) 4133 return c 4134 } 4135 4136 // ShowMissing sets the optional parameter "showMissing": If the list should 4137 // show missing documents. A document is missing if it does not exist, but 4138 // there are sub-documents nested underneath it. When true, such missing 4139 // documents will be returned with a key but will not have fields, 4140 // `create_time`, or `update_time` set. Requests with `show_missing` may not 4141 // specify `where` or `order_by`. 4142 func (c *ProjectsDatabasesDocumentsListCall) ShowMissing(showMissing bool) *ProjectsDatabasesDocumentsListCall { 4143 c.urlParams_.Set("showMissing", fmt.Sprint(showMissing)) 4144 return c 4145 } 4146 4147 // Transaction sets the optional parameter "transaction": Perform the read as 4148 // part of an already active transaction. 4149 func (c *ProjectsDatabasesDocumentsListCall) Transaction(transaction string) *ProjectsDatabasesDocumentsListCall { 4150 c.urlParams_.Set("transaction", transaction) 4151 return c 4152 } 4153 4154 // Fields allows partial responses to be retrieved. See 4155 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4156 // details. 4157 func (c *ProjectsDatabasesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsListCall { 4158 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4159 return c 4160 } 4161 4162 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4163 // object's ETag matches the given value. This is useful for getting updates 4164 // only after the object has changed since the last request. 4165 func (c *ProjectsDatabasesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesDocumentsListCall { 4166 c.ifNoneMatch_ = entityTag 4167 return c 4168 } 4169 4170 // Context sets the context to be used in this call's Do method. 4171 func (c *ProjectsDatabasesDocumentsListCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsListCall { 4172 c.ctx_ = ctx 4173 return c 4174 } 4175 4176 // Header returns a http.Header that can be modified by the caller to add 4177 // headers to the request. 4178 func (c *ProjectsDatabasesDocumentsListCall) Header() http.Header { 4179 if c.header_ == nil { 4180 c.header_ = make(http.Header) 4181 } 4182 return c.header_ 4183 } 4184 4185 func (c *ProjectsDatabasesDocumentsListCall) doRequest(alt string) (*http.Response, error) { 4186 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4187 if c.ifNoneMatch_ != "" { 4188 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4189 } 4190 var body io.Reader = nil 4191 c.urlParams_.Set("alt", alt) 4192 c.urlParams_.Set("prettyPrint", "false") 4193 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/{collectionId}") 4194 urls += "?" + c.urlParams_.Encode() 4195 req, err := http.NewRequest("GET", urls, body) 4196 if err != nil { 4197 return nil, err 4198 } 4199 req.Header = reqHeaders 4200 googleapi.Expand(req.URL, map[string]string{ 4201 "parent": c.parent, 4202 "collectionId": c.collectionId, 4203 }) 4204 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4205 } 4206 4207 // Do executes the "firestore.projects.databases.documents.list" call. 4208 // Any non-2xx status code is an error. Response headers are in either 4209 // *ListDocumentsResponse.ServerResponse.Header or (if a response was returned 4210 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4211 // check whether the returned error was because http.StatusNotModified was 4212 // returned. 4213 func (c *ProjectsDatabasesDocumentsListCall) Do(opts ...googleapi.CallOption) (*ListDocumentsResponse, error) { 4214 gensupport.SetOptions(c.urlParams_, opts...) 4215 res, err := c.doRequest("json") 4216 if res != nil && res.StatusCode == http.StatusNotModified { 4217 if res.Body != nil { 4218 res.Body.Close() 4219 } 4220 return nil, gensupport.WrapError(&googleapi.Error{ 4221 Code: res.StatusCode, 4222 Header: res.Header, 4223 }) 4224 } 4225 if err != nil { 4226 return nil, err 4227 } 4228 defer googleapi.CloseBody(res) 4229 if err := googleapi.CheckResponse(res); err != nil { 4230 return nil, gensupport.WrapError(err) 4231 } 4232 ret := &ListDocumentsResponse{ 4233 ServerResponse: googleapi.ServerResponse{ 4234 Header: res.Header, 4235 HTTPStatusCode: res.StatusCode, 4236 }, 4237 } 4238 target := &ret 4239 if err := gensupport.DecodeResponse(target, res); err != nil { 4240 return nil, err 4241 } 4242 return ret, nil 4243 } 4244 4245 // Pages invokes f for each page of results. 4246 // A non-nil error returned from f will halt the iteration. 4247 // The provided context supersedes any context provided to the Context method. 4248 func (c *ProjectsDatabasesDocumentsListCall) Pages(ctx context.Context, f func(*ListDocumentsResponse) error) error { 4249 c.ctx_ = ctx 4250 defer c.PageToken(c.urlParams_.Get("pageToken")) 4251 for { 4252 x, err := c.Do() 4253 if err != nil { 4254 return err 4255 } 4256 if err := f(x); err != nil { 4257 return err 4258 } 4259 if x.NextPageToken == "" { 4260 return nil 4261 } 4262 c.PageToken(x.NextPageToken) 4263 } 4264 } 4265 4266 type ProjectsDatabasesDocumentsListCollectionIdsCall struct { 4267 s *Service 4268 parent string 4269 listcollectionidsrequest *ListCollectionIdsRequest 4270 urlParams_ gensupport.URLParams 4271 ctx_ context.Context 4272 header_ http.Header 4273 } 4274 4275 // ListCollectionIds: Lists all the collection IDs underneath a document. 4276 // 4277 // - parent: The parent document. In the format: 4278 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 4279 // For example: 4280 // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`. 4281 func (r *ProjectsDatabasesDocumentsService) ListCollectionIds(parent string, listcollectionidsrequest *ListCollectionIdsRequest) *ProjectsDatabasesDocumentsListCollectionIdsCall { 4282 c := &ProjectsDatabasesDocumentsListCollectionIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4283 c.parent = parent 4284 c.listcollectionidsrequest = listcollectionidsrequest 4285 return c 4286 } 4287 4288 // Fields allows partial responses to be retrieved. See 4289 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4290 // details. 4291 func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsListCollectionIdsCall { 4292 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4293 return c 4294 } 4295 4296 // Context sets the context to be used in this call's Do method. 4297 func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsListCollectionIdsCall { 4298 c.ctx_ = ctx 4299 return c 4300 } 4301 4302 // Header returns a http.Header that can be modified by the caller to add 4303 // headers to the request. 4304 func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Header() http.Header { 4305 if c.header_ == nil { 4306 c.header_ = make(http.Header) 4307 } 4308 return c.header_ 4309 } 4310 4311 func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) doRequest(alt string) (*http.Response, error) { 4312 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4313 var body io.Reader = nil 4314 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listcollectionidsrequest) 4315 if err != nil { 4316 return nil, err 4317 } 4318 c.urlParams_.Set("alt", alt) 4319 c.urlParams_.Set("prettyPrint", "false") 4320 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:listCollectionIds") 4321 urls += "?" + c.urlParams_.Encode() 4322 req, err := http.NewRequest("POST", urls, body) 4323 if err != nil { 4324 return nil, err 4325 } 4326 req.Header = reqHeaders 4327 googleapi.Expand(req.URL, map[string]string{ 4328 "parent": c.parent, 4329 }) 4330 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4331 } 4332 4333 // Do executes the "firestore.projects.databases.documents.listCollectionIds" call. 4334 // Any non-2xx status code is an error. Response headers are in either 4335 // *ListCollectionIdsResponse.ServerResponse.Header or (if a response was 4336 // returned at all) in error.(*googleapi.Error).Header. Use 4337 // googleapi.IsNotModified to check whether the returned error was because 4338 // http.StatusNotModified was returned. 4339 func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Do(opts ...googleapi.CallOption) (*ListCollectionIdsResponse, error) { 4340 gensupport.SetOptions(c.urlParams_, opts...) 4341 res, err := c.doRequest("json") 4342 if res != nil && res.StatusCode == http.StatusNotModified { 4343 if res.Body != nil { 4344 res.Body.Close() 4345 } 4346 return nil, gensupport.WrapError(&googleapi.Error{ 4347 Code: res.StatusCode, 4348 Header: res.Header, 4349 }) 4350 } 4351 if err != nil { 4352 return nil, err 4353 } 4354 defer googleapi.CloseBody(res) 4355 if err := googleapi.CheckResponse(res); err != nil { 4356 return nil, gensupport.WrapError(err) 4357 } 4358 ret := &ListCollectionIdsResponse{ 4359 ServerResponse: googleapi.ServerResponse{ 4360 Header: res.Header, 4361 HTTPStatusCode: res.StatusCode, 4362 }, 4363 } 4364 target := &ret 4365 if err := gensupport.DecodeResponse(target, res); err != nil { 4366 return nil, err 4367 } 4368 return ret, nil 4369 } 4370 4371 // Pages invokes f for each page of results. 4372 // A non-nil error returned from f will halt the iteration. 4373 // The provided context supersedes any context provided to the Context method. 4374 func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Pages(ctx context.Context, f func(*ListCollectionIdsResponse) error) error { 4375 c.ctx_ = ctx 4376 defer func(pt string) { c.listcollectionidsrequest.PageToken = pt }(c.listcollectionidsrequest.PageToken) 4377 for { 4378 x, err := c.Do() 4379 if err != nil { 4380 return err 4381 } 4382 if err := f(x); err != nil { 4383 return err 4384 } 4385 if x.NextPageToken == "" { 4386 return nil 4387 } 4388 c.listcollectionidsrequest.PageToken = x.NextPageToken 4389 } 4390 } 4391 4392 type ProjectsDatabasesDocumentsListDocumentsCall struct { 4393 s *Service 4394 parent string 4395 collectionId string 4396 urlParams_ gensupport.URLParams 4397 ifNoneMatch_ string 4398 ctx_ context.Context 4399 header_ http.Header 4400 } 4401 4402 // ListDocuments: Lists documents. 4403 // 4404 // - collectionId: Optional. The collection ID, relative to `parent`, to list. 4405 // For example: `chatrooms` or `messages`. This is optional, and when not 4406 // provided, Firestore will list documents from all collections under the 4407 // provided `parent`. 4408 // - parent: The parent resource name. In the format: 4409 // `projects/{project_id}/databases/{database_id}/documents` or 4410 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 4411 // For example: `projects/my-project/databases/my-database/documents` or 4412 // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`. 4413 func (r *ProjectsDatabasesDocumentsService) ListDocuments(parent string, collectionId string) *ProjectsDatabasesDocumentsListDocumentsCall { 4414 c := &ProjectsDatabasesDocumentsListDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4415 c.parent = parent 4416 c.collectionId = collectionId 4417 return c 4418 } 4419 4420 // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The list of 4421 // field paths in the mask. See Document.fields for a field path syntax 4422 // reference. 4423 func (c *ProjectsDatabasesDocumentsListDocumentsCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsListDocumentsCall { 4424 c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...)) 4425 return c 4426 } 4427 4428 // OrderBy sets the optional parameter "orderBy": The optional ordering of the 4429 // documents to return. For example: `priority desc, __name__ desc`. This 4430 // mirrors the `ORDER BY` used in Firestore queries but in a string 4431 // representation. When absent, documents are ordered based on `__name__ ASC`. 4432 func (c *ProjectsDatabasesDocumentsListDocumentsCall) OrderBy(orderBy string) *ProjectsDatabasesDocumentsListDocumentsCall { 4433 c.urlParams_.Set("orderBy", orderBy) 4434 return c 4435 } 4436 4437 // PageSize sets the optional parameter "pageSize": The maximum number of 4438 // documents to return in a single response. Firestore may return fewer than 4439 // this value. 4440 func (c *ProjectsDatabasesDocumentsListDocumentsCall) PageSize(pageSize int64) *ProjectsDatabasesDocumentsListDocumentsCall { 4441 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4442 return c 4443 } 4444 4445 // PageToken sets the optional parameter "pageToken": A page token, received 4446 // from a previous `ListDocuments` response. Provide this to retrieve the 4447 // subsequent page. When paginating, all other parameters (with the exception 4448 // of `page_size`) must match the values set in the request that generated the 4449 // page token. 4450 func (c *ProjectsDatabasesDocumentsListDocumentsCall) PageToken(pageToken string) *ProjectsDatabasesDocumentsListDocumentsCall { 4451 c.urlParams_.Set("pageToken", pageToken) 4452 return c 4453 } 4454 4455 // ReadTime sets the optional parameter "readTime": Perform the read at the 4456 // provided time. This must be a microsecond precision timestamp within the 4457 // past one hour, or if Point-in-Time Recovery is enabled, can additionally be 4458 // a whole minute timestamp within the past 7 days. 4459 func (c *ProjectsDatabasesDocumentsListDocumentsCall) ReadTime(readTime string) *ProjectsDatabasesDocumentsListDocumentsCall { 4460 c.urlParams_.Set("readTime", readTime) 4461 return c 4462 } 4463 4464 // ShowMissing sets the optional parameter "showMissing": If the list should 4465 // show missing documents. A document is missing if it does not exist, but 4466 // there are sub-documents nested underneath it. When true, such missing 4467 // documents will be returned with a key but will not have fields, 4468 // `create_time`, or `update_time` set. Requests with `show_missing` may not 4469 // specify `where` or `order_by`. 4470 func (c *ProjectsDatabasesDocumentsListDocumentsCall) ShowMissing(showMissing bool) *ProjectsDatabasesDocumentsListDocumentsCall { 4471 c.urlParams_.Set("showMissing", fmt.Sprint(showMissing)) 4472 return c 4473 } 4474 4475 // Transaction sets the optional parameter "transaction": Perform the read as 4476 // part of an already active transaction. 4477 func (c *ProjectsDatabasesDocumentsListDocumentsCall) Transaction(transaction string) *ProjectsDatabasesDocumentsListDocumentsCall { 4478 c.urlParams_.Set("transaction", transaction) 4479 return c 4480 } 4481 4482 // Fields allows partial responses to be retrieved. See 4483 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4484 // details. 4485 func (c *ProjectsDatabasesDocumentsListDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsListDocumentsCall { 4486 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4487 return c 4488 } 4489 4490 // IfNoneMatch sets an optional parameter which makes the operation fail if the 4491 // object's ETag matches the given value. This is useful for getting updates 4492 // only after the object has changed since the last request. 4493 func (c *ProjectsDatabasesDocumentsListDocumentsCall) IfNoneMatch(entityTag string) *ProjectsDatabasesDocumentsListDocumentsCall { 4494 c.ifNoneMatch_ = entityTag 4495 return c 4496 } 4497 4498 // Context sets the context to be used in this call's Do method. 4499 func (c *ProjectsDatabasesDocumentsListDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsListDocumentsCall { 4500 c.ctx_ = ctx 4501 return c 4502 } 4503 4504 // Header returns a http.Header that can be modified by the caller to add 4505 // headers to the request. 4506 func (c *ProjectsDatabasesDocumentsListDocumentsCall) Header() http.Header { 4507 if c.header_ == nil { 4508 c.header_ = make(http.Header) 4509 } 4510 return c.header_ 4511 } 4512 4513 func (c *ProjectsDatabasesDocumentsListDocumentsCall) doRequest(alt string) (*http.Response, error) { 4514 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 4515 if c.ifNoneMatch_ != "" { 4516 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4517 } 4518 var body io.Reader = nil 4519 c.urlParams_.Set("alt", alt) 4520 c.urlParams_.Set("prettyPrint", "false") 4521 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/{collectionId}") 4522 urls += "?" + c.urlParams_.Encode() 4523 req, err := http.NewRequest("GET", urls, body) 4524 if err != nil { 4525 return nil, err 4526 } 4527 req.Header = reqHeaders 4528 googleapi.Expand(req.URL, map[string]string{ 4529 "parent": c.parent, 4530 "collectionId": c.collectionId, 4531 }) 4532 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4533 } 4534 4535 // Do executes the "firestore.projects.databases.documents.listDocuments" call. 4536 // Any non-2xx status code is an error. Response headers are in either 4537 // *ListDocumentsResponse.ServerResponse.Header or (if a response was returned 4538 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4539 // check whether the returned error was because http.StatusNotModified was 4540 // returned. 4541 func (c *ProjectsDatabasesDocumentsListDocumentsCall) Do(opts ...googleapi.CallOption) (*ListDocumentsResponse, error) { 4542 gensupport.SetOptions(c.urlParams_, opts...) 4543 res, err := c.doRequest("json") 4544 if res != nil && res.StatusCode == http.StatusNotModified { 4545 if res.Body != nil { 4546 res.Body.Close() 4547 } 4548 return nil, gensupport.WrapError(&googleapi.Error{ 4549 Code: res.StatusCode, 4550 Header: res.Header, 4551 }) 4552 } 4553 if err != nil { 4554 return nil, err 4555 } 4556 defer googleapi.CloseBody(res) 4557 if err := googleapi.CheckResponse(res); err != nil { 4558 return nil, gensupport.WrapError(err) 4559 } 4560 ret := &ListDocumentsResponse{ 4561 ServerResponse: googleapi.ServerResponse{ 4562 Header: res.Header, 4563 HTTPStatusCode: res.StatusCode, 4564 }, 4565 } 4566 target := &ret 4567 if err := gensupport.DecodeResponse(target, res); err != nil { 4568 return nil, err 4569 } 4570 return ret, nil 4571 } 4572 4573 // Pages invokes f for each page of results. 4574 // A non-nil error returned from f will halt the iteration. 4575 // The provided context supersedes any context provided to the Context method. 4576 func (c *ProjectsDatabasesDocumentsListDocumentsCall) Pages(ctx context.Context, f func(*ListDocumentsResponse) error) error { 4577 c.ctx_ = ctx 4578 defer c.PageToken(c.urlParams_.Get("pageToken")) 4579 for { 4580 x, err := c.Do() 4581 if err != nil { 4582 return err 4583 } 4584 if err := f(x); err != nil { 4585 return err 4586 } 4587 if x.NextPageToken == "" { 4588 return nil 4589 } 4590 c.PageToken(x.NextPageToken) 4591 } 4592 } 4593 4594 type ProjectsDatabasesDocumentsListenCall struct { 4595 s *Service 4596 database string 4597 listenrequest *ListenRequest 4598 urlParams_ gensupport.URLParams 4599 ctx_ context.Context 4600 header_ http.Header 4601 } 4602 4603 // Listen: Listens to changes. This method is only available via gRPC or 4604 // WebChannel (not REST). 4605 // 4606 // - database: The database name. In the format: 4607 // `projects/{project_id}/databases/{database_id}`. 4608 func (r *ProjectsDatabasesDocumentsService) Listen(database string, listenrequest *ListenRequest) *ProjectsDatabasesDocumentsListenCall { 4609 c := &ProjectsDatabasesDocumentsListenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4610 c.database = database 4611 c.listenrequest = listenrequest 4612 return c 4613 } 4614 4615 // Fields allows partial responses to be retrieved. See 4616 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4617 // details. 4618 func (c *ProjectsDatabasesDocumentsListenCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsListenCall { 4619 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4620 return c 4621 } 4622 4623 // Context sets the context to be used in this call's Do method. 4624 func (c *ProjectsDatabasesDocumentsListenCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsListenCall { 4625 c.ctx_ = ctx 4626 return c 4627 } 4628 4629 // Header returns a http.Header that can be modified by the caller to add 4630 // headers to the request. 4631 func (c *ProjectsDatabasesDocumentsListenCall) Header() http.Header { 4632 if c.header_ == nil { 4633 c.header_ = make(http.Header) 4634 } 4635 return c.header_ 4636 } 4637 4638 func (c *ProjectsDatabasesDocumentsListenCall) doRequest(alt string) (*http.Response, error) { 4639 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4640 var body io.Reader = nil 4641 body, err := googleapi.WithoutDataWrapper.JSONReader(c.listenrequest) 4642 if err != nil { 4643 return nil, err 4644 } 4645 c.urlParams_.Set("alt", alt) 4646 c.urlParams_.Set("prettyPrint", "false") 4647 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+database}/documents:listen") 4648 urls += "?" + c.urlParams_.Encode() 4649 req, err := http.NewRequest("POST", urls, body) 4650 if err != nil { 4651 return nil, err 4652 } 4653 req.Header = reqHeaders 4654 googleapi.Expand(req.URL, map[string]string{ 4655 "database": c.database, 4656 }) 4657 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4658 } 4659 4660 // Do executes the "firestore.projects.databases.documents.listen" call. 4661 // Any non-2xx status code is an error. Response headers are in either 4662 // *ListenResponse.ServerResponse.Header or (if a response was returned at all) 4663 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4664 // whether the returned error was because http.StatusNotModified was returned. 4665 func (c *ProjectsDatabasesDocumentsListenCall) Do(opts ...googleapi.CallOption) (*ListenResponse, error) { 4666 gensupport.SetOptions(c.urlParams_, opts...) 4667 res, err := c.doRequest("json") 4668 if res != nil && res.StatusCode == http.StatusNotModified { 4669 if res.Body != nil { 4670 res.Body.Close() 4671 } 4672 return nil, gensupport.WrapError(&googleapi.Error{ 4673 Code: res.StatusCode, 4674 Header: res.Header, 4675 }) 4676 } 4677 if err != nil { 4678 return nil, err 4679 } 4680 defer googleapi.CloseBody(res) 4681 if err := googleapi.CheckResponse(res); err != nil { 4682 return nil, gensupport.WrapError(err) 4683 } 4684 ret := &ListenResponse{ 4685 ServerResponse: googleapi.ServerResponse{ 4686 Header: res.Header, 4687 HTTPStatusCode: res.StatusCode, 4688 }, 4689 } 4690 target := &ret 4691 if err := gensupport.DecodeResponse(target, res); err != nil { 4692 return nil, err 4693 } 4694 return ret, nil 4695 } 4696 4697 type ProjectsDatabasesDocumentsPartitionQueryCall struct { 4698 s *Service 4699 parent string 4700 partitionqueryrequest *PartitionQueryRequest 4701 urlParams_ gensupport.URLParams 4702 ctx_ context.Context 4703 header_ http.Header 4704 } 4705 4706 // PartitionQuery: Partitions a query by returning partition cursors that can 4707 // be used to run the query in parallel. The returned partition cursors are 4708 // split points that can be used by RunQuery as starting/end points for the 4709 // query results. 4710 // 4711 // - parent: The parent resource name. In the format: 4712 // `projects/{project_id}/databases/{database_id}/documents`. Document 4713 // resource names are not supported; only database resource names can be 4714 // specified. 4715 func (r *ProjectsDatabasesDocumentsService) PartitionQuery(parent string, partitionqueryrequest *PartitionQueryRequest) *ProjectsDatabasesDocumentsPartitionQueryCall { 4716 c := &ProjectsDatabasesDocumentsPartitionQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4717 c.parent = parent 4718 c.partitionqueryrequest = partitionqueryrequest 4719 return c 4720 } 4721 4722 // Fields allows partial responses to be retrieved. See 4723 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4724 // details. 4725 func (c *ProjectsDatabasesDocumentsPartitionQueryCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsPartitionQueryCall { 4726 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4727 return c 4728 } 4729 4730 // Context sets the context to be used in this call's Do method. 4731 func (c *ProjectsDatabasesDocumentsPartitionQueryCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsPartitionQueryCall { 4732 c.ctx_ = ctx 4733 return c 4734 } 4735 4736 // Header returns a http.Header that can be modified by the caller to add 4737 // headers to the request. 4738 func (c *ProjectsDatabasesDocumentsPartitionQueryCall) Header() http.Header { 4739 if c.header_ == nil { 4740 c.header_ = make(http.Header) 4741 } 4742 return c.header_ 4743 } 4744 4745 func (c *ProjectsDatabasesDocumentsPartitionQueryCall) doRequest(alt string) (*http.Response, error) { 4746 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4747 var body io.Reader = nil 4748 body, err := googleapi.WithoutDataWrapper.JSONReader(c.partitionqueryrequest) 4749 if err != nil { 4750 return nil, err 4751 } 4752 c.urlParams_.Set("alt", alt) 4753 c.urlParams_.Set("prettyPrint", "false") 4754 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:partitionQuery") 4755 urls += "?" + c.urlParams_.Encode() 4756 req, err := http.NewRequest("POST", urls, body) 4757 if err != nil { 4758 return nil, err 4759 } 4760 req.Header = reqHeaders 4761 googleapi.Expand(req.URL, map[string]string{ 4762 "parent": c.parent, 4763 }) 4764 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4765 } 4766 4767 // Do executes the "firestore.projects.databases.documents.partitionQuery" call. 4768 // Any non-2xx status code is an error. Response headers are in either 4769 // *PartitionQueryResponse.ServerResponse.Header or (if a response was returned 4770 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4771 // check whether the returned error was because http.StatusNotModified was 4772 // returned. 4773 func (c *ProjectsDatabasesDocumentsPartitionQueryCall) Do(opts ...googleapi.CallOption) (*PartitionQueryResponse, error) { 4774 gensupport.SetOptions(c.urlParams_, opts...) 4775 res, err := c.doRequest("json") 4776 if res != nil && res.StatusCode == http.StatusNotModified { 4777 if res.Body != nil { 4778 res.Body.Close() 4779 } 4780 return nil, gensupport.WrapError(&googleapi.Error{ 4781 Code: res.StatusCode, 4782 Header: res.Header, 4783 }) 4784 } 4785 if err != nil { 4786 return nil, err 4787 } 4788 defer googleapi.CloseBody(res) 4789 if err := googleapi.CheckResponse(res); err != nil { 4790 return nil, gensupport.WrapError(err) 4791 } 4792 ret := &PartitionQueryResponse{ 4793 ServerResponse: googleapi.ServerResponse{ 4794 Header: res.Header, 4795 HTTPStatusCode: res.StatusCode, 4796 }, 4797 } 4798 target := &ret 4799 if err := gensupport.DecodeResponse(target, res); err != nil { 4800 return nil, err 4801 } 4802 return ret, nil 4803 } 4804 4805 // Pages invokes f for each page of results. 4806 // A non-nil error returned from f will halt the iteration. 4807 // The provided context supersedes any context provided to the Context method. 4808 func (c *ProjectsDatabasesDocumentsPartitionQueryCall) Pages(ctx context.Context, f func(*PartitionQueryResponse) error) error { 4809 c.ctx_ = ctx 4810 defer func(pt string) { c.partitionqueryrequest.PageToken = pt }(c.partitionqueryrequest.PageToken) 4811 for { 4812 x, err := c.Do() 4813 if err != nil { 4814 return err 4815 } 4816 if err := f(x); err != nil { 4817 return err 4818 } 4819 if x.NextPageToken == "" { 4820 return nil 4821 } 4822 c.partitionqueryrequest.PageToken = x.NextPageToken 4823 } 4824 } 4825 4826 type ProjectsDatabasesDocumentsPatchCall struct { 4827 s *Service 4828 name string 4829 document *Document 4830 urlParams_ gensupport.URLParams 4831 ctx_ context.Context 4832 header_ http.Header 4833 } 4834 4835 // Patch: Updates or inserts a document. 4836 // 4837 // - name: The resource name of the document, for example 4838 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 4839 func (r *ProjectsDatabasesDocumentsService) Patch(name string, document *Document) *ProjectsDatabasesDocumentsPatchCall { 4840 c := &ProjectsDatabasesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4841 c.name = name 4842 c.document = document 4843 return c 4844 } 4845 4846 // CurrentDocumentExists sets the optional parameter "currentDocument.exists": 4847 // When set to `true`, the target document must exist. When set to `false`, the 4848 // target document must not exist. 4849 func (c *ProjectsDatabasesDocumentsPatchCall) CurrentDocumentExists(currentDocumentExists bool) *ProjectsDatabasesDocumentsPatchCall { 4850 c.urlParams_.Set("currentDocument.exists", fmt.Sprint(currentDocumentExists)) 4851 return c 4852 } 4853 4854 // CurrentDocumentUpdateTime sets the optional parameter 4855 // "currentDocument.updateTime": When set, the target document must exist and 4856 // have been last updated at that time. Timestamp must be microsecond aligned. 4857 func (c *ProjectsDatabasesDocumentsPatchCall) CurrentDocumentUpdateTime(currentDocumentUpdateTime string) *ProjectsDatabasesDocumentsPatchCall { 4858 c.urlParams_.Set("currentDocument.updateTime", currentDocumentUpdateTime) 4859 return c 4860 } 4861 4862 // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The list of 4863 // field paths in the mask. See Document.fields for a field path syntax 4864 // reference. 4865 func (c *ProjectsDatabasesDocumentsPatchCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsPatchCall { 4866 c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...)) 4867 return c 4868 } 4869 4870 // UpdateMaskFieldPaths sets the optional parameter "updateMask.fieldPaths": 4871 // The list of field paths in the mask. See Document.fields for a field path 4872 // syntax reference. 4873 func (c *ProjectsDatabasesDocumentsPatchCall) UpdateMaskFieldPaths(updateMaskFieldPaths ...string) *ProjectsDatabasesDocumentsPatchCall { 4874 c.urlParams_.SetMulti("updateMask.fieldPaths", append([]string{}, updateMaskFieldPaths...)) 4875 return c 4876 } 4877 4878 // Fields allows partial responses to be retrieved. See 4879 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4880 // details. 4881 func (c *ProjectsDatabasesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsPatchCall { 4882 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4883 return c 4884 } 4885 4886 // Context sets the context to be used in this call's Do method. 4887 func (c *ProjectsDatabasesDocumentsPatchCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsPatchCall { 4888 c.ctx_ = ctx 4889 return c 4890 } 4891 4892 // Header returns a http.Header that can be modified by the caller to add 4893 // headers to the request. 4894 func (c *ProjectsDatabasesDocumentsPatchCall) Header() http.Header { 4895 if c.header_ == nil { 4896 c.header_ = make(http.Header) 4897 } 4898 return c.header_ 4899 } 4900 4901 func (c *ProjectsDatabasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) { 4902 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 4903 var body io.Reader = nil 4904 body, err := googleapi.WithoutDataWrapper.JSONReader(c.document) 4905 if err != nil { 4906 return nil, err 4907 } 4908 c.urlParams_.Set("alt", alt) 4909 c.urlParams_.Set("prettyPrint", "false") 4910 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 4911 urls += "?" + c.urlParams_.Encode() 4912 req, err := http.NewRequest("PATCH", urls, body) 4913 if err != nil { 4914 return nil, err 4915 } 4916 req.Header = reqHeaders 4917 googleapi.Expand(req.URL, map[string]string{ 4918 "name": c.name, 4919 }) 4920 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4921 } 4922 4923 // Do executes the "firestore.projects.databases.documents.patch" call. 4924 // Any non-2xx status code is an error. Response headers are in either 4925 // *Document.ServerResponse.Header or (if a response was returned at all) in 4926 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4927 // whether the returned error was because http.StatusNotModified was returned. 4928 func (c *ProjectsDatabasesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*Document, error) { 4929 gensupport.SetOptions(c.urlParams_, opts...) 4930 res, err := c.doRequest("json") 4931 if res != nil && res.StatusCode == http.StatusNotModified { 4932 if res.Body != nil { 4933 res.Body.Close() 4934 } 4935 return nil, gensupport.WrapError(&googleapi.Error{ 4936 Code: res.StatusCode, 4937 Header: res.Header, 4938 }) 4939 } 4940 if err != nil { 4941 return nil, err 4942 } 4943 defer googleapi.CloseBody(res) 4944 if err := googleapi.CheckResponse(res); err != nil { 4945 return nil, gensupport.WrapError(err) 4946 } 4947 ret := &Document{ 4948 ServerResponse: googleapi.ServerResponse{ 4949 Header: res.Header, 4950 HTTPStatusCode: res.StatusCode, 4951 }, 4952 } 4953 target := &ret 4954 if err := gensupport.DecodeResponse(target, res); err != nil { 4955 return nil, err 4956 } 4957 return ret, nil 4958 } 4959 4960 type ProjectsDatabasesDocumentsRollbackCall struct { 4961 s *Service 4962 database string 4963 rollbackrequest *RollbackRequest 4964 urlParams_ gensupport.URLParams 4965 ctx_ context.Context 4966 header_ http.Header 4967 } 4968 4969 // Rollback: Rolls back a transaction. 4970 // 4971 // - database: The database name. In the format: 4972 // `projects/{project_id}/databases/{database_id}`. 4973 func (r *ProjectsDatabasesDocumentsService) Rollback(database string, rollbackrequest *RollbackRequest) *ProjectsDatabasesDocumentsRollbackCall { 4974 c := &ProjectsDatabasesDocumentsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4975 c.database = database 4976 c.rollbackrequest = rollbackrequest 4977 return c 4978 } 4979 4980 // Fields allows partial responses to be retrieved. See 4981 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 4982 // details. 4983 func (c *ProjectsDatabasesDocumentsRollbackCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsRollbackCall { 4984 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4985 return c 4986 } 4987 4988 // Context sets the context to be used in this call's Do method. 4989 func (c *ProjectsDatabasesDocumentsRollbackCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsRollbackCall { 4990 c.ctx_ = ctx 4991 return c 4992 } 4993 4994 // Header returns a http.Header that can be modified by the caller to add 4995 // headers to the request. 4996 func (c *ProjectsDatabasesDocumentsRollbackCall) Header() http.Header { 4997 if c.header_ == nil { 4998 c.header_ = make(http.Header) 4999 } 5000 return c.header_ 5001 } 5002 5003 func (c *ProjectsDatabasesDocumentsRollbackCall) doRequest(alt string) (*http.Response, error) { 5004 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5005 var body io.Reader = nil 5006 body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest) 5007 if err != nil { 5008 return nil, err 5009 } 5010 c.urlParams_.Set("alt", alt) 5011 c.urlParams_.Set("prettyPrint", "false") 5012 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+database}/documents:rollback") 5013 urls += "?" + c.urlParams_.Encode() 5014 req, err := http.NewRequest("POST", urls, body) 5015 if err != nil { 5016 return nil, err 5017 } 5018 req.Header = reqHeaders 5019 googleapi.Expand(req.URL, map[string]string{ 5020 "database": c.database, 5021 }) 5022 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5023 } 5024 5025 // Do executes the "firestore.projects.databases.documents.rollback" call. 5026 // Any non-2xx status code is an error. Response headers are in either 5027 // *Empty.ServerResponse.Header or (if a response was returned at all) in 5028 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5029 // whether the returned error was because http.StatusNotModified was returned. 5030 func (c *ProjectsDatabasesDocumentsRollbackCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5031 gensupport.SetOptions(c.urlParams_, opts...) 5032 res, err := c.doRequest("json") 5033 if res != nil && res.StatusCode == http.StatusNotModified { 5034 if res.Body != nil { 5035 res.Body.Close() 5036 } 5037 return nil, gensupport.WrapError(&googleapi.Error{ 5038 Code: res.StatusCode, 5039 Header: res.Header, 5040 }) 5041 } 5042 if err != nil { 5043 return nil, err 5044 } 5045 defer googleapi.CloseBody(res) 5046 if err := googleapi.CheckResponse(res); err != nil { 5047 return nil, gensupport.WrapError(err) 5048 } 5049 ret := &Empty{ 5050 ServerResponse: googleapi.ServerResponse{ 5051 Header: res.Header, 5052 HTTPStatusCode: res.StatusCode, 5053 }, 5054 } 5055 target := &ret 5056 if err := gensupport.DecodeResponse(target, res); err != nil { 5057 return nil, err 5058 } 5059 return ret, nil 5060 } 5061 5062 type ProjectsDatabasesDocumentsRunAggregationQueryCall struct { 5063 s *Service 5064 parent string 5065 runaggregationqueryrequest *RunAggregationQueryRequest 5066 urlParams_ gensupport.URLParams 5067 ctx_ context.Context 5068 header_ http.Header 5069 } 5070 5071 // RunAggregationQuery: Runs an aggregation query. Rather than producing 5072 // Document results like Firestore.RunQuery, this API allows running an 5073 // aggregation to produce a series of AggregationResult server-side. High-Level 5074 // Example: ``` -- Return the number of documents in table given a filter. 5075 // SELECT COUNT(*) FROM ( SELECT * FROM k where a = true ); ``` 5076 // 5077 // - parent: The parent resource name. In the format: 5078 // `projects/{project_id}/databases/{database_id}/documents` or 5079 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 5080 // For example: `projects/my-project/databases/my-database/documents` or 5081 // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`. 5082 func (r *ProjectsDatabasesDocumentsService) RunAggregationQuery(parent string, runaggregationqueryrequest *RunAggregationQueryRequest) *ProjectsDatabasesDocumentsRunAggregationQueryCall { 5083 c := &ProjectsDatabasesDocumentsRunAggregationQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5084 c.parent = parent 5085 c.runaggregationqueryrequest = runaggregationqueryrequest 5086 return c 5087 } 5088 5089 // Fields allows partial responses to be retrieved. See 5090 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5091 // details. 5092 func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsRunAggregationQueryCall { 5093 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5094 return c 5095 } 5096 5097 // Context sets the context to be used in this call's Do method. 5098 func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsRunAggregationQueryCall { 5099 c.ctx_ = ctx 5100 return c 5101 } 5102 5103 // Header returns a http.Header that can be modified by the caller to add 5104 // headers to the request. 5105 func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) Header() http.Header { 5106 if c.header_ == nil { 5107 c.header_ = make(http.Header) 5108 } 5109 return c.header_ 5110 } 5111 5112 func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) doRequest(alt string) (*http.Response, error) { 5113 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5114 var body io.Reader = nil 5115 body, err := googleapi.WithoutDataWrapper.JSONReader(c.runaggregationqueryrequest) 5116 if err != nil { 5117 return nil, err 5118 } 5119 c.urlParams_.Set("alt", alt) 5120 c.urlParams_.Set("prettyPrint", "false") 5121 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:runAggregationQuery") 5122 urls += "?" + c.urlParams_.Encode() 5123 req, err := http.NewRequest("POST", urls, body) 5124 if err != nil { 5125 return nil, err 5126 } 5127 req.Header = reqHeaders 5128 googleapi.Expand(req.URL, map[string]string{ 5129 "parent": c.parent, 5130 }) 5131 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5132 } 5133 5134 // Do executes the "firestore.projects.databases.documents.runAggregationQuery" call. 5135 // Any non-2xx status code is an error. Response headers are in either 5136 // *RunAggregationQueryResponse.ServerResponse.Header or (if a response was 5137 // returned at all) in error.(*googleapi.Error).Header. Use 5138 // googleapi.IsNotModified to check whether the returned error was because 5139 // http.StatusNotModified was returned. 5140 func (c *ProjectsDatabasesDocumentsRunAggregationQueryCall) Do(opts ...googleapi.CallOption) (*RunAggregationQueryResponse, error) { 5141 gensupport.SetOptions(c.urlParams_, opts...) 5142 res, err := c.doRequest("json") 5143 if res != nil && res.StatusCode == http.StatusNotModified { 5144 if res.Body != nil { 5145 res.Body.Close() 5146 } 5147 return nil, gensupport.WrapError(&googleapi.Error{ 5148 Code: res.StatusCode, 5149 Header: res.Header, 5150 }) 5151 } 5152 if err != nil { 5153 return nil, err 5154 } 5155 defer googleapi.CloseBody(res) 5156 if err := googleapi.CheckResponse(res); err != nil { 5157 return nil, gensupport.WrapError(err) 5158 } 5159 ret := &RunAggregationQueryResponse{ 5160 ServerResponse: googleapi.ServerResponse{ 5161 Header: res.Header, 5162 HTTPStatusCode: res.StatusCode, 5163 }, 5164 } 5165 target := &ret 5166 if err := gensupport.DecodeResponse(target, res); err != nil { 5167 return nil, err 5168 } 5169 return ret, nil 5170 } 5171 5172 type ProjectsDatabasesDocumentsRunQueryCall struct { 5173 s *Service 5174 parent string 5175 runqueryrequest *RunQueryRequest 5176 urlParams_ gensupport.URLParams 5177 ctx_ context.Context 5178 header_ http.Header 5179 } 5180 5181 // RunQuery: Runs a query. 5182 // 5183 // - parent: The parent resource name. In the format: 5184 // `projects/{project_id}/databases/{database_id}/documents` or 5185 // `projects/{project_id}/databases/{database_id}/documents/{document_path}`. 5186 // For example: `projects/my-project/databases/my-database/documents` or 5187 // `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`. 5188 func (r *ProjectsDatabasesDocumentsService) RunQuery(parent string, runqueryrequest *RunQueryRequest) *ProjectsDatabasesDocumentsRunQueryCall { 5189 c := &ProjectsDatabasesDocumentsRunQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5190 c.parent = parent 5191 c.runqueryrequest = runqueryrequest 5192 return c 5193 } 5194 5195 // Fields allows partial responses to be retrieved. See 5196 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5197 // details. 5198 func (c *ProjectsDatabasesDocumentsRunQueryCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsRunQueryCall { 5199 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5200 return c 5201 } 5202 5203 // Context sets the context to be used in this call's Do method. 5204 func (c *ProjectsDatabasesDocumentsRunQueryCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsRunQueryCall { 5205 c.ctx_ = ctx 5206 return c 5207 } 5208 5209 // Header returns a http.Header that can be modified by the caller to add 5210 // headers to the request. 5211 func (c *ProjectsDatabasesDocumentsRunQueryCall) Header() http.Header { 5212 if c.header_ == nil { 5213 c.header_ = make(http.Header) 5214 } 5215 return c.header_ 5216 } 5217 5218 func (c *ProjectsDatabasesDocumentsRunQueryCall) doRequest(alt string) (*http.Response, error) { 5219 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5220 var body io.Reader = nil 5221 body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest) 5222 if err != nil { 5223 return nil, err 5224 } 5225 c.urlParams_.Set("alt", alt) 5226 c.urlParams_.Set("prettyPrint", "false") 5227 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}:runQuery") 5228 urls += "?" + c.urlParams_.Encode() 5229 req, err := http.NewRequest("POST", urls, body) 5230 if err != nil { 5231 return nil, err 5232 } 5233 req.Header = reqHeaders 5234 googleapi.Expand(req.URL, map[string]string{ 5235 "parent": c.parent, 5236 }) 5237 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5238 } 5239 5240 // Do executes the "firestore.projects.databases.documents.runQuery" call. 5241 // Any non-2xx status code is an error. Response headers are in either 5242 // *RunQueryResponse.ServerResponse.Header or (if a response was returned at 5243 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5244 // check whether the returned error was because http.StatusNotModified was 5245 // returned. 5246 func (c *ProjectsDatabasesDocumentsRunQueryCall) Do(opts ...googleapi.CallOption) (*RunQueryResponse, error) { 5247 gensupport.SetOptions(c.urlParams_, opts...) 5248 res, err := c.doRequest("json") 5249 if res != nil && res.StatusCode == http.StatusNotModified { 5250 if res.Body != nil { 5251 res.Body.Close() 5252 } 5253 return nil, gensupport.WrapError(&googleapi.Error{ 5254 Code: res.StatusCode, 5255 Header: res.Header, 5256 }) 5257 } 5258 if err != nil { 5259 return nil, err 5260 } 5261 defer googleapi.CloseBody(res) 5262 if err := googleapi.CheckResponse(res); err != nil { 5263 return nil, gensupport.WrapError(err) 5264 } 5265 ret := &RunQueryResponse{ 5266 ServerResponse: googleapi.ServerResponse{ 5267 Header: res.Header, 5268 HTTPStatusCode: res.StatusCode, 5269 }, 5270 } 5271 target := &ret 5272 if err := gensupport.DecodeResponse(target, res); err != nil { 5273 return nil, err 5274 } 5275 return ret, nil 5276 } 5277 5278 type ProjectsDatabasesDocumentsWriteCall struct { 5279 s *Service 5280 database string 5281 writerequest *WriteRequest 5282 urlParams_ gensupport.URLParams 5283 ctx_ context.Context 5284 header_ http.Header 5285 } 5286 5287 // Write: Streams batches of document updates and deletes, in order. This 5288 // method is only available via gRPC or WebChannel (not REST). 5289 // 5290 // - database: The database name. In the format: 5291 // `projects/{project_id}/databases/{database_id}`. This is only required in 5292 // the first message. 5293 func (r *ProjectsDatabasesDocumentsService) Write(database string, writerequest *WriteRequest) *ProjectsDatabasesDocumentsWriteCall { 5294 c := &ProjectsDatabasesDocumentsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5295 c.database = database 5296 c.writerequest = writerequest 5297 return c 5298 } 5299 5300 // Fields allows partial responses to be retrieved. See 5301 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5302 // details. 5303 func (c *ProjectsDatabasesDocumentsWriteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsWriteCall { 5304 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5305 return c 5306 } 5307 5308 // Context sets the context to be used in this call's Do method. 5309 func (c *ProjectsDatabasesDocumentsWriteCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsWriteCall { 5310 c.ctx_ = ctx 5311 return c 5312 } 5313 5314 // Header returns a http.Header that can be modified by the caller to add 5315 // headers to the request. 5316 func (c *ProjectsDatabasesDocumentsWriteCall) Header() http.Header { 5317 if c.header_ == nil { 5318 c.header_ = make(http.Header) 5319 } 5320 return c.header_ 5321 } 5322 5323 func (c *ProjectsDatabasesDocumentsWriteCall) doRequest(alt string) (*http.Response, error) { 5324 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5325 var body io.Reader = nil 5326 body, err := googleapi.WithoutDataWrapper.JSONReader(c.writerequest) 5327 if err != nil { 5328 return nil, err 5329 } 5330 c.urlParams_.Set("alt", alt) 5331 c.urlParams_.Set("prettyPrint", "false") 5332 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+database}/documents:write") 5333 urls += "?" + c.urlParams_.Encode() 5334 req, err := http.NewRequest("POST", urls, body) 5335 if err != nil { 5336 return nil, err 5337 } 5338 req.Header = reqHeaders 5339 googleapi.Expand(req.URL, map[string]string{ 5340 "database": c.database, 5341 }) 5342 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5343 } 5344 5345 // Do executes the "firestore.projects.databases.documents.write" call. 5346 // Any non-2xx status code is an error. Response headers are in either 5347 // *WriteResponse.ServerResponse.Header or (if a response was returned at all) 5348 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5349 // whether the returned error was because http.StatusNotModified was returned. 5350 func (c *ProjectsDatabasesDocumentsWriteCall) Do(opts ...googleapi.CallOption) (*WriteResponse, error) { 5351 gensupport.SetOptions(c.urlParams_, opts...) 5352 res, err := c.doRequest("json") 5353 if res != nil && res.StatusCode == http.StatusNotModified { 5354 if res.Body != nil { 5355 res.Body.Close() 5356 } 5357 return nil, gensupport.WrapError(&googleapi.Error{ 5358 Code: res.StatusCode, 5359 Header: res.Header, 5360 }) 5361 } 5362 if err != nil { 5363 return nil, err 5364 } 5365 defer googleapi.CloseBody(res) 5366 if err := googleapi.CheckResponse(res); err != nil { 5367 return nil, gensupport.WrapError(err) 5368 } 5369 ret := &WriteResponse{ 5370 ServerResponse: googleapi.ServerResponse{ 5371 Header: res.Header, 5372 HTTPStatusCode: res.StatusCode, 5373 }, 5374 } 5375 target := &ret 5376 if err := gensupport.DecodeResponse(target, res); err != nil { 5377 return nil, err 5378 } 5379 return ret, nil 5380 } 5381 5382 type ProjectsDatabasesIndexesCreateCall struct { 5383 s *Service 5384 parent string 5385 googlefirestoreadminv1beta1index *GoogleFirestoreAdminV1beta1Index 5386 urlParams_ gensupport.URLParams 5387 ctx_ context.Context 5388 header_ http.Header 5389 } 5390 5391 // Create: Creates the specified index. A newly created index's initial state 5392 // is `CREATING`. On completion of the returned google.longrunning.Operation, 5393 // the state will be `READY`. If the index already exists, the call will return 5394 // an `ALREADY_EXISTS` status. During creation, the process could result in an 5395 // error, in which case the index will move to the `ERROR` state. The process 5396 // can be recovered by fixing the data that caused the error, removing the 5397 // index with delete, then re-creating the index with create. Indexes with a 5398 // single field cannot be created. 5399 // 5400 // - parent: The name of the database this index will apply to. For example: 5401 // `projects/{project_id}/databases/{database_id}`. 5402 func (r *ProjectsDatabasesIndexesService) Create(parent string, googlefirestoreadminv1beta1index *GoogleFirestoreAdminV1beta1Index) *ProjectsDatabasesIndexesCreateCall { 5403 c := &ProjectsDatabasesIndexesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5404 c.parent = parent 5405 c.googlefirestoreadminv1beta1index = googlefirestoreadminv1beta1index 5406 return c 5407 } 5408 5409 // Fields allows partial responses to be retrieved. See 5410 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5411 // details. 5412 func (c *ProjectsDatabasesIndexesCreateCall) Fields(s ...googleapi.Field) *ProjectsDatabasesIndexesCreateCall { 5413 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5414 return c 5415 } 5416 5417 // Context sets the context to be used in this call's Do method. 5418 func (c *ProjectsDatabasesIndexesCreateCall) Context(ctx context.Context) *ProjectsDatabasesIndexesCreateCall { 5419 c.ctx_ = ctx 5420 return c 5421 } 5422 5423 // Header returns a http.Header that can be modified by the caller to add 5424 // headers to the request. 5425 func (c *ProjectsDatabasesIndexesCreateCall) Header() http.Header { 5426 if c.header_ == nil { 5427 c.header_ = make(http.Header) 5428 } 5429 return c.header_ 5430 } 5431 5432 func (c *ProjectsDatabasesIndexesCreateCall) doRequest(alt string) (*http.Response, error) { 5433 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 5434 var body io.Reader = nil 5435 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta1index) 5436 if err != nil { 5437 return nil, err 5438 } 5439 c.urlParams_.Set("alt", alt) 5440 c.urlParams_.Set("prettyPrint", "false") 5441 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/indexes") 5442 urls += "?" + c.urlParams_.Encode() 5443 req, err := http.NewRequest("POST", urls, body) 5444 if err != nil { 5445 return nil, err 5446 } 5447 req.Header = reqHeaders 5448 googleapi.Expand(req.URL, map[string]string{ 5449 "parent": c.parent, 5450 }) 5451 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5452 } 5453 5454 // Do executes the "firestore.projects.databases.indexes.create" call. 5455 // Any non-2xx status code is an error. Response headers are in either 5456 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 5457 // returned at all) in error.(*googleapi.Error).Header. Use 5458 // googleapi.IsNotModified to check whether the returned error was because 5459 // http.StatusNotModified was returned. 5460 func (c *ProjectsDatabasesIndexesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 5461 gensupport.SetOptions(c.urlParams_, opts...) 5462 res, err := c.doRequest("json") 5463 if res != nil && res.StatusCode == http.StatusNotModified { 5464 if res.Body != nil { 5465 res.Body.Close() 5466 } 5467 return nil, gensupport.WrapError(&googleapi.Error{ 5468 Code: res.StatusCode, 5469 Header: res.Header, 5470 }) 5471 } 5472 if err != nil { 5473 return nil, err 5474 } 5475 defer googleapi.CloseBody(res) 5476 if err := googleapi.CheckResponse(res); err != nil { 5477 return nil, gensupport.WrapError(err) 5478 } 5479 ret := &GoogleLongrunningOperation{ 5480 ServerResponse: googleapi.ServerResponse{ 5481 Header: res.Header, 5482 HTTPStatusCode: res.StatusCode, 5483 }, 5484 } 5485 target := &ret 5486 if err := gensupport.DecodeResponse(target, res); err != nil { 5487 return nil, err 5488 } 5489 return ret, nil 5490 } 5491 5492 type ProjectsDatabasesIndexesDeleteCall struct { 5493 s *Service 5494 name string 5495 urlParams_ gensupport.URLParams 5496 ctx_ context.Context 5497 header_ http.Header 5498 } 5499 5500 // Delete: Deletes an index. 5501 // 5502 // - name: The index name. For example: 5503 // `projects/{project_id}/databases/{database_id}/indexes/{index_id}`. 5504 func (r *ProjectsDatabasesIndexesService) Delete(name string) *ProjectsDatabasesIndexesDeleteCall { 5505 c := &ProjectsDatabasesIndexesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5506 c.name = name 5507 return c 5508 } 5509 5510 // Fields allows partial responses to be retrieved. See 5511 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5512 // details. 5513 func (c *ProjectsDatabasesIndexesDeleteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesIndexesDeleteCall { 5514 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5515 return c 5516 } 5517 5518 // Context sets the context to be used in this call's Do method. 5519 func (c *ProjectsDatabasesIndexesDeleteCall) Context(ctx context.Context) *ProjectsDatabasesIndexesDeleteCall { 5520 c.ctx_ = ctx 5521 return c 5522 } 5523 5524 // Header returns a http.Header that can be modified by the caller to add 5525 // headers to the request. 5526 func (c *ProjectsDatabasesIndexesDeleteCall) Header() http.Header { 5527 if c.header_ == nil { 5528 c.header_ = make(http.Header) 5529 } 5530 return c.header_ 5531 } 5532 5533 func (c *ProjectsDatabasesIndexesDeleteCall) doRequest(alt string) (*http.Response, error) { 5534 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5535 var body io.Reader = nil 5536 c.urlParams_.Set("alt", alt) 5537 c.urlParams_.Set("prettyPrint", "false") 5538 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5539 urls += "?" + c.urlParams_.Encode() 5540 req, err := http.NewRequest("DELETE", urls, body) 5541 if err != nil { 5542 return nil, err 5543 } 5544 req.Header = reqHeaders 5545 googleapi.Expand(req.URL, map[string]string{ 5546 "name": c.name, 5547 }) 5548 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5549 } 5550 5551 // Do executes the "firestore.projects.databases.indexes.delete" call. 5552 // Any non-2xx status code is an error. Response headers are in either 5553 // *Empty.ServerResponse.Header or (if a response was returned at all) in 5554 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5555 // whether the returned error was because http.StatusNotModified was returned. 5556 func (c *ProjectsDatabasesIndexesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5557 gensupport.SetOptions(c.urlParams_, opts...) 5558 res, err := c.doRequest("json") 5559 if res != nil && res.StatusCode == http.StatusNotModified { 5560 if res.Body != nil { 5561 res.Body.Close() 5562 } 5563 return nil, gensupport.WrapError(&googleapi.Error{ 5564 Code: res.StatusCode, 5565 Header: res.Header, 5566 }) 5567 } 5568 if err != nil { 5569 return nil, err 5570 } 5571 defer googleapi.CloseBody(res) 5572 if err := googleapi.CheckResponse(res); err != nil { 5573 return nil, gensupport.WrapError(err) 5574 } 5575 ret := &Empty{ 5576 ServerResponse: googleapi.ServerResponse{ 5577 Header: res.Header, 5578 HTTPStatusCode: res.StatusCode, 5579 }, 5580 } 5581 target := &ret 5582 if err := gensupport.DecodeResponse(target, res); err != nil { 5583 return nil, err 5584 } 5585 return ret, nil 5586 } 5587 5588 type ProjectsDatabasesIndexesGetCall struct { 5589 s *Service 5590 name string 5591 urlParams_ gensupport.URLParams 5592 ifNoneMatch_ string 5593 ctx_ context.Context 5594 header_ http.Header 5595 } 5596 5597 // Get: Gets an index. 5598 // 5599 // - name: The name of the index. For example: 5600 // `projects/{project_id}/databases/{database_id}/indexes/{index_id}`. 5601 func (r *ProjectsDatabasesIndexesService) Get(name string) *ProjectsDatabasesIndexesGetCall { 5602 c := &ProjectsDatabasesIndexesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5603 c.name = name 5604 return c 5605 } 5606 5607 // Fields allows partial responses to be retrieved. See 5608 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5609 // details. 5610 func (c *ProjectsDatabasesIndexesGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesIndexesGetCall { 5611 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5612 return c 5613 } 5614 5615 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5616 // object's ETag matches the given value. This is useful for getting updates 5617 // only after the object has changed since the last request. 5618 func (c *ProjectsDatabasesIndexesGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesIndexesGetCall { 5619 c.ifNoneMatch_ = entityTag 5620 return c 5621 } 5622 5623 // Context sets the context to be used in this call's Do method. 5624 func (c *ProjectsDatabasesIndexesGetCall) Context(ctx context.Context) *ProjectsDatabasesIndexesGetCall { 5625 c.ctx_ = ctx 5626 return c 5627 } 5628 5629 // Header returns a http.Header that can be modified by the caller to add 5630 // headers to the request. 5631 func (c *ProjectsDatabasesIndexesGetCall) Header() http.Header { 5632 if c.header_ == nil { 5633 c.header_ = make(http.Header) 5634 } 5635 return c.header_ 5636 } 5637 5638 func (c *ProjectsDatabasesIndexesGetCall) doRequest(alt string) (*http.Response, error) { 5639 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5640 if c.ifNoneMatch_ != "" { 5641 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5642 } 5643 var body io.Reader = nil 5644 c.urlParams_.Set("alt", alt) 5645 c.urlParams_.Set("prettyPrint", "false") 5646 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 5647 urls += "?" + c.urlParams_.Encode() 5648 req, err := http.NewRequest("GET", urls, body) 5649 if err != nil { 5650 return nil, err 5651 } 5652 req.Header = reqHeaders 5653 googleapi.Expand(req.URL, map[string]string{ 5654 "name": c.name, 5655 }) 5656 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5657 } 5658 5659 // Do executes the "firestore.projects.databases.indexes.get" call. 5660 // Any non-2xx status code is an error. Response headers are in either 5661 // *GoogleFirestoreAdminV1beta1Index.ServerResponse.Header or (if a response 5662 // was returned at all) in error.(*googleapi.Error).Header. Use 5663 // googleapi.IsNotModified to check whether the returned error was because 5664 // http.StatusNotModified was returned. 5665 func (c *ProjectsDatabasesIndexesGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta1Index, error) { 5666 gensupport.SetOptions(c.urlParams_, opts...) 5667 res, err := c.doRequest("json") 5668 if res != nil && res.StatusCode == http.StatusNotModified { 5669 if res.Body != nil { 5670 res.Body.Close() 5671 } 5672 return nil, gensupport.WrapError(&googleapi.Error{ 5673 Code: res.StatusCode, 5674 Header: res.Header, 5675 }) 5676 } 5677 if err != nil { 5678 return nil, err 5679 } 5680 defer googleapi.CloseBody(res) 5681 if err := googleapi.CheckResponse(res); err != nil { 5682 return nil, gensupport.WrapError(err) 5683 } 5684 ret := &GoogleFirestoreAdminV1beta1Index{ 5685 ServerResponse: googleapi.ServerResponse{ 5686 Header: res.Header, 5687 HTTPStatusCode: res.StatusCode, 5688 }, 5689 } 5690 target := &ret 5691 if err := gensupport.DecodeResponse(target, res); err != nil { 5692 return nil, err 5693 } 5694 return ret, nil 5695 } 5696 5697 type ProjectsDatabasesIndexesListCall struct { 5698 s *Service 5699 parent string 5700 urlParams_ gensupport.URLParams 5701 ifNoneMatch_ string 5702 ctx_ context.Context 5703 header_ http.Header 5704 } 5705 5706 // List: Lists the indexes that match the specified filters. 5707 // 5708 // - parent: The database name. For example: 5709 // `projects/{project_id}/databases/{database_id}`. 5710 func (r *ProjectsDatabasesIndexesService) List(parent string) *ProjectsDatabasesIndexesListCall { 5711 c := &ProjectsDatabasesIndexesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5712 c.parent = parent 5713 return c 5714 } 5715 5716 // Filter sets the optional parameter "filter": 5717 func (c *ProjectsDatabasesIndexesListCall) Filter(filter string) *ProjectsDatabasesIndexesListCall { 5718 c.urlParams_.Set("filter", filter) 5719 return c 5720 } 5721 5722 // PageSize sets the optional parameter "pageSize": The standard List page 5723 // size. 5724 func (c *ProjectsDatabasesIndexesListCall) PageSize(pageSize int64) *ProjectsDatabasesIndexesListCall { 5725 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5726 return c 5727 } 5728 5729 // PageToken sets the optional parameter "pageToken": The standard List page 5730 // token. 5731 func (c *ProjectsDatabasesIndexesListCall) PageToken(pageToken string) *ProjectsDatabasesIndexesListCall { 5732 c.urlParams_.Set("pageToken", pageToken) 5733 return c 5734 } 5735 5736 // Fields allows partial responses to be retrieved. See 5737 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 5738 // details. 5739 func (c *ProjectsDatabasesIndexesListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesIndexesListCall { 5740 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5741 return c 5742 } 5743 5744 // IfNoneMatch sets an optional parameter which makes the operation fail if the 5745 // object's ETag matches the given value. This is useful for getting updates 5746 // only after the object has changed since the last request. 5747 func (c *ProjectsDatabasesIndexesListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesIndexesListCall { 5748 c.ifNoneMatch_ = entityTag 5749 return c 5750 } 5751 5752 // Context sets the context to be used in this call's Do method. 5753 func (c *ProjectsDatabasesIndexesListCall) Context(ctx context.Context) *ProjectsDatabasesIndexesListCall { 5754 c.ctx_ = ctx 5755 return c 5756 } 5757 5758 // Header returns a http.Header that can be modified by the caller to add 5759 // headers to the request. 5760 func (c *ProjectsDatabasesIndexesListCall) Header() http.Header { 5761 if c.header_ == nil { 5762 c.header_ = make(http.Header) 5763 } 5764 return c.header_ 5765 } 5766 5767 func (c *ProjectsDatabasesIndexesListCall) doRequest(alt string) (*http.Response, error) { 5768 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 5769 if c.ifNoneMatch_ != "" { 5770 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5771 } 5772 var body io.Reader = nil 5773 c.urlParams_.Set("alt", alt) 5774 c.urlParams_.Set("prettyPrint", "false") 5775 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/indexes") 5776 urls += "?" + c.urlParams_.Encode() 5777 req, err := http.NewRequest("GET", urls, body) 5778 if err != nil { 5779 return nil, err 5780 } 5781 req.Header = reqHeaders 5782 googleapi.Expand(req.URL, map[string]string{ 5783 "parent": c.parent, 5784 }) 5785 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5786 } 5787 5788 // Do executes the "firestore.projects.databases.indexes.list" call. 5789 // Any non-2xx status code is an error. Response headers are in either 5790 // *GoogleFirestoreAdminV1beta1ListIndexesResponse.ServerResponse.Header or (if 5791 // a response was returned at all) in error.(*googleapi.Error).Header. Use 5792 // googleapi.IsNotModified to check whether the returned error was because 5793 // http.StatusNotModified was returned. 5794 func (c *ProjectsDatabasesIndexesListCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta1ListIndexesResponse, error) { 5795 gensupport.SetOptions(c.urlParams_, opts...) 5796 res, err := c.doRequest("json") 5797 if res != nil && res.StatusCode == http.StatusNotModified { 5798 if res.Body != nil { 5799 res.Body.Close() 5800 } 5801 return nil, gensupport.WrapError(&googleapi.Error{ 5802 Code: res.StatusCode, 5803 Header: res.Header, 5804 }) 5805 } 5806 if err != nil { 5807 return nil, err 5808 } 5809 defer googleapi.CloseBody(res) 5810 if err := googleapi.CheckResponse(res); err != nil { 5811 return nil, gensupport.WrapError(err) 5812 } 5813 ret := &GoogleFirestoreAdminV1beta1ListIndexesResponse{ 5814 ServerResponse: googleapi.ServerResponse{ 5815 Header: res.Header, 5816 HTTPStatusCode: res.StatusCode, 5817 }, 5818 } 5819 target := &ret 5820 if err := gensupport.DecodeResponse(target, res); err != nil { 5821 return nil, err 5822 } 5823 return ret, nil 5824 } 5825 5826 // Pages invokes f for each page of results. 5827 // A non-nil error returned from f will halt the iteration. 5828 // The provided context supersedes any context provided to the Context method. 5829 func (c *ProjectsDatabasesIndexesListCall) Pages(ctx context.Context, f func(*GoogleFirestoreAdminV1beta1ListIndexesResponse) error) error { 5830 c.ctx_ = ctx 5831 defer c.PageToken(c.urlParams_.Get("pageToken")) 5832 for { 5833 x, err := c.Do() 5834 if err != nil { 5835 return err 5836 } 5837 if err := f(x); err != nil { 5838 return err 5839 } 5840 if x.NextPageToken == "" { 5841 return nil 5842 } 5843 c.PageToken(x.NextPageToken) 5844 } 5845 } 5846