Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

2716 rindas
104 KiB

  1. // Copyright 2019 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. // Code generated file. DO NOT EDIT.
  5. // Package firestore provides access to the Cloud Firestore API.
  6. //
  7. // This package is DEPRECATED. Use package cloud.google.com/go/firestore instead.
  8. //
  9. // For product documentation, see: https://cloud.google.com/firestore
  10. //
  11. // Creating a client
  12. //
  13. // Usage example:
  14. //
  15. // import "google.golang.org/api/firestore/v1beta2"
  16. // ...
  17. // ctx := context.Background()
  18. // firestoreService, err := firestore.NewService(ctx)
  19. //
  20. // In this example, Google Application Default Credentials are used for authentication.
  21. //
  22. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  23. //
  24. // Other authentication options
  25. //
  26. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  27. //
  28. // firestoreService, err := firestore.NewService(ctx, option.WithScopes(firestore.DatastoreScope))
  29. //
  30. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  31. //
  32. // firestoreService, err := firestore.NewService(ctx, option.WithAPIKey("AIza..."))
  33. //
  34. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  35. //
  36. // config := &oauth2.Config{...}
  37. // // ...
  38. // token, err := config.Exchange(ctx, ...)
  39. // firestoreService, err := firestore.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  40. //
  41. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  42. package firestore // import "google.golang.org/api/firestore/v1beta2"
  43. import (
  44. "bytes"
  45. "context"
  46. "encoding/json"
  47. "errors"
  48. "fmt"
  49. "io"
  50. "net/http"
  51. "net/url"
  52. "strconv"
  53. "strings"
  54. gensupport "google.golang.org/api/gensupport"
  55. googleapi "google.golang.org/api/googleapi"
  56. option "google.golang.org/api/option"
  57. htransport "google.golang.org/api/transport/http"
  58. )
  59. // Always reference these packages, just in case the auto-generated code
  60. // below doesn't.
  61. var _ = bytes.NewBuffer
  62. var _ = strconv.Itoa
  63. var _ = fmt.Sprintf
  64. var _ = json.NewDecoder
  65. var _ = io.Copy
  66. var _ = url.Parse
  67. var _ = gensupport.MarshalJSON
  68. var _ = googleapi.Version
  69. var _ = errors.New
  70. var _ = strings.Replace
  71. var _ = context.Canceled
  72. const apiId = "firestore:v1beta2"
  73. const apiName = "firestore"
  74. const apiVersion = "v1beta2"
  75. const basePath = "https://firestore.googleapis.com/"
  76. // OAuth2 scopes used by this API.
  77. const (
  78. // View and manage your data across Google Cloud Platform services
  79. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  80. // View and manage your Google Cloud Datastore data
  81. DatastoreScope = "https://www.googleapis.com/auth/datastore"
  82. )
  83. // NewService creates a new Service.
  84. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  85. scopesOption := option.WithScopes(
  86. "https://www.googleapis.com/auth/cloud-platform",
  87. "https://www.googleapis.com/auth/datastore",
  88. )
  89. // NOTE: prepend, so we don't override user-specified scopes.
  90. opts = append([]option.ClientOption{scopesOption}, opts...)
  91. client, endpoint, err := htransport.NewClient(ctx, opts...)
  92. if err != nil {
  93. return nil, err
  94. }
  95. s, err := New(client)
  96. if err != nil {
  97. return nil, err
  98. }
  99. if endpoint != "" {
  100. s.BasePath = endpoint
  101. }
  102. return s, nil
  103. }
  104. // New creates a new Service. It uses the provided http.Client for requests.
  105. //
  106. // Deprecated: please use NewService instead.
  107. // To provide a custom HTTP client, use option.WithHTTPClient.
  108. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  109. func New(client *http.Client) (*Service, error) {
  110. if client == nil {
  111. return nil, errors.New("client is nil")
  112. }
  113. s := &Service{client: client, BasePath: basePath}
  114. s.Projects = NewProjectsService(s)
  115. return s, nil
  116. }
  117. type Service struct {
  118. client *http.Client
  119. BasePath string // API endpoint base URL
  120. UserAgent string // optional additional User-Agent fragment
  121. Projects *ProjectsService
  122. }
  123. func (s *Service) userAgent() string {
  124. if s.UserAgent == "" {
  125. return googleapi.UserAgent
  126. }
  127. return googleapi.UserAgent + " " + s.UserAgent
  128. }
  129. func NewProjectsService(s *Service) *ProjectsService {
  130. rs := &ProjectsService{s: s}
  131. rs.Databases = NewProjectsDatabasesService(s)
  132. return rs
  133. }
  134. type ProjectsService struct {
  135. s *Service
  136. Databases *ProjectsDatabasesService
  137. }
  138. func NewProjectsDatabasesService(s *Service) *ProjectsDatabasesService {
  139. rs := &ProjectsDatabasesService{s: s}
  140. rs.CollectionGroups = NewProjectsDatabasesCollectionGroupsService(s)
  141. return rs
  142. }
  143. type ProjectsDatabasesService struct {
  144. s *Service
  145. CollectionGroups *ProjectsDatabasesCollectionGroupsService
  146. }
  147. func NewProjectsDatabasesCollectionGroupsService(s *Service) *ProjectsDatabasesCollectionGroupsService {
  148. rs := &ProjectsDatabasesCollectionGroupsService{s: s}
  149. rs.Fields = NewProjectsDatabasesCollectionGroupsFieldsService(s)
  150. rs.Indexes = NewProjectsDatabasesCollectionGroupsIndexesService(s)
  151. return rs
  152. }
  153. type ProjectsDatabasesCollectionGroupsService struct {
  154. s *Service
  155. Fields *ProjectsDatabasesCollectionGroupsFieldsService
  156. Indexes *ProjectsDatabasesCollectionGroupsIndexesService
  157. }
  158. func NewProjectsDatabasesCollectionGroupsFieldsService(s *Service) *ProjectsDatabasesCollectionGroupsFieldsService {
  159. rs := &ProjectsDatabasesCollectionGroupsFieldsService{s: s}
  160. return rs
  161. }
  162. type ProjectsDatabasesCollectionGroupsFieldsService struct {
  163. s *Service
  164. }
  165. func NewProjectsDatabasesCollectionGroupsIndexesService(s *Service) *ProjectsDatabasesCollectionGroupsIndexesService {
  166. rs := &ProjectsDatabasesCollectionGroupsIndexesService{s: s}
  167. return rs
  168. }
  169. type ProjectsDatabasesCollectionGroupsIndexesService struct {
  170. s *Service
  171. }
  172. // Empty: A generic empty message that you can re-use to avoid defining
  173. // duplicated
  174. // empty messages in your APIs. A typical example is to use it as the
  175. // request
  176. // or the response type of an API method. For instance:
  177. //
  178. // service Foo {
  179. // rpc Bar(google.protobuf.Empty) returns
  180. // (google.protobuf.Empty);
  181. // }
  182. //
  183. // The JSON representation for `Empty` is empty JSON object `{}`.
  184. type Empty struct {
  185. // ServerResponse contains the HTTP response code and headers from the
  186. // server.
  187. googleapi.ServerResponse `json:"-"`
  188. }
  189. // GoogleFirestoreAdminV1beta2ExportDocumentsMetadata: Metadata for
  190. // google.longrunning.Operation results
  191. // from
  192. // FirestoreAdmin.ExportDocuments.
  193. type GoogleFirestoreAdminV1beta2ExportDocumentsMetadata struct {
  194. // CollectionIds: Which collection ids are being exported.
  195. CollectionIds []string `json:"collectionIds,omitempty"`
  196. // EndTime: The time this operation completed. Will be unset if
  197. // operation still in
  198. // progress.
  199. EndTime string `json:"endTime,omitempty"`
  200. // OperationState: The state of the export operation.
  201. //
  202. // Possible values:
  203. // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
  204. // "INITIALIZING" - Request is being prepared for processing.
  205. // "PROCESSING" - Request is actively being processed.
  206. // "CANCELLING" - Request is in the process of being cancelled after
  207. // user called
  208. // google.longrunning.Operations.CancelOperation on the operation.
  209. // "FINALIZING" - Request has been processed and is in its
  210. // finalization stage.
  211. // "SUCCESSFUL" - Request has completed successfully.
  212. // "FAILED" - Request has finished being processed, but encountered an
  213. // error.
  214. // "CANCELLED" - Request has finished being cancelled after user
  215. // called
  216. // google.longrunning.Operations.CancelOperation.
  217. OperationState string `json:"operationState,omitempty"`
  218. // OutputUriPrefix: Where the entities are being exported to.
  219. OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
  220. // ProgressBytes: The progress, in bytes, of this operation.
  221. ProgressBytes *GoogleFirestoreAdminV1beta2Progress `json:"progressBytes,omitempty"`
  222. // ProgressDocuments: The progress, in documents, of this operation.
  223. ProgressDocuments *GoogleFirestoreAdminV1beta2Progress `json:"progressDocuments,omitempty"`
  224. // StartTime: The time this operation started.
  225. StartTime string `json:"startTime,omitempty"`
  226. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  227. // unconditionally include in API requests. By default, fields with
  228. // empty values are omitted from API requests. However, any non-pointer,
  229. // non-interface field appearing in ForceSendFields will be sent to the
  230. // server regardless of whether the field is empty or not. This may be
  231. // used to include empty fields in Patch requests.
  232. ForceSendFields []string `json:"-"`
  233. // NullFields is a list of field names (e.g. "CollectionIds") to include
  234. // in API requests with the JSON null value. By default, fields with
  235. // empty values are omitted from API requests. However, any field with
  236. // an empty value appearing in NullFields will be sent to the server as
  237. // null. It is an error if a field in this list has a non-empty value.
  238. // This may be used to include null fields in Patch requests.
  239. NullFields []string `json:"-"`
  240. }
  241. func (s *GoogleFirestoreAdminV1beta2ExportDocumentsMetadata) MarshalJSON() ([]byte, error) {
  242. type NoMethod GoogleFirestoreAdminV1beta2ExportDocumentsMetadata
  243. raw := NoMethod(*s)
  244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  245. }
  246. // GoogleFirestoreAdminV1beta2ExportDocumentsRequest: The request for
  247. // FirestoreAdmin.ExportDocuments.
  248. type GoogleFirestoreAdminV1beta2ExportDocumentsRequest struct {
  249. // CollectionIds: Which collection ids to export. Unspecified means all
  250. // collections.
  251. CollectionIds []string `json:"collectionIds,omitempty"`
  252. // OutputUriPrefix: The output URI. Currently only supports Google Cloud
  253. // Storage URIs of the
  254. // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
  255. // name
  256. // of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an
  257. // optional
  258. // Google Cloud Storage namespace path. When
  259. // choosing a name, be sure to consider Google Cloud Storage
  260. // naming
  261. // guidelines: https://cloud.google.com/storage/docs/naming.
  262. // If the URI is a bucket (without a namespace path), a prefix will
  263. // be
  264. // generated based on the start time.
  265. OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
  266. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  267. // unconditionally include in API requests. By default, fields with
  268. // empty values are omitted from API requests. However, any non-pointer,
  269. // non-interface field appearing in ForceSendFields will be sent to the
  270. // server regardless of whether the field is empty or not. This may be
  271. // used to include empty fields in Patch requests.
  272. ForceSendFields []string `json:"-"`
  273. // NullFields is a list of field names (e.g. "CollectionIds") to include
  274. // in API requests with the JSON null value. By default, fields with
  275. // empty values are omitted from API requests. However, any field with
  276. // an empty value appearing in NullFields will be sent to the server as
  277. // null. It is an error if a field in this list has a non-empty value.
  278. // This may be used to include null fields in Patch requests.
  279. NullFields []string `json:"-"`
  280. }
  281. func (s *GoogleFirestoreAdminV1beta2ExportDocumentsRequest) MarshalJSON() ([]byte, error) {
  282. type NoMethod GoogleFirestoreAdminV1beta2ExportDocumentsRequest
  283. raw := NoMethod(*s)
  284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  285. }
  286. // GoogleFirestoreAdminV1beta2ExportDocumentsResponse: Returned in the
  287. // google.longrunning.Operation response field.
  288. type GoogleFirestoreAdminV1beta2ExportDocumentsResponse struct {
  289. // OutputUriPrefix: Location of the output files. This can be used to
  290. // begin an import
  291. // into Cloud Firestore (this project or another project) after the
  292. // operation
  293. // completes successfully.
  294. OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
  295. // ForceSendFields is a list of field names (e.g. "OutputUriPrefix") to
  296. // unconditionally include in API requests. By default, fields with
  297. // empty values are omitted from API requests. However, any non-pointer,
  298. // non-interface field appearing in ForceSendFields will be sent to the
  299. // server regardless of whether the field is empty or not. This may be
  300. // used to include empty fields in Patch requests.
  301. ForceSendFields []string `json:"-"`
  302. // NullFields is a list of field names (e.g. "OutputUriPrefix") to
  303. // include in API requests with the JSON null value. By default, fields
  304. // with empty values are omitted from API requests. However, any field
  305. // with an empty value appearing in NullFields will be sent to the
  306. // server as null. It is an error if a field in this list has a
  307. // non-empty value. This may be used to include null fields in Patch
  308. // requests.
  309. NullFields []string `json:"-"`
  310. }
  311. func (s *GoogleFirestoreAdminV1beta2ExportDocumentsResponse) MarshalJSON() ([]byte, error) {
  312. type NoMethod GoogleFirestoreAdminV1beta2ExportDocumentsResponse
  313. raw := NoMethod(*s)
  314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  315. }
  316. // GoogleFirestoreAdminV1beta2Field: Represents a single field in the
  317. // database.
  318. //
  319. // Fields are grouped by their "Collection Group", which represent
  320. // all
  321. // collections in the database with the same id.
  322. type GoogleFirestoreAdminV1beta2Field struct {
  323. // IndexConfig: The index configuration for this field. If unset, field
  324. // indexing will
  325. // revert to the configuration defined by the `ancestor_field`.
  326. // To
  327. // explicitly remove all indexes for this field, specify an index
  328. // config
  329. // with an empty list of indexes.
  330. IndexConfig *GoogleFirestoreAdminV1beta2IndexConfig `json:"indexConfig,omitempty"`
  331. // Name: A field name of the
  332. // form
  333. // `projects/{project_id}/databases/{database_id}/collectionGroups/{
  334. // collection_id}/fields/{field_path}`
  335. //
  336. // A field path may be a simple field name, e.g. `address` or a path to
  337. // fields
  338. // within map_value , e.g. `address.city`,
  339. // or a special field path. The only valid special field is `*`,
  340. // which
  341. // represents any field.
  342. //
  343. // Field paths may be quoted using ` (backtick). The only character that
  344. // needs
  345. // to be escaped within a quoted field path is the backtick character
  346. // itself,
  347. // escaped using a backslash. Special characters in field paths
  348. // that
  349. // must be quoted include: `*`, `.`,
  350. // ``` (backtick), `[`, `]`, as well as any ascii symbolic
  351. // characters.
  352. //
  353. // Examples:
  354. // (Note: Comments here are written in markdown syntax, so there is an
  355. // additional layer of backticks to represent a code
  356. // block)
  357. // `\`address.city\`` represents a field named `address.city`, not the
  358. // map key
  359. // `city` in the field `address`.
  360. // `\`*\`` represents a field named `*`, not any field.
  361. //
  362. // A special `Field` contains the default indexing settings for all
  363. // fields.
  364. // This field's resource name
  365. // is:
  366. // `projects/{project_id}/databases/{database_id}/collectionGroups/__
  367. // default__/fields/*`
  368. // Indexes defined on this `Field` will be applied to all fields which
  369. // do not
  370. // have their own `Field` index configuration.
  371. Name string `json:"name,omitempty"`
  372. // ServerResponse contains the HTTP response code and headers from the
  373. // server.
  374. googleapi.ServerResponse `json:"-"`
  375. // ForceSendFields is a list of field names (e.g. "IndexConfig") to
  376. // unconditionally include in API requests. By default, fields with
  377. // empty values are omitted from API requests. However, any non-pointer,
  378. // non-interface field appearing in ForceSendFields will be sent to the
  379. // server regardless of whether the field is empty or not. This may be
  380. // used to include empty fields in Patch requests.
  381. ForceSendFields []string `json:"-"`
  382. // NullFields is a list of field names (e.g. "IndexConfig") to include
  383. // in API requests with the JSON null value. By default, fields with
  384. // empty values are omitted from API requests. However, any field with
  385. // an empty value appearing in NullFields will be sent to the server as
  386. // null. It is an error if a field in this list has a non-empty value.
  387. // This may be used to include null fields in Patch requests.
  388. NullFields []string `json:"-"`
  389. }
  390. func (s *GoogleFirestoreAdminV1beta2Field) MarshalJSON() ([]byte, error) {
  391. type NoMethod GoogleFirestoreAdminV1beta2Field
  392. raw := NoMethod(*s)
  393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  394. }
  395. // GoogleFirestoreAdminV1beta2FieldOperationMetadata: Metadata for
  396. // google.longrunning.Operation results from
  397. // FirestoreAdmin.UpdateField.
  398. type GoogleFirestoreAdminV1beta2FieldOperationMetadata struct {
  399. // BytesProgress: The progress, in bytes, of this operation.
  400. BytesProgress *GoogleFirestoreAdminV1beta2Progress `json:"bytesProgress,omitempty"`
  401. // DocumentProgress: The progress, in documents, of this operation.
  402. DocumentProgress *GoogleFirestoreAdminV1beta2Progress `json:"documentProgress,omitempty"`
  403. // EndTime: The time this operation completed. Will be unset if
  404. // operation still in
  405. // progress.
  406. EndTime string `json:"endTime,omitempty"`
  407. // Field: The field resource that this operation is acting on. For
  408. // example:
  409. // `projects/{project_id}/databases/{database_id}/collectionGrou
  410. // ps/{collection_id}/fields/{field_path}`
  411. Field string `json:"field,omitempty"`
  412. // IndexConfigDeltas: A list of IndexConfigDelta, which describe the
  413. // intent of this
  414. // operation.
  415. IndexConfigDeltas []*GoogleFirestoreAdminV1beta2IndexConfigDelta `json:"indexConfigDeltas,omitempty"`
  416. // StartTime: The time this operation started.
  417. StartTime string `json:"startTime,omitempty"`
  418. // State: The state of the operation.
  419. //
  420. // Possible values:
  421. // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
  422. // "INITIALIZING" - Request is being prepared for processing.
  423. // "PROCESSING" - Request is actively being processed.
  424. // "CANCELLING" - Request is in the process of being cancelled after
  425. // user called
  426. // google.longrunning.Operations.CancelOperation on the operation.
  427. // "FINALIZING" - Request has been processed and is in its
  428. // finalization stage.
  429. // "SUCCESSFUL" - Request has completed successfully.
  430. // "FAILED" - Request has finished being processed, but encountered an
  431. // error.
  432. // "CANCELLED" - Request has finished being cancelled after user
  433. // called
  434. // google.longrunning.Operations.CancelOperation.
  435. State string `json:"state,omitempty"`
  436. // ForceSendFields is a list of field names (e.g. "BytesProgress") to
  437. // unconditionally include in API requests. By default, fields with
  438. // empty values are omitted from API requests. However, any non-pointer,
  439. // non-interface field appearing in ForceSendFields will be sent to the
  440. // server regardless of whether the field is empty or not. This may be
  441. // used to include empty fields in Patch requests.
  442. ForceSendFields []string `json:"-"`
  443. // NullFields is a list of field names (e.g. "BytesProgress") to include
  444. // in API requests with the JSON null value. By default, fields with
  445. // empty values are omitted from API requests. However, any field with
  446. // an empty value appearing in NullFields will be sent to the server as
  447. // null. It is an error if a field in this list has a non-empty value.
  448. // This may be used to include null fields in Patch requests.
  449. NullFields []string `json:"-"`
  450. }
  451. func (s *GoogleFirestoreAdminV1beta2FieldOperationMetadata) MarshalJSON() ([]byte, error) {
  452. type NoMethod GoogleFirestoreAdminV1beta2FieldOperationMetadata
  453. raw := NoMethod(*s)
  454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  455. }
  456. // GoogleFirestoreAdminV1beta2ImportDocumentsMetadata: Metadata for
  457. // google.longrunning.Operation results
  458. // from
  459. // FirestoreAdmin.ImportDocuments.
  460. type GoogleFirestoreAdminV1beta2ImportDocumentsMetadata struct {
  461. // CollectionIds: Which collection ids are being imported.
  462. CollectionIds []string `json:"collectionIds,omitempty"`
  463. // EndTime: The time this operation completed. Will be unset if
  464. // operation still in
  465. // progress.
  466. EndTime string `json:"endTime,omitempty"`
  467. // InputUriPrefix: The location of the documents being imported.
  468. InputUriPrefix string `json:"inputUriPrefix,omitempty"`
  469. // OperationState: The state of the import operation.
  470. //
  471. // Possible values:
  472. // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
  473. // "INITIALIZING" - Request is being prepared for processing.
  474. // "PROCESSING" - Request is actively being processed.
  475. // "CANCELLING" - Request is in the process of being cancelled after
  476. // user called
  477. // google.longrunning.Operations.CancelOperation on the operation.
  478. // "FINALIZING" - Request has been processed and is in its
  479. // finalization stage.
  480. // "SUCCESSFUL" - Request has completed successfully.
  481. // "FAILED" - Request has finished being processed, but encountered an
  482. // error.
  483. // "CANCELLED" - Request has finished being cancelled after user
  484. // called
  485. // google.longrunning.Operations.CancelOperation.
  486. OperationState string `json:"operationState,omitempty"`
  487. // ProgressBytes: The progress, in bytes, of this operation.
  488. ProgressBytes *GoogleFirestoreAdminV1beta2Progress `json:"progressBytes,omitempty"`
  489. // ProgressDocuments: The progress, in documents, of this operation.
  490. ProgressDocuments *GoogleFirestoreAdminV1beta2Progress `json:"progressDocuments,omitempty"`
  491. // StartTime: The time this operation started.
  492. StartTime string `json:"startTime,omitempty"`
  493. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  494. // unconditionally include in API requests. By default, fields with
  495. // empty values are omitted from API requests. However, any non-pointer,
  496. // non-interface field appearing in ForceSendFields will be sent to the
  497. // server regardless of whether the field is empty or not. This may be
  498. // used to include empty fields in Patch requests.
  499. ForceSendFields []string `json:"-"`
  500. // NullFields is a list of field names (e.g. "CollectionIds") to include
  501. // in API requests with the JSON null value. By default, fields with
  502. // empty values are omitted from API requests. However, any field with
  503. // an empty value appearing in NullFields will be sent to the server as
  504. // null. It is an error if a field in this list has a non-empty value.
  505. // This may be used to include null fields in Patch requests.
  506. NullFields []string `json:"-"`
  507. }
  508. func (s *GoogleFirestoreAdminV1beta2ImportDocumentsMetadata) MarshalJSON() ([]byte, error) {
  509. type NoMethod GoogleFirestoreAdminV1beta2ImportDocumentsMetadata
  510. raw := NoMethod(*s)
  511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  512. }
  513. // GoogleFirestoreAdminV1beta2ImportDocumentsRequest: The request for
  514. // FirestoreAdmin.ImportDocuments.
  515. type GoogleFirestoreAdminV1beta2ImportDocumentsRequest struct {
  516. // CollectionIds: Which collection ids to import. Unspecified means all
  517. // collections included
  518. // in the import.
  519. CollectionIds []string `json:"collectionIds,omitempty"`
  520. // InputUriPrefix: Location of the exported files.
  521. // This must match the output_uri_prefix of an ExportDocumentsResponse
  522. // from
  523. // an export that has completed
  524. // successfully.
  525. // See:
  526. // google.firestore.admin.v1beta2.ExportDocumentsRespo
  527. // nse.output_uri_prefix.
  528. InputUriPrefix string `json:"inputUriPrefix,omitempty"`
  529. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  530. // unconditionally include in API requests. By default, fields with
  531. // empty values are omitted from API requests. However, any non-pointer,
  532. // non-interface field appearing in ForceSendFields will be sent to the
  533. // server regardless of whether the field is empty or not. This may be
  534. // used to include empty fields in Patch requests.
  535. ForceSendFields []string `json:"-"`
  536. // NullFields is a list of field names (e.g. "CollectionIds") to include
  537. // in API requests with the JSON null value. By default, fields with
  538. // empty values are omitted from API requests. However, any field with
  539. // an empty value appearing in NullFields will be sent to the server as
  540. // null. It is an error if a field in this list has a non-empty value.
  541. // This may be used to include null fields in Patch requests.
  542. NullFields []string `json:"-"`
  543. }
  544. func (s *GoogleFirestoreAdminV1beta2ImportDocumentsRequest) MarshalJSON() ([]byte, error) {
  545. type NoMethod GoogleFirestoreAdminV1beta2ImportDocumentsRequest
  546. raw := NoMethod(*s)
  547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  548. }
  549. // GoogleFirestoreAdminV1beta2Index: Cloud Firestore indexes enable
  550. // simple and complex queries against
  551. // documents in a database.
  552. type GoogleFirestoreAdminV1beta2Index struct {
  553. // Fields: The fields supported by this index.
  554. //
  555. // For composite indexes, this is always 2 or more fields.
  556. // The last field entry is always for the field path `__name__`. If,
  557. // on
  558. // creation, `__name__` was not specified as the last field, it will be
  559. // added
  560. // automatically with the same direction as that of the last field
  561. // defined. If
  562. // the final field in a composite index is not directional, the
  563. // `__name__`
  564. // will be ordered ASCENDING (unless explicitly specified).
  565. //
  566. // For single field indexes, this will always be exactly one entry with
  567. // a
  568. // field path equal to the field path of the associated field.
  569. Fields []*GoogleFirestoreAdminV1beta2IndexField `json:"fields,omitempty"`
  570. // Name: Output only.
  571. // A server defined name for this index.
  572. // The form of this name for composite indexes will
  573. // be:
  574. // `projects/{project_id}/databases/{database_id}/collectionGroups/{c
  575. // ollection_id}/indexes/{composite_index_id}`
  576. // For single field indexes, this field will be empty.
  577. Name string `json:"name,omitempty"`
  578. // QueryScope: Indexes with a collection query scope specified allow
  579. // queries
  580. // against a collection that is the child of a specific document,
  581. // specified at
  582. // query time, and that has the same collection id.
  583. //
  584. // Indexes with a collection group query scope specified allow queries
  585. // against
  586. // all collections descended from a specific document, specified at
  587. // query
  588. // time, and that have the same collection id as this index.
  589. //
  590. // Possible values:
  591. // "QUERY_SCOPE_UNSPECIFIED" - The query scope is unspecified. Not a
  592. // valid option.
  593. // "COLLECTION" - Indexes with a collection query scope specified
  594. // allow queries
  595. // against a collection that is the child of a specific document,
  596. // specified
  597. // at query time, and that has the collection id specified by the index.
  598. QueryScope string `json:"queryScope,omitempty"`
  599. // State: Output only.
  600. // The serving state of the index.
  601. //
  602. // Possible values:
  603. // "STATE_UNSPECIFIED" - The state is unspecified.
  604. // "CREATING" - The index is being created.
  605. // There is an active long-running operation for the index.
  606. // The index is updated when writing a document.
  607. // Some index data may exist.
  608. // "READY" - The index is ready to be used.
  609. // The index is updated when writing a document.
  610. // The index is fully populated from all stored documents it applies to.
  611. // "NEEDS_REPAIR" - The index was being created, but something went
  612. // wrong.
  613. // There is no active long-running operation for the index,
  614. // and the most recently finished long-running operation failed.
  615. // The index is not updated when writing a document.
  616. // Some index data may exist.
  617. // Use the google.longrunning.Operations API to determine why the
  618. // operation
  619. // that last attempted to create this index failed, then re-create
  620. // the
  621. // index.
  622. State string `json:"state,omitempty"`
  623. // ServerResponse contains the HTTP response code and headers from the
  624. // server.
  625. googleapi.ServerResponse `json:"-"`
  626. // ForceSendFields is a list of field names (e.g. "Fields") to
  627. // unconditionally include in API requests. By default, fields with
  628. // empty values are omitted from API requests. However, any non-pointer,
  629. // non-interface field appearing in ForceSendFields will be sent to the
  630. // server regardless of whether the field is empty or not. This may be
  631. // used to include empty fields in Patch requests.
  632. ForceSendFields []string `json:"-"`
  633. // NullFields is a list of field names (e.g. "Fields") to include in API
  634. // requests with the JSON null value. By default, fields with empty
  635. // values are omitted from API requests. However, any field with an
  636. // empty value appearing in NullFields will be sent to the server as
  637. // null. It is an error if a field in this list has a non-empty value.
  638. // This may be used to include null fields in Patch requests.
  639. NullFields []string `json:"-"`
  640. }
  641. func (s *GoogleFirestoreAdminV1beta2Index) MarshalJSON() ([]byte, error) {
  642. type NoMethod GoogleFirestoreAdminV1beta2Index
  643. raw := NoMethod(*s)
  644. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  645. }
  646. // GoogleFirestoreAdminV1beta2IndexConfig: The index configuration for
  647. // this field.
  648. type GoogleFirestoreAdminV1beta2IndexConfig struct {
  649. // AncestorField: Output only.
  650. // Specifies the resource name of the `Field` from which this
  651. // field's
  652. // index configuration is set (when `uses_ancestor_config` is true),
  653. // or from which it *would* be set if this field had no index
  654. // configuration
  655. // (when `uses_ancestor_config` is false).
  656. AncestorField string `json:"ancestorField,omitempty"`
  657. // Indexes: The indexes supported for this field.
  658. Indexes []*GoogleFirestoreAdminV1beta2Index `json:"indexes,omitempty"`
  659. // Reverting: Output only
  660. // When true, the `Field`'s index configuration is in the process of
  661. // being
  662. // reverted. Once complete, the index config will transition to the
  663. // same
  664. // state as the field specified by `ancestor_field`, at which
  665. // point
  666. // `uses_ancestor_config` will be `true` and `reverting` will be
  667. // `false`.
  668. Reverting bool `json:"reverting,omitempty"`
  669. // UsesAncestorConfig: Output only.
  670. // When true, the `Field`'s index configuration is set from
  671. // the
  672. // configuration specified by the `ancestor_field`.
  673. // When false, the `Field`'s index configuration is defined explicitly.
  674. UsesAncestorConfig bool `json:"usesAncestorConfig,omitempty"`
  675. // ForceSendFields is a list of field names (e.g. "AncestorField") to
  676. // unconditionally include in API requests. By default, fields with
  677. // empty values are omitted from API requests. However, any non-pointer,
  678. // non-interface field appearing in ForceSendFields will be sent to the
  679. // server regardless of whether the field is empty or not. This may be
  680. // used to include empty fields in Patch requests.
  681. ForceSendFields []string `json:"-"`
  682. // NullFields is a list of field names (e.g. "AncestorField") to include
  683. // in API requests with the JSON null value. By default, fields with
  684. // empty values are omitted from API requests. However, any field with
  685. // an empty value appearing in NullFields will be sent to the server as
  686. // null. It is an error if a field in this list has a non-empty value.
  687. // This may be used to include null fields in Patch requests.
  688. NullFields []string `json:"-"`
  689. }
  690. func (s *GoogleFirestoreAdminV1beta2IndexConfig) MarshalJSON() ([]byte, error) {
  691. type NoMethod GoogleFirestoreAdminV1beta2IndexConfig
  692. raw := NoMethod(*s)
  693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  694. }
  695. // GoogleFirestoreAdminV1beta2IndexConfigDelta: Information about an
  696. // index configuration change.
  697. type GoogleFirestoreAdminV1beta2IndexConfigDelta struct {
  698. // ChangeType: Specifies how the index is changing.
  699. //
  700. // Possible values:
  701. // "CHANGE_TYPE_UNSPECIFIED" - The type of change is not specified or
  702. // known.
  703. // "ADD" - The single field index is being added.
  704. // "REMOVE" - The single field index is being removed.
  705. ChangeType string `json:"changeType,omitempty"`
  706. // Index: The index being changed.
  707. Index *GoogleFirestoreAdminV1beta2Index `json:"index,omitempty"`
  708. // ForceSendFields is a list of field names (e.g. "ChangeType") to
  709. // unconditionally include in API requests. By default, fields with
  710. // empty values are omitted from API requests. However, any non-pointer,
  711. // non-interface field appearing in ForceSendFields will be sent to the
  712. // server regardless of whether the field is empty or not. This may be
  713. // used to include empty fields in Patch requests.
  714. ForceSendFields []string `json:"-"`
  715. // NullFields is a list of field names (e.g. "ChangeType") to include in
  716. // API requests with the JSON null value. By default, fields with empty
  717. // values are omitted from API requests. However, any field with an
  718. // empty value appearing in NullFields will be sent to the server as
  719. // null. It is an error if a field in this list has a non-empty value.
  720. // This may be used to include null fields in Patch requests.
  721. NullFields []string `json:"-"`
  722. }
  723. func (s *GoogleFirestoreAdminV1beta2IndexConfigDelta) MarshalJSON() ([]byte, error) {
  724. type NoMethod GoogleFirestoreAdminV1beta2IndexConfigDelta
  725. raw := NoMethod(*s)
  726. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  727. }
  728. // GoogleFirestoreAdminV1beta2IndexField: A field in an index.
  729. // The field_path describes which field is indexed, the value_mode
  730. // describes
  731. // how the field value is indexed.
  732. type GoogleFirestoreAdminV1beta2IndexField struct {
  733. // ArrayConfig: Indicates that this field supports operations on
  734. // `array_value`s.
  735. //
  736. // Possible values:
  737. // "ARRAY_CONFIG_UNSPECIFIED" - The index does not support additional
  738. // array queries.
  739. // "CONTAINS" - The index supports array containment queries.
  740. ArrayConfig string `json:"arrayConfig,omitempty"`
  741. // FieldPath: Can be __name__.
  742. // For single field indexes, this must match the name of the field or
  743. // may
  744. // be omitted.
  745. FieldPath string `json:"fieldPath,omitempty"`
  746. // Order: Indicates that this field supports ordering by the specified
  747. // order or
  748. // comparing using =, <, <=, >, >=.
  749. //
  750. // Possible values:
  751. // "ORDER_UNSPECIFIED" - The ordering is unspecified. Not a valid
  752. // option.
  753. // "ASCENDING" - The field is ordered by ascending field value.
  754. // "DESCENDING" - The field is ordered by descending field value.
  755. Order string `json:"order,omitempty"`
  756. // ForceSendFields is a list of field names (e.g. "ArrayConfig") to
  757. // unconditionally include in API requests. By default, fields with
  758. // empty values are omitted from API requests. However, any non-pointer,
  759. // non-interface field appearing in ForceSendFields will be sent to the
  760. // server regardless of whether the field is empty or not. This may be
  761. // used to include empty fields in Patch requests.
  762. ForceSendFields []string `json:"-"`
  763. // NullFields is a list of field names (e.g. "ArrayConfig") to include
  764. // in API requests with the JSON null value. By default, fields with
  765. // empty values are omitted from API requests. However, any field with
  766. // an empty value appearing in NullFields will be sent to the server as
  767. // null. It is an error if a field in this list has a non-empty value.
  768. // This may be used to include null fields in Patch requests.
  769. NullFields []string `json:"-"`
  770. }
  771. func (s *GoogleFirestoreAdminV1beta2IndexField) MarshalJSON() ([]byte, error) {
  772. type NoMethod GoogleFirestoreAdminV1beta2IndexField
  773. raw := NoMethod(*s)
  774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  775. }
  776. // GoogleFirestoreAdminV1beta2IndexOperationMetadata: Metadata for
  777. // google.longrunning.Operation results from
  778. // FirestoreAdmin.CreateIndex.
  779. type GoogleFirestoreAdminV1beta2IndexOperationMetadata struct {
  780. // EndTime: The time this operation completed. Will be unset if
  781. // operation still in
  782. // progress.
  783. EndTime string `json:"endTime,omitempty"`
  784. // Index: The index resource that this operation is acting on. For
  785. // example:
  786. // `projects/{project_id}/databases/{database_id}/collectionGrou
  787. // ps/{collection_id}/indexes/{index_id}`
  788. Index string `json:"index,omitempty"`
  789. // ProgressBytes: The progress, in bytes, of this operation.
  790. ProgressBytes *GoogleFirestoreAdminV1beta2Progress `json:"progressBytes,omitempty"`
  791. // ProgressDocuments: The progress, in documents, of this operation.
  792. ProgressDocuments *GoogleFirestoreAdminV1beta2Progress `json:"progressDocuments,omitempty"`
  793. // StartTime: The time this operation started.
  794. StartTime string `json:"startTime,omitempty"`
  795. // State: The state of the operation.
  796. //
  797. // Possible values:
  798. // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
  799. // "INITIALIZING" - Request is being prepared for processing.
  800. // "PROCESSING" - Request is actively being processed.
  801. // "CANCELLING" - Request is in the process of being cancelled after
  802. // user called
  803. // google.longrunning.Operations.CancelOperation on the operation.
  804. // "FINALIZING" - Request has been processed and is in its
  805. // finalization stage.
  806. // "SUCCESSFUL" - Request has completed successfully.
  807. // "FAILED" - Request has finished being processed, but encountered an
  808. // error.
  809. // "CANCELLED" - Request has finished being cancelled after user
  810. // called
  811. // google.longrunning.Operations.CancelOperation.
  812. State string `json:"state,omitempty"`
  813. // ForceSendFields is a list of field names (e.g. "EndTime") to
  814. // unconditionally include in API requests. By default, fields with
  815. // empty values are omitted from API requests. However, any non-pointer,
  816. // non-interface field appearing in ForceSendFields will be sent to the
  817. // server regardless of whether the field is empty or not. This may be
  818. // used to include empty fields in Patch requests.
  819. ForceSendFields []string `json:"-"`
  820. // NullFields is a list of field names (e.g. "EndTime") to include in
  821. // API requests with the JSON null value. By default, fields with empty
  822. // values are omitted from API requests. However, any field with an
  823. // empty value appearing in NullFields will be sent to the server as
  824. // null. It is an error if a field in this list has a non-empty value.
  825. // This may be used to include null fields in Patch requests.
  826. NullFields []string `json:"-"`
  827. }
  828. func (s *GoogleFirestoreAdminV1beta2IndexOperationMetadata) MarshalJSON() ([]byte, error) {
  829. type NoMethod GoogleFirestoreAdminV1beta2IndexOperationMetadata
  830. raw := NoMethod(*s)
  831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  832. }
  833. // GoogleFirestoreAdminV1beta2ListFieldsResponse: The response for
  834. // FirestoreAdmin.ListFields.
  835. type GoogleFirestoreAdminV1beta2ListFieldsResponse struct {
  836. // Fields: The requested fields.
  837. Fields []*GoogleFirestoreAdminV1beta2Field `json:"fields,omitempty"`
  838. // NextPageToken: A page token that may be used to request another page
  839. // of results. If blank,
  840. // this is the last page.
  841. NextPageToken string `json:"nextPageToken,omitempty"`
  842. // ServerResponse contains the HTTP response code and headers from the
  843. // server.
  844. googleapi.ServerResponse `json:"-"`
  845. // ForceSendFields is a list of field names (e.g. "Fields") to
  846. // unconditionally include in API requests. By default, fields with
  847. // empty values are omitted from API requests. However, any non-pointer,
  848. // non-interface field appearing in ForceSendFields will be sent to the
  849. // server regardless of whether the field is empty or not. This may be
  850. // used to include empty fields in Patch requests.
  851. ForceSendFields []string `json:"-"`
  852. // NullFields is a list of field names (e.g. "Fields") to include in API
  853. // requests with the JSON null value. By default, fields with empty
  854. // values are omitted from API requests. However, any field with an
  855. // empty value appearing in NullFields will be sent to the server as
  856. // null. It is an error if a field in this list has a non-empty value.
  857. // This may be used to include null fields in Patch requests.
  858. NullFields []string `json:"-"`
  859. }
  860. func (s *GoogleFirestoreAdminV1beta2ListFieldsResponse) MarshalJSON() ([]byte, error) {
  861. type NoMethod GoogleFirestoreAdminV1beta2ListFieldsResponse
  862. raw := NoMethod(*s)
  863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  864. }
  865. // GoogleFirestoreAdminV1beta2ListIndexesResponse: The response for
  866. // FirestoreAdmin.ListIndexes.
  867. type GoogleFirestoreAdminV1beta2ListIndexesResponse struct {
  868. // Indexes: The requested indexes.
  869. Indexes []*GoogleFirestoreAdminV1beta2Index `json:"indexes,omitempty"`
  870. // NextPageToken: A page token that may be used to request another page
  871. // of results. If blank,
  872. // this is the last page.
  873. NextPageToken string `json:"nextPageToken,omitempty"`
  874. // ServerResponse contains the HTTP response code and headers from the
  875. // server.
  876. googleapi.ServerResponse `json:"-"`
  877. // ForceSendFields is a list of field names (e.g. "Indexes") to
  878. // unconditionally include in API requests. By default, fields with
  879. // empty values are omitted from API requests. However, any non-pointer,
  880. // non-interface field appearing in ForceSendFields will be sent to the
  881. // server regardless of whether the field is empty or not. This may be
  882. // used to include empty fields in Patch requests.
  883. ForceSendFields []string `json:"-"`
  884. // NullFields is a list of field names (e.g. "Indexes") to include in
  885. // API requests with the JSON null value. By default, fields with empty
  886. // values are omitted from API requests. However, any field with an
  887. // empty value appearing in NullFields will be sent to the server as
  888. // null. It is an error if a field in this list has a non-empty value.
  889. // This may be used to include null fields in Patch requests.
  890. NullFields []string `json:"-"`
  891. }
  892. func (s *GoogleFirestoreAdminV1beta2ListIndexesResponse) MarshalJSON() ([]byte, error) {
  893. type NoMethod GoogleFirestoreAdminV1beta2ListIndexesResponse
  894. raw := NoMethod(*s)
  895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  896. }
  897. // GoogleFirestoreAdminV1beta2Progress: Describes the progress of the
  898. // operation.
  899. // Unit of work is generic and must be interpreted based on where
  900. // Progress
  901. // 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
  909. // empty values are omitted from API requests. However, any non-pointer,
  910. // non-interface field appearing in ForceSendFields will be sent to the
  911. // server regardless of whether the field is empty or not. This may be
  912. // used to include empty fields in Patch requests.
  913. ForceSendFields []string `json:"-"`
  914. // NullFields is a list of field names (e.g. "CompletedWork") to include
  915. // in API requests with the JSON null value. By default, fields with
  916. // empty values are omitted from API requests. However, any field with
  917. // an empty value appearing in NullFields will be sent to the server as
  918. // null. It is an error if a field in this list has a non-empty value.
  919. // This may be used to include null fields in Patch requests.
  920. NullFields []string `json:"-"`
  921. }
  922. func (s *GoogleFirestoreAdminV1beta2Progress) MarshalJSON() ([]byte, error) {
  923. type NoMethod GoogleFirestoreAdminV1beta2Progress
  924. raw := NoMethod(*s)
  925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  926. }
  927. // GoogleLongrunningOperation: This resource represents a long-running
  928. // operation that is the result of a
  929. // network API call.
  930. type GoogleLongrunningOperation struct {
  931. // Done: If the value is `false`, it means the operation is still in
  932. // progress.
  933. // If `true`, the operation is completed, and either `error` or
  934. // `response` is
  935. // available.
  936. Done bool `json:"done,omitempty"`
  937. // Error: The error result of the operation in case of failure or
  938. // cancellation.
  939. Error *Status `json:"error,omitempty"`
  940. // Metadata: Service-specific metadata associated with the operation.
  941. // It typically
  942. // contains progress information and common metadata such as create
  943. // time.
  944. // Some services might not provide such metadata. Any method that
  945. // returns a
  946. // long-running operation should document the metadata type, if any.
  947. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  948. // Name: The server-assigned name, which is only unique within the same
  949. // service that
  950. // originally returns it. If you use the default HTTP mapping,
  951. // the
  952. // `name` should have the format of `operations/some/unique/name`.
  953. Name string `json:"name,omitempty"`
  954. // Response: The normal response of the operation in case of success.
  955. // If the original
  956. // method returns no data on success, such as `Delete`, the response
  957. // is
  958. // `google.protobuf.Empty`. If the original method is
  959. // standard
  960. // `Get`/`Create`/`Update`, the response should be the resource. For
  961. // other
  962. // methods, the response should have the type `XxxResponse`, where
  963. // `Xxx`
  964. // is the original method name. For example, if the original method
  965. // name
  966. // is `TakeSnapshot()`, the inferred response type
  967. // is
  968. // `TakeSnapshotResponse`.
  969. Response googleapi.RawMessage `json:"response,omitempty"`
  970. // ServerResponse contains the HTTP response code and headers from the
  971. // server.
  972. googleapi.ServerResponse `json:"-"`
  973. // ForceSendFields is a list of field names (e.g. "Done") to
  974. // unconditionally include in API requests. By default, fields with
  975. // empty values are omitted from API requests. However, any non-pointer,
  976. // non-interface field appearing in ForceSendFields will be sent to the
  977. // server regardless of whether the field is empty or not. This may be
  978. // used to include empty fields in Patch requests.
  979. ForceSendFields []string `json:"-"`
  980. // NullFields is a list of field names (e.g. "Done") to include in API
  981. // requests with the JSON null value. By default, fields with empty
  982. // values are omitted from API requests. However, any field with an
  983. // empty value appearing in NullFields will be sent to the server as
  984. // null. It is an error if a field in this list has a non-empty value.
  985. // This may be used to include null fields in Patch requests.
  986. NullFields []string `json:"-"`
  987. }
  988. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  989. type NoMethod GoogleLongrunningOperation
  990. raw := NoMethod(*s)
  991. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  992. }
  993. // Status: The `Status` type defines a logical error model that is
  994. // suitable for different
  995. // programming environments, including REST APIs and RPC APIs. It is
  996. // used by
  997. // [gRPC](https://github.com/grpc). The error model is designed to
  998. // be:
  999. //
  1000. // - Simple to use and understand for most users
  1001. // - Flexible enough to meet unexpected needs
  1002. //
  1003. // # Overview
  1004. //
  1005. // The `Status` message contains three pieces of data: error code, error
  1006. // message,
  1007. // and error details. The error code should be an enum value
  1008. // of
  1009. // google.rpc.Code, but it may accept additional error codes if needed.
  1010. // The
  1011. // error message should be a developer-facing English message that
  1012. // helps
  1013. // developers *understand* and *resolve* the error. If a localized
  1014. // user-facing
  1015. // error message is needed, put the localized message in the error
  1016. // details or
  1017. // localize it in the client. The optional error details may contain
  1018. // arbitrary
  1019. // information about the error. There is a predefined set of error
  1020. // detail types
  1021. // in the package `google.rpc` that can be used for common error
  1022. // conditions.
  1023. //
  1024. // # Language mapping
  1025. //
  1026. // The `Status` message is the logical representation of the error
  1027. // model, but it
  1028. // is not necessarily the actual wire format. When the `Status` message
  1029. // is
  1030. // exposed in different client libraries and different wire protocols,
  1031. // it can be
  1032. // mapped differently. For example, it will likely be mapped to some
  1033. // exceptions
  1034. // in Java, but more likely mapped to some error codes in C.
  1035. //
  1036. // # Other uses
  1037. //
  1038. // The error model and the `Status` message can be used in a variety
  1039. // of
  1040. // environments, either with or without APIs, to provide a
  1041. // consistent developer experience across different
  1042. // environments.
  1043. //
  1044. // Example uses of this error model include:
  1045. //
  1046. // - Partial errors. If a service needs to return partial errors to the
  1047. // client,
  1048. // it may embed the `Status` in the normal response to indicate the
  1049. // partial
  1050. // errors.
  1051. //
  1052. // - Workflow errors. A typical workflow has multiple steps. Each step
  1053. // may
  1054. // have a `Status` message for error reporting.
  1055. //
  1056. // - Batch operations. If a client uses batch request and batch
  1057. // response, the
  1058. // `Status` message should be used directly inside batch response,
  1059. // one for
  1060. // each error sub-response.
  1061. //
  1062. // - Asynchronous operations. If an API call embeds asynchronous
  1063. // operation
  1064. // results in its response, the status of those operations should
  1065. // be
  1066. // represented directly using the `Status` message.
  1067. //
  1068. // - Logging. If some API errors are stored in logs, the message
  1069. // `Status` could
  1070. // be used directly after any stripping needed for security/privacy
  1071. // reasons.
  1072. type Status struct {
  1073. // Code: The status code, which should be an enum value of
  1074. // google.rpc.Code.
  1075. Code int64 `json:"code,omitempty"`
  1076. // Details: A list of messages that carry the error details. There is a
  1077. // common set of
  1078. // message types for APIs to use.
  1079. Details []googleapi.RawMessage `json:"details,omitempty"`
  1080. // Message: A developer-facing error message, which should be in
  1081. // English. Any
  1082. // user-facing error message should be localized and sent in
  1083. // the
  1084. // google.rpc.Status.details field, or localized by the client.
  1085. Message string `json:"message,omitempty"`
  1086. // ForceSendFields is a list of field names (e.g. "Code") to
  1087. // unconditionally include in API requests. By default, fields with
  1088. // empty values are omitted from API requests. However, any non-pointer,
  1089. // non-interface field appearing in ForceSendFields will be sent to the
  1090. // server regardless of whether the field is empty or not. This may be
  1091. // used to include empty fields in Patch requests.
  1092. ForceSendFields []string `json:"-"`
  1093. // NullFields is a list of field names (e.g. "Code") to include in API
  1094. // requests with the JSON null value. By default, fields with empty
  1095. // values are omitted from API requests. However, any field with an
  1096. // empty value appearing in NullFields will be sent to the server as
  1097. // null. It is an error if a field in this list has a non-empty value.
  1098. // This may be used to include null fields in Patch requests.
  1099. NullFields []string `json:"-"`
  1100. }
  1101. func (s *Status) MarshalJSON() ([]byte, error) {
  1102. type NoMethod Status
  1103. raw := NoMethod(*s)
  1104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1105. }
  1106. // method id "firestore.projects.databases.exportDocuments":
  1107. type ProjectsDatabasesExportDocumentsCall struct {
  1108. s *Service
  1109. name string
  1110. googlefirestoreadminv1beta2exportdocumentsrequest *GoogleFirestoreAdminV1beta2ExportDocumentsRequest
  1111. urlParams_ gensupport.URLParams
  1112. ctx_ context.Context
  1113. header_ http.Header
  1114. }
  1115. // ExportDocuments: Exports a copy of all or a subset of documents from
  1116. // Google Cloud Firestore
  1117. // to another storage system, such as Google Cloud Storage. Recent
  1118. // updates to
  1119. // documents may not be reflected in the export. The export occurs in
  1120. // the
  1121. // background and its progress can be monitored and managed via
  1122. // the
  1123. // Operation resource that is created. The output of an export may only
  1124. // be
  1125. // used once the associated operation is done. If an export operation
  1126. // is
  1127. // cancelled before completion it may leave partial data behind in
  1128. // Google
  1129. // Cloud Storage.
  1130. func (r *ProjectsDatabasesService) ExportDocuments(name string, googlefirestoreadminv1beta2exportdocumentsrequest *GoogleFirestoreAdminV1beta2ExportDocumentsRequest) *ProjectsDatabasesExportDocumentsCall {
  1131. c := &ProjectsDatabasesExportDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1132. c.name = name
  1133. c.googlefirestoreadminv1beta2exportdocumentsrequest = googlefirestoreadminv1beta2exportdocumentsrequest
  1134. return c
  1135. }
  1136. // Fields allows partial responses to be retrieved. See
  1137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1138. // for more information.
  1139. func (c *ProjectsDatabasesExportDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesExportDocumentsCall {
  1140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1141. return c
  1142. }
  1143. // Context sets the context to be used in this call's Do method. Any
  1144. // pending HTTP request will be aborted if the provided context is
  1145. // canceled.
  1146. func (c *ProjectsDatabasesExportDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesExportDocumentsCall {
  1147. c.ctx_ = ctx
  1148. return c
  1149. }
  1150. // Header returns an http.Header that can be modified by the caller to
  1151. // add HTTP headers to the request.
  1152. func (c *ProjectsDatabasesExportDocumentsCall) Header() http.Header {
  1153. if c.header_ == nil {
  1154. c.header_ = make(http.Header)
  1155. }
  1156. return c.header_
  1157. }
  1158. func (c *ProjectsDatabasesExportDocumentsCall) doRequest(alt string) (*http.Response, error) {
  1159. reqHeaders := make(http.Header)
  1160. for k, v := range c.header_ {
  1161. reqHeaders[k] = v
  1162. }
  1163. reqHeaders.Set("User-Agent", c.s.userAgent())
  1164. var body io.Reader = nil
  1165. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2exportdocumentsrequest)
  1166. if err != nil {
  1167. return nil, err
  1168. }
  1169. reqHeaders.Set("Content-Type", "application/json")
  1170. c.urlParams_.Set("alt", alt)
  1171. c.urlParams_.Set("prettyPrint", "false")
  1172. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:exportDocuments")
  1173. urls += "?" + c.urlParams_.Encode()
  1174. req, err := http.NewRequest("POST", urls, body)
  1175. if err != nil {
  1176. return nil, err
  1177. }
  1178. req.Header = reqHeaders
  1179. googleapi.Expand(req.URL, map[string]string{
  1180. "name": c.name,
  1181. })
  1182. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1183. }
  1184. // Do executes the "firestore.projects.databases.exportDocuments" call.
  1185. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  1186. // Any non-2xx status code is an error. Response headers are in either
  1187. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  1188. // was returned at all) in error.(*googleapi.Error).Header. Use
  1189. // googleapi.IsNotModified to check whether the returned error was
  1190. // because http.StatusNotModified was returned.
  1191. func (c *ProjectsDatabasesExportDocumentsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1192. gensupport.SetOptions(c.urlParams_, opts...)
  1193. res, err := c.doRequest("json")
  1194. if res != nil && res.StatusCode == http.StatusNotModified {
  1195. if res.Body != nil {
  1196. res.Body.Close()
  1197. }
  1198. return nil, &googleapi.Error{
  1199. Code: res.StatusCode,
  1200. Header: res.Header,
  1201. }
  1202. }
  1203. if err != nil {
  1204. return nil, err
  1205. }
  1206. defer googleapi.CloseBody(res)
  1207. if err := googleapi.CheckResponse(res); err != nil {
  1208. return nil, err
  1209. }
  1210. ret := &GoogleLongrunningOperation{
  1211. ServerResponse: googleapi.ServerResponse{
  1212. Header: res.Header,
  1213. HTTPStatusCode: res.StatusCode,
  1214. },
  1215. }
  1216. target := &ret
  1217. if err := gensupport.DecodeResponse(target, res); err != nil {
  1218. return nil, err
  1219. }
  1220. return ret, nil
  1221. // {
  1222. // "description": "Exports a copy of all or a subset of documents from Google Cloud Firestore\nto another storage system, such as Google Cloud Storage. Recent updates to\ndocuments may not be reflected in the export. The export occurs in the\nbackground and its progress can be monitored and managed via the\nOperation resource that is created. The output of an export may only be\nused once the associated operation is done. If an export operation is\ncancelled before completion it may leave partial data behind in Google\nCloud Storage.",
  1223. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}:exportDocuments",
  1224. // "httpMethod": "POST",
  1225. // "id": "firestore.projects.databases.exportDocuments",
  1226. // "parameterOrder": [
  1227. // "name"
  1228. // ],
  1229. // "parameters": {
  1230. // "name": {
  1231. // "description": "Database to export. Should be of the form:\n`projects/{project_id}/databases/{database_id}`.",
  1232. // "location": "path",
  1233. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  1234. // "required": true,
  1235. // "type": "string"
  1236. // }
  1237. // },
  1238. // "path": "v1beta2/{+name}:exportDocuments",
  1239. // "request": {
  1240. // "$ref": "GoogleFirestoreAdminV1beta2ExportDocumentsRequest"
  1241. // },
  1242. // "response": {
  1243. // "$ref": "GoogleLongrunningOperation"
  1244. // },
  1245. // "scopes": [
  1246. // "https://www.googleapis.com/auth/cloud-platform",
  1247. // "https://www.googleapis.com/auth/datastore"
  1248. // ]
  1249. // }
  1250. }
  1251. // method id "firestore.projects.databases.importDocuments":
  1252. type ProjectsDatabasesImportDocumentsCall struct {
  1253. s *Service
  1254. name string
  1255. googlefirestoreadminv1beta2importdocumentsrequest *GoogleFirestoreAdminV1beta2ImportDocumentsRequest
  1256. urlParams_ gensupport.URLParams
  1257. ctx_ context.Context
  1258. header_ http.Header
  1259. }
  1260. // ImportDocuments: Imports documents into Google Cloud Firestore.
  1261. // Existing documents with the
  1262. // same name are overwritten. The import occurs in the background and
  1263. // its
  1264. // progress can be monitored and managed via the Operation resource that
  1265. // is
  1266. // created. If an ImportDocuments operation is cancelled, it is
  1267. // possible
  1268. // that a subset of the data has already been imported to Cloud
  1269. // Firestore.
  1270. func (r *ProjectsDatabasesService) ImportDocuments(name string, googlefirestoreadminv1beta2importdocumentsrequest *GoogleFirestoreAdminV1beta2ImportDocumentsRequest) *ProjectsDatabasesImportDocumentsCall {
  1271. c := &ProjectsDatabasesImportDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1272. c.name = name
  1273. c.googlefirestoreadminv1beta2importdocumentsrequest = googlefirestoreadminv1beta2importdocumentsrequest
  1274. return c
  1275. }
  1276. // Fields allows partial responses to be retrieved. See
  1277. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1278. // for more information.
  1279. func (c *ProjectsDatabasesImportDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesImportDocumentsCall {
  1280. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1281. return c
  1282. }
  1283. // Context sets the context to be used in this call's Do method. Any
  1284. // pending HTTP request will be aborted if the provided context is
  1285. // canceled.
  1286. func (c *ProjectsDatabasesImportDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesImportDocumentsCall {
  1287. c.ctx_ = ctx
  1288. return c
  1289. }
  1290. // Header returns an http.Header that can be modified by the caller to
  1291. // add HTTP headers to the request.
  1292. func (c *ProjectsDatabasesImportDocumentsCall) Header() http.Header {
  1293. if c.header_ == nil {
  1294. c.header_ = make(http.Header)
  1295. }
  1296. return c.header_
  1297. }
  1298. func (c *ProjectsDatabasesImportDocumentsCall) doRequest(alt string) (*http.Response, error) {
  1299. reqHeaders := make(http.Header)
  1300. for k, v := range c.header_ {
  1301. reqHeaders[k] = v
  1302. }
  1303. reqHeaders.Set("User-Agent", c.s.userAgent())
  1304. var body io.Reader = nil
  1305. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2importdocumentsrequest)
  1306. if err != nil {
  1307. return nil, err
  1308. }
  1309. reqHeaders.Set("Content-Type", "application/json")
  1310. c.urlParams_.Set("alt", alt)
  1311. c.urlParams_.Set("prettyPrint", "false")
  1312. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:importDocuments")
  1313. urls += "?" + c.urlParams_.Encode()
  1314. req, err := http.NewRequest("POST", urls, body)
  1315. if err != nil {
  1316. return nil, err
  1317. }
  1318. req.Header = reqHeaders
  1319. googleapi.Expand(req.URL, map[string]string{
  1320. "name": c.name,
  1321. })
  1322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1323. }
  1324. // Do executes the "firestore.projects.databases.importDocuments" call.
  1325. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  1326. // Any non-2xx status code is an error. Response headers are in either
  1327. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  1328. // was returned at all) in error.(*googleapi.Error).Header. Use
  1329. // googleapi.IsNotModified to check whether the returned error was
  1330. // because http.StatusNotModified was returned.
  1331. func (c *ProjectsDatabasesImportDocumentsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1332. gensupport.SetOptions(c.urlParams_, opts...)
  1333. res, err := c.doRequest("json")
  1334. if res != nil && res.StatusCode == http.StatusNotModified {
  1335. if res.Body != nil {
  1336. res.Body.Close()
  1337. }
  1338. return nil, &googleapi.Error{
  1339. Code: res.StatusCode,
  1340. Header: res.Header,
  1341. }
  1342. }
  1343. if err != nil {
  1344. return nil, err
  1345. }
  1346. defer googleapi.CloseBody(res)
  1347. if err := googleapi.CheckResponse(res); err != nil {
  1348. return nil, err
  1349. }
  1350. ret := &GoogleLongrunningOperation{
  1351. ServerResponse: googleapi.ServerResponse{
  1352. Header: res.Header,
  1353. HTTPStatusCode: res.StatusCode,
  1354. },
  1355. }
  1356. target := &ret
  1357. if err := gensupport.DecodeResponse(target, res); err != nil {
  1358. return nil, err
  1359. }
  1360. return ret, nil
  1361. // {
  1362. // "description": "Imports documents into Google Cloud Firestore. Existing documents with the\nsame name are overwritten. The import occurs in the background and its\nprogress can be monitored and managed via the Operation resource that is\ncreated. If an ImportDocuments operation is cancelled, it is possible\nthat a subset of the data has already been imported to Cloud Firestore.",
  1363. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}:importDocuments",
  1364. // "httpMethod": "POST",
  1365. // "id": "firestore.projects.databases.importDocuments",
  1366. // "parameterOrder": [
  1367. // "name"
  1368. // ],
  1369. // "parameters": {
  1370. // "name": {
  1371. // "description": "Database to import into. Should be of the form:\n`projects/{project_id}/databases/{database_id}`.",
  1372. // "location": "path",
  1373. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  1374. // "required": true,
  1375. // "type": "string"
  1376. // }
  1377. // },
  1378. // "path": "v1beta2/{+name}:importDocuments",
  1379. // "request": {
  1380. // "$ref": "GoogleFirestoreAdminV1beta2ImportDocumentsRequest"
  1381. // },
  1382. // "response": {
  1383. // "$ref": "GoogleLongrunningOperation"
  1384. // },
  1385. // "scopes": [
  1386. // "https://www.googleapis.com/auth/cloud-platform",
  1387. // "https://www.googleapis.com/auth/datastore"
  1388. // ]
  1389. // }
  1390. }
  1391. // method id "firestore.projects.databases.collectionGroups.fields.get":
  1392. type ProjectsDatabasesCollectionGroupsFieldsGetCall struct {
  1393. s *Service
  1394. name string
  1395. urlParams_ gensupport.URLParams
  1396. ifNoneMatch_ string
  1397. ctx_ context.Context
  1398. header_ http.Header
  1399. }
  1400. // Get: Gets the metadata and configuration for a Field.
  1401. func (r *ProjectsDatabasesCollectionGroupsFieldsService) Get(name string) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  1402. c := &ProjectsDatabasesCollectionGroupsFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1403. c.name = name
  1404. return c
  1405. }
  1406. // Fields allows partial responses to be retrieved. See
  1407. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1408. // for more information.
  1409. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  1410. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1411. return c
  1412. }
  1413. // IfNoneMatch sets the optional parameter which makes the operation
  1414. // fail if the object's ETag matches the given value. This is useful for
  1415. // getting updates only after the object has changed since the last
  1416. // request. Use googleapi.IsNotModified to check whether the response
  1417. // error from Do is the result of In-None-Match.
  1418. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  1419. c.ifNoneMatch_ = entityTag
  1420. return c
  1421. }
  1422. // Context sets the context to be used in this call's Do method. Any
  1423. // pending HTTP request will be aborted if the provided context is
  1424. // canceled.
  1425. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  1426. c.ctx_ = ctx
  1427. return c
  1428. }
  1429. // Header returns an http.Header that can be modified by the caller to
  1430. // add HTTP headers to the request.
  1431. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Header() http.Header {
  1432. if c.header_ == nil {
  1433. c.header_ = make(http.Header)
  1434. }
  1435. return c.header_
  1436. }
  1437. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  1438. reqHeaders := make(http.Header)
  1439. for k, v := range c.header_ {
  1440. reqHeaders[k] = v
  1441. }
  1442. reqHeaders.Set("User-Agent", c.s.userAgent())
  1443. if c.ifNoneMatch_ != "" {
  1444. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1445. }
  1446. var body io.Reader = nil
  1447. c.urlParams_.Set("alt", alt)
  1448. c.urlParams_.Set("prettyPrint", "false")
  1449. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  1450. urls += "?" + c.urlParams_.Encode()
  1451. req, err := http.NewRequest("GET", urls, body)
  1452. if err != nil {
  1453. return nil, err
  1454. }
  1455. req.Header = reqHeaders
  1456. googleapi.Expand(req.URL, map[string]string{
  1457. "name": c.name,
  1458. })
  1459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1460. }
  1461. // Do executes the "firestore.projects.databases.collectionGroups.fields.get" call.
  1462. // Exactly one of *GoogleFirestoreAdminV1beta2Field or error will be
  1463. // non-nil. Any non-2xx status code is an error. Response headers are in
  1464. // either *GoogleFirestoreAdminV1beta2Field.ServerResponse.Header or (if
  1465. // a response was returned at all) in error.(*googleapi.Error).Header.
  1466. // Use googleapi.IsNotModified to check whether the returned error was
  1467. // because http.StatusNotModified was returned.
  1468. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta2Field, error) {
  1469. gensupport.SetOptions(c.urlParams_, opts...)
  1470. res, err := c.doRequest("json")
  1471. if res != nil && res.StatusCode == http.StatusNotModified {
  1472. if res.Body != nil {
  1473. res.Body.Close()
  1474. }
  1475. return nil, &googleapi.Error{
  1476. Code: res.StatusCode,
  1477. Header: res.Header,
  1478. }
  1479. }
  1480. if err != nil {
  1481. return nil, err
  1482. }
  1483. defer googleapi.CloseBody(res)
  1484. if err := googleapi.CheckResponse(res); err != nil {
  1485. return nil, err
  1486. }
  1487. ret := &GoogleFirestoreAdminV1beta2Field{
  1488. ServerResponse: googleapi.ServerResponse{
  1489. Header: res.Header,
  1490. HTTPStatusCode: res.StatusCode,
  1491. },
  1492. }
  1493. target := &ret
  1494. if err := gensupport.DecodeResponse(target, res); err != nil {
  1495. return nil, err
  1496. }
  1497. return ret, nil
  1498. // {
  1499. // "description": "Gets the metadata and configuration for a Field.",
  1500. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/fields/{fieldsId}",
  1501. // "httpMethod": "GET",
  1502. // "id": "firestore.projects.databases.collectionGroups.fields.get",
  1503. // "parameterOrder": [
  1504. // "name"
  1505. // ],
  1506. // "parameters": {
  1507. // "name": {
  1508. // "description": "A name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`",
  1509. // "location": "path",
  1510. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+$",
  1511. // "required": true,
  1512. // "type": "string"
  1513. // }
  1514. // },
  1515. // "path": "v1beta2/{+name}",
  1516. // "response": {
  1517. // "$ref": "GoogleFirestoreAdminV1beta2Field"
  1518. // },
  1519. // "scopes": [
  1520. // "https://www.googleapis.com/auth/cloud-platform",
  1521. // "https://www.googleapis.com/auth/datastore"
  1522. // ]
  1523. // }
  1524. }
  1525. // method id "firestore.projects.databases.collectionGroups.fields.list":
  1526. type ProjectsDatabasesCollectionGroupsFieldsListCall struct {
  1527. s *Service
  1528. parent string
  1529. urlParams_ gensupport.URLParams
  1530. ifNoneMatch_ string
  1531. ctx_ context.Context
  1532. header_ http.Header
  1533. }
  1534. // List: Lists the field configuration and metadata for this
  1535. // database.
  1536. //
  1537. // Currently, FirestoreAdmin.ListFields only supports listing
  1538. // fields
  1539. // that have been explicitly overridden. To issue this query,
  1540. // call
  1541. // FirestoreAdmin.ListFields with the filter set
  1542. // to
  1543. // `indexConfig.usesAncestorConfig:false`.
  1544. func (r *ProjectsDatabasesCollectionGroupsFieldsService) List(parent string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1545. c := &ProjectsDatabasesCollectionGroupsFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1546. c.parent = parent
  1547. return c
  1548. }
  1549. // Filter sets the optional parameter "filter": The filter to apply to
  1550. // list results. Currently,
  1551. // FirestoreAdmin.ListFields only supports listing fields
  1552. // that have been explicitly overridden. To issue this query,
  1553. // call
  1554. // FirestoreAdmin.ListFields with the filter set
  1555. // to
  1556. // `indexConfig.usesAncestorConfig:false`.
  1557. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Filter(filter string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1558. c.urlParams_.Set("filter", filter)
  1559. return c
  1560. }
  1561. // PageSize sets the optional parameter "pageSize": The number of
  1562. // results to return.
  1563. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) PageSize(pageSize int64) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1564. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1565. return c
  1566. }
  1567. // PageToken sets the optional parameter "pageToken": A page token,
  1568. // returned from a previous call to
  1569. // FirestoreAdmin.ListFields, that may be used to get the next
  1570. // page of results.
  1571. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) PageToken(pageToken string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1572. c.urlParams_.Set("pageToken", pageToken)
  1573. return c
  1574. }
  1575. // Fields allows partial responses to be retrieved. See
  1576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1577. // for more information.
  1578. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1580. return c
  1581. }
  1582. // IfNoneMatch sets the optional parameter which makes the operation
  1583. // fail if the object's ETag matches the given value. This is useful for
  1584. // getting updates only after the object has changed since the last
  1585. // request. Use googleapi.IsNotModified to check whether the response
  1586. // error from Do is the result of In-None-Match.
  1587. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1588. c.ifNoneMatch_ = entityTag
  1589. return c
  1590. }
  1591. // Context sets the context to be used in this call's Do method. Any
  1592. // pending HTTP request will be aborted if the provided context is
  1593. // canceled.
  1594. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  1595. c.ctx_ = ctx
  1596. return c
  1597. }
  1598. // Header returns an http.Header that can be modified by the caller to
  1599. // add HTTP headers to the request.
  1600. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Header() http.Header {
  1601. if c.header_ == nil {
  1602. c.header_ = make(http.Header)
  1603. }
  1604. return c.header_
  1605. }
  1606. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) doRequest(alt string) (*http.Response, error) {
  1607. reqHeaders := make(http.Header)
  1608. for k, v := range c.header_ {
  1609. reqHeaders[k] = v
  1610. }
  1611. reqHeaders.Set("User-Agent", c.s.userAgent())
  1612. if c.ifNoneMatch_ != "" {
  1613. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1614. }
  1615. var body io.Reader = nil
  1616. c.urlParams_.Set("alt", alt)
  1617. c.urlParams_.Set("prettyPrint", "false")
  1618. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/fields")
  1619. urls += "?" + c.urlParams_.Encode()
  1620. req, err := http.NewRequest("GET", urls, body)
  1621. if err != nil {
  1622. return nil, err
  1623. }
  1624. req.Header = reqHeaders
  1625. googleapi.Expand(req.URL, map[string]string{
  1626. "parent": c.parent,
  1627. })
  1628. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1629. }
  1630. // Do executes the "firestore.projects.databases.collectionGroups.fields.list" call.
  1631. // Exactly one of *GoogleFirestoreAdminV1beta2ListFieldsResponse or
  1632. // error will be non-nil. Any non-2xx status code is an error. Response
  1633. // headers are in either
  1634. // *GoogleFirestoreAdminV1beta2ListFieldsResponse.ServerResponse.Header
  1635. // or (if a response was returned at all) in
  1636. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1637. // whether the returned error was because http.StatusNotModified was
  1638. // returned.
  1639. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta2ListFieldsResponse, error) {
  1640. gensupport.SetOptions(c.urlParams_, opts...)
  1641. res, err := c.doRequest("json")
  1642. if res != nil && res.StatusCode == http.StatusNotModified {
  1643. if res.Body != nil {
  1644. res.Body.Close()
  1645. }
  1646. return nil, &googleapi.Error{
  1647. Code: res.StatusCode,
  1648. Header: res.Header,
  1649. }
  1650. }
  1651. if err != nil {
  1652. return nil, err
  1653. }
  1654. defer googleapi.CloseBody(res)
  1655. if err := googleapi.CheckResponse(res); err != nil {
  1656. return nil, err
  1657. }
  1658. ret := &GoogleFirestoreAdminV1beta2ListFieldsResponse{
  1659. ServerResponse: googleapi.ServerResponse{
  1660. Header: res.Header,
  1661. HTTPStatusCode: res.StatusCode,
  1662. },
  1663. }
  1664. target := &ret
  1665. if err := gensupport.DecodeResponse(target, res); err != nil {
  1666. return nil, err
  1667. }
  1668. return ret, nil
  1669. // {
  1670. // "description": "Lists the field configuration and metadata for this database.\n\nCurrently, FirestoreAdmin.ListFields only supports listing fields\nthat have been explicitly overridden. To issue this query, call\nFirestoreAdmin.ListFields with the filter set to\n`indexConfig.usesAncestorConfig:false`.",
  1671. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/fields",
  1672. // "httpMethod": "GET",
  1673. // "id": "firestore.projects.databases.collectionGroups.fields.list",
  1674. // "parameterOrder": [
  1675. // "parent"
  1676. // ],
  1677. // "parameters": {
  1678. // "filter": {
  1679. // "description": "The filter to apply to list results. Currently,\nFirestoreAdmin.ListFields only supports listing fields\nthat have been explicitly overridden. To issue this query, call\nFirestoreAdmin.ListFields with the filter set to\n`indexConfig.usesAncestorConfig:false`.",
  1680. // "location": "query",
  1681. // "type": "string"
  1682. // },
  1683. // "pageSize": {
  1684. // "description": "The number of results to return.",
  1685. // "format": "int32",
  1686. // "location": "query",
  1687. // "type": "integer"
  1688. // },
  1689. // "pageToken": {
  1690. // "description": "A page token, returned from a previous call to\nFirestoreAdmin.ListFields, that may be used to get the next\npage of results.",
  1691. // "location": "query",
  1692. // "type": "string"
  1693. // },
  1694. // "parent": {
  1695. // "description": "A parent name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`",
  1696. // "location": "path",
  1697. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+$",
  1698. // "required": true,
  1699. // "type": "string"
  1700. // }
  1701. // },
  1702. // "path": "v1beta2/{+parent}/fields",
  1703. // "response": {
  1704. // "$ref": "GoogleFirestoreAdminV1beta2ListFieldsResponse"
  1705. // },
  1706. // "scopes": [
  1707. // "https://www.googleapis.com/auth/cloud-platform",
  1708. // "https://www.googleapis.com/auth/datastore"
  1709. // ]
  1710. // }
  1711. }
  1712. // Pages invokes f for each page of results.
  1713. // A non-nil error returned from f will halt the iteration.
  1714. // The provided context supersedes any context provided to the Context method.
  1715. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Pages(ctx context.Context, f func(*GoogleFirestoreAdminV1beta2ListFieldsResponse) error) error {
  1716. c.ctx_ = ctx
  1717. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1718. for {
  1719. x, err := c.Do()
  1720. if err != nil {
  1721. return err
  1722. }
  1723. if err := f(x); err != nil {
  1724. return err
  1725. }
  1726. if x.NextPageToken == "" {
  1727. return nil
  1728. }
  1729. c.PageToken(x.NextPageToken)
  1730. }
  1731. }
  1732. // method id "firestore.projects.databases.collectionGroups.fields.patch":
  1733. type ProjectsDatabasesCollectionGroupsFieldsPatchCall struct {
  1734. s *Service
  1735. name string
  1736. googlefirestoreadminv1beta2field *GoogleFirestoreAdminV1beta2Field
  1737. urlParams_ gensupport.URLParams
  1738. ctx_ context.Context
  1739. header_ http.Header
  1740. }
  1741. // Patch: Updates a field configuration. Currently, field updates apply
  1742. // only to
  1743. // single field index configuration. However, calls
  1744. // to
  1745. // FirestoreAdmin.UpdateField should provide a field mask to
  1746. // avoid
  1747. // changing any configuration that the caller isn't aware of. The field
  1748. // mask
  1749. // should be specified as: `{ paths: "index_config" }`.
  1750. //
  1751. // This call returns a google.longrunning.Operation which may be used
  1752. // to
  1753. // track the status of the field update. The metadata for
  1754. // the operation will be the type FieldOperationMetadata.
  1755. //
  1756. // To configure the default field settings for the database, use
  1757. // the special `Field` with resource
  1758. // name:
  1759. // `projects/{project_id}/databases/{database_id}/collectionGroups/
  1760. // __default__/fields/*`.
  1761. func (r *ProjectsDatabasesCollectionGroupsFieldsService) Patch(name string, googlefirestoreadminv1beta2field *GoogleFirestoreAdminV1beta2Field) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  1762. c := &ProjectsDatabasesCollectionGroupsFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1763. c.name = name
  1764. c.googlefirestoreadminv1beta2field = googlefirestoreadminv1beta2field
  1765. return c
  1766. }
  1767. // UpdateMask sets the optional parameter "updateMask": A mask, relative
  1768. // to the field. If specified, only configuration specified
  1769. // by this field_mask will be updated in the field.
  1770. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) UpdateMask(updateMask string) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  1771. c.urlParams_.Set("updateMask", updateMask)
  1772. return c
  1773. }
  1774. // Fields allows partial responses to be retrieved. See
  1775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1776. // for more information.
  1777. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  1778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1779. return c
  1780. }
  1781. // Context sets the context to be used in this call's Do method. Any
  1782. // pending HTTP request will be aborted if the provided context is
  1783. // canceled.
  1784. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  1785. c.ctx_ = ctx
  1786. return c
  1787. }
  1788. // Header returns an http.Header that can be modified by the caller to
  1789. // add HTTP headers to the request.
  1790. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Header() http.Header {
  1791. if c.header_ == nil {
  1792. c.header_ = make(http.Header)
  1793. }
  1794. return c.header_
  1795. }
  1796. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  1797. reqHeaders := make(http.Header)
  1798. for k, v := range c.header_ {
  1799. reqHeaders[k] = v
  1800. }
  1801. reqHeaders.Set("User-Agent", c.s.userAgent())
  1802. var body io.Reader = nil
  1803. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2field)
  1804. if err != nil {
  1805. return nil, err
  1806. }
  1807. reqHeaders.Set("Content-Type", "application/json")
  1808. c.urlParams_.Set("alt", alt)
  1809. c.urlParams_.Set("prettyPrint", "false")
  1810. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  1811. urls += "?" + c.urlParams_.Encode()
  1812. req, err := http.NewRequest("PATCH", urls, body)
  1813. if err != nil {
  1814. return nil, err
  1815. }
  1816. req.Header = reqHeaders
  1817. googleapi.Expand(req.URL, map[string]string{
  1818. "name": c.name,
  1819. })
  1820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1821. }
  1822. // Do executes the "firestore.projects.databases.collectionGroups.fields.patch" call.
  1823. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  1824. // Any non-2xx status code is an error. Response headers are in either
  1825. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  1826. // was returned at all) in error.(*googleapi.Error).Header. Use
  1827. // googleapi.IsNotModified to check whether the returned error was
  1828. // because http.StatusNotModified was returned.
  1829. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1830. gensupport.SetOptions(c.urlParams_, opts...)
  1831. res, err := c.doRequest("json")
  1832. if res != nil && res.StatusCode == http.StatusNotModified {
  1833. if res.Body != nil {
  1834. res.Body.Close()
  1835. }
  1836. return nil, &googleapi.Error{
  1837. Code: res.StatusCode,
  1838. Header: res.Header,
  1839. }
  1840. }
  1841. if err != nil {
  1842. return nil, err
  1843. }
  1844. defer googleapi.CloseBody(res)
  1845. if err := googleapi.CheckResponse(res); err != nil {
  1846. return nil, err
  1847. }
  1848. ret := &GoogleLongrunningOperation{
  1849. ServerResponse: googleapi.ServerResponse{
  1850. Header: res.Header,
  1851. HTTPStatusCode: res.StatusCode,
  1852. },
  1853. }
  1854. target := &ret
  1855. if err := gensupport.DecodeResponse(target, res); err != nil {
  1856. return nil, err
  1857. }
  1858. return ret, nil
  1859. // {
  1860. // "description": "Updates a field configuration. Currently, field updates apply only to\nsingle field index configuration. However, calls to\nFirestoreAdmin.UpdateField should provide a field mask to avoid\nchanging any configuration that the caller isn't aware of. The field mask\nshould be specified as: `{ paths: \"index_config\" }`.\n\nThis call returns a google.longrunning.Operation which may be used to\ntrack the status of the field update. The metadata for\nthe operation will be the type FieldOperationMetadata.\n\nTo configure the default field settings for the database, use\nthe special `Field` with resource name:\n`projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`.",
  1861. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/fields/{fieldsId}",
  1862. // "httpMethod": "PATCH",
  1863. // "id": "firestore.projects.databases.collectionGroups.fields.patch",
  1864. // "parameterOrder": [
  1865. // "name"
  1866. // ],
  1867. // "parameters": {
  1868. // "name": {
  1869. // "description": "A field name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}`\n\nA field path may be a simple field name, e.g. `address` or a path to fields\nwithin map_value , e.g. `address.city`,\nor a special field path. The only valid special field is `*`, which\nrepresents any field.\n\nField paths may be quoted using ` (backtick). The only character that needs\nto be escaped within a quoted field path is the backtick character itself,\nescaped using a backslash. Special characters in field paths that\nmust be quoted include: `*`, `.`,\n``` (backtick), `[`, `]`, as well as any ascii symbolic characters.\n\nExamples:\n(Note: Comments here are written in markdown syntax, so there is an\n additional layer of backticks to represent a code block)\n`\\`address.city\\`` represents a field named `address.city`, not the map key\n`city` in the field `address`.\n`\\`*\\`` represents a field named `*`, not any field.\n\nA special `Field` contains the default indexing settings for all fields.\nThis field's resource name is:\n`projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields/*`\nIndexes defined on this `Field` will be applied to all fields which do not\nhave their own `Field` index configuration.",
  1870. // "location": "path",
  1871. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+$",
  1872. // "required": true,
  1873. // "type": "string"
  1874. // },
  1875. // "updateMask": {
  1876. // "description": "A mask, relative to the field. If specified, only configuration specified\nby this field_mask will be updated in the field.",
  1877. // "format": "google-fieldmask",
  1878. // "location": "query",
  1879. // "type": "string"
  1880. // }
  1881. // },
  1882. // "path": "v1beta2/{+name}",
  1883. // "request": {
  1884. // "$ref": "GoogleFirestoreAdminV1beta2Field"
  1885. // },
  1886. // "response": {
  1887. // "$ref": "GoogleLongrunningOperation"
  1888. // },
  1889. // "scopes": [
  1890. // "https://www.googleapis.com/auth/cloud-platform",
  1891. // "https://www.googleapis.com/auth/datastore"
  1892. // ]
  1893. // }
  1894. }
  1895. // method id "firestore.projects.databases.collectionGroups.indexes.create":
  1896. type ProjectsDatabasesCollectionGroupsIndexesCreateCall struct {
  1897. s *Service
  1898. parent string
  1899. googlefirestoreadminv1beta2index *GoogleFirestoreAdminV1beta2Index
  1900. urlParams_ gensupport.URLParams
  1901. ctx_ context.Context
  1902. header_ http.Header
  1903. }
  1904. // Create: Creates a composite index. This returns a
  1905. // google.longrunning.Operation
  1906. // which may be used to track the status of the creation. The metadata
  1907. // for
  1908. // the operation will be the type IndexOperationMetadata.
  1909. func (r *ProjectsDatabasesCollectionGroupsIndexesService) Create(parent string, googlefirestoreadminv1beta2index *GoogleFirestoreAdminV1beta2Index) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  1910. c := &ProjectsDatabasesCollectionGroupsIndexesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1911. c.parent = parent
  1912. c.googlefirestoreadminv1beta2index = googlefirestoreadminv1beta2index
  1913. return c
  1914. }
  1915. // Fields allows partial responses to be retrieved. See
  1916. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1917. // for more information.
  1918. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  1919. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1920. return c
  1921. }
  1922. // Context sets the context to be used in this call's Do method. Any
  1923. // pending HTTP request will be aborted if the provided context is
  1924. // canceled.
  1925. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  1926. c.ctx_ = ctx
  1927. return c
  1928. }
  1929. // Header returns an http.Header that can be modified by the caller to
  1930. // add HTTP headers to the request.
  1931. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Header() http.Header {
  1932. if c.header_ == nil {
  1933. c.header_ = make(http.Header)
  1934. }
  1935. return c.header_
  1936. }
  1937. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) doRequest(alt string) (*http.Response, error) {
  1938. reqHeaders := make(http.Header)
  1939. for k, v := range c.header_ {
  1940. reqHeaders[k] = v
  1941. }
  1942. reqHeaders.Set("User-Agent", c.s.userAgent())
  1943. var body io.Reader = nil
  1944. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1beta2index)
  1945. if err != nil {
  1946. return nil, err
  1947. }
  1948. reqHeaders.Set("Content-Type", "application/json")
  1949. c.urlParams_.Set("alt", alt)
  1950. c.urlParams_.Set("prettyPrint", "false")
  1951. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/indexes")
  1952. urls += "?" + c.urlParams_.Encode()
  1953. req, err := http.NewRequest("POST", urls, body)
  1954. if err != nil {
  1955. return nil, err
  1956. }
  1957. req.Header = reqHeaders
  1958. googleapi.Expand(req.URL, map[string]string{
  1959. "parent": c.parent,
  1960. })
  1961. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1962. }
  1963. // Do executes the "firestore.projects.databases.collectionGroups.indexes.create" call.
  1964. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  1965. // Any non-2xx status code is an error. Response headers are in either
  1966. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  1967. // was returned at all) in error.(*googleapi.Error).Header. Use
  1968. // googleapi.IsNotModified to check whether the returned error was
  1969. // because http.StatusNotModified was returned.
  1970. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1971. gensupport.SetOptions(c.urlParams_, opts...)
  1972. res, err := c.doRequest("json")
  1973. if res != nil && res.StatusCode == http.StatusNotModified {
  1974. if res.Body != nil {
  1975. res.Body.Close()
  1976. }
  1977. return nil, &googleapi.Error{
  1978. Code: res.StatusCode,
  1979. Header: res.Header,
  1980. }
  1981. }
  1982. if err != nil {
  1983. return nil, err
  1984. }
  1985. defer googleapi.CloseBody(res)
  1986. if err := googleapi.CheckResponse(res); err != nil {
  1987. return nil, err
  1988. }
  1989. ret := &GoogleLongrunningOperation{
  1990. ServerResponse: googleapi.ServerResponse{
  1991. Header: res.Header,
  1992. HTTPStatusCode: res.StatusCode,
  1993. },
  1994. }
  1995. target := &ret
  1996. if err := gensupport.DecodeResponse(target, res); err != nil {
  1997. return nil, err
  1998. }
  1999. return ret, nil
  2000. // {
  2001. // "description": "Creates a composite index. This returns a google.longrunning.Operation\nwhich may be used to track the status of the creation. The metadata for\nthe operation will be the type IndexOperationMetadata.",
  2002. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/indexes",
  2003. // "httpMethod": "POST",
  2004. // "id": "firestore.projects.databases.collectionGroups.indexes.create",
  2005. // "parameterOrder": [
  2006. // "parent"
  2007. // ],
  2008. // "parameters": {
  2009. // "parent": {
  2010. // "description": "A parent name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`",
  2011. // "location": "path",
  2012. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+$",
  2013. // "required": true,
  2014. // "type": "string"
  2015. // }
  2016. // },
  2017. // "path": "v1beta2/{+parent}/indexes",
  2018. // "request": {
  2019. // "$ref": "GoogleFirestoreAdminV1beta2Index"
  2020. // },
  2021. // "response": {
  2022. // "$ref": "GoogleLongrunningOperation"
  2023. // },
  2024. // "scopes": [
  2025. // "https://www.googleapis.com/auth/cloud-platform",
  2026. // "https://www.googleapis.com/auth/datastore"
  2027. // ]
  2028. // }
  2029. }
  2030. // method id "firestore.projects.databases.collectionGroups.indexes.delete":
  2031. type ProjectsDatabasesCollectionGroupsIndexesDeleteCall struct {
  2032. s *Service
  2033. name string
  2034. urlParams_ gensupport.URLParams
  2035. ctx_ context.Context
  2036. header_ http.Header
  2037. }
  2038. // Delete: Deletes a composite index.
  2039. func (r *ProjectsDatabasesCollectionGroupsIndexesService) Delete(name string) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  2040. c := &ProjectsDatabasesCollectionGroupsIndexesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2041. c.name = name
  2042. return c
  2043. }
  2044. // Fields allows partial responses to be retrieved. See
  2045. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2046. // for more information.
  2047. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  2048. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2049. return c
  2050. }
  2051. // Context sets the context to be used in this call's Do method. Any
  2052. // pending HTTP request will be aborted if the provided context is
  2053. // canceled.
  2054. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  2055. c.ctx_ = ctx
  2056. return c
  2057. }
  2058. // Header returns an http.Header that can be modified by the caller to
  2059. // add HTTP headers to the request.
  2060. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Header() http.Header {
  2061. if c.header_ == nil {
  2062. c.header_ = make(http.Header)
  2063. }
  2064. return c.header_
  2065. }
  2066. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2067. reqHeaders := make(http.Header)
  2068. for k, v := range c.header_ {
  2069. reqHeaders[k] = v
  2070. }
  2071. reqHeaders.Set("User-Agent", c.s.userAgent())
  2072. var body io.Reader = nil
  2073. c.urlParams_.Set("alt", alt)
  2074. c.urlParams_.Set("prettyPrint", "false")
  2075. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  2076. urls += "?" + c.urlParams_.Encode()
  2077. req, err := http.NewRequest("DELETE", urls, body)
  2078. if err != nil {
  2079. return nil, err
  2080. }
  2081. req.Header = reqHeaders
  2082. googleapi.Expand(req.URL, map[string]string{
  2083. "name": c.name,
  2084. })
  2085. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2086. }
  2087. // Do executes the "firestore.projects.databases.collectionGroups.indexes.delete" call.
  2088. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2089. // code is an error. Response headers are in either
  2090. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2091. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2092. // check whether the returned error was because http.StatusNotModified
  2093. // was returned.
  2094. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2095. gensupport.SetOptions(c.urlParams_, opts...)
  2096. res, err := c.doRequest("json")
  2097. if res != nil && res.StatusCode == http.StatusNotModified {
  2098. if res.Body != nil {
  2099. res.Body.Close()
  2100. }
  2101. return nil, &googleapi.Error{
  2102. Code: res.StatusCode,
  2103. Header: res.Header,
  2104. }
  2105. }
  2106. if err != nil {
  2107. return nil, err
  2108. }
  2109. defer googleapi.CloseBody(res)
  2110. if err := googleapi.CheckResponse(res); err != nil {
  2111. return nil, err
  2112. }
  2113. ret := &Empty{
  2114. ServerResponse: googleapi.ServerResponse{
  2115. Header: res.Header,
  2116. HTTPStatusCode: res.StatusCode,
  2117. },
  2118. }
  2119. target := &ret
  2120. if err := gensupport.DecodeResponse(target, res); err != nil {
  2121. return nil, err
  2122. }
  2123. return ret, nil
  2124. // {
  2125. // "description": "Deletes a composite index.",
  2126. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/indexes/{indexesId}",
  2127. // "httpMethod": "DELETE",
  2128. // "id": "firestore.projects.databases.collectionGroups.indexes.delete",
  2129. // "parameterOrder": [
  2130. // "name"
  2131. // ],
  2132. // "parameters": {
  2133. // "name": {
  2134. // "description": "A name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`",
  2135. // "location": "path",
  2136. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+$",
  2137. // "required": true,
  2138. // "type": "string"
  2139. // }
  2140. // },
  2141. // "path": "v1beta2/{+name}",
  2142. // "response": {
  2143. // "$ref": "Empty"
  2144. // },
  2145. // "scopes": [
  2146. // "https://www.googleapis.com/auth/cloud-platform",
  2147. // "https://www.googleapis.com/auth/datastore"
  2148. // ]
  2149. // }
  2150. }
  2151. // method id "firestore.projects.databases.collectionGroups.indexes.get":
  2152. type ProjectsDatabasesCollectionGroupsIndexesGetCall struct {
  2153. s *Service
  2154. name string
  2155. urlParams_ gensupport.URLParams
  2156. ifNoneMatch_ string
  2157. ctx_ context.Context
  2158. header_ http.Header
  2159. }
  2160. // Get: Gets a composite index.
  2161. func (r *ProjectsDatabasesCollectionGroupsIndexesService) Get(name string) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  2162. c := &ProjectsDatabasesCollectionGroupsIndexesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2163. c.name = name
  2164. return c
  2165. }
  2166. // Fields allows partial responses to be retrieved. See
  2167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2168. // for more information.
  2169. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  2170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2171. return c
  2172. }
  2173. // IfNoneMatch sets the optional parameter which makes the operation
  2174. // fail if the object's ETag matches the given value. This is useful for
  2175. // getting updates only after the object has changed since the last
  2176. // request. Use googleapi.IsNotModified to check whether the response
  2177. // error from Do is the result of In-None-Match.
  2178. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  2179. c.ifNoneMatch_ = entityTag
  2180. return c
  2181. }
  2182. // Context sets the context to be used in this call's Do method. Any
  2183. // pending HTTP request will be aborted if the provided context is
  2184. // canceled.
  2185. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  2186. c.ctx_ = ctx
  2187. return c
  2188. }
  2189. // Header returns an http.Header that can be modified by the caller to
  2190. // add HTTP headers to the request.
  2191. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Header() http.Header {
  2192. if c.header_ == nil {
  2193. c.header_ = make(http.Header)
  2194. }
  2195. return c.header_
  2196. }
  2197. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) doRequest(alt string) (*http.Response, error) {
  2198. reqHeaders := make(http.Header)
  2199. for k, v := range c.header_ {
  2200. reqHeaders[k] = v
  2201. }
  2202. reqHeaders.Set("User-Agent", c.s.userAgent())
  2203. if c.ifNoneMatch_ != "" {
  2204. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2205. }
  2206. var body io.Reader = nil
  2207. c.urlParams_.Set("alt", alt)
  2208. c.urlParams_.Set("prettyPrint", "false")
  2209. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  2210. urls += "?" + c.urlParams_.Encode()
  2211. req, err := http.NewRequest("GET", urls, body)
  2212. if err != nil {
  2213. return nil, err
  2214. }
  2215. req.Header = reqHeaders
  2216. googleapi.Expand(req.URL, map[string]string{
  2217. "name": c.name,
  2218. })
  2219. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2220. }
  2221. // Do executes the "firestore.projects.databases.collectionGroups.indexes.get" call.
  2222. // Exactly one of *GoogleFirestoreAdminV1beta2Index or error will be
  2223. // non-nil. Any non-2xx status code is an error. Response headers are in
  2224. // either *GoogleFirestoreAdminV1beta2Index.ServerResponse.Header or (if
  2225. // a response was returned at all) in error.(*googleapi.Error).Header.
  2226. // Use googleapi.IsNotModified to check whether the returned error was
  2227. // because http.StatusNotModified was returned.
  2228. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta2Index, error) {
  2229. gensupport.SetOptions(c.urlParams_, opts...)
  2230. res, err := c.doRequest("json")
  2231. if res != nil && res.StatusCode == http.StatusNotModified {
  2232. if res.Body != nil {
  2233. res.Body.Close()
  2234. }
  2235. return nil, &googleapi.Error{
  2236. Code: res.StatusCode,
  2237. Header: res.Header,
  2238. }
  2239. }
  2240. if err != nil {
  2241. return nil, err
  2242. }
  2243. defer googleapi.CloseBody(res)
  2244. if err := googleapi.CheckResponse(res); err != nil {
  2245. return nil, err
  2246. }
  2247. ret := &GoogleFirestoreAdminV1beta2Index{
  2248. ServerResponse: googleapi.ServerResponse{
  2249. Header: res.Header,
  2250. HTTPStatusCode: res.StatusCode,
  2251. },
  2252. }
  2253. target := &ret
  2254. if err := gensupport.DecodeResponse(target, res); err != nil {
  2255. return nil, err
  2256. }
  2257. return ret, nil
  2258. // {
  2259. // "description": "Gets a composite index.",
  2260. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/indexes/{indexesId}",
  2261. // "httpMethod": "GET",
  2262. // "id": "firestore.projects.databases.collectionGroups.indexes.get",
  2263. // "parameterOrder": [
  2264. // "name"
  2265. // ],
  2266. // "parameters": {
  2267. // "name": {
  2268. // "description": "A name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`",
  2269. // "location": "path",
  2270. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+$",
  2271. // "required": true,
  2272. // "type": "string"
  2273. // }
  2274. // },
  2275. // "path": "v1beta2/{+name}",
  2276. // "response": {
  2277. // "$ref": "GoogleFirestoreAdminV1beta2Index"
  2278. // },
  2279. // "scopes": [
  2280. // "https://www.googleapis.com/auth/cloud-platform",
  2281. // "https://www.googleapis.com/auth/datastore"
  2282. // ]
  2283. // }
  2284. }
  2285. // method id "firestore.projects.databases.collectionGroups.indexes.list":
  2286. type ProjectsDatabasesCollectionGroupsIndexesListCall struct {
  2287. s *Service
  2288. parent string
  2289. urlParams_ gensupport.URLParams
  2290. ifNoneMatch_ string
  2291. ctx_ context.Context
  2292. header_ http.Header
  2293. }
  2294. // List: Lists composite indexes.
  2295. func (r *ProjectsDatabasesCollectionGroupsIndexesService) List(parent string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2296. c := &ProjectsDatabasesCollectionGroupsIndexesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2297. c.parent = parent
  2298. return c
  2299. }
  2300. // Filter sets the optional parameter "filter": The filter to apply to
  2301. // list results.
  2302. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Filter(filter string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2303. c.urlParams_.Set("filter", filter)
  2304. return c
  2305. }
  2306. // PageSize sets the optional parameter "pageSize": The number of
  2307. // results to return.
  2308. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) PageSize(pageSize int64) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2309. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2310. return c
  2311. }
  2312. // PageToken sets the optional parameter "pageToken": A page token,
  2313. // returned from a previous call to
  2314. // FirestoreAdmin.ListIndexes, that may be used to get the next
  2315. // page of results.
  2316. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) PageToken(pageToken string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2317. c.urlParams_.Set("pageToken", pageToken)
  2318. return c
  2319. }
  2320. // Fields allows partial responses to be retrieved. See
  2321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2322. // for more information.
  2323. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2325. return c
  2326. }
  2327. // IfNoneMatch sets the optional parameter which makes the operation
  2328. // fail if the object's ETag matches the given value. This is useful for
  2329. // getting updates only after the object has changed since the last
  2330. // request. Use googleapi.IsNotModified to check whether the response
  2331. // error from Do is the result of In-None-Match.
  2332. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2333. c.ifNoneMatch_ = entityTag
  2334. return c
  2335. }
  2336. // Context sets the context to be used in this call's Do method. Any
  2337. // pending HTTP request will be aborted if the provided context is
  2338. // canceled.
  2339. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  2340. c.ctx_ = ctx
  2341. return c
  2342. }
  2343. // Header returns an http.Header that can be modified by the caller to
  2344. // add HTTP headers to the request.
  2345. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Header() http.Header {
  2346. if c.header_ == nil {
  2347. c.header_ = make(http.Header)
  2348. }
  2349. return c.header_
  2350. }
  2351. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) doRequest(alt string) (*http.Response, error) {
  2352. reqHeaders := make(http.Header)
  2353. for k, v := range c.header_ {
  2354. reqHeaders[k] = v
  2355. }
  2356. reqHeaders.Set("User-Agent", c.s.userAgent())
  2357. if c.ifNoneMatch_ != "" {
  2358. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2359. }
  2360. var body io.Reader = nil
  2361. c.urlParams_.Set("alt", alt)
  2362. c.urlParams_.Set("prettyPrint", "false")
  2363. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/indexes")
  2364. urls += "?" + c.urlParams_.Encode()
  2365. req, err := http.NewRequest("GET", urls, body)
  2366. if err != nil {
  2367. return nil, err
  2368. }
  2369. req.Header = reqHeaders
  2370. googleapi.Expand(req.URL, map[string]string{
  2371. "parent": c.parent,
  2372. })
  2373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2374. }
  2375. // Do executes the "firestore.projects.databases.collectionGroups.indexes.list" call.
  2376. // Exactly one of *GoogleFirestoreAdminV1beta2ListIndexesResponse or
  2377. // error will be non-nil. Any non-2xx status code is an error. Response
  2378. // headers are in either
  2379. // *GoogleFirestoreAdminV1beta2ListIndexesResponse.ServerResponse.Header
  2380. // or (if a response was returned at all) in
  2381. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2382. // whether the returned error was because http.StatusNotModified was
  2383. // returned.
  2384. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1beta2ListIndexesResponse, error) {
  2385. gensupport.SetOptions(c.urlParams_, opts...)
  2386. res, err := c.doRequest("json")
  2387. if res != nil && res.StatusCode == http.StatusNotModified {
  2388. if res.Body != nil {
  2389. res.Body.Close()
  2390. }
  2391. return nil, &googleapi.Error{
  2392. Code: res.StatusCode,
  2393. Header: res.Header,
  2394. }
  2395. }
  2396. if err != nil {
  2397. return nil, err
  2398. }
  2399. defer googleapi.CloseBody(res)
  2400. if err := googleapi.CheckResponse(res); err != nil {
  2401. return nil, err
  2402. }
  2403. ret := &GoogleFirestoreAdminV1beta2ListIndexesResponse{
  2404. ServerResponse: googleapi.ServerResponse{
  2405. Header: res.Header,
  2406. HTTPStatusCode: res.StatusCode,
  2407. },
  2408. }
  2409. target := &ret
  2410. if err := gensupport.DecodeResponse(target, res); err != nil {
  2411. return nil, err
  2412. }
  2413. return ret, nil
  2414. // {
  2415. // "description": "Lists composite indexes.",
  2416. // "flatPath": "v1beta2/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/indexes",
  2417. // "httpMethod": "GET",
  2418. // "id": "firestore.projects.databases.collectionGroups.indexes.list",
  2419. // "parameterOrder": [
  2420. // "parent"
  2421. // ],
  2422. // "parameters": {
  2423. // "filter": {
  2424. // "description": "The filter to apply to list results.",
  2425. // "location": "query",
  2426. // "type": "string"
  2427. // },
  2428. // "pageSize": {
  2429. // "description": "The number of results to return.",
  2430. // "format": "int32",
  2431. // "location": "query",
  2432. // "type": "integer"
  2433. // },
  2434. // "pageToken": {
  2435. // "description": "A page token, returned from a previous call to\nFirestoreAdmin.ListIndexes, that may be used to get the next\npage of results.",
  2436. // "location": "query",
  2437. // "type": "string"
  2438. // },
  2439. // "parent": {
  2440. // "description": "A parent name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`",
  2441. // "location": "path",
  2442. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+$",
  2443. // "required": true,
  2444. // "type": "string"
  2445. // }
  2446. // },
  2447. // "path": "v1beta2/{+parent}/indexes",
  2448. // "response": {
  2449. // "$ref": "GoogleFirestoreAdminV1beta2ListIndexesResponse"
  2450. // },
  2451. // "scopes": [
  2452. // "https://www.googleapis.com/auth/cloud-platform",
  2453. // "https://www.googleapis.com/auth/datastore"
  2454. // ]
  2455. // }
  2456. }
  2457. // Pages invokes f for each page of results.
  2458. // A non-nil error returned from f will halt the iteration.
  2459. // The provided context supersedes any context provided to the Context method.
  2460. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Pages(ctx context.Context, f func(*GoogleFirestoreAdminV1beta2ListIndexesResponse) error) error {
  2461. c.ctx_ = ctx
  2462. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2463. for {
  2464. x, err := c.Do()
  2465. if err != nil {
  2466. return err
  2467. }
  2468. if err := f(x); err != nil {
  2469. return err
  2470. }
  2471. if x.NextPageToken == "" {
  2472. return nil
  2473. }
  2474. c.PageToken(x.NextPageToken)
  2475. }
  2476. }