...

Source file src/google.golang.org/api/firestore/v1beta2/firestore-gen.go

Documentation: google.golang.org/api/firestore/v1beta2

     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/v1beta2"
    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/v1beta2"
    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:v1beta2"
    97  const apiName = "firestore"
    98  const apiVersion = "v1beta2"
    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.CollectionGroups = NewProjectsDatabasesCollectionGroupsService(s)
   183  	return rs
   184  }
   185  
   186  type ProjectsDatabasesService struct {
   187  	s *Service
   188  
   189  	CollectionGroups *ProjectsDatabasesCollectionGroupsService
   190  }
   191  
   192  func NewProjectsDatabasesCollectionGroupsService(s *Service) *ProjectsDatabasesCollectionGroupsService {
   193  	rs := &ProjectsDatabasesCollectionGroupsService{s: s}
   194  	rs.Fields = NewProjectsDatabasesCollectionGroupsFieldsService(s)
   195  	rs.Indexes = NewProjectsDatabasesCollectionGroupsIndexesService(s)
   196  	return rs
   197  }
   198  
   199  type ProjectsDatabasesCollectionGroupsService struct {
   200  	s *Service
   201  
   202  	Fields *ProjectsDatabasesCollectionGroupsFieldsService
   203  
   204  	Indexes *ProjectsDatabasesCollectionGroupsIndexesService
   205  }
   206  
   207  func NewProjectsDatabasesCollectionGroupsFieldsService(s *Service) *ProjectsDatabasesCollectionGroupsFieldsService {
   208  	rs := &ProjectsDatabasesCollectionGroupsFieldsService{s: s}
   209  	return rs
   210  }
   211  
   212  type ProjectsDatabasesCollectionGroupsFieldsService struct {
   213  	s *Service
   214  }
   215  
   216  func NewProjectsDatabasesCollectionGroupsIndexesService(s *Service) *ProjectsDatabasesCollectionGroupsIndexesService {
   217  	rs := &ProjectsDatabasesCollectionGroupsIndexesService{s: s}
   218  	return rs
   219  }
   220  
   221  type ProjectsDatabasesCollectionGroupsIndexesService struct {
   222  	s *Service
   223  }
   224  
   225  // Empty: A generic empty message that you can re-use to avoid defining
   226  // duplicated empty messages in your APIs. A typical example is to use it as
   227  // the request or the response type of an API method. For instance: service Foo
   228  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   229  type Empty struct {
   230  	// ServerResponse contains the HTTP response code and headers from the server.
   231  	googleapi.ServerResponse `json:"-"`
   232  }
   233  
   234  // GoogleFirestoreAdminV1CreateDatabaseMetadata: Metadata related to the create
   235  // database operation.
   236  type GoogleFirestoreAdminV1CreateDatabaseMetadata struct {
   237  }
   238  
   239  // GoogleFirestoreAdminV1DeleteDatabaseMetadata: Metadata related to the delete
   240  // database operation.
   241  type GoogleFirestoreAdminV1DeleteDatabaseMetadata struct {
   242  }
   243  
   244  // GoogleFirestoreAdminV1Progress: Describes the progress of the operation.
   245  // Unit of work is generic and must be interpreted based on where Progress is
   246  // used.
   247  type GoogleFirestoreAdminV1Progress struct {
   248  	// CompletedWork: The amount of work completed.
   249  	CompletedWork int64 `json:"completedWork,omitempty,string"`
   250  	// EstimatedWork: The amount of work estimated.
   251  	EstimatedWork int64 `json:"estimatedWork,omitempty,string"`
   252  	// ForceSendFields is a list of field names (e.g. "CompletedWork") to
   253  	// unconditionally include in API requests. By default, fields with empty or
   254  	// default values are omitted from API requests. See
   255  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   256  	// details.
   257  	ForceSendFields []string `json:"-"`
   258  	// NullFields is a list of field names (e.g. "CompletedWork") to include in API
   259  	// requests with the JSON null value. By default, fields with empty values are
   260  	// omitted from API requests. See
   261  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   262  	NullFields []string `json:"-"`
   263  }
   264  
   265  func (s *GoogleFirestoreAdminV1Progress) MarshalJSON() ([]byte, error) {
   266  	type NoMethod GoogleFirestoreAdminV1Progress
   267  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   268  }
   269  
   270  // GoogleFirestoreAdminV1RestoreDatabaseMetadata: Metadata for the long-running
   271  // operation from the RestoreDatabase request.
   272  type GoogleFirestoreAdminV1RestoreDatabaseMetadata struct {
   273  	// Backup: The name of the backup restoring from.
   274  	Backup string `json:"backup,omitempty"`
   275  	// Database: The name of the database being restored to.
   276  	Database string `json:"database,omitempty"`
   277  	// EndTime: The time the restore finished, unset for ongoing restores.
   278  	EndTime string `json:"endTime,omitempty"`
   279  	// OperationState: The operation state of the restore.
   280  	//
   281  	// Possible values:
   282  	//   "OPERATION_STATE_UNSPECIFIED" - Unspecified.
   283  	//   "INITIALIZING" - Request is being prepared for processing.
   284  	//   "PROCESSING" - Request is actively being processed.
   285  	//   "CANCELLING" - Request is in the process of being cancelled after user
   286  	// called google.longrunning.Operations.CancelOperation on the operation.
   287  	//   "FINALIZING" - Request has been processed and is in its finalization
   288  	// stage.
   289  	//   "SUCCESSFUL" - Request has completed successfully.
   290  	//   "FAILED" - Request has finished being processed, but encountered an error.
   291  	//   "CANCELLED" - Request has finished being cancelled after user called
   292  	// google.longrunning.Operations.CancelOperation.
   293  	OperationState string `json:"operationState,omitempty"`
   294  	// ProgressPercentage: How far along the restore is as an estimated percentage
   295  	// of remaining time.
   296  	ProgressPercentage *GoogleFirestoreAdminV1Progress `json:"progressPercentage,omitempty"`
   297  	// StartTime: The time the restore was started.
   298  	StartTime string `json:"startTime,omitempty"`
   299  	// ForceSendFields is a list of field names (e.g. "Backup") to unconditionally
   300  	// include in API requests. By default, fields with empty or default values are
   301  	// omitted from API requests. See
   302  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   303  	// details.
   304  	ForceSendFields []string `json:"-"`
   305  	// NullFields is a list of field names (e.g. "Backup") to include in API
   306  	// requests with the JSON null value. By default, fields with empty values are
   307  	// omitted from API requests. See
   308  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   309  	NullFields []string `json:"-"`
   310  }
   311  
   312  func (s *GoogleFirestoreAdminV1RestoreDatabaseMetadata) MarshalJSON() ([]byte, error) {
   313  	type NoMethod GoogleFirestoreAdminV1RestoreDatabaseMetadata
   314  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   315  }
   316  
   317  // GoogleFirestoreAdminV1UpdateDatabaseMetadata: Metadata related to the update
   318  // database operation.
   319  type GoogleFirestoreAdminV1UpdateDatabaseMetadata struct {
   320  }
   321  
   322  // GoogleFirestoreAdminV1beta2ExportDocumentsMetadata: Metadata for
   323  // google.longrunning.Operation results from FirestoreAdmin.ExportDocuments.
   324  type GoogleFirestoreAdminV1beta2ExportDocumentsMetadata struct {
   325  	// CollectionIds: Which collection ids are being exported.
   326  	CollectionIds []string `json:"collectionIds,omitempty"`
   327  	// EndTime: The time this operation completed. Will be unset if operation still
   328  	// in progress.
   329  	EndTime string `json:"endTime,omitempty"`
   330  	// OperationState: The state of the export operation.
   331  	//
   332  	// Possible values:
   333  	//   "OPERATION_STATE_UNSPECIFIED" - Unspecified.
   334  	//   "INITIALIZING" - Request is being prepared for processing.
   335  	//   "PROCESSING" - Request is actively being processed.
   336  	//   "CANCELLING" - Request is in the process of being cancelled after user
   337  	// called google.longrunning.Operations.CancelOperation on the operation.
   338  	//   "FINALIZING" - Request has been processed and is in its finalization
   339  	// stage.
   340  	//   "SUCCESSFUL" - Request has completed successfully.
   341  	//   "FAILED" - Request has finished being processed, but encountered an error.
   342  	//   "CANCELLED" - Request has finished being cancelled after user called
   343  	// google.longrunning.Operations.CancelOperation.
   344  	OperationState string `json:"operationState,omitempty"`
   345  	// OutputUriPrefix: Where the entities are being exported to.
   346  	OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
   347  	// ProgressBytes: The progress, in bytes, of this operation.
   348  	ProgressBytes *GoogleFirestoreAdminV1beta2Progress `json:"progressBytes,omitempty"`
   349  	// ProgressDocuments: The progress, in documents, of this operation.
   350  	ProgressDocuments *GoogleFirestoreAdminV1beta2Progress `json:"progressDocuments,omitempty"`
   351  	// StartTime: The time this operation started.
   352  	StartTime string `json:"startTime,omitempty"`
   353  	// ForceSendFields is a list of field names (e.g. "CollectionIds") to
   354  	// unconditionally include in API requests. By default, fields with empty or
   355  	// default values are omitted from API requests. See
   356  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   357  	// details.
   358  	ForceSendFields []string `json:"-"`
   359  	// NullFields is a list of field names (e.g. "CollectionIds") to include in API
   360  	// requests with the JSON null value. By default, fields with empty values are
   361  	// omitted from API requests. See
   362  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   363  	NullFields []string `json:"-"`
   364  }
   365  
   366  func (s *GoogleFirestoreAdminV1beta2ExportDocumentsMetadata) MarshalJSON() ([]byte, error) {
   367  	type NoMethod GoogleFirestoreAdminV1beta2ExportDocumentsMetadata
   368  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   369  }
   370  
   371  // GoogleFirestoreAdminV1beta2ExportDocumentsRequest: The request for
   372  // FirestoreAdmin.ExportDocuments.
   373  type GoogleFirestoreAdminV1beta2ExportDocumentsRequest struct {
   374  	// CollectionIds: Which collection ids to export. Unspecified means all
   375  	// collections.
   376  	CollectionIds []string `json:"collectionIds,omitempty"`
   377  	// OutputUriPrefix: The output URI. Currently only supports Google Cloud
   378  	// Storage URIs of the form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where
   379  	// `BUCKET_NAME` is the name of the Google Cloud Storage bucket and
   380  	// `NAMESPACE_PATH` is an optional Google Cloud Storage namespace path. When
   381  	// choosing a name, be sure to consider Google Cloud Storage naming guidelines:
   382  	// https://cloud.google.com/storage/docs/naming. If the URI is a bucket
   383  	// (without a namespace path), a prefix will be generated based on the start
   384  	// time.
   385  	OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
   386  	// ForceSendFields is a list of field names (e.g. "CollectionIds") to
   387  	// unconditionally include in API requests. By default, fields with empty or
   388  	// default values are omitted from API requests. See
   389  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   390  	// details.
   391  	ForceSendFields []string `json:"-"`
   392  	// NullFields is a list of field names (e.g. "CollectionIds") to include in API
   393  	// requests with the JSON null value. By default, fields with empty values are
   394  	// omitted from API requests. See
   395  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   396  	NullFields []string `json:"-"`
   397  }
   398  
   399  func (s *GoogleFirestoreAdminV1beta2ExportDocumentsRequest) MarshalJSON() ([]byte, error) {
   400  	type NoMethod GoogleFirestoreAdminV1beta2ExportDocumentsRequest
   401  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   402  }
   403  
   404  // GoogleFirestoreAdminV1beta2ExportDocumentsResponse: Returned in the
   405  // google.longrunning.Operation response field.
   406  type GoogleFirestoreAdminV1beta2ExportDocumentsResponse struct {
   407  	// OutputUriPrefix: Location of the output files. This can be used to begin an
   408  	// import into Cloud Firestore (this project or another project) after the
   409  	// operation completes successfully.
   410  	OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
   411  	// ForceSendFields is a list of field names (e.g. "OutputUriPrefix") to
   412  	// unconditionally include in API requests. By default, fields with empty or
   413  	// default values are omitted from API requests. See
   414  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   415  	// details.
   416  	ForceSendFields []string `json:"-"`
   417  	// NullFields is a list of field names (e.g. "OutputUriPrefix") to include in
   418  	// API requests with the JSON null value. By default, fields with empty values
   419  	// are omitted from API requests. See
   420  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   421  	NullFields []string `json:"-"`
   422  }
   423  
   424  func (s *GoogleFirestoreAdminV1beta2ExportDocumentsResponse) MarshalJSON() ([]byte, error) {
   425  	type NoMethod GoogleFirestoreAdminV1beta2ExportDocumentsResponse
   426  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   427  }
   428  
   429  // GoogleFirestoreAdminV1beta2Field: Represents a single field in the database.
   430  // Fields are grouped by their "Collection Group", which represent all
   431  // collections in the database with the same id.
   432  type GoogleFirestoreAdminV1beta2Field struct {
   433  	// IndexConfig: The index configuration for this field. If unset, field
   434  	// indexing will revert to the configuration defined by the `ancestor_field`.
   435  	// To explicitly remove all indexes for this field, specify an index config
   436  	// with an empty list of indexes.
   437  	IndexConfig *GoogleFirestoreAdminV1beta2IndexConfig `json:"indexConfig,omitempty"`
   438  	// Name: A field name of the form
   439  	// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_i
   440  	// d}/fields/{field_path}` A field path may be a simple field name, e.g.
   441  	// `address` or a path to fields within map_value , e.g. `address.city`, or a
   442  	// special field path. The only valid special field is `*`, which represents
   443  	// any field. Field paths may be quoted using ` (backtick). The only character
   444  	// that needs to be escaped within a quoted field path is the backtick
   445  	// character itself, escaped using a backslash. Special characters in field
   446  	// paths that must be quoted include: `*`, `.`, ``` (backtick), `[`, `]`, as
   447  	// well as any ascii symbolic characters. Examples: (Note: Comments here are
   448  	// written in markdown syntax, so there is an additional layer of backticks to
   449  	// represent a code block) `\`address.city\`` represents a field named
   450  	// `address.city`, not the map key `city` in the field `address`. `\`*\``
   451  	// represents a field named `*`, not any field. A special `Field` contains the
   452  	// default indexing settings for all fields. This field's resource name is:
   453  	// `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/f
   454  	// ields/*` Indexes defined on this `Field` will be applied to all fields which
   455  	// do not have their own `Field` index configuration.
   456  	Name string `json:"name,omitempty"`
   457  
   458  	// ServerResponse contains the HTTP response code and headers from the server.
   459  	googleapi.ServerResponse `json:"-"`
   460  	// ForceSendFields is a list of field names (e.g. "IndexConfig") to
   461  	// unconditionally include in API requests. By default, fields with empty or
   462  	// default values are omitted from API requests. See
   463  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   464  	// details.
   465  	ForceSendFields []string `json:"-"`
   466  	// NullFields is a list of field names (e.g. "IndexConfig") to include in API
   467  	// requests with the JSON null value. By default, fields with empty values are
   468  	// omitted from API requests. See
   469  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   470  	NullFields []string `json:"-"`
   471  }
   472  
   473  func (s *GoogleFirestoreAdminV1beta2Field) MarshalJSON() ([]byte, error) {
   474  	type NoMethod GoogleFirestoreAdminV1beta2Field
   475  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   476  }
   477  
   478  // GoogleFirestoreAdminV1beta2FieldOperationMetadata: Metadata for
   479  // google.longrunning.Operation results from FirestoreAdmin.UpdateField.
   480  type GoogleFirestoreAdminV1beta2FieldOperationMetadata struct {
   481  	// BytesProgress: The progress, in bytes, of this operation.
   482  	BytesProgress *GoogleFirestoreAdminV1beta2Progress `json:"bytesProgress,omitempty"`
   483  	// DocumentProgress: The progress, in documents, of this operation.
   484  	DocumentProgress *GoogleFirestoreAdminV1beta2Progress `json:"documentProgress,omitempty"`
   485  	// EndTime: The time this operation completed. Will be unset if operation still
   486  	// in progress.
   487  	EndTime string `json:"endTime,omitempty"`
   488  	// Field: The field resource that this operation is acting on. For example:
   489  	// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_i
   490  	// d}/fields/{field_path}`
   491  	Field string `json:"field,omitempty"`
   492  	// IndexConfigDeltas: A list of IndexConfigDelta, which describe the intent of
   493  	// this operation.
   494  	IndexConfigDeltas []*GoogleFirestoreAdminV1beta2IndexConfigDelta `json:"indexConfigDeltas,omitempty"`
   495  	// StartTime: The time this operation started.
   496  	StartTime string `json:"startTime,omitempty"`
   497  	// State: The state of the operation.
   498  	//
   499  	// Possible values:
   500  	//   "OPERATION_STATE_UNSPECIFIED" - Unspecified.
   501  	//   "INITIALIZING" - Request is being prepared for processing.
   502  	//   "PROCESSING" - Request is actively being processed.
   503  	//   "CANCELLING" - Request is in the process of being cancelled after user
   504  	// called google.longrunning.Operations.CancelOperation on the operation.
   505  	//   "FINALIZING" - Request has been processed and is in its finalization
   506  	// stage.
   507  	//   "SUCCESSFUL" - Request has completed successfully.
   508  	//   "FAILED" - Request has finished being processed, but encountered an error.
   509  	//   "CANCELLED" - Request has finished being cancelled after user called
   510  	// google.longrunning.Operations.CancelOperation.
   511  	State string `json:"state,omitempty"`
   512  	// ForceSendFields is a list of field names (e.g. "BytesProgress") to
   513  	// unconditionally include in API requests. By default, fields with empty or
   514  	// default values are omitted from API requests. See
   515  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   516  	// details.
   517  	ForceSendFields []string `json:"-"`
   518  	// NullFields is a list of field names (e.g. "BytesProgress") to include in API
   519  	// requests with the JSON null value. By default, fields with empty values are
   520  	// omitted from API requests. See
   521  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   522  	NullFields []string `json:"-"`
   523  }
   524  
   525  func (s *GoogleFirestoreAdminV1beta2FieldOperationMetadata) MarshalJSON() ([]byte, error) {
   526  	type NoMethod GoogleFirestoreAdminV1beta2FieldOperationMetadata
   527  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   528  }
   529  
   530  // GoogleFirestoreAdminV1beta2ImportDocumentsMetadata: Metadata for
   531  // google.longrunning.Operation results from FirestoreAdmin.ImportDocuments.
   532  type GoogleFirestoreAdminV1beta2ImportDocumentsMetadata struct {
   533  	// CollectionIds: Which collection ids are being imported.
   534  	CollectionIds []string `json:"collectionIds,omitempty"`
   535  	// EndTime: The time this operation completed. Will be unset if operation still
   536  	// in progress.
   537  	EndTime string `json:"endTime,omitempty"`
   538  	// InputUriPrefix: The location of the documents being imported.
   539  	InputUriPrefix string `json:"inputUriPrefix,omitempty"`
   540  	// OperationState: The state of the import operation.
   541  	//
   542  	// Possible values:
   543  	//   "OPERATION_STATE_UNSPECIFIED" - Unspecified.
   544  	//   "INITIALIZING" - Request is being prepared for processing.
   545  	//   "PROCESSING" - Request is actively being processed.
   546  	//   "CANCELLING" - Request is in the process of being cancelled after user
   547  	// called google.longrunning.Operations.CancelOperation on the operation.
   548  	//   "FINALIZING" - Request has been processed and is in its finalization
   549  	// stage.
   550  	//   "SUCCESSFUL" - Request has completed successfully.
   551  	//   "FAILED" - Request has finished being processed, but encountered an error.
   552  	//   "CANCELLED" - Request has finished being cancelled after user called
   553  	// google.longrunning.Operations.CancelOperation.
   554  	OperationState string `json:"operationState,omitempty"`
   555  	// ProgressBytes: The progress, in bytes, of this operation.
   556  	ProgressBytes *GoogleFirestoreAdminV1beta2Progress `json:"progressBytes,omitempty"`
   557  	// ProgressDocuments: The progress, in documents, of this operation.
   558  	ProgressDocuments *GoogleFirestoreAdminV1beta2Progress `json:"progressDocuments,omitempty"`
   559  	// StartTime: The time this operation started.
   560  	StartTime string `json:"startTime,omitempty"`
   561  	// ForceSendFields is a list of field names (e.g. "CollectionIds") to
   562  	// unconditionally include in API requests. By default, fields with empty or
   563  	// default values are omitted from API requests. See
   564  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   565  	// details.
   566  	ForceSendFields []string `json:"-"`
   567  	// NullFields is a list of field names (e.g. "CollectionIds") to include in API
   568  	// requests with the JSON null value. By default, fields with empty values are
   569  	// omitted from API requests. See
   570  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   571  	NullFields []string `json:"-"`
   572  }
   573  
   574  func (s *GoogleFirestoreAdminV1beta2ImportDocumentsMetadata) MarshalJSON() ([]byte, error) {
   575  	type NoMethod GoogleFirestoreAdminV1beta2ImportDocumentsMetadata
   576  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   577  }
   578  
   579  // GoogleFirestoreAdminV1beta2ImportDocumentsRequest: The request for
   580  // FirestoreAdmin.ImportDocuments.
   581  type GoogleFirestoreAdminV1beta2ImportDocumentsRequest struct {
   582  	// CollectionIds: Which collection ids to import. Unspecified means all
   583  	// collections included in the import.
   584  	CollectionIds []string `json:"collectionIds,omitempty"`
   585  	// InputUriPrefix: Location of the exported files. This must match the
   586  	// output_uri_prefix of an ExportDocumentsResponse from an export that has
   587  	// completed successfully. See:
   588  	// google.firestore.admin.v1beta2.ExportDocumentsResponse.output_uri_prefix.
   589  	InputUriPrefix string `json:"inputUriPrefix,omitempty"`
   590  	// ForceSendFields is a list of field names (e.g. "CollectionIds") to
   591  	// unconditionally include in API requests. By default, fields with empty or
   592  	// default values are omitted from API requests. See
   593  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   594  	// details.
   595  	ForceSendFields []string `json:"-"`
   596  	// NullFields is a list of field names (e.g. "CollectionIds") to include in API
   597  	// requests with the JSON null value. By default, fields with empty values are
   598  	// omitted from API requests. See
   599  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   600  	NullFields []string `json:"-"`
   601  }
   602  
   603  func (s *GoogleFirestoreAdminV1beta2ImportDocumentsRequest) MarshalJSON() ([]byte, error) {
   604  	type NoMethod GoogleFirestoreAdminV1beta2ImportDocumentsRequest
   605  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   606  }
   607  
   608  // GoogleFirestoreAdminV1beta2Index: Cloud Firestore indexes enable simple and
   609  // complex queries against documents in a database.
   610  type GoogleFirestoreAdminV1beta2Index struct {
   611  	// Fields: The fields supported by this index. For composite indexes, this is
   612  	// always 2 or more fields. The last field entry is always for the field path
   613  	// `__name__`. If, on creation, `__name__` was not specified as the last field,
   614  	// it will be added automatically with the same direction as that of the last
   615  	// field defined. If the final field in a composite index is not directional,
   616  	// the `__name__` will be ordered ASCENDING (unless explicitly specified). For
   617  	// single field indexes, this will always be exactly one entry with a field
   618  	// path equal to the field path of the associated field.
   619  	Fields []*GoogleFirestoreAdminV1beta2IndexField `json:"fields,omitempty"`
   620  	// Name: Output only. A server defined name for this index. The form of this
   621  	// name for composite indexes will be:
   622  	// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_i
   623  	// d}/indexes/{composite_index_id}` For single field indexes, this field will
   624  	// be empty.
   625  	Name string `json:"name,omitempty"`
   626  	// QueryScope: Indexes with a collection query scope specified allow queries
   627  	// against a collection that is the child of a specific document, specified at
   628  	// query time, and that has the same collection id. Indexes with a collection
   629  	// group query scope specified allow queries against all collections descended
   630  	// from a specific document, specified at query time, and that have the same
   631  	// collection id as this index.
   632  	//
   633  	// Possible values:
   634  	//   "QUERY_SCOPE_UNSPECIFIED" - The query scope is unspecified. Not a valid
   635  	// option.
   636  	//   "COLLECTION" - Indexes with a collection query scope specified allow
   637  	// queries against a collection that is the child of a specific document,
   638  	// specified at query time, and that has the collection id specified by the
   639  	// index.
   640  	//   "COLLECTION_GROUP" - Indexes with a collection group query scope specified
   641  	// allow queries against all collections that has the collection id specified
   642  	// by the index.
   643  	QueryScope string `json:"queryScope,omitempty"`
   644  	// State: Output only. The serving state of the index.
   645  	//
   646  	// Possible values:
   647  	//   "STATE_UNSPECIFIED" - The state is unspecified.
   648  	//   "CREATING" - The index is being created. There is an active long-running
   649  	// operation for the index. The index is updated when writing a document. Some
   650  	// index data may exist.
   651  	//   "READY" - The index is ready to be used. The index is updated when writing
   652  	// a document. The index is fully populated from all stored documents it
   653  	// applies to.
   654  	//   "NEEDS_REPAIR" - The index was being created, but something went wrong.
   655  	// There is no active long-running operation for the index, and the most
   656  	// recently finished long-running operation failed. The index is not updated
   657  	// when writing a document. Some index data may exist. Use the
   658  	// google.longrunning.Operations API to determine why the operation that last
   659  	// attempted to create this index failed, then re-create the index.
   660  	State string `json:"state,omitempty"`
   661  
   662  	// ServerResponse contains the HTTP response code and headers from the server.
   663  	googleapi.ServerResponse `json:"-"`
   664  	// ForceSendFields is a list of field names (e.g. "Fields") to unconditionally
   665  	// include in API requests. By default, fields with empty or default values are
   666  	// omitted from API requests. See
   667  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   668  	// details.
   669  	ForceSendFields []string `json:"-"`
   670  	// NullFields is a list of field names (e.g. "Fields") to include in API
   671  	// requests with the JSON null value. By default, fields with empty values are
   672  	// omitted from API requests. See
   673  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   674  	NullFields []string `json:"-"`
   675  }
   676  
   677  func (s *GoogleFirestoreAdminV1beta2Index) MarshalJSON() ([]byte, error) {
   678  	type NoMethod GoogleFirestoreAdminV1beta2Index
   679  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   680  }
   681  
   682  // GoogleFirestoreAdminV1beta2IndexConfig: The index configuration for this
   683  // field.
   684  type GoogleFirestoreAdminV1beta2IndexConfig struct {
   685  	// AncestorField: Output only. Specifies the resource name of the `Field` from
   686  	// which this field's index configuration is set (when `uses_ancestor_config`
   687  	// is true), or from which it *would* be set if this field had no index
   688  	// configuration (when `uses_ancestor_config` is false).
   689  	AncestorField string `json:"ancestorField,omitempty"`
   690  	// Indexes: The indexes supported for this field.
   691  	Indexes []*GoogleFirestoreAdminV1beta2Index `json:"indexes,omitempty"`
   692  	// Reverting: Output only When true, the `Field`'s index configuration is in
   693  	// the process of being reverted. Once complete, the index config will
   694  	// transition to the same state as the field specified by `ancestor_field`, at
   695  	// which point `uses_ancestor_config` will be `true` and `reverting` will be
   696  	// `false`.
   697  	Reverting bool `json:"reverting,omitempty"`
   698  	// UsesAncestorConfig: Output only. When true, the `Field`'s index
   699  	// configuration is set from the configuration specified by the
   700  	// `ancestor_field`. When false, the `Field`'s index configuration is defined
   701  	// explicitly.
   702  	UsesAncestorConfig bool `json:"usesAncestorConfig,omitempty"`
   703  	// ForceSendFields is a list of field names (e.g. "AncestorField") to
   704  	// unconditionally include in API requests. By default, fields with empty or
   705  	// default values are omitted from API requests. See
   706  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   707  	// details.
   708  	ForceSendFields []string `json:"-"`
   709  	// NullFields is a list of field names (e.g. "AncestorField") to include in API
   710  	// requests with the JSON null value. By default, fields with empty values are
   711  	// omitted from API requests. See
   712  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   713  	NullFields []string `json:"-"`
   714  }
   715  
   716  func (s *GoogleFirestoreAdminV1beta2IndexConfig) MarshalJSON() ([]byte, error) {
   717  	type NoMethod GoogleFirestoreAdminV1beta2IndexConfig
   718  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   719  }
   720  
   721  // GoogleFirestoreAdminV1beta2IndexConfigDelta: Information about an index
   722  // configuration change.
   723  type GoogleFirestoreAdminV1beta2IndexConfigDelta struct {
   724  	// ChangeType: Specifies how the index is changing.
   725  	//
   726  	// Possible values:
   727  	//   "CHANGE_TYPE_UNSPECIFIED" - The type of change is not specified or known.
   728  	//   "ADD" - The single field index is being added.
   729  	//   "REMOVE" - The single field index is being removed.
   730  	ChangeType string `json:"changeType,omitempty"`
   731  	// Index: The index being changed.
   732  	Index *GoogleFirestoreAdminV1beta2Index `json:"index,omitempty"`
   733  	// ForceSendFields is a list of field names (e.g. "ChangeType") to
   734  	// unconditionally include in API requests. By default, fields with empty or
   735  	// default values are omitted from API requests. See
   736  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   737  	// details.
   738  	ForceSendFields []string `json:"-"`
   739  	// NullFields is a list of field names (e.g. "ChangeType") to include in API
   740  	// requests with the JSON null value. By default, fields with empty values are
   741  	// omitted from API requests. See
   742  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   743  	NullFields []string `json:"-"`
   744  }
   745  
   746  func (s *GoogleFirestoreAdminV1beta2IndexConfigDelta) MarshalJSON() ([]byte, error) {
   747  	type NoMethod GoogleFirestoreAdminV1beta2IndexConfigDelta
   748  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   749  }
   750  
   751  // GoogleFirestoreAdminV1beta2IndexField: A field in an index. The field_path
   752  // describes which field is indexed, the value_mode describes how the field
   753  // value is indexed.
   754  type GoogleFirestoreAdminV1beta2IndexField struct {
   755  	// ArrayConfig: Indicates that this field supports operations on
   756  	// `array_value`s.
   757  	//
   758  	// Possible values:
   759  	//   "ARRAY_CONFIG_UNSPECIFIED" - The index does not support additional array
   760  	// queries.
   761  	//   "CONTAINS" - The index supports array containment queries.
   762  	ArrayConfig string `json:"arrayConfig,omitempty"`
   763  	// FieldPath: Can be __name__. For single field indexes, this must match the
   764  	// name of the field or may be omitted.
   765  	FieldPath string `json:"fieldPath,omitempty"`
   766  	// Order: Indicates that this field supports ordering by the specified order or
   767  	// comparing using =, <, <=, >, >=.
   768  	//
   769  	// Possible values:
   770  	//   "ORDER_UNSPECIFIED" - The ordering is unspecified. Not a valid option.
   771  	//   "ASCENDING" - The field is ordered by ascending field value.
   772  	//   "DESCENDING" - The field is ordered by descending field value.
   773  	Order string `json:"order,omitempty"`
   774  	// ForceSendFields is a list of field names (e.g. "ArrayConfig") 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. "ArrayConfig") 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 *GoogleFirestoreAdminV1beta2IndexField) MarshalJSON() ([]byte, error) {
   788  	type NoMethod GoogleFirestoreAdminV1beta2IndexField
   789  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   790  }
   791  
   792  // GoogleFirestoreAdminV1beta2IndexOperationMetadata: Metadata for
   793  // google.longrunning.Operation results from FirestoreAdmin.CreateIndex.
   794  type GoogleFirestoreAdminV1beta2IndexOperationMetadata struct {
   795  	// EndTime: The time this operation completed. Will be unset if operation still
   796  	// in progress.
   797  	EndTime string `json:"endTime,omitempty"`
   798  	// Index: The index resource that this operation is acting on. For example:
   799  	// `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_i
   800  	// d}/indexes/{index_id}`
   801  	Index string `json:"index,omitempty"`
   802  	// ProgressBytes: The progress, in bytes, of this operation.
   803  	ProgressBytes *GoogleFirestoreAdminV1beta2Progress `json:"progressBytes,omitempty"`
   804  	// ProgressDocuments: The progress, in documents, of this operation.
   805  	ProgressDocuments *GoogleFirestoreAdminV1beta2Progress `json:"progressDocuments,omitempty"`
   806  	// StartTime: The time this operation started.
   807  	StartTime string `json:"startTime,omitempty"`
   808  	// State: The state of the operation.
   809  	//
   810  	// Possible values:
   811  	//   "OPERATION_STATE_UNSPECIFIED" - Unspecified.
   812  	//   "INITIALIZING" - Request is being prepared for processing.
   813  	//   "PROCESSING" - Request is actively being processed.
   814  	//   "CANCELLING" - Request is in the process of being cancelled after user
   815  	// called google.longrunning.Operations.CancelOperation on the operation.
   816  	//   "FINALIZING" - Request has been processed and is in its finalization
   817  	// stage.
   818  	//   "SUCCESSFUL" - Request has completed successfully.
   819  	//   "FAILED" - Request has finished being processed, but encountered an error.
   820  	//   "CANCELLED" - Request has finished being cancelled after user called
   821  	// google.longrunning.Operations.CancelOperation.
   822  	State string `json:"state,omitempty"`
   823  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   824  	// include in API requests. By default, fields with empty or default values are
   825  	// omitted from API requests. See
   826  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   827  	// details.
   828  	ForceSendFields []string `json:"-"`
   829  	// NullFields is a list of field names (e.g. "EndTime") to include in API
   830  	// requests with the JSON null value. By default, fields with empty values are
   831  	// omitted from API requests. See
   832  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   833  	NullFields []string `json:"-"`
   834  }
   835  
   836  func (s *GoogleFirestoreAdminV1beta2IndexOperationMetadata) MarshalJSON() ([]byte, error) {
   837  	type NoMethod GoogleFirestoreAdminV1beta2IndexOperationMetadata
   838  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   839  }
   840  
   841  // GoogleFirestoreAdminV1beta2ListFieldsResponse: The response for
   842  // FirestoreAdmin.ListFields.
   843  type GoogleFirestoreAdminV1beta2ListFieldsResponse struct {
   844  	// Fields: The requested fields.
   845  	Fields []*GoogleFirestoreAdminV1beta2Field `json:"fields,omitempty"`
   846  	// NextPageToken: A page token that may be used to request another page of
   847  	// results. If blank, this is the last page.
   848  	NextPageToken string `json:"nextPageToken,omitempty"`
   849  
   850  	// ServerResponse contains the HTTP response code and headers from the server.
   851  	googleapi.ServerResponse `json:"-"`
   852  	// ForceSendFields is a list of field names (e.g. "Fields") to unconditionally
   853  	// include in API requests. By default, fields with empty or default values are
   854  	// omitted from API requests. See
   855  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   856  	// details.
   857  	ForceSendFields []string `json:"-"`
   858  	// NullFields is a list of field names (e.g. "Fields") to include in API
   859  	// requests with the JSON null value. By default, fields with empty values are
   860  	// omitted from API requests. See
   861  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   862  	NullFields []string `json:"-"`
   863  }
   864  
   865  func (s *GoogleFirestoreAdminV1beta2ListFieldsResponse) MarshalJSON() ([]byte, error) {
   866  	type NoMethod GoogleFirestoreAdminV1beta2ListFieldsResponse
   867  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   868  }
   869  
   870  // GoogleFirestoreAdminV1beta2ListIndexesResponse: The response for
   871  // FirestoreAdmin.ListIndexes.
   872  type GoogleFirestoreAdminV1beta2ListIndexesResponse struct {
   873  	// Indexes: The requested indexes.
   874  	Indexes []*GoogleFirestoreAdminV1beta2Index `json:"indexes,omitempty"`
   875  	// NextPageToken: A page token that may be used to request another page of
   876  	// results. If blank, this is the last page.
   877  	NextPageToken string `json:"nextPageToken,omitempty"`
   878  
   879  	// ServerResponse contains the HTTP response code and headers from the server.
   880  	googleapi.ServerResponse `json:"-"`
   881  	// ForceSendFields is a list of field names (e.g. "Indexes") to unconditionally
   882  	// include in API requests. By default, fields with empty or default values are
   883  	// omitted from API requests. See
   884  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   885  	// details.
   886  	ForceSendFields []string `json:"-"`
   887  	// NullFields is a list of field names (e.g. "Indexes") to include in API
   888  	// requests with the JSON null value. By default, fields with empty values are
   889  	// omitted from API requests. See
   890  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   891  	NullFields []string `json:"-"`
   892  }
   893  
   894  func (s *GoogleFirestoreAdminV1beta2ListIndexesResponse) MarshalJSON() ([]byte, error) {
   895  	type NoMethod GoogleFirestoreAdminV1beta2ListIndexesResponse
   896  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   897  }
   898  
   899  // GoogleFirestoreAdminV1beta2Progress: Describes the progress of the
   900  // operation. Unit of work is generic and must be interpreted based on where
   901  // Progress is used.
   902  type GoogleFirestoreAdminV1beta2Progress struct {
   903  	// CompletedWork: The amount of work completed.
   904  	CompletedWork int64 `json:"completedWork,omitempty,string"`
   905  	// EstimatedWork: The amount of work estimated.
   906  	EstimatedWork int64 `json:"estimatedWork,omitempty,string"`
   907  	// ForceSendFields is a list of field names (e.g. "CompletedWork") to
   908  	// unconditionally include in API requests. By default, fields with empty or
   909  	// default values are omitted from API requests. See
   910  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   911  	// details.
   912  	ForceSendFields []string `json:"-"`
   913  	// NullFields is a list of field names (e.g. "CompletedWork") to include in API
   914  	// requests with the JSON null value. By default, fields with empty values are
   915  	// omitted from API requests. See
   916  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   917  	NullFields []string `json:"-"`
   918  }
   919  
   920  func (s *GoogleFirestoreAdminV1beta2Progress) MarshalJSON() ([]byte, error) {
   921  	type NoMethod GoogleFirestoreAdminV1beta2Progress
   922  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   923  }
   924  
   925  // GoogleLongrunningOperation: This resource represents a long-running
   926  // operation that is the result of a network API call.
   927  type GoogleLongrunningOperation struct {
   928  	// Done: If the value is `false`, it means the operation is still in progress.
   929  	// If `true`, the operation is completed, and either `error` or `response` is
   930  	// available.
   931  	Done bool `json:"done,omitempty"`
   932  	// Error: The error result of the operation in case of failure or cancellation.
   933  	Error *Status `json:"error,omitempty"`
   934  	// Metadata: Service-specific metadata associated with the operation. It
   935  	// typically contains progress information and common metadata such as create
   936  	// time. Some services might not provide such metadata. Any method that returns
   937  	// a long-running operation should document the metadata type, if any.
   938  	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
   939  	// Name: The server-assigned name, which is only unique within the same service
   940  	// that originally returns it. If you use the default HTTP mapping, the `name`
   941  	// should be a resource name ending with `operations/{unique_id}`.
   942  	Name string `json:"name,omitempty"`
   943  	// Response: The normal, successful response of the operation. If the original
   944  	// method returns no data on success, such as `Delete`, the response is
   945  	// `google.protobuf.Empty`. If the original method is standard
   946  	// `Get`/`Create`/`Update`, the response should be the resource. For other
   947  	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
   948  	// original method name. For example, if the original method name is
   949  	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
   950  	Response googleapi.RawMessage `json:"response,omitempty"`
   951  
   952  	// ServerResponse contains the HTTP response code and headers from the server.
   953  	googleapi.ServerResponse `json:"-"`
   954  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
   955  	// include in API requests. By default, fields with empty or default values are
   956  	// omitted from API requests. See
   957  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   958  	// details.
   959  	ForceSendFields []string `json:"-"`
   960  	// NullFields is a list of field names (e.g. "Done") to include in API requests
   961  	// with the JSON null value. By default, fields with empty values are omitted
   962  	// from API requests. See
   963  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   964  	NullFields []string `json:"-"`
   965  }
   966  
   967  func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
   968  	type NoMethod GoogleLongrunningOperation
   969  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   970  }
   971  
   972  // Status: The `Status` type defines a logical error model that is suitable for
   973  // different programming environments, including REST APIs and RPC APIs. It is
   974  // used by gRPC (https://github.com/grpc). Each `Status` message contains three
   975  // pieces of data: error code, error message, and error details. You can find
   976  // out more about this error model and how to work with it in the API Design
   977  // Guide (https://cloud.google.com/apis/design/errors).
   978  type Status struct {
   979  	// Code: The status code, which should be an enum value of google.rpc.Code.
   980  	Code int64 `json:"code,omitempty"`
   981  	// Details: A list of messages that carry the error details. There is a common
   982  	// set of message types for APIs to use.
   983  	Details []googleapi.RawMessage `json:"details,omitempty"`
   984  	// Message: A developer-facing error message, which should be in English. Any
   985  	// user-facing error message should be localized and sent in the
   986  	// google.rpc.Status.details field, or localized by the client.
   987  	Message string `json:"message,omitempty"`
   988  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
   989  	// include in API requests. By default, fields with empty or default values are
   990  	// omitted from API requests. See
   991  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   992  	// details.
   993  	ForceSendFields []string `json:"-"`
   994  	// NullFields is a list of field names (e.g. "Code") to include in API requests
   995  	// with the JSON null value. By default, fields with empty values are omitted
   996  	// from API requests. See
   997  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   998  	NullFields []string `json:"-"`
   999  }
  1000  
  1001  func (s *Status) MarshalJSON() ([]byte, error) {
  1002  	type NoMethod Status
  1003  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1004  }
  1005  
  1006  type ProjectsDatabasesExportDocumentsCall struct {
  1007  	s                                                 *Service
  1008  	name                                              string
  1009  	googlefirestoreadminv1beta2exportdocumentsrequest *GoogleFirestoreAdminV1beta2ExportDocumentsRequest
  1010  	urlParams_                                        gensupport.URLParams
  1011  	ctx_                                              context.Context
  1012  	header_                                           http.Header
  1013  }
  1014  
  1015  // ExportDocuments: Exports a copy of all or a subset of documents from Google
  1016  // Cloud Firestore to another storage system, such as Google Cloud Storage.
  1017  // Recent updates to documents may not be reflected in the export. The export
  1018  // occurs in the background and its progress can be monitored and managed via
  1019  // the Operation resource that is created. The output of an export may only be
  1020  // used once the associated operation is done. If an export operation is
  1021  // cancelled before completion it may leave partial data behind in Google Cloud
  1022  // Storage.
  1023  //
  1024  //   - name: Database to export. Should be of the form:
  1025  //     `projects/{project_id}/databases/{database_id}`.
  1026  func (r *ProjectsDatabasesService) ExportDocuments(name string, googlefirestoreadminv1beta2exportdocumentsrequest *GoogleFirestoreAdminV1beta2ExportDocumentsRequest) *ProjectsDatabasesExportDocumentsCall {
  1027  	c := &ProjectsDatabasesExportDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1028  	c.name = name
  1029  	c.googlefirestoreadminv1beta2exportdocumentsrequest = googlefirestoreadminv1beta2exportdocumentsrequest
  1030  	return c
  1031  }
  1032  
  1033  // Fields allows partial responses to be retrieved. See
  1034  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1035  // details.
  1036  func (c *ProjectsDatabasesExportDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesExportDocumentsCall {
  1037  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1038  	return c
  1039  }
  1040  
  1041  // Context sets the context to be used in this call's Do method.
  1042  func (c *ProjectsDatabasesExportDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesExportDocumentsCall {
  1043  	c.ctx_ = ctx
  1044  	return c
  1045  }
  1046  
  1047  // Header returns a http.Header that can be modified by the caller to add
  1048  // headers to the request.
  1049  func (c *ProjectsDatabasesExportDocumentsCall) Header() http.Header {
  1050  	if c.header_ == nil {
  1051  		c.header_ = make(http.Header)
  1052  	}
  1053  	return c.header_
  1054  }
  1055  
  1056  func (c *ProjectsDatabasesExportDocumentsCall) doRequest(alt string) (*http.Response, error) {
  1057  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1058  	var body io.Reader = nil
  1059  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2exportdocumentsrequest)
  1060  	if err != nil {
  1061  		return nil, err
  1062  	}
  1063  	c.urlParams_.Set("alt", alt)
  1064  	c.urlParams_.Set("prettyPrint", "false")
  1065  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:exportDocuments")
  1066  	urls += "?" + c.urlParams_.Encode()
  1067  	req, err := http.NewRequest("POST", urls, body)
  1068  	if err != nil {
  1069  		return nil, err
  1070  	}
  1071  	req.Header = reqHeaders
  1072  	googleapi.Expand(req.URL, map[string]string{
  1073  		"name": c.name,
  1074  	})
  1075  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1076  }
  1077  
  1078  // Do executes the "firestore.projects.databases.exportDocuments" call.
  1079  // Any non-2xx status code is an error. Response headers are in either
  1080  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  1081  // returned at all) in error.(*googleapi.Error).Header. Use
  1082  // googleapi.IsNotModified to check whether the returned error was because
  1083  // http.StatusNotModified was returned.
  1084  func (c *ProjectsDatabasesExportDocumentsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1085  	gensupport.SetOptions(c.urlParams_, opts...)
  1086  	res, err := c.doRequest("json")
  1087  	if res != nil && res.StatusCode == http.StatusNotModified {
  1088  		if res.Body != nil {
  1089  			res.Body.Close()
  1090  		}
  1091  		return nil, gensupport.WrapError(&googleapi.Error{
  1092  			Code:   res.StatusCode,
  1093  			Header: res.Header,
  1094  		})
  1095  	}
  1096  	if err != nil {
  1097  		return nil, err
  1098  	}
  1099  	defer googleapi.CloseBody(res)
  1100  	if err := googleapi.CheckResponse(res); err != nil {
  1101  		return nil, gensupport.WrapError(err)
  1102  	}
  1103  	ret := &GoogleLongrunningOperation{
  1104  		ServerResponse: googleapi.ServerResponse{
  1105  			Header:         res.Header,
  1106  			HTTPStatusCode: res.StatusCode,
  1107  		},
  1108  	}
  1109  	target := &ret
  1110  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1111  		return nil, err
  1112  	}
  1113  	return ret, nil
  1114  }
  1115  
  1116  type ProjectsDatabasesImportDocumentsCall struct {
  1117  	s                                                 *Service
  1118  	name                                              string
  1119  	googlefirestoreadminv1beta2importdocumentsrequest *GoogleFirestoreAdminV1beta2ImportDocumentsRequest
  1120  	urlParams_                                        gensupport.URLParams
  1121  	ctx_                                              context.Context
  1122  	header_                                           http.Header
  1123  }
  1124  
  1125  // ImportDocuments: Imports documents into Google Cloud Firestore. Existing
  1126  // documents with the same name are overwritten. The import occurs in the
  1127  // background and its progress can be monitored and managed via the Operation
  1128  // resource that is created. If an ImportDocuments operation is cancelled, it
  1129  // is possible that a subset of the data has already been imported to Cloud
  1130  // Firestore.
  1131  //
  1132  //   - name: Database to import into. Should be of the form:
  1133  //     `projects/{project_id}/databases/{database_id}`.
  1134  func (r *ProjectsDatabasesService) ImportDocuments(name string, googlefirestoreadminv1beta2importdocumentsrequest *GoogleFirestoreAdminV1beta2ImportDocumentsRequest) *ProjectsDatabasesImportDocumentsCall {
  1135  	c := &ProjectsDatabasesImportDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1136  	c.name = name
  1137  	c.googlefirestoreadminv1beta2importdocumentsrequest = googlefirestoreadminv1beta2importdocumentsrequest
  1138  	return c
  1139  }
  1140  
  1141  // Fields allows partial responses to be retrieved. See
  1142  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1143  // details.
  1144  func (c *ProjectsDatabasesImportDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesImportDocumentsCall {
  1145  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1146  	return c
  1147  }
  1148  
  1149  // Context sets the context to be used in this call's Do method.
  1150  func (c *ProjectsDatabasesImportDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesImportDocumentsCall {
  1151  	c.ctx_ = ctx
  1152  	return c
  1153  }
  1154  
  1155  // Header returns a http.Header that can be modified by the caller to add
  1156  // headers to the request.
  1157  func (c *ProjectsDatabasesImportDocumentsCall) Header() http.Header {
  1158  	if c.header_ == nil {
  1159  		c.header_ = make(http.Header)
  1160  	}
  1161  	return c.header_
  1162  }
  1163  
  1164  func (c *ProjectsDatabasesImportDocumentsCall) doRequest(alt string) (*http.Response, error) {
  1165  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1166  	var body io.Reader = nil
  1167  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2importdocumentsrequest)
  1168  	if err != nil {
  1169  		return nil, err
  1170  	}
  1171  	c.urlParams_.Set("alt", alt)
  1172  	c.urlParams_.Set("prettyPrint", "false")
  1173  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:importDocuments")
  1174  	urls += "?" + c.urlParams_.Encode()
  1175  	req, err := http.NewRequest("POST", urls, body)
  1176  	if err != nil {
  1177  		return nil, err
  1178  	}
  1179  	req.Header = reqHeaders
  1180  	googleapi.Expand(req.URL, map[string]string{
  1181  		"name": c.name,
  1182  	})
  1183  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1184  }
  1185  
  1186  // Do executes the "firestore.projects.databases.importDocuments" call.
  1187  // Any non-2xx status code is an error. Response headers are in either
  1188  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  1189  // returned at all) in error.(*googleapi.Error).Header. Use
  1190  // googleapi.IsNotModified to check whether the returned error was because
  1191  // http.StatusNotModified was returned.
  1192  func (c *ProjectsDatabasesImportDocumentsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1193  	gensupport.SetOptions(c.urlParams_, opts...)
  1194  	res, err := c.doRequest("json")
  1195  	if res != nil && res.StatusCode == http.StatusNotModified {
  1196  		if res.Body != nil {
  1197  			res.Body.Close()
  1198  		}
  1199  		return nil, gensupport.WrapError(&googleapi.Error{
  1200  			Code:   res.StatusCode,
  1201  			Header: res.Header,
  1202  		})
  1203  	}
  1204  	if err != nil {
  1205  		return nil, err
  1206  	}
  1207  	defer googleapi.CloseBody(res)
  1208  	if err := googleapi.CheckResponse(res); err != nil {
  1209  		return nil, gensupport.WrapError(err)
  1210  	}
  1211  	ret := &GoogleLongrunningOperation{
  1212  		ServerResponse: googleapi.ServerResponse{
  1213  			Header:         res.Header,
  1214  			HTTPStatusCode: res.StatusCode,
  1215  		},
  1216  	}
  1217  	target := &ret
  1218  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1219  		return nil, err
  1220  	}
  1221  	return ret, nil
  1222  }
  1223  
  1224  type ProjectsDatabasesCollectionGroupsFieldsGetCall struct {
  1225  	s            *Service
  1226  	name         string
  1227  	urlParams_   gensupport.URLParams
  1228  	ifNoneMatch_ string
  1229  	ctx_         context.Context
  1230  	header_      http.Header
  1231  }
  1232  
  1233  // Get: Gets the metadata and configuration for a Field.
  1234  //
  1235  //   - name: A name of the form
  1236  //     `projects/{project_id}/databases/{database_id}/collectionGroups/{collection
  1237  //     _id}/fields/{field_id}`.
  1238  func (r *ProjectsDatabasesCollectionGroupsFieldsService) Get(name string) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  1239  	c := &ProjectsDatabasesCollectionGroupsFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1240  	c.name = name
  1241  	return c
  1242  }
  1243  
  1244  // Fields allows partial responses to be retrieved. See
  1245  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1246  // details.
  1247  func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  1248  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1249  	return c
  1250  }
  1251  
  1252  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1253  // object's ETag matches the given value. This is useful for getting updates
  1254  // only after the object has changed since the last request.
  1255  func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  1256  	c.ifNoneMatch_ = entityTag
  1257  	return c
  1258  }
  1259  
  1260  // Context sets the context to be used in this call's Do method.
  1261  func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  1262  	c.ctx_ = ctx
  1263  	return c
  1264  }
  1265  
  1266  // Header returns a http.Header that can be modified by the caller to add
  1267  // headers to the request.
  1268  func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Header() http.Header {
  1269  	if c.header_ == nil {
  1270  		c.header_ = make(http.Header)
  1271  	}
  1272  	return c.header_
  1273  }
  1274  
  1275  func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  1276  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1277  	if c.ifNoneMatch_ != "" {
  1278  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1279  	}
  1280  	var body io.Reader = nil
  1281  	c.urlParams_.Set("alt", alt)
  1282  	c.urlParams_.Set("prettyPrint", "false")
  1283  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  1284  	urls += "?" + c.urlParams_.Encode()
  1285  	req, err := http.NewRequest("GET", urls, body)
  1286  	if err != nil {
  1287  		return nil, err
  1288  	}
  1289  	req.Header = reqHeaders
  1290  	googleapi.Expand(req.URL, map[string]string{
  1291  		"name": c.name,
  1292  	})
  1293  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1294  }
  1295  
  1296  // Do executes the "firestore.projects.databases.collectionGroups.fields.get" call.
  1297  // Any non-2xx status code is an error. Response headers are in either
  1298  // *GoogleFirestoreAdminV1beta2Field.ServerResponse.Header or (if a response
  1299  // was returned at all) in error.(*googleapi.Error).Header. Use
  1300  // googleapi.IsNotModified to check whether the returned error was because
  1301  // http.StatusNotModified was returned.
  1302  func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta2Field, error) {
  1303  	gensupport.SetOptions(c.urlParams_, opts...)
  1304  	res, err := c.doRequest("json")
  1305  	if res != nil && res.StatusCode == http.StatusNotModified {
  1306  		if res.Body != nil {
  1307  			res.Body.Close()
  1308  		}
  1309  		return nil, gensupport.WrapError(&googleapi.Error{
  1310  			Code:   res.StatusCode,
  1311  			Header: res.Header,
  1312  		})
  1313  	}
  1314  	if err != nil {
  1315  		return nil, err
  1316  	}
  1317  	defer googleapi.CloseBody(res)
  1318  	if err := googleapi.CheckResponse(res); err != nil {
  1319  		return nil, gensupport.WrapError(err)
  1320  	}
  1321  	ret := &GoogleFirestoreAdminV1beta2Field{
  1322  		ServerResponse: googleapi.ServerResponse{
  1323  			Header:         res.Header,
  1324  			HTTPStatusCode: res.StatusCode,
  1325  		},
  1326  	}
  1327  	target := &ret
  1328  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1329  		return nil, err
  1330  	}
  1331  	return ret, nil
  1332  }
  1333  
  1334  type ProjectsDatabasesCollectionGroupsFieldsListCall struct {
  1335  	s            *Service
  1336  	parent       string
  1337  	urlParams_   gensupport.URLParams
  1338  	ifNoneMatch_ string
  1339  	ctx_         context.Context
  1340  	header_      http.Header
  1341  }
  1342  
  1343  // List: Lists the field configuration and metadata for this database.
  1344  // Currently, FirestoreAdmin.ListFields only supports listing fields that have
  1345  // been explicitly overridden. To issue this query, call
  1346  // FirestoreAdmin.ListFields with the filter set to
  1347  // `indexConfig.usesAncestorConfig:false`.
  1348  //
  1349  //   - parent: A parent name of the form
  1350  //     `projects/{project_id}/databases/{database_id}/collectionGroups/{collection
  1351  //     _id}`.
  1352  func (r *ProjectsDatabasesCollectionGroupsFieldsService) List(parent string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1353  	c := &ProjectsDatabasesCollectionGroupsFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1354  	c.parent = parent
  1355  	return c
  1356  }
  1357  
  1358  // Filter sets the optional parameter "filter": The filter to apply to list
  1359  // results. Currently, FirestoreAdmin.ListFields only supports listing fields
  1360  // that have been explicitly overridden. To issue this query, call
  1361  // FirestoreAdmin.ListFields with the filter set to
  1362  // `indexConfig.usesAncestorConfig:false`.
  1363  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Filter(filter string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1364  	c.urlParams_.Set("filter", filter)
  1365  	return c
  1366  }
  1367  
  1368  // PageSize sets the optional parameter "pageSize": The number of results to
  1369  // return.
  1370  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) PageSize(pageSize int64) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1371  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1372  	return c
  1373  }
  1374  
  1375  // PageToken sets the optional parameter "pageToken": A page token, returned
  1376  // from a previous call to FirestoreAdmin.ListFields, that may be used to get
  1377  // the next page of results.
  1378  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) PageToken(pageToken string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1379  	c.urlParams_.Set("pageToken", pageToken)
  1380  	return c
  1381  }
  1382  
  1383  // Fields allows partial responses to be retrieved. See
  1384  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1385  // details.
  1386  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1387  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1388  	return c
  1389  }
  1390  
  1391  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1392  // object's ETag matches the given value. This is useful for getting updates
  1393  // only after the object has changed since the last request.
  1394  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1395  	c.ifNoneMatch_ = entityTag
  1396  	return c
  1397  }
  1398  
  1399  // Context sets the context to be used in this call's Do method.
  1400  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1401  	c.ctx_ = ctx
  1402  	return c
  1403  }
  1404  
  1405  // Header returns a http.Header that can be modified by the caller to add
  1406  // headers to the request.
  1407  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Header() http.Header {
  1408  	if c.header_ == nil {
  1409  		c.header_ = make(http.Header)
  1410  	}
  1411  	return c.header_
  1412  }
  1413  
  1414  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) doRequest(alt string) (*http.Response, error) {
  1415  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1416  	if c.ifNoneMatch_ != "" {
  1417  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1418  	}
  1419  	var body io.Reader = nil
  1420  	c.urlParams_.Set("alt", alt)
  1421  	c.urlParams_.Set("prettyPrint", "false")
  1422  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/fields")
  1423  	urls += "?" + c.urlParams_.Encode()
  1424  	req, err := http.NewRequest("GET", urls, body)
  1425  	if err != nil {
  1426  		return nil, err
  1427  	}
  1428  	req.Header = reqHeaders
  1429  	googleapi.Expand(req.URL, map[string]string{
  1430  		"parent": c.parent,
  1431  	})
  1432  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1433  }
  1434  
  1435  // Do executes the "firestore.projects.databases.collectionGroups.fields.list" call.
  1436  // Any non-2xx status code is an error. Response headers are in either
  1437  // *GoogleFirestoreAdminV1beta2ListFieldsResponse.ServerResponse.Header or (if
  1438  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  1439  // googleapi.IsNotModified to check whether the returned error was because
  1440  // http.StatusNotModified was returned.
  1441  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta2ListFieldsResponse, error) {
  1442  	gensupport.SetOptions(c.urlParams_, opts...)
  1443  	res, err := c.doRequest("json")
  1444  	if res != nil && res.StatusCode == http.StatusNotModified {
  1445  		if res.Body != nil {
  1446  			res.Body.Close()
  1447  		}
  1448  		return nil, gensupport.WrapError(&googleapi.Error{
  1449  			Code:   res.StatusCode,
  1450  			Header: res.Header,
  1451  		})
  1452  	}
  1453  	if err != nil {
  1454  		return nil, err
  1455  	}
  1456  	defer googleapi.CloseBody(res)
  1457  	if err := googleapi.CheckResponse(res); err != nil {
  1458  		return nil, gensupport.WrapError(err)
  1459  	}
  1460  	ret := &GoogleFirestoreAdminV1beta2ListFieldsResponse{
  1461  		ServerResponse: googleapi.ServerResponse{
  1462  			Header:         res.Header,
  1463  			HTTPStatusCode: res.StatusCode,
  1464  		},
  1465  	}
  1466  	target := &ret
  1467  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1468  		return nil, err
  1469  	}
  1470  	return ret, nil
  1471  }
  1472  
  1473  // Pages invokes f for each page of results.
  1474  // A non-nil error returned from f will halt the iteration.
  1475  // The provided context supersedes any context provided to the Context method.
  1476  func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Pages(ctx context.Context, f func(*GoogleFirestoreAdminV1beta2ListFieldsResponse) error) error {
  1477  	c.ctx_ = ctx
  1478  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1479  	for {
  1480  		x, err := c.Do()
  1481  		if err != nil {
  1482  			return err
  1483  		}
  1484  		if err := f(x); err != nil {
  1485  			return err
  1486  		}
  1487  		if x.NextPageToken == "" {
  1488  			return nil
  1489  		}
  1490  		c.PageToken(x.NextPageToken)
  1491  	}
  1492  }
  1493  
  1494  type ProjectsDatabasesCollectionGroupsFieldsPatchCall struct {
  1495  	s                                *Service
  1496  	name                             string
  1497  	googlefirestoreadminv1beta2field *GoogleFirestoreAdminV1beta2Field
  1498  	urlParams_                       gensupport.URLParams
  1499  	ctx_                             context.Context
  1500  	header_                          http.Header
  1501  }
  1502  
  1503  // Patch: Updates a field configuration. Currently, field updates apply only to
  1504  // single field index configuration. However, calls to
  1505  // FirestoreAdmin.UpdateField should provide a field mask to avoid changing any
  1506  // configuration that the caller isn't aware of. The field mask should be
  1507  // specified as: `{ paths: "index_config" }`. This call returns a
  1508  // google.longrunning.Operation which may be used to track the status of the
  1509  // field update. The metadata for the operation will be the type
  1510  // FieldOperationMetadata. To configure the default field settings for the
  1511  // database, use the special `Field` with resource name:
  1512  // `projects/{project_id}/databases/{database_id}/collectionGroups/__default__/f
  1513  // ields/*`.
  1514  //
  1515  //   - name: A field name of the form
  1516  //     `projects/{project_id}/databases/{database_id}/collectionGroups/{collection
  1517  //     _id}/fields/{field_path}` A field path may be a simple field name, e.g.
  1518  //     `address` or a path to fields within map_value , e.g. `address.city`, or a
  1519  //     special field path. The only valid special field is `*`, which represents
  1520  //     any field. Field paths may be quoted using ` (backtick). The only
  1521  //     character that needs to be escaped within a quoted field path is the
  1522  //     backtick character itself, escaped using a backslash. Special characters
  1523  //     in field paths that must be quoted include: `*`, `.`, ``` (backtick), `[`,
  1524  //     `]`, as well as any ascii symbolic characters. Examples: (Note: Comments
  1525  //     here are written in markdown syntax, so there is an additional layer of
  1526  //     backticks to represent a code block) `\`address.city\“ represents a field
  1527  //     named `address.city`, not the map key `city` in the field `address`.
  1528  //     `\`*\“ represents a field named `*`, not any field. A special `Field`
  1529  //     contains the default indexing settings for all fields. This field's
  1530  //     resource name is:
  1531  //     `projects/{project_id}/databases/{database_id}/collectionGroups/__default__
  1532  //     /fields/*` Indexes defined on this `Field` will be applied to all fields
  1533  //     which do not have their own `Field` index configuration.
  1534  func (r *ProjectsDatabasesCollectionGroupsFieldsService) Patch(name string, googlefirestoreadminv1beta2field *GoogleFirestoreAdminV1beta2Field) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  1535  	c := &ProjectsDatabasesCollectionGroupsFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1536  	c.name = name
  1537  	c.googlefirestoreadminv1beta2field = googlefirestoreadminv1beta2field
  1538  	return c
  1539  }
  1540  
  1541  // UpdateMask sets the optional parameter "updateMask": A mask, relative to the
  1542  // field. If specified, only configuration specified by this field_mask will be
  1543  // updated in the field.
  1544  func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) UpdateMask(updateMask string) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  1545  	c.urlParams_.Set("updateMask", updateMask)
  1546  	return c
  1547  }
  1548  
  1549  // Fields allows partial responses to be retrieved. See
  1550  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1551  // details.
  1552  func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  1553  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1554  	return c
  1555  }
  1556  
  1557  // Context sets the context to be used in this call's Do method.
  1558  func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  1559  	c.ctx_ = ctx
  1560  	return c
  1561  }
  1562  
  1563  // Header returns a http.Header that can be modified by the caller to add
  1564  // headers to the request.
  1565  func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Header() http.Header {
  1566  	if c.header_ == nil {
  1567  		c.header_ = make(http.Header)
  1568  	}
  1569  	return c.header_
  1570  }
  1571  
  1572  func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  1573  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1574  	var body io.Reader = nil
  1575  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2field)
  1576  	if err != nil {
  1577  		return nil, err
  1578  	}
  1579  	c.urlParams_.Set("alt", alt)
  1580  	c.urlParams_.Set("prettyPrint", "false")
  1581  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  1582  	urls += "?" + c.urlParams_.Encode()
  1583  	req, err := http.NewRequest("PATCH", urls, body)
  1584  	if err != nil {
  1585  		return nil, err
  1586  	}
  1587  	req.Header = reqHeaders
  1588  	googleapi.Expand(req.URL, map[string]string{
  1589  		"name": c.name,
  1590  	})
  1591  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1592  }
  1593  
  1594  // Do executes the "firestore.projects.databases.collectionGroups.fields.patch" call.
  1595  // Any non-2xx status code is an error. Response headers are in either
  1596  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  1597  // returned at all) in error.(*googleapi.Error).Header. Use
  1598  // googleapi.IsNotModified to check whether the returned error was because
  1599  // http.StatusNotModified was returned.
  1600  func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1601  	gensupport.SetOptions(c.urlParams_, opts...)
  1602  	res, err := c.doRequest("json")
  1603  	if res != nil && res.StatusCode == http.StatusNotModified {
  1604  		if res.Body != nil {
  1605  			res.Body.Close()
  1606  		}
  1607  		return nil, gensupport.WrapError(&googleapi.Error{
  1608  			Code:   res.StatusCode,
  1609  			Header: res.Header,
  1610  		})
  1611  	}
  1612  	if err != nil {
  1613  		return nil, err
  1614  	}
  1615  	defer googleapi.CloseBody(res)
  1616  	if err := googleapi.CheckResponse(res); err != nil {
  1617  		return nil, gensupport.WrapError(err)
  1618  	}
  1619  	ret := &GoogleLongrunningOperation{
  1620  		ServerResponse: googleapi.ServerResponse{
  1621  			Header:         res.Header,
  1622  			HTTPStatusCode: res.StatusCode,
  1623  		},
  1624  	}
  1625  	target := &ret
  1626  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1627  		return nil, err
  1628  	}
  1629  	return ret, nil
  1630  }
  1631  
  1632  type ProjectsDatabasesCollectionGroupsIndexesCreateCall struct {
  1633  	s                                *Service
  1634  	parent                           string
  1635  	googlefirestoreadminv1beta2index *GoogleFirestoreAdminV1beta2Index
  1636  	urlParams_                       gensupport.URLParams
  1637  	ctx_                             context.Context
  1638  	header_                          http.Header
  1639  }
  1640  
  1641  // Create: Creates a composite index. This returns a
  1642  // google.longrunning.Operation which may be used to track the status of the
  1643  // creation. The metadata for the operation will be the type
  1644  // IndexOperationMetadata.
  1645  //
  1646  //   - parent: A parent name of the form
  1647  //     `projects/{project_id}/databases/{database_id}/collectionGroups/{collection
  1648  //     _id}`.
  1649  func (r *ProjectsDatabasesCollectionGroupsIndexesService) Create(parent string, googlefirestoreadminv1beta2index *GoogleFirestoreAdminV1beta2Index) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  1650  	c := &ProjectsDatabasesCollectionGroupsIndexesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1651  	c.parent = parent
  1652  	c.googlefirestoreadminv1beta2index = googlefirestoreadminv1beta2index
  1653  	return c
  1654  }
  1655  
  1656  // Fields allows partial responses to be retrieved. See
  1657  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1658  // details.
  1659  func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  1660  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1661  	return c
  1662  }
  1663  
  1664  // Context sets the context to be used in this call's Do method.
  1665  func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  1666  	c.ctx_ = ctx
  1667  	return c
  1668  }
  1669  
  1670  // Header returns a http.Header that can be modified by the caller to add
  1671  // headers to the request.
  1672  func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Header() http.Header {
  1673  	if c.header_ == nil {
  1674  		c.header_ = make(http.Header)
  1675  	}
  1676  	return c.header_
  1677  }
  1678  
  1679  func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) doRequest(alt string) (*http.Response, error) {
  1680  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1681  	var body io.Reader = nil
  1682  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2index)
  1683  	if err != nil {
  1684  		return nil, err
  1685  	}
  1686  	c.urlParams_.Set("alt", alt)
  1687  	c.urlParams_.Set("prettyPrint", "false")
  1688  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/indexes")
  1689  	urls += "?" + c.urlParams_.Encode()
  1690  	req, err := http.NewRequest("POST", urls, body)
  1691  	if err != nil {
  1692  		return nil, err
  1693  	}
  1694  	req.Header = reqHeaders
  1695  	googleapi.Expand(req.URL, map[string]string{
  1696  		"parent": c.parent,
  1697  	})
  1698  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1699  }
  1700  
  1701  // Do executes the "firestore.projects.databases.collectionGroups.indexes.create" call.
  1702  // Any non-2xx status code is an error. Response headers are in either
  1703  // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was
  1704  // returned at all) in error.(*googleapi.Error).Header. Use
  1705  // googleapi.IsNotModified to check whether the returned error was because
  1706  // http.StatusNotModified was returned.
  1707  func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1708  	gensupport.SetOptions(c.urlParams_, opts...)
  1709  	res, err := c.doRequest("json")
  1710  	if res != nil && res.StatusCode == http.StatusNotModified {
  1711  		if res.Body != nil {
  1712  			res.Body.Close()
  1713  		}
  1714  		return nil, gensupport.WrapError(&googleapi.Error{
  1715  			Code:   res.StatusCode,
  1716  			Header: res.Header,
  1717  		})
  1718  	}
  1719  	if err != nil {
  1720  		return nil, err
  1721  	}
  1722  	defer googleapi.CloseBody(res)
  1723  	if err := googleapi.CheckResponse(res); err != nil {
  1724  		return nil, gensupport.WrapError(err)
  1725  	}
  1726  	ret := &GoogleLongrunningOperation{
  1727  		ServerResponse: googleapi.ServerResponse{
  1728  			Header:         res.Header,
  1729  			HTTPStatusCode: res.StatusCode,
  1730  		},
  1731  	}
  1732  	target := &ret
  1733  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1734  		return nil, err
  1735  	}
  1736  	return ret, nil
  1737  }
  1738  
  1739  type ProjectsDatabasesCollectionGroupsIndexesDeleteCall struct {
  1740  	s          *Service
  1741  	name       string
  1742  	urlParams_ gensupport.URLParams
  1743  	ctx_       context.Context
  1744  	header_    http.Header
  1745  }
  1746  
  1747  // Delete: Deletes a composite index.
  1748  //
  1749  //   - name: A name of the form
  1750  //     `projects/{project_id}/databases/{database_id}/collectionGroups/{collection
  1751  //     _id}/indexes/{index_id}`.
  1752  func (r *ProjectsDatabasesCollectionGroupsIndexesService) Delete(name string) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  1753  	c := &ProjectsDatabasesCollectionGroupsIndexesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1754  	c.name = name
  1755  	return c
  1756  }
  1757  
  1758  // Fields allows partial responses to be retrieved. See
  1759  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1760  // details.
  1761  func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  1762  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1763  	return c
  1764  }
  1765  
  1766  // Context sets the context to be used in this call's Do method.
  1767  func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  1768  	c.ctx_ = ctx
  1769  	return c
  1770  }
  1771  
  1772  // Header returns a http.Header that can be modified by the caller to add
  1773  // headers to the request.
  1774  func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Header() http.Header {
  1775  	if c.header_ == nil {
  1776  		c.header_ = make(http.Header)
  1777  	}
  1778  	return c.header_
  1779  }
  1780  
  1781  func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) doRequest(alt string) (*http.Response, error) {
  1782  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1783  	var body io.Reader = nil
  1784  	c.urlParams_.Set("alt", alt)
  1785  	c.urlParams_.Set("prettyPrint", "false")
  1786  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  1787  	urls += "?" + c.urlParams_.Encode()
  1788  	req, err := http.NewRequest("DELETE", urls, body)
  1789  	if err != nil {
  1790  		return nil, err
  1791  	}
  1792  	req.Header = reqHeaders
  1793  	googleapi.Expand(req.URL, map[string]string{
  1794  		"name": c.name,
  1795  	})
  1796  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1797  }
  1798  
  1799  // Do executes the "firestore.projects.databases.collectionGroups.indexes.delete" call.
  1800  // Any non-2xx status code is an error. Response headers are in either
  1801  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  1802  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1803  // whether the returned error was because http.StatusNotModified was returned.
  1804  func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1805  	gensupport.SetOptions(c.urlParams_, opts...)
  1806  	res, err := c.doRequest("json")
  1807  	if res != nil && res.StatusCode == http.StatusNotModified {
  1808  		if res.Body != nil {
  1809  			res.Body.Close()
  1810  		}
  1811  		return nil, gensupport.WrapError(&googleapi.Error{
  1812  			Code:   res.StatusCode,
  1813  			Header: res.Header,
  1814  		})
  1815  	}
  1816  	if err != nil {
  1817  		return nil, err
  1818  	}
  1819  	defer googleapi.CloseBody(res)
  1820  	if err := googleapi.CheckResponse(res); err != nil {
  1821  		return nil, gensupport.WrapError(err)
  1822  	}
  1823  	ret := &Empty{
  1824  		ServerResponse: googleapi.ServerResponse{
  1825  			Header:         res.Header,
  1826  			HTTPStatusCode: res.StatusCode,
  1827  		},
  1828  	}
  1829  	target := &ret
  1830  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1831  		return nil, err
  1832  	}
  1833  	return ret, nil
  1834  }
  1835  
  1836  type ProjectsDatabasesCollectionGroupsIndexesGetCall struct {
  1837  	s            *Service
  1838  	name         string
  1839  	urlParams_   gensupport.URLParams
  1840  	ifNoneMatch_ string
  1841  	ctx_         context.Context
  1842  	header_      http.Header
  1843  }
  1844  
  1845  // Get: Gets a composite index.
  1846  //
  1847  //   - name: A name of the form
  1848  //     `projects/{project_id}/databases/{database_id}/collectionGroups/{collection
  1849  //     _id}/indexes/{index_id}`.
  1850  func (r *ProjectsDatabasesCollectionGroupsIndexesService) Get(name string) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  1851  	c := &ProjectsDatabasesCollectionGroupsIndexesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1852  	c.name = name
  1853  	return c
  1854  }
  1855  
  1856  // Fields allows partial responses to be retrieved. See
  1857  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1858  // details.
  1859  func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  1860  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1861  	return c
  1862  }
  1863  
  1864  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1865  // object's ETag matches the given value. This is useful for getting updates
  1866  // only after the object has changed since the last request.
  1867  func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  1868  	c.ifNoneMatch_ = entityTag
  1869  	return c
  1870  }
  1871  
  1872  // Context sets the context to be used in this call's Do method.
  1873  func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  1874  	c.ctx_ = ctx
  1875  	return c
  1876  }
  1877  
  1878  // Header returns a http.Header that can be modified by the caller to add
  1879  // headers to the request.
  1880  func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Header() http.Header {
  1881  	if c.header_ == nil {
  1882  		c.header_ = make(http.Header)
  1883  	}
  1884  	return c.header_
  1885  }
  1886  
  1887  func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) doRequest(alt string) (*http.Response, error) {
  1888  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1889  	if c.ifNoneMatch_ != "" {
  1890  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1891  	}
  1892  	var body io.Reader = nil
  1893  	c.urlParams_.Set("alt", alt)
  1894  	c.urlParams_.Set("prettyPrint", "false")
  1895  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  1896  	urls += "?" + c.urlParams_.Encode()
  1897  	req, err := http.NewRequest("GET", urls, body)
  1898  	if err != nil {
  1899  		return nil, err
  1900  	}
  1901  	req.Header = reqHeaders
  1902  	googleapi.Expand(req.URL, map[string]string{
  1903  		"name": c.name,
  1904  	})
  1905  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1906  }
  1907  
  1908  // Do executes the "firestore.projects.databases.collectionGroups.indexes.get" call.
  1909  // Any non-2xx status code is an error. Response headers are in either
  1910  // *GoogleFirestoreAdminV1beta2Index.ServerResponse.Header or (if a response
  1911  // was returned at all) in error.(*googleapi.Error).Header. Use
  1912  // googleapi.IsNotModified to check whether the returned error was because
  1913  // http.StatusNotModified was returned.
  1914  func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta2Index, error) {
  1915  	gensupport.SetOptions(c.urlParams_, opts...)
  1916  	res, err := c.doRequest("json")
  1917  	if res != nil && res.StatusCode == http.StatusNotModified {
  1918  		if res.Body != nil {
  1919  			res.Body.Close()
  1920  		}
  1921  		return nil, gensupport.WrapError(&googleapi.Error{
  1922  			Code:   res.StatusCode,
  1923  			Header: res.Header,
  1924  		})
  1925  	}
  1926  	if err != nil {
  1927  		return nil, err
  1928  	}
  1929  	defer googleapi.CloseBody(res)
  1930  	if err := googleapi.CheckResponse(res); err != nil {
  1931  		return nil, gensupport.WrapError(err)
  1932  	}
  1933  	ret := &GoogleFirestoreAdminV1beta2Index{
  1934  		ServerResponse: googleapi.ServerResponse{
  1935  			Header:         res.Header,
  1936  			HTTPStatusCode: res.StatusCode,
  1937  		},
  1938  	}
  1939  	target := &ret
  1940  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1941  		return nil, err
  1942  	}
  1943  	return ret, nil
  1944  }
  1945  
  1946  type ProjectsDatabasesCollectionGroupsIndexesListCall struct {
  1947  	s            *Service
  1948  	parent       string
  1949  	urlParams_   gensupport.URLParams
  1950  	ifNoneMatch_ string
  1951  	ctx_         context.Context
  1952  	header_      http.Header
  1953  }
  1954  
  1955  // List: Lists composite indexes.
  1956  //
  1957  //   - parent: A parent name of the form
  1958  //     `projects/{project_id}/databases/{database_id}/collectionGroups/{collection
  1959  //     _id}`.
  1960  func (r *ProjectsDatabasesCollectionGroupsIndexesService) List(parent string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  1961  	c := &ProjectsDatabasesCollectionGroupsIndexesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1962  	c.parent = parent
  1963  	return c
  1964  }
  1965  
  1966  // Filter sets the optional parameter "filter": The filter to apply to list
  1967  // results.
  1968  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Filter(filter string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  1969  	c.urlParams_.Set("filter", filter)
  1970  	return c
  1971  }
  1972  
  1973  // PageSize sets the optional parameter "pageSize": The number of results to
  1974  // return.
  1975  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) PageSize(pageSize int64) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  1976  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1977  	return c
  1978  }
  1979  
  1980  // PageToken sets the optional parameter "pageToken": A page token, returned
  1981  // from a previous call to FirestoreAdmin.ListIndexes, that may be used to get
  1982  // the next page of results.
  1983  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) PageToken(pageToken string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  1984  	c.urlParams_.Set("pageToken", pageToken)
  1985  	return c
  1986  }
  1987  
  1988  // Fields allows partial responses to be retrieved. See
  1989  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1990  // details.
  1991  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  1992  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1993  	return c
  1994  }
  1995  
  1996  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1997  // object's ETag matches the given value. This is useful for getting updates
  1998  // only after the object has changed since the last request.
  1999  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2000  	c.ifNoneMatch_ = entityTag
  2001  	return c
  2002  }
  2003  
  2004  // Context sets the context to be used in this call's Do method.
  2005  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2006  	c.ctx_ = ctx
  2007  	return c
  2008  }
  2009  
  2010  // Header returns a http.Header that can be modified by the caller to add
  2011  // headers to the request.
  2012  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Header() http.Header {
  2013  	if c.header_ == nil {
  2014  		c.header_ = make(http.Header)
  2015  	}
  2016  	return c.header_
  2017  }
  2018  
  2019  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) doRequest(alt string) (*http.Response, error) {
  2020  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2021  	if c.ifNoneMatch_ != "" {
  2022  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2023  	}
  2024  	var body io.Reader = nil
  2025  	c.urlParams_.Set("alt", alt)
  2026  	c.urlParams_.Set("prettyPrint", "false")
  2027  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/indexes")
  2028  	urls += "?" + c.urlParams_.Encode()
  2029  	req, err := http.NewRequest("GET", urls, body)
  2030  	if err != nil {
  2031  		return nil, err
  2032  	}
  2033  	req.Header = reqHeaders
  2034  	googleapi.Expand(req.URL, map[string]string{
  2035  		"parent": c.parent,
  2036  	})
  2037  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2038  }
  2039  
  2040  // Do executes the "firestore.projects.databases.collectionGroups.indexes.list" call.
  2041  // Any non-2xx status code is an error. Response headers are in either
  2042  // *GoogleFirestoreAdminV1beta2ListIndexesResponse.ServerResponse.Header or (if
  2043  // a response was returned at all) in error.(*googleapi.Error).Header. Use
  2044  // googleapi.IsNotModified to check whether the returned error was because
  2045  // http.StatusNotModified was returned.
  2046  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta2ListIndexesResponse, error) {
  2047  	gensupport.SetOptions(c.urlParams_, opts...)
  2048  	res, err := c.doRequest("json")
  2049  	if res != nil && res.StatusCode == http.StatusNotModified {
  2050  		if res.Body != nil {
  2051  			res.Body.Close()
  2052  		}
  2053  		return nil, gensupport.WrapError(&googleapi.Error{
  2054  			Code:   res.StatusCode,
  2055  			Header: res.Header,
  2056  		})
  2057  	}
  2058  	if err != nil {
  2059  		return nil, err
  2060  	}
  2061  	defer googleapi.CloseBody(res)
  2062  	if err := googleapi.CheckResponse(res); err != nil {
  2063  		return nil, gensupport.WrapError(err)
  2064  	}
  2065  	ret := &GoogleFirestoreAdminV1beta2ListIndexesResponse{
  2066  		ServerResponse: googleapi.ServerResponse{
  2067  			Header:         res.Header,
  2068  			HTTPStatusCode: res.StatusCode,
  2069  		},
  2070  	}
  2071  	target := &ret
  2072  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2073  		return nil, err
  2074  	}
  2075  	return ret, nil
  2076  }
  2077  
  2078  // Pages invokes f for each page of results.
  2079  // A non-nil error returned from f will halt the iteration.
  2080  // The provided context supersedes any context provided to the Context method.
  2081  func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Pages(ctx context.Context, f func(*GoogleFirestoreAdminV1beta2ListIndexesResponse) error) error {
  2082  	c.ctx_ = ctx
  2083  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2084  	for {
  2085  		x, err := c.Do()
  2086  		if err != nil {
  2087  			return err
  2088  		}
  2089  		if err := f(x); err != nil {
  2090  			return err
  2091  		}
  2092  		if x.NextPageToken == "" {
  2093  			return nil
  2094  		}
  2095  		c.PageToken(x.NextPageToken)
  2096  	}
  2097  }
  2098  

View as plain text