You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

8284 lines
304 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/v1"
  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/v1"
  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:v1"
  73. const apiName = "firestore"
  74. const apiVersion = "v1"
  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. rs.Locations = NewProjectsLocationsService(s)
  133. return rs
  134. }
  135. type ProjectsService struct {
  136. s *Service
  137. Databases *ProjectsDatabasesService
  138. Locations *ProjectsLocationsService
  139. }
  140. func NewProjectsDatabasesService(s *Service) *ProjectsDatabasesService {
  141. rs := &ProjectsDatabasesService{s: s}
  142. rs.CollectionGroups = NewProjectsDatabasesCollectionGroupsService(s)
  143. rs.Documents = NewProjectsDatabasesDocumentsService(s)
  144. rs.Operations = NewProjectsDatabasesOperationsService(s)
  145. return rs
  146. }
  147. type ProjectsDatabasesService struct {
  148. s *Service
  149. CollectionGroups *ProjectsDatabasesCollectionGroupsService
  150. Documents *ProjectsDatabasesDocumentsService
  151. Operations *ProjectsDatabasesOperationsService
  152. }
  153. func NewProjectsDatabasesCollectionGroupsService(s *Service) *ProjectsDatabasesCollectionGroupsService {
  154. rs := &ProjectsDatabasesCollectionGroupsService{s: s}
  155. rs.Fields = NewProjectsDatabasesCollectionGroupsFieldsService(s)
  156. rs.Indexes = NewProjectsDatabasesCollectionGroupsIndexesService(s)
  157. return rs
  158. }
  159. type ProjectsDatabasesCollectionGroupsService struct {
  160. s *Service
  161. Fields *ProjectsDatabasesCollectionGroupsFieldsService
  162. Indexes *ProjectsDatabasesCollectionGroupsIndexesService
  163. }
  164. func NewProjectsDatabasesCollectionGroupsFieldsService(s *Service) *ProjectsDatabasesCollectionGroupsFieldsService {
  165. rs := &ProjectsDatabasesCollectionGroupsFieldsService{s: s}
  166. return rs
  167. }
  168. type ProjectsDatabasesCollectionGroupsFieldsService struct {
  169. s *Service
  170. }
  171. func NewProjectsDatabasesCollectionGroupsIndexesService(s *Service) *ProjectsDatabasesCollectionGroupsIndexesService {
  172. rs := &ProjectsDatabasesCollectionGroupsIndexesService{s: s}
  173. return rs
  174. }
  175. type ProjectsDatabasesCollectionGroupsIndexesService struct {
  176. s *Service
  177. }
  178. func NewProjectsDatabasesDocumentsService(s *Service) *ProjectsDatabasesDocumentsService {
  179. rs := &ProjectsDatabasesDocumentsService{s: s}
  180. return rs
  181. }
  182. type ProjectsDatabasesDocumentsService struct {
  183. s *Service
  184. }
  185. func NewProjectsDatabasesOperationsService(s *Service) *ProjectsDatabasesOperationsService {
  186. rs := &ProjectsDatabasesOperationsService{s: s}
  187. return rs
  188. }
  189. type ProjectsDatabasesOperationsService struct {
  190. s *Service
  191. }
  192. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  193. rs := &ProjectsLocationsService{s: s}
  194. return rs
  195. }
  196. type ProjectsLocationsService struct {
  197. s *Service
  198. }
  199. // ArrayValue: An array value.
  200. type ArrayValue struct {
  201. // Values: Values in the array.
  202. Values []*Value `json:"values,omitempty"`
  203. // ForceSendFields is a list of field names (e.g. "Values") to
  204. // unconditionally include in API requests. By default, fields with
  205. // empty values are omitted from API requests. However, any non-pointer,
  206. // non-interface field appearing in ForceSendFields will be sent to the
  207. // server regardless of whether the field is empty or not. This may be
  208. // used to include empty fields in Patch requests.
  209. ForceSendFields []string `json:"-"`
  210. // NullFields is a list of field names (e.g. "Values") to include in API
  211. // requests with the JSON null value. By default, fields with empty
  212. // values are omitted from API requests. However, any field with an
  213. // empty value appearing in NullFields will be sent to the server as
  214. // null. It is an error if a field in this list has a non-empty value.
  215. // This may be used to include null fields in Patch requests.
  216. NullFields []string `json:"-"`
  217. }
  218. func (s *ArrayValue) MarshalJSON() ([]byte, error) {
  219. type NoMethod ArrayValue
  220. raw := NoMethod(*s)
  221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  222. }
  223. // BatchGetDocumentsRequest: The request for
  224. // Firestore.BatchGetDocuments.
  225. type BatchGetDocumentsRequest struct {
  226. // Documents: The names of the documents to retrieve. In the
  227. // format:
  228. // `projects/{project_id}/databases/{database_id}/documents/{docu
  229. // ment_path}`.
  230. // The request will fail if any of the document is not a child resource
  231. // of the
  232. // given `database`. Duplicate names will be elided.
  233. Documents []string `json:"documents,omitempty"`
  234. // Mask: The fields to return. If not set, returns all fields.
  235. //
  236. // If a document has a field that is not present in this mask, that
  237. // field will
  238. // not be returned in the response.
  239. Mask *DocumentMask `json:"mask,omitempty"`
  240. // NewTransaction: Starts a new transaction and reads the
  241. // documents.
  242. // Defaults to a read-only transaction.
  243. // The new transaction ID will be returned as the first response in
  244. // the
  245. // stream.
  246. NewTransaction *TransactionOptions `json:"newTransaction,omitempty"`
  247. // ReadTime: Reads documents as they were at the given time.
  248. // This may not be older than 60 seconds.
  249. ReadTime string `json:"readTime,omitempty"`
  250. // Transaction: Reads documents in a transaction.
  251. Transaction string `json:"transaction,omitempty"`
  252. // ForceSendFields is a list of field names (e.g. "Documents") to
  253. // unconditionally include in API requests. By default, fields with
  254. // empty values are omitted from API requests. However, any non-pointer,
  255. // non-interface field appearing in ForceSendFields will be sent to the
  256. // server regardless of whether the field is empty or not. This may be
  257. // used to include empty fields in Patch requests.
  258. ForceSendFields []string `json:"-"`
  259. // NullFields is a list of field names (e.g. "Documents") to include in
  260. // API requests with the JSON null value. By default, fields with empty
  261. // values are omitted from API requests. However, any field with an
  262. // empty value appearing in NullFields will be sent to the server as
  263. // null. It is an error if a field in this list has a non-empty value.
  264. // This may be used to include null fields in Patch requests.
  265. NullFields []string `json:"-"`
  266. }
  267. func (s *BatchGetDocumentsRequest) MarshalJSON() ([]byte, error) {
  268. type NoMethod BatchGetDocumentsRequest
  269. raw := NoMethod(*s)
  270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  271. }
  272. // BatchGetDocumentsResponse: The streamed response for
  273. // Firestore.BatchGetDocuments.
  274. type BatchGetDocumentsResponse struct {
  275. // Found: A document that was requested.
  276. Found *Document `json:"found,omitempty"`
  277. // Missing: A document name that was requested but does not exist. In
  278. // the
  279. // format:
  280. // `projects/{project_id}/databases/{database_id}/documents/{docu
  281. // ment_path}`.
  282. Missing string `json:"missing,omitempty"`
  283. // ReadTime: The time at which the document was read.
  284. // This may be monotically increasing, in this case the previous
  285. // documents in
  286. // the result stream are guaranteed not to have changed between
  287. // their
  288. // read_time and this one.
  289. ReadTime string `json:"readTime,omitempty"`
  290. // Transaction: The transaction that was started as part of this
  291. // request.
  292. // Will only be set in the first response, and only
  293. // if
  294. // BatchGetDocumentsRequest.new_transaction was set in the request.
  295. Transaction string `json:"transaction,omitempty"`
  296. // ServerResponse contains the HTTP response code and headers from the
  297. // server.
  298. googleapi.ServerResponse `json:"-"`
  299. // ForceSendFields is a list of field names (e.g. "Found") to
  300. // unconditionally include in API requests. By default, fields with
  301. // empty values are omitted from API requests. However, any non-pointer,
  302. // non-interface field appearing in ForceSendFields will be sent to the
  303. // server regardless of whether the field is empty or not. This may be
  304. // used to include empty fields in Patch requests.
  305. ForceSendFields []string `json:"-"`
  306. // NullFields is a list of field names (e.g. "Found") to include in API
  307. // requests with the JSON null value. By default, fields with empty
  308. // values are omitted from API requests. However, any field with an
  309. // empty value appearing in NullFields will be sent to the server as
  310. // null. It is an error if a field in this list has a non-empty value.
  311. // This may be used to include null fields in Patch requests.
  312. NullFields []string `json:"-"`
  313. }
  314. func (s *BatchGetDocumentsResponse) MarshalJSON() ([]byte, error) {
  315. type NoMethod BatchGetDocumentsResponse
  316. raw := NoMethod(*s)
  317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  318. }
  319. // BeginTransactionRequest: The request for Firestore.BeginTransaction.
  320. type BeginTransactionRequest struct {
  321. // Options: The options for the transaction.
  322. // Defaults to a read-write transaction.
  323. Options *TransactionOptions `json:"options,omitempty"`
  324. // ForceSendFields is a list of field names (e.g. "Options") to
  325. // unconditionally include in API requests. By default, fields with
  326. // empty values are omitted from API requests. However, any non-pointer,
  327. // non-interface field appearing in ForceSendFields will be sent to the
  328. // server regardless of whether the field is empty or not. This may be
  329. // used to include empty fields in Patch requests.
  330. ForceSendFields []string `json:"-"`
  331. // NullFields is a list of field names (e.g. "Options") to include in
  332. // API requests with the JSON null value. By default, fields with empty
  333. // values are omitted from API requests. However, any field with an
  334. // empty value appearing in NullFields will be sent to the server as
  335. // null. It is an error if a field in this list has a non-empty value.
  336. // This may be used to include null fields in Patch requests.
  337. NullFields []string `json:"-"`
  338. }
  339. func (s *BeginTransactionRequest) MarshalJSON() ([]byte, error) {
  340. type NoMethod BeginTransactionRequest
  341. raw := NoMethod(*s)
  342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  343. }
  344. // BeginTransactionResponse: The response for
  345. // Firestore.BeginTransaction.
  346. type BeginTransactionResponse struct {
  347. // Transaction: The transaction that was started.
  348. Transaction string `json:"transaction,omitempty"`
  349. // ServerResponse contains the HTTP response code and headers from the
  350. // server.
  351. googleapi.ServerResponse `json:"-"`
  352. // ForceSendFields is a list of field names (e.g. "Transaction") to
  353. // unconditionally include in API requests. By default, fields with
  354. // empty values are omitted from API requests. However, any non-pointer,
  355. // non-interface field appearing in ForceSendFields will be sent to the
  356. // server regardless of whether the field is empty or not. This may be
  357. // used to include empty fields in Patch requests.
  358. ForceSendFields []string `json:"-"`
  359. // NullFields is a list of field names (e.g. "Transaction") to include
  360. // in API requests with the JSON null value. By default, fields with
  361. // empty values are omitted from API requests. However, any field with
  362. // an empty value appearing in NullFields will be sent to the server as
  363. // null. It is an error if a field in this list has a non-empty value.
  364. // This may be used to include null fields in Patch requests.
  365. NullFields []string `json:"-"`
  366. }
  367. func (s *BeginTransactionResponse) MarshalJSON() ([]byte, error) {
  368. type NoMethod BeginTransactionResponse
  369. raw := NoMethod(*s)
  370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  371. }
  372. // CollectionSelector: A selection of a collection, such as `messages as
  373. // m1`.
  374. type CollectionSelector struct {
  375. // AllDescendants: When false, selects only collections that are
  376. // immediate children of
  377. // the `parent` specified in the containing `RunQueryRequest`.
  378. // When true, selects all descendant collections.
  379. AllDescendants bool `json:"allDescendants,omitempty"`
  380. // CollectionId: The collection ID.
  381. // When set, selects only collections with this ID.
  382. CollectionId string `json:"collectionId,omitempty"`
  383. // ForceSendFields is a list of field names (e.g. "AllDescendants") to
  384. // unconditionally include in API requests. By default, fields with
  385. // empty values are omitted from API requests. However, any non-pointer,
  386. // non-interface field appearing in ForceSendFields will be sent to the
  387. // server regardless of whether the field is empty or not. This may be
  388. // used to include empty fields in Patch requests.
  389. ForceSendFields []string `json:"-"`
  390. // NullFields is a list of field names (e.g. "AllDescendants") to
  391. // include in API requests with the JSON null value. By default, fields
  392. // with empty values are omitted from API requests. However, any field
  393. // with an empty value appearing in NullFields will be sent to the
  394. // server as null. It is an error if a field in this list has a
  395. // non-empty value. This may be used to include null fields in Patch
  396. // requests.
  397. NullFields []string `json:"-"`
  398. }
  399. func (s *CollectionSelector) MarshalJSON() ([]byte, error) {
  400. type NoMethod CollectionSelector
  401. raw := NoMethod(*s)
  402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  403. }
  404. // CommitRequest: The request for Firestore.Commit.
  405. type CommitRequest struct {
  406. // Transaction: If set, applies all writes in this transaction, and
  407. // commits it.
  408. Transaction string `json:"transaction,omitempty"`
  409. // Writes: The writes to apply.
  410. //
  411. // Always executed atomically and in order.
  412. Writes []*Write `json:"writes,omitempty"`
  413. // ForceSendFields is a list of field names (e.g. "Transaction") to
  414. // unconditionally include in API requests. By default, fields with
  415. // empty values are omitted from API requests. However, any non-pointer,
  416. // non-interface field appearing in ForceSendFields will be sent to the
  417. // server regardless of whether the field is empty or not. This may be
  418. // used to include empty fields in Patch requests.
  419. ForceSendFields []string `json:"-"`
  420. // NullFields is a list of field names (e.g. "Transaction") to include
  421. // in API requests with the JSON null value. By default, fields with
  422. // empty values are omitted from API requests. However, any field with
  423. // an empty value appearing in NullFields will be sent to the server as
  424. // null. It is an error if a field in this list has a non-empty value.
  425. // This may be used to include null fields in Patch requests.
  426. NullFields []string `json:"-"`
  427. }
  428. func (s *CommitRequest) MarshalJSON() ([]byte, error) {
  429. type NoMethod CommitRequest
  430. raw := NoMethod(*s)
  431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  432. }
  433. // CommitResponse: The response for Firestore.Commit.
  434. type CommitResponse struct {
  435. // CommitTime: The time at which the commit occurred.
  436. CommitTime string `json:"commitTime,omitempty"`
  437. // WriteResults: The result of applying the writes.
  438. //
  439. // This i-th write result corresponds to the i-th write in the
  440. // request.
  441. WriteResults []*WriteResult `json:"writeResults,omitempty"`
  442. // ServerResponse contains the HTTP response code and headers from the
  443. // server.
  444. googleapi.ServerResponse `json:"-"`
  445. // ForceSendFields is a list of field names (e.g. "CommitTime") to
  446. // unconditionally include in API requests. By default, fields with
  447. // empty values are omitted from API requests. However, any non-pointer,
  448. // non-interface field appearing in ForceSendFields will be sent to the
  449. // server regardless of whether the field is empty or not. This may be
  450. // used to include empty fields in Patch requests.
  451. ForceSendFields []string `json:"-"`
  452. // NullFields is a list of field names (e.g. "CommitTime") to include in
  453. // API requests with the JSON null value. By default, fields with empty
  454. // values are omitted from API requests. However, any field with an
  455. // empty value appearing in NullFields will be sent to the server as
  456. // null. It is an error if a field in this list has a non-empty value.
  457. // This may be used to include null fields in Patch requests.
  458. NullFields []string `json:"-"`
  459. }
  460. func (s *CommitResponse) MarshalJSON() ([]byte, error) {
  461. type NoMethod CommitResponse
  462. raw := NoMethod(*s)
  463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  464. }
  465. // CompositeFilter: A filter that merges multiple other filters using
  466. // the given operator.
  467. type CompositeFilter struct {
  468. // Filters: The list of filters to combine.
  469. // Must contain at least one filter.
  470. Filters []*Filter `json:"filters,omitempty"`
  471. // Op: The operator for combining multiple filters.
  472. //
  473. // Possible values:
  474. // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used.
  475. // "AND" - The results are required to satisfy each of the combined
  476. // filters.
  477. Op string `json:"op,omitempty"`
  478. // ForceSendFields is a list of field names (e.g. "Filters") to
  479. // unconditionally include in API requests. By default, fields with
  480. // empty values are omitted from API requests. However, any non-pointer,
  481. // non-interface field appearing in ForceSendFields will be sent to the
  482. // server regardless of whether the field is empty or not. This may be
  483. // used to include empty fields in Patch requests.
  484. ForceSendFields []string `json:"-"`
  485. // NullFields is a list of field names (e.g. "Filters") to include in
  486. // API requests with the JSON null value. By default, fields with empty
  487. // values are omitted from API requests. However, any field with an
  488. // empty value appearing in NullFields will be sent to the server as
  489. // null. It is an error if a field in this list has a non-empty value.
  490. // This may be used to include null fields in Patch requests.
  491. NullFields []string `json:"-"`
  492. }
  493. func (s *CompositeFilter) MarshalJSON() ([]byte, error) {
  494. type NoMethod CompositeFilter
  495. raw := NoMethod(*s)
  496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  497. }
  498. // Cursor: A position in a query result set.
  499. type Cursor struct {
  500. // Before: If the position is just before or just after the given
  501. // values, relative
  502. // to the sort order defined by the query.
  503. Before bool `json:"before,omitempty"`
  504. // Values: The values that represent a position, in the order they
  505. // appear in
  506. // the order by clause of a query.
  507. //
  508. // Can contain fewer values than specified in the order by clause.
  509. Values []*Value `json:"values,omitempty"`
  510. // ForceSendFields is a list of field names (e.g. "Before") to
  511. // unconditionally include in API requests. By default, fields with
  512. // empty values are omitted from API requests. However, any non-pointer,
  513. // non-interface field appearing in ForceSendFields will be sent to the
  514. // server regardless of whether the field is empty or not. This may be
  515. // used to include empty fields in Patch requests.
  516. ForceSendFields []string `json:"-"`
  517. // NullFields is a list of field names (e.g. "Before") to include in API
  518. // requests with the JSON null value. By default, fields with empty
  519. // values are omitted from API requests. However, any field with an
  520. // empty value appearing in NullFields will be sent to the server as
  521. // null. It is an error if a field in this list has a non-empty value.
  522. // This may be used to include null fields in Patch requests.
  523. NullFields []string `json:"-"`
  524. }
  525. func (s *Cursor) MarshalJSON() ([]byte, error) {
  526. type NoMethod Cursor
  527. raw := NoMethod(*s)
  528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  529. }
  530. // Document: A Firestore document.
  531. //
  532. // Must not exceed 1 MiB - 4 bytes.
  533. type Document struct {
  534. // CreateTime: Output only. The time at which the document was
  535. // created.
  536. //
  537. // This value increases monotonically when a document is deleted
  538. // then
  539. // recreated. It can also be compared to values from other documents
  540. // and
  541. // the `read_time` of a query.
  542. CreateTime string `json:"createTime,omitempty"`
  543. // Fields: The document's fields.
  544. //
  545. // The map keys represent field names.
  546. //
  547. // A simple field name contains only characters `a` to `z`, `A` to
  548. // `Z`,
  549. // `0` to `9`, or `_`, and must not start with `0` to `9`. For
  550. // example,
  551. // `foo_bar_17`.
  552. //
  553. // Field names matching the regular expression `__.*__` are reserved.
  554. // Reserved
  555. // field names are forbidden except in certain documented contexts. The
  556. // map
  557. // keys, represented as UTF-8, must not exceed 1,500 bytes and cannot
  558. // be
  559. // empty.
  560. //
  561. // Field paths may be used in other contexts to refer to structured
  562. // fields
  563. // defined here. For `map_value`, the field path is represented by the
  564. // simple
  565. // or quoted field names of the containing fields, delimited by `.`.
  566. // For
  567. // example, the structured field
  568. // "foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would
  569. // be
  570. // represented by the field path `foo.x&y`.
  571. //
  572. // Within a field path, a quoted field name starts and ends with `` ` ``
  573. // and
  574. // may contain any character. Some characters, including `` ` ``, must
  575. // be
  576. // escaped using a `\`. For example, `` `x&y` `` represents `x&y` and
  577. // `` `bak\`tik` `` represents `` bak`tik ``.
  578. Fields map[string]Value `json:"fields,omitempty"`
  579. // Name: The resource name of the document, for
  580. // example
  581. // `projects/{project_id}/databases/{database_id}/documents/{docu
  582. // ment_path}`.
  583. Name string `json:"name,omitempty"`
  584. // UpdateTime: Output only. The time at which the document was last
  585. // changed.
  586. //
  587. // This value is initially set to the `create_time` then
  588. // increases
  589. // monotonically with each change to the document. It can also
  590. // be
  591. // compared to values from other documents and the `read_time` of a
  592. // query.
  593. UpdateTime string `json:"updateTime,omitempty"`
  594. // ServerResponse contains the HTTP response code and headers from the
  595. // server.
  596. googleapi.ServerResponse `json:"-"`
  597. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  598. // unconditionally include in API requests. By default, fields with
  599. // empty values are omitted from API requests. However, any non-pointer,
  600. // non-interface field appearing in ForceSendFields will be sent to the
  601. // server regardless of whether the field is empty or not. This may be
  602. // used to include empty fields in Patch requests.
  603. ForceSendFields []string `json:"-"`
  604. // NullFields is a list of field names (e.g. "CreateTime") to include in
  605. // API requests with the JSON null value. By default, fields with empty
  606. // values are omitted from API requests. However, any field with an
  607. // empty value appearing in NullFields will be sent to the server as
  608. // null. It is an error if a field in this list has a non-empty value.
  609. // This may be used to include null fields in Patch requests.
  610. NullFields []string `json:"-"`
  611. }
  612. func (s *Document) MarshalJSON() ([]byte, error) {
  613. type NoMethod Document
  614. raw := NoMethod(*s)
  615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  616. }
  617. // DocumentChange: A Document has changed.
  618. //
  619. // May be the result of multiple writes, including deletes,
  620. // that
  621. // ultimately resulted in a new value for the Document.
  622. //
  623. // Multiple DocumentChange messages may be returned for the same
  624. // logical
  625. // change, if multiple targets are affected.
  626. type DocumentChange struct {
  627. // Document: The new state of the Document.
  628. //
  629. // If `mask` is set, contains only fields that were updated or added.
  630. Document *Document `json:"document,omitempty"`
  631. // RemovedTargetIds: A set of target IDs for targets that no longer
  632. // match this document.
  633. RemovedTargetIds []int64 `json:"removedTargetIds,omitempty"`
  634. // TargetIds: A set of target IDs of targets that match this document.
  635. TargetIds []int64 `json:"targetIds,omitempty"`
  636. // ForceSendFields is a list of field names (e.g. "Document") to
  637. // unconditionally include in API requests. By default, fields with
  638. // empty values are omitted from API requests. However, any non-pointer,
  639. // non-interface field appearing in ForceSendFields will be sent to the
  640. // server regardless of whether the field is empty or not. This may be
  641. // used to include empty fields in Patch requests.
  642. ForceSendFields []string `json:"-"`
  643. // NullFields is a list of field names (e.g. "Document") to include in
  644. // API requests with the JSON null value. By default, fields with empty
  645. // values are omitted from API requests. However, any field with an
  646. // empty value appearing in NullFields will be sent to the server as
  647. // null. It is an error if a field in this list has a non-empty value.
  648. // This may be used to include null fields in Patch requests.
  649. NullFields []string `json:"-"`
  650. }
  651. func (s *DocumentChange) MarshalJSON() ([]byte, error) {
  652. type NoMethod DocumentChange
  653. raw := NoMethod(*s)
  654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  655. }
  656. // DocumentDelete: A Document has been deleted.
  657. //
  658. // May be the result of multiple writes, including updates, the
  659. // last of which deleted the Document.
  660. //
  661. // Multiple DocumentDelete messages may be returned for the same
  662. // logical
  663. // delete, if multiple targets are affected.
  664. type DocumentDelete struct {
  665. // Document: The resource name of the Document that was deleted.
  666. Document string `json:"document,omitempty"`
  667. // ReadTime: The read timestamp at which the delete was
  668. // observed.
  669. //
  670. // Greater or equal to the `commit_time` of the delete.
  671. ReadTime string `json:"readTime,omitempty"`
  672. // RemovedTargetIds: A set of target IDs for targets that previously
  673. // matched this entity.
  674. RemovedTargetIds []int64 `json:"removedTargetIds,omitempty"`
  675. // ForceSendFields is a list of field names (e.g. "Document") 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. "Document") to include in
  683. // API requests with the JSON null value. By default, fields with empty
  684. // values are omitted from API requests. However, any field with an
  685. // 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 *DocumentDelete) MarshalJSON() ([]byte, error) {
  691. type NoMethod DocumentDelete
  692. raw := NoMethod(*s)
  693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  694. }
  695. // DocumentMask: A set of field paths on a document.
  696. // Used to restrict a get or update operation on a document to a subset
  697. // of its
  698. // fields.
  699. // This is different from standard field masks, as this is always scoped
  700. // to a
  701. // Document, and takes in account the dynamic nature of Value.
  702. type DocumentMask struct {
  703. // FieldPaths: The list of field paths in the mask. See Document.fields
  704. // for a field
  705. // path syntax reference.
  706. FieldPaths []string `json:"fieldPaths,omitempty"`
  707. // ForceSendFields is a list of field names (e.g. "FieldPaths") to
  708. // unconditionally include in API requests. By default, fields with
  709. // empty values are omitted from API requests. However, any non-pointer,
  710. // non-interface field appearing in ForceSendFields will be sent to the
  711. // server regardless of whether the field is empty or not. This may be
  712. // used to include empty fields in Patch requests.
  713. ForceSendFields []string `json:"-"`
  714. // NullFields is a list of field names (e.g. "FieldPaths") to include in
  715. // API requests with the JSON null value. By default, fields with empty
  716. // values are omitted from API requests. However, any field with an
  717. // empty value appearing in NullFields will be sent to the server as
  718. // null. It is an error if a field in this list has a non-empty value.
  719. // This may be used to include null fields in Patch requests.
  720. NullFields []string `json:"-"`
  721. }
  722. func (s *DocumentMask) MarshalJSON() ([]byte, error) {
  723. type NoMethod DocumentMask
  724. raw := NoMethod(*s)
  725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  726. }
  727. // DocumentRemove: A Document has been removed from the view of the
  728. // targets.
  729. //
  730. // Sent if the document is no longer relevant to a target and is out of
  731. // view.
  732. // Can be sent instead of a DocumentDelete or a DocumentChange if the
  733. // server
  734. // can not send the new value of the document.
  735. //
  736. // Multiple DocumentRemove messages may be returned for the same
  737. // logical
  738. // write or delete, if multiple targets are affected.
  739. type DocumentRemove struct {
  740. // Document: The resource name of the Document that has gone out of
  741. // view.
  742. Document string `json:"document,omitempty"`
  743. // ReadTime: The read timestamp at which the remove was
  744. // observed.
  745. //
  746. // Greater or equal to the `commit_time` of the change/delete/remove.
  747. ReadTime string `json:"readTime,omitempty"`
  748. // RemovedTargetIds: A set of target IDs for targets that previously
  749. // matched this document.
  750. RemovedTargetIds []int64 `json:"removedTargetIds,omitempty"`
  751. // ForceSendFields is a list of field names (e.g. "Document") to
  752. // unconditionally include in API requests. By default, fields with
  753. // empty values are omitted from API requests. However, any non-pointer,
  754. // non-interface field appearing in ForceSendFields will be sent to the
  755. // server regardless of whether the field is empty or not. This may be
  756. // used to include empty fields in Patch requests.
  757. ForceSendFields []string `json:"-"`
  758. // NullFields is a list of field names (e.g. "Document") to include in
  759. // API requests with the JSON null value. By default, fields with empty
  760. // values are omitted from API requests. However, any field with an
  761. // empty value appearing in NullFields will be sent to the server as
  762. // null. It is an error if a field in this list has a non-empty value.
  763. // This may be used to include null fields in Patch requests.
  764. NullFields []string `json:"-"`
  765. }
  766. func (s *DocumentRemove) MarshalJSON() ([]byte, error) {
  767. type NoMethod DocumentRemove
  768. raw := NoMethod(*s)
  769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  770. }
  771. // DocumentTransform: A transformation of a document.
  772. type DocumentTransform struct {
  773. // Document: The name of the document to transform.
  774. Document string `json:"document,omitempty"`
  775. // FieldTransforms: The list of transformations to apply to the fields
  776. // of the document, in
  777. // order.
  778. // This must not be empty.
  779. FieldTransforms []*FieldTransform `json:"fieldTransforms,omitempty"`
  780. // ForceSendFields is a list of field names (e.g. "Document") to
  781. // unconditionally include in API requests. By default, fields with
  782. // empty values are omitted from API requests. However, any non-pointer,
  783. // non-interface field appearing in ForceSendFields will be sent to the
  784. // server regardless of whether the field is empty or not. This may be
  785. // used to include empty fields in Patch requests.
  786. ForceSendFields []string `json:"-"`
  787. // NullFields is a list of field names (e.g. "Document") to include in
  788. // API requests with the JSON null value. By default, fields with empty
  789. // values are omitted from API requests. However, any field with an
  790. // empty value appearing in NullFields will be sent to the server as
  791. // null. It is an error if a field in this list has a non-empty value.
  792. // This may be used to include null fields in Patch requests.
  793. NullFields []string `json:"-"`
  794. }
  795. func (s *DocumentTransform) MarshalJSON() ([]byte, error) {
  796. type NoMethod DocumentTransform
  797. raw := NoMethod(*s)
  798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  799. }
  800. // DocumentsTarget: A target specified by a set of documents names.
  801. type DocumentsTarget struct {
  802. // Documents: The names of the documents to retrieve. In the
  803. // format:
  804. // `projects/{project_id}/databases/{database_id}/documents/{docu
  805. // ment_path}`.
  806. // The request will fail if any of the document is not a child resource
  807. // of
  808. // the given `database`. Duplicate names will be elided.
  809. Documents []string `json:"documents,omitempty"`
  810. // ForceSendFields is a list of field names (e.g. "Documents") to
  811. // unconditionally include in API requests. By default, fields with
  812. // empty values are omitted from API requests. However, any non-pointer,
  813. // non-interface field appearing in ForceSendFields will be sent to the
  814. // server regardless of whether the field is empty or not. This may be
  815. // used to include empty fields in Patch requests.
  816. ForceSendFields []string `json:"-"`
  817. // NullFields is a list of field names (e.g. "Documents") to include in
  818. // API requests with the JSON null value. By default, fields with empty
  819. // values are omitted from API requests. However, any field with an
  820. // empty value appearing in NullFields will be sent to the server as
  821. // null. It is an error if a field in this list has a non-empty value.
  822. // This may be used to include null fields in Patch requests.
  823. NullFields []string `json:"-"`
  824. }
  825. func (s *DocumentsTarget) MarshalJSON() ([]byte, error) {
  826. type NoMethod DocumentsTarget
  827. raw := NoMethod(*s)
  828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  829. }
  830. // Empty: A generic empty message that you can re-use to avoid defining
  831. // duplicated
  832. // empty messages in your APIs. A typical example is to use it as the
  833. // request
  834. // or the response type of an API method. For instance:
  835. //
  836. // service Foo {
  837. // rpc Bar(google.protobuf.Empty) returns
  838. // (google.protobuf.Empty);
  839. // }
  840. //
  841. // The JSON representation for `Empty` is empty JSON object `{}`.
  842. type Empty struct {
  843. // ServerResponse contains the HTTP response code and headers from the
  844. // server.
  845. googleapi.ServerResponse `json:"-"`
  846. }
  847. // ExistenceFilter: A digest of all the documents that match a given
  848. // target.
  849. type ExistenceFilter struct {
  850. // Count: The total count of documents that match target_id.
  851. //
  852. // If different from the count of documents in the client that match,
  853. // the
  854. // client must manually determine which documents no longer match the
  855. // target.
  856. Count int64 `json:"count,omitempty"`
  857. // TargetId: The target ID to which this filter applies.
  858. TargetId int64 `json:"targetId,omitempty"`
  859. // ForceSendFields is a list of field names (e.g. "Count") to
  860. // unconditionally include in API requests. By default, fields with
  861. // empty values are omitted from API requests. However, any non-pointer,
  862. // non-interface field appearing in ForceSendFields will be sent to the
  863. // server regardless of whether the field is empty or not. This may be
  864. // used to include empty fields in Patch requests.
  865. ForceSendFields []string `json:"-"`
  866. // NullFields is a list of field names (e.g. "Count") to include in API
  867. // requests with the JSON null value. By default, fields with empty
  868. // values are omitted from API requests. However, any field with an
  869. // empty value appearing in NullFields will be sent to the server as
  870. // null. It is an error if a field in this list has a non-empty value.
  871. // This may be used to include null fields in Patch requests.
  872. NullFields []string `json:"-"`
  873. }
  874. func (s *ExistenceFilter) MarshalJSON() ([]byte, error) {
  875. type NoMethod ExistenceFilter
  876. raw := NoMethod(*s)
  877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  878. }
  879. // FieldFilter: A filter on a specific field.
  880. type FieldFilter struct {
  881. // Field: The field to filter by.
  882. Field *FieldReference `json:"field,omitempty"`
  883. // Op: The operator to filter by.
  884. //
  885. // Possible values:
  886. // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used.
  887. // "LESS_THAN" - Less than. Requires that the field come first in
  888. // `order_by`.
  889. // "LESS_THAN_OR_EQUAL" - Less than or equal. Requires that the field
  890. // come first in `order_by`.
  891. // "GREATER_THAN" - Greater than. Requires that the field come first
  892. // in `order_by`.
  893. // "GREATER_THAN_OR_EQUAL" - Greater than or equal. Requires that the
  894. // field come first in
  895. // `order_by`.
  896. // "EQUAL" - Equal.
  897. // "ARRAY_CONTAINS" - Contains. Requires that the field is an array.
  898. Op string `json:"op,omitempty"`
  899. // Value: The value to compare to.
  900. Value *Value `json:"value,omitempty"`
  901. // ForceSendFields is a list of field names (e.g. "Field") to
  902. // unconditionally include in API requests. By default, fields with
  903. // empty values are omitted from API requests. However, any non-pointer,
  904. // non-interface field appearing in ForceSendFields will be sent to the
  905. // server regardless of whether the field is empty or not. This may be
  906. // used to include empty fields in Patch requests.
  907. ForceSendFields []string `json:"-"`
  908. // NullFields is a list of field names (e.g. "Field") to include in API
  909. // requests with the JSON null value. By default, fields with empty
  910. // values are omitted from API requests. However, any field with an
  911. // empty value appearing in NullFields will be sent to the server as
  912. // null. It is an error if a field in this list has a non-empty value.
  913. // This may be used to include null fields in Patch requests.
  914. NullFields []string `json:"-"`
  915. }
  916. func (s *FieldFilter) MarshalJSON() ([]byte, error) {
  917. type NoMethod FieldFilter
  918. raw := NoMethod(*s)
  919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  920. }
  921. // FieldReference: A reference to a field, such as `max(messages.time)
  922. // as max_time`.
  923. type FieldReference struct {
  924. FieldPath string `json:"fieldPath,omitempty"`
  925. // ForceSendFields is a list of field names (e.g. "FieldPath") to
  926. // unconditionally include in API requests. By default, fields with
  927. // empty values are omitted from API requests. However, any non-pointer,
  928. // non-interface field appearing in ForceSendFields will be sent to the
  929. // server regardless of whether the field is empty or not. This may be
  930. // used to include empty fields in Patch requests.
  931. ForceSendFields []string `json:"-"`
  932. // NullFields is a list of field names (e.g. "FieldPath") to include in
  933. // API requests with the JSON null value. By default, fields with empty
  934. // values are omitted from API requests. However, any field with an
  935. // empty value appearing in NullFields will be sent to the server as
  936. // null. It is an error if a field in this list has a non-empty value.
  937. // This may be used to include null fields in Patch requests.
  938. NullFields []string `json:"-"`
  939. }
  940. func (s *FieldReference) MarshalJSON() ([]byte, error) {
  941. type NoMethod FieldReference
  942. raw := NoMethod(*s)
  943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  944. }
  945. // FieldTransform: A transformation of a field of the document.
  946. type FieldTransform struct {
  947. // AppendMissingElements: Append the given elements in order if they are
  948. // not already present in
  949. // the current field value.
  950. // If the field is not an array, or if the field does not yet exist, it
  951. // is
  952. // first set to the empty array.
  953. //
  954. // Equivalent numbers of different types (e.g. 3L and 3.0)
  955. // are
  956. // considered equal when checking if a value is missing.
  957. // NaN is equal to NaN, and Null is equal to Null.
  958. // If the input contains multiple equivalent values, only the first
  959. // will
  960. // be considered.
  961. //
  962. // The corresponding transform_result will be the null value.
  963. AppendMissingElements *ArrayValue `json:"appendMissingElements,omitempty"`
  964. // FieldPath: The path of the field. See Document.fields for the field
  965. // path syntax
  966. // reference.
  967. FieldPath string `json:"fieldPath,omitempty"`
  968. // Increment: Adds the given value to the field's current value.
  969. //
  970. // This must be an integer or a double value.
  971. // If the field is not an integer or double, or if the field does not
  972. // yet
  973. // exist, the transformation will set the field to the given value.
  974. // If either of the given value or the current field value are
  975. // doubles,
  976. // both values will be interpreted as doubles. Double arithmetic
  977. // and
  978. // representation of double values follow IEEE 754 semantics.
  979. // If there is positive/negative integer overflow, the field is
  980. // resolved
  981. // to the largest magnitude positive/negative integer.
  982. Increment *Value `json:"increment,omitempty"`
  983. // Maximum: Sets the field to the maximum of its current value and the
  984. // given value.
  985. //
  986. // This must be an integer or a double value.
  987. // If the field is not an integer or double, or if the field does not
  988. // yet
  989. // exist, the transformation will set the field to the given value.
  990. // If a maximum operation is applied where the field and the input
  991. // value
  992. // are of mixed types (that is - one is an integer and one is a
  993. // double)
  994. // the field takes on the type of the larger operand. If the operands
  995. // are
  996. // equivalent (e.g. 3 and 3.0), the field does not change.
  997. // 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value
  998. // and
  999. // zero input value is always the stored value.
  1000. // The maximum of any numeric value x and NaN is NaN.
  1001. Maximum *Value `json:"maximum,omitempty"`
  1002. // Minimum: Sets the field to the minimum of its current value and the
  1003. // given value.
  1004. //
  1005. // This must be an integer or a double value.
  1006. // If the field is not an integer or double, or if the field does not
  1007. // yet
  1008. // exist, the transformation will set the field to the input value.
  1009. // If a minimum operation is applied where the field and the input
  1010. // value
  1011. // are of mixed types (that is - one is an integer and one is a
  1012. // double)
  1013. // the field takes on the type of the smaller operand. If the operands
  1014. // are
  1015. // equivalent (e.g. 3 and 3.0), the field does not change.
  1016. // 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value
  1017. // and
  1018. // zero input value is always the stored value.
  1019. // The minimum of any numeric value x and NaN is NaN.
  1020. Minimum *Value `json:"minimum,omitempty"`
  1021. // RemoveAllFromArray: Remove all of the given elements from the array
  1022. // in the field.
  1023. // If the field is not an array, or if the field does not yet exist, it
  1024. // is
  1025. // set to the empty array.
  1026. //
  1027. // Equivalent numbers of the different types (e.g. 3L and 3.0)
  1028. // are
  1029. // considered equal when deciding whether an element should be
  1030. // removed.
  1031. // NaN is equal to NaN, and Null is equal to Null.
  1032. // This will remove all equivalent values if there are duplicates.
  1033. //
  1034. // The corresponding transform_result will be the null value.
  1035. RemoveAllFromArray *ArrayValue `json:"removeAllFromArray,omitempty"`
  1036. // SetToServerValue: Sets the field to the given server value.
  1037. //
  1038. // Possible values:
  1039. // "SERVER_VALUE_UNSPECIFIED" - Unspecified. This value must not be
  1040. // used.
  1041. // "REQUEST_TIME" - The time at which the server processed the
  1042. // request, with millisecond
  1043. // precision.
  1044. SetToServerValue string `json:"setToServerValue,omitempty"`
  1045. // ForceSendFields is a list of field names (e.g.
  1046. // "AppendMissingElements") to unconditionally include in API requests.
  1047. // By default, fields with empty values are omitted from API requests.
  1048. // However, any non-pointer, non-interface field appearing in
  1049. // ForceSendFields will be sent to the server regardless of whether the
  1050. // field is empty or not. This may be used to include empty fields in
  1051. // Patch requests.
  1052. ForceSendFields []string `json:"-"`
  1053. // NullFields is a list of field names (e.g. "AppendMissingElements") to
  1054. // include in API requests with the JSON null value. By default, fields
  1055. // with empty values are omitted from API requests. However, any field
  1056. // with an empty value appearing in NullFields will be sent to the
  1057. // server as null. It is an error if a field in this list has a
  1058. // non-empty value. This may be used to include null fields in Patch
  1059. // requests.
  1060. NullFields []string `json:"-"`
  1061. }
  1062. func (s *FieldTransform) MarshalJSON() ([]byte, error) {
  1063. type NoMethod FieldTransform
  1064. raw := NoMethod(*s)
  1065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1066. }
  1067. // Filter: A filter.
  1068. type Filter struct {
  1069. // CompositeFilter: A composite filter.
  1070. CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"`
  1071. // FieldFilter: A filter on a document field.
  1072. FieldFilter *FieldFilter `json:"fieldFilter,omitempty"`
  1073. // UnaryFilter: A filter that takes exactly one argument.
  1074. UnaryFilter *UnaryFilter `json:"unaryFilter,omitempty"`
  1075. // ForceSendFields is a list of field names (e.g. "CompositeFilter") to
  1076. // unconditionally include in API requests. By default, fields with
  1077. // empty values are omitted from API requests. However, any non-pointer,
  1078. // non-interface field appearing in ForceSendFields will be sent to the
  1079. // server regardless of whether the field is empty or not. This may be
  1080. // used to include empty fields in Patch requests.
  1081. ForceSendFields []string `json:"-"`
  1082. // NullFields is a list of field names (e.g. "CompositeFilter") to
  1083. // include in API requests with the JSON null value. By default, fields
  1084. // with empty values are omitted from API requests. However, any field
  1085. // with an empty value appearing in NullFields will be sent to the
  1086. // server as null. It is an error if a field in this list has a
  1087. // non-empty value. This may be used to include null fields in Patch
  1088. // requests.
  1089. NullFields []string `json:"-"`
  1090. }
  1091. func (s *Filter) MarshalJSON() ([]byte, error) {
  1092. type NoMethod Filter
  1093. raw := NoMethod(*s)
  1094. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1095. }
  1096. // GoogleFirestoreAdminV1ExportDocumentsMetadata: Metadata for
  1097. // google.longrunning.Operation results
  1098. // from
  1099. // FirestoreAdmin.ExportDocuments.
  1100. type GoogleFirestoreAdminV1ExportDocumentsMetadata struct {
  1101. // CollectionIds: Which collection ids are being exported.
  1102. CollectionIds []string `json:"collectionIds,omitempty"`
  1103. // EndTime: The time this operation completed. Will be unset if
  1104. // operation still in
  1105. // progress.
  1106. EndTime string `json:"endTime,omitempty"`
  1107. // OperationState: The state of the export operation.
  1108. //
  1109. // Possible values:
  1110. // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
  1111. // "INITIALIZING" - Request is being prepared for processing.
  1112. // "PROCESSING" - Request is actively being processed.
  1113. // "CANCELLING" - Request is in the process of being cancelled after
  1114. // user called
  1115. // google.longrunning.Operations.CancelOperation on the operation.
  1116. // "FINALIZING" - Request has been processed and is in its
  1117. // finalization stage.
  1118. // "SUCCESSFUL" - Request has completed successfully.
  1119. // "FAILED" - Request has finished being processed, but encountered an
  1120. // error.
  1121. // "CANCELLED" - Request has finished being cancelled after user
  1122. // called
  1123. // google.longrunning.Operations.CancelOperation.
  1124. OperationState string `json:"operationState,omitempty"`
  1125. // OutputUriPrefix: Where the entities are being exported to.
  1126. OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
  1127. // ProgressBytes: The progress, in bytes, of this operation.
  1128. ProgressBytes *GoogleFirestoreAdminV1Progress `json:"progressBytes,omitempty"`
  1129. // ProgressDocuments: The progress, in documents, of this operation.
  1130. ProgressDocuments *GoogleFirestoreAdminV1Progress `json:"progressDocuments,omitempty"`
  1131. // StartTime: The time this operation started.
  1132. StartTime string `json:"startTime,omitempty"`
  1133. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  1134. // unconditionally include in API requests. By default, fields with
  1135. // empty values are omitted from API requests. However, any non-pointer,
  1136. // non-interface field appearing in ForceSendFields will be sent to the
  1137. // server regardless of whether the field is empty or not. This may be
  1138. // used to include empty fields in Patch requests.
  1139. ForceSendFields []string `json:"-"`
  1140. // NullFields is a list of field names (e.g. "CollectionIds") to include
  1141. // in API requests with the JSON null value. By default, fields with
  1142. // empty values are omitted from API requests. However, any field with
  1143. // an empty value appearing in NullFields will be sent to the server as
  1144. // null. It is an error if a field in this list has a non-empty value.
  1145. // This may be used to include null fields in Patch requests.
  1146. NullFields []string `json:"-"`
  1147. }
  1148. func (s *GoogleFirestoreAdminV1ExportDocumentsMetadata) MarshalJSON() ([]byte, error) {
  1149. type NoMethod GoogleFirestoreAdminV1ExportDocumentsMetadata
  1150. raw := NoMethod(*s)
  1151. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1152. }
  1153. // GoogleFirestoreAdminV1ExportDocumentsRequest: The request for
  1154. // FirestoreAdmin.ExportDocuments.
  1155. type GoogleFirestoreAdminV1ExportDocumentsRequest struct {
  1156. // CollectionIds: Which collection ids to export. Unspecified means all
  1157. // collections.
  1158. CollectionIds []string `json:"collectionIds,omitempty"`
  1159. // OutputUriPrefix: The output URI. Currently only supports Google Cloud
  1160. // Storage URIs of the
  1161. // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the
  1162. // name
  1163. // of the Google Cloud Storage bucket and `NAMESPACE_PATH` is an
  1164. // optional
  1165. // Google Cloud Storage namespace path. When
  1166. // choosing a name, be sure to consider Google Cloud Storage
  1167. // naming
  1168. // guidelines: https://cloud.google.com/storage/docs/naming.
  1169. // If the URI is a bucket (without a namespace path), a prefix will
  1170. // be
  1171. // generated based on the start time.
  1172. OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
  1173. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  1174. // unconditionally include in API requests. By default, fields with
  1175. // empty values are omitted from API requests. However, any non-pointer,
  1176. // non-interface field appearing in ForceSendFields will be sent to the
  1177. // server regardless of whether the field is empty or not. This may be
  1178. // used to include empty fields in Patch requests.
  1179. ForceSendFields []string `json:"-"`
  1180. // NullFields is a list of field names (e.g. "CollectionIds") to include
  1181. // in API requests with the JSON null value. By default, fields with
  1182. // empty values are omitted from API requests. However, any field with
  1183. // an empty value appearing in NullFields will be sent to the server as
  1184. // null. It is an error if a field in this list has a non-empty value.
  1185. // This may be used to include null fields in Patch requests.
  1186. NullFields []string `json:"-"`
  1187. }
  1188. func (s *GoogleFirestoreAdminV1ExportDocumentsRequest) MarshalJSON() ([]byte, error) {
  1189. type NoMethod GoogleFirestoreAdminV1ExportDocumentsRequest
  1190. raw := NoMethod(*s)
  1191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1192. }
  1193. // GoogleFirestoreAdminV1ExportDocumentsResponse: Returned in the
  1194. // google.longrunning.Operation response field.
  1195. type GoogleFirestoreAdminV1ExportDocumentsResponse struct {
  1196. // OutputUriPrefix: Location of the output files. This can be used to
  1197. // begin an import
  1198. // into Cloud Firestore (this project or another project) after the
  1199. // operation
  1200. // completes successfully.
  1201. OutputUriPrefix string `json:"outputUriPrefix,omitempty"`
  1202. // ForceSendFields is a list of field names (e.g. "OutputUriPrefix") to
  1203. // unconditionally include in API requests. By default, fields with
  1204. // empty values are omitted from API requests. However, any non-pointer,
  1205. // non-interface field appearing in ForceSendFields will be sent to the
  1206. // server regardless of whether the field is empty or not. This may be
  1207. // used to include empty fields in Patch requests.
  1208. ForceSendFields []string `json:"-"`
  1209. // NullFields is a list of field names (e.g. "OutputUriPrefix") to
  1210. // include in API requests with the JSON null value. By default, fields
  1211. // with empty values are omitted from API requests. However, any field
  1212. // with an empty value appearing in NullFields will be sent to the
  1213. // server as null. It is an error if a field in this list has a
  1214. // non-empty value. This may be used to include null fields in Patch
  1215. // requests.
  1216. NullFields []string `json:"-"`
  1217. }
  1218. func (s *GoogleFirestoreAdminV1ExportDocumentsResponse) MarshalJSON() ([]byte, error) {
  1219. type NoMethod GoogleFirestoreAdminV1ExportDocumentsResponse
  1220. raw := NoMethod(*s)
  1221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1222. }
  1223. // GoogleFirestoreAdminV1Field: Represents a single field in the
  1224. // database.
  1225. //
  1226. // Fields are grouped by their "Collection Group", which represent
  1227. // all
  1228. // collections in the database with the same id.
  1229. type GoogleFirestoreAdminV1Field struct {
  1230. // IndexConfig: The index configuration for this field. If unset, field
  1231. // indexing will
  1232. // revert to the configuration defined by the `ancestor_field`.
  1233. // To
  1234. // explicitly remove all indexes for this field, specify an index
  1235. // config
  1236. // with an empty list of indexes.
  1237. IndexConfig *GoogleFirestoreAdminV1IndexConfig `json:"indexConfig,omitempty"`
  1238. // Name: A field name of the
  1239. // form
  1240. // `projects/{project_id}/databases/{database_id}/collectionGroups/{
  1241. // collection_id}/fields/{field_path}`
  1242. //
  1243. // A field path may be a simple field name, e.g. `address` or a path to
  1244. // fields
  1245. // within map_value , e.g. `address.city`,
  1246. // or a special field path. The only valid special field is `*`,
  1247. // which
  1248. // represents any field.
  1249. //
  1250. // Field paths may be quoted using ` (backtick). The only character that
  1251. // needs
  1252. // to be escaped within a quoted field path is the backtick character
  1253. // itself,
  1254. // escaped using a backslash. Special characters in field paths
  1255. // that
  1256. // must be quoted include: `*`, `.`,
  1257. // ``` (backtick), `[`, `]`, as well as any ascii symbolic
  1258. // characters.
  1259. //
  1260. // Examples:
  1261. // (Note: Comments here are written in markdown syntax, so there is an
  1262. // additional layer of backticks to represent a code
  1263. // block)
  1264. // `\`address.city\`` represents a field named `address.city`, not the
  1265. // map key
  1266. // `city` in the field `address`.
  1267. // `\`*\`` represents a field named `*`, not any field.
  1268. //
  1269. // A special `Field` contains the default indexing settings for all
  1270. // fields.
  1271. // This field's resource name
  1272. // is:
  1273. // `projects/{project_id}/databases/{database_id}/collectionGroups/__
  1274. // default__/fields/*`
  1275. // Indexes defined on this `Field` will be applied to all fields which
  1276. // do not
  1277. // have their own `Field` index configuration.
  1278. Name string `json:"name,omitempty"`
  1279. // ServerResponse contains the HTTP response code and headers from the
  1280. // server.
  1281. googleapi.ServerResponse `json:"-"`
  1282. // ForceSendFields is a list of field names (e.g. "IndexConfig") to
  1283. // unconditionally include in API requests. By default, fields with
  1284. // empty values are omitted from API requests. However, any non-pointer,
  1285. // non-interface field appearing in ForceSendFields will be sent to the
  1286. // server regardless of whether the field is empty or not. This may be
  1287. // used to include empty fields in Patch requests.
  1288. ForceSendFields []string `json:"-"`
  1289. // NullFields is a list of field names (e.g. "IndexConfig") to include
  1290. // in API requests with the JSON null value. By default, fields with
  1291. // empty values are omitted from API requests. However, any field with
  1292. // an empty value appearing in NullFields will be sent to the server as
  1293. // null. It is an error if a field in this list has a non-empty value.
  1294. // This may be used to include null fields in Patch requests.
  1295. NullFields []string `json:"-"`
  1296. }
  1297. func (s *GoogleFirestoreAdminV1Field) MarshalJSON() ([]byte, error) {
  1298. type NoMethod GoogleFirestoreAdminV1Field
  1299. raw := NoMethod(*s)
  1300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1301. }
  1302. // GoogleFirestoreAdminV1FieldOperationMetadata: Metadata for
  1303. // google.longrunning.Operation results from
  1304. // FirestoreAdmin.UpdateField.
  1305. type GoogleFirestoreAdminV1FieldOperationMetadata struct {
  1306. // EndTime: The time this operation completed. Will be unset if
  1307. // operation still in
  1308. // progress.
  1309. EndTime string `json:"endTime,omitempty"`
  1310. // Field: The field resource that this operation is acting on. For
  1311. // example:
  1312. // `projects/{project_id}/databases/{database_id}/collectionGrou
  1313. // ps/{collection_id}/fields/{field_path}`
  1314. Field string `json:"field,omitempty"`
  1315. // IndexConfigDeltas: A list of IndexConfigDelta, which describe the
  1316. // intent of this
  1317. // operation.
  1318. IndexConfigDeltas []*GoogleFirestoreAdminV1IndexConfigDelta `json:"indexConfigDeltas,omitempty"`
  1319. // ProgressBytes: The progress, in bytes, of this operation.
  1320. ProgressBytes *GoogleFirestoreAdminV1Progress `json:"progressBytes,omitempty"`
  1321. // ProgressDocuments: The progress, in documents, of this operation.
  1322. ProgressDocuments *GoogleFirestoreAdminV1Progress `json:"progressDocuments,omitempty"`
  1323. // StartTime: The time this operation started.
  1324. StartTime string `json:"startTime,omitempty"`
  1325. // State: The state of the operation.
  1326. //
  1327. // Possible values:
  1328. // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
  1329. // "INITIALIZING" - Request is being prepared for processing.
  1330. // "PROCESSING" - Request is actively being processed.
  1331. // "CANCELLING" - Request is in the process of being cancelled after
  1332. // user called
  1333. // google.longrunning.Operations.CancelOperation on the operation.
  1334. // "FINALIZING" - Request has been processed and is in its
  1335. // finalization stage.
  1336. // "SUCCESSFUL" - Request has completed successfully.
  1337. // "FAILED" - Request has finished being processed, but encountered an
  1338. // error.
  1339. // "CANCELLED" - Request has finished being cancelled after user
  1340. // called
  1341. // google.longrunning.Operations.CancelOperation.
  1342. State string `json:"state,omitempty"`
  1343. // ForceSendFields is a list of field names (e.g. "EndTime") to
  1344. // unconditionally include in API requests. By default, fields with
  1345. // empty values are omitted from API requests. However, any non-pointer,
  1346. // non-interface field appearing in ForceSendFields will be sent to the
  1347. // server regardless of whether the field is empty or not. This may be
  1348. // used to include empty fields in Patch requests.
  1349. ForceSendFields []string `json:"-"`
  1350. // NullFields is a list of field names (e.g. "EndTime") to include in
  1351. // API requests with the JSON null value. By default, fields with empty
  1352. // values are omitted from API requests. However, any field with an
  1353. // empty value appearing in NullFields will be sent to the server as
  1354. // null. It is an error if a field in this list has a non-empty value.
  1355. // This may be used to include null fields in Patch requests.
  1356. NullFields []string `json:"-"`
  1357. }
  1358. func (s *GoogleFirestoreAdminV1FieldOperationMetadata) MarshalJSON() ([]byte, error) {
  1359. type NoMethod GoogleFirestoreAdminV1FieldOperationMetadata
  1360. raw := NoMethod(*s)
  1361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1362. }
  1363. // GoogleFirestoreAdminV1ImportDocumentsMetadata: Metadata for
  1364. // google.longrunning.Operation results
  1365. // from
  1366. // FirestoreAdmin.ImportDocuments.
  1367. type GoogleFirestoreAdminV1ImportDocumentsMetadata struct {
  1368. // CollectionIds: Which collection ids are being imported.
  1369. CollectionIds []string `json:"collectionIds,omitempty"`
  1370. // EndTime: The time this operation completed. Will be unset if
  1371. // operation still in
  1372. // progress.
  1373. EndTime string `json:"endTime,omitempty"`
  1374. // InputUriPrefix: The location of the documents being imported.
  1375. InputUriPrefix string `json:"inputUriPrefix,omitempty"`
  1376. // OperationState: The state of the import operation.
  1377. //
  1378. // Possible values:
  1379. // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
  1380. // "INITIALIZING" - Request is being prepared for processing.
  1381. // "PROCESSING" - Request is actively being processed.
  1382. // "CANCELLING" - Request is in the process of being cancelled after
  1383. // user called
  1384. // google.longrunning.Operations.CancelOperation on the operation.
  1385. // "FINALIZING" - Request has been processed and is in its
  1386. // finalization stage.
  1387. // "SUCCESSFUL" - Request has completed successfully.
  1388. // "FAILED" - Request has finished being processed, but encountered an
  1389. // error.
  1390. // "CANCELLED" - Request has finished being cancelled after user
  1391. // called
  1392. // google.longrunning.Operations.CancelOperation.
  1393. OperationState string `json:"operationState,omitempty"`
  1394. // ProgressBytes: The progress, in bytes, of this operation.
  1395. ProgressBytes *GoogleFirestoreAdminV1Progress `json:"progressBytes,omitempty"`
  1396. // ProgressDocuments: The progress, in documents, of this operation.
  1397. ProgressDocuments *GoogleFirestoreAdminV1Progress `json:"progressDocuments,omitempty"`
  1398. // StartTime: The time this operation started.
  1399. StartTime string `json:"startTime,omitempty"`
  1400. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  1401. // unconditionally include in API requests. By default, fields with
  1402. // empty values are omitted from API requests. However, any non-pointer,
  1403. // non-interface field appearing in ForceSendFields will be sent to the
  1404. // server regardless of whether the field is empty or not. This may be
  1405. // used to include empty fields in Patch requests.
  1406. ForceSendFields []string `json:"-"`
  1407. // NullFields is a list of field names (e.g. "CollectionIds") to include
  1408. // in API requests with the JSON null value. By default, fields with
  1409. // empty values are omitted from API requests. However, any field with
  1410. // an empty value appearing in NullFields will be sent to the server as
  1411. // null. It is an error if a field in this list has a non-empty value.
  1412. // This may be used to include null fields in Patch requests.
  1413. NullFields []string `json:"-"`
  1414. }
  1415. func (s *GoogleFirestoreAdminV1ImportDocumentsMetadata) MarshalJSON() ([]byte, error) {
  1416. type NoMethod GoogleFirestoreAdminV1ImportDocumentsMetadata
  1417. raw := NoMethod(*s)
  1418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1419. }
  1420. // GoogleFirestoreAdminV1ImportDocumentsRequest: The request for
  1421. // FirestoreAdmin.ImportDocuments.
  1422. type GoogleFirestoreAdminV1ImportDocumentsRequest struct {
  1423. // CollectionIds: Which collection ids to import. Unspecified means all
  1424. // collections included
  1425. // in the import.
  1426. CollectionIds []string `json:"collectionIds,omitempty"`
  1427. // InputUriPrefix: Location of the exported files.
  1428. // This must match the output_uri_prefix of an ExportDocumentsResponse
  1429. // from
  1430. // an export that has completed
  1431. // successfully.
  1432. // See:
  1433. // google.firestore.admin.v1.ExportDocumentsResponse.o
  1434. // utput_uri_prefix.
  1435. InputUriPrefix string `json:"inputUriPrefix,omitempty"`
  1436. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  1437. // unconditionally include in API requests. By default, fields with
  1438. // empty values are omitted from API requests. However, any non-pointer,
  1439. // non-interface field appearing in ForceSendFields will be sent to the
  1440. // server regardless of whether the field is empty or not. This may be
  1441. // used to include empty fields in Patch requests.
  1442. ForceSendFields []string `json:"-"`
  1443. // NullFields is a list of field names (e.g. "CollectionIds") to include
  1444. // in API requests with the JSON null value. By default, fields with
  1445. // empty values are omitted from API requests. However, any field with
  1446. // an empty value appearing in NullFields will be sent to the server as
  1447. // null. It is an error if a field in this list has a non-empty value.
  1448. // This may be used to include null fields in Patch requests.
  1449. NullFields []string `json:"-"`
  1450. }
  1451. func (s *GoogleFirestoreAdminV1ImportDocumentsRequest) MarshalJSON() ([]byte, error) {
  1452. type NoMethod GoogleFirestoreAdminV1ImportDocumentsRequest
  1453. raw := NoMethod(*s)
  1454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1455. }
  1456. // GoogleFirestoreAdminV1Index: Cloud Firestore indexes enable simple
  1457. // and complex queries against
  1458. // documents in a database.
  1459. type GoogleFirestoreAdminV1Index struct {
  1460. // Fields: The fields supported by this index.
  1461. //
  1462. // For composite indexes, this is always 2 or more fields.
  1463. // The last field entry is always for the field path `__name__`. If,
  1464. // on
  1465. // creation, `__name__` was not specified as the last field, it will be
  1466. // added
  1467. // automatically with the same direction as that of the last field
  1468. // defined. If
  1469. // the final field in a composite index is not directional, the
  1470. // `__name__`
  1471. // will be ordered ASCENDING (unless explicitly specified).
  1472. //
  1473. // For single field indexes, this will always be exactly one entry with
  1474. // a
  1475. // field path equal to the field path of the associated field.
  1476. Fields []*GoogleFirestoreAdminV1IndexField `json:"fields,omitempty"`
  1477. // Name: Output only.
  1478. // A server defined name for this index.
  1479. // The form of this name for composite indexes will
  1480. // be:
  1481. // `projects/{project_id}/databases/{database_id}/collectionGroups/{c
  1482. // ollection_id}/indexes/{composite_index_id}`
  1483. // For single field indexes, this field will be empty.
  1484. Name string `json:"name,omitempty"`
  1485. // QueryScope: Indexes with a collection query scope specified allow
  1486. // queries
  1487. // against a collection that is the child of a specific document,
  1488. // specified at
  1489. // query time, and that has the same collection id.
  1490. //
  1491. // Indexes with a collection group query scope specified allow queries
  1492. // against
  1493. // all collections descended from a specific document, specified at
  1494. // query
  1495. // time, and that have the same collection id as this index.
  1496. //
  1497. // Possible values:
  1498. // "QUERY_SCOPE_UNSPECIFIED" - The query scope is unspecified. Not a
  1499. // valid option.
  1500. // "COLLECTION" - Indexes with a collection query scope specified
  1501. // allow queries
  1502. // against a collection that is the child of a specific document,
  1503. // specified
  1504. // at query time, and that has the collection id specified by the index.
  1505. QueryScope string `json:"queryScope,omitempty"`
  1506. // State: Output only.
  1507. // The serving state of the index.
  1508. //
  1509. // Possible values:
  1510. // "STATE_UNSPECIFIED" - The state is unspecified.
  1511. // "CREATING" - The index is being created.
  1512. // There is an active long-running operation for the index.
  1513. // The index is updated when writing a document.
  1514. // Some index data may exist.
  1515. // "READY" - The index is ready to be used.
  1516. // The index is updated when writing a document.
  1517. // The index is fully populated from all stored documents it applies to.
  1518. // "NEEDS_REPAIR" - The index was being created, but something went
  1519. // wrong.
  1520. // There is no active long-running operation for the index,
  1521. // and the most recently finished long-running operation failed.
  1522. // The index is not updated when writing a document.
  1523. // Some index data may exist.
  1524. // Use the google.longrunning.Operations API to determine why the
  1525. // operation
  1526. // that last attempted to create this index failed, then re-create
  1527. // the
  1528. // index.
  1529. State string `json:"state,omitempty"`
  1530. // ServerResponse contains the HTTP response code and headers from the
  1531. // server.
  1532. googleapi.ServerResponse `json:"-"`
  1533. // ForceSendFields is a list of field names (e.g. "Fields") to
  1534. // unconditionally include in API requests. By default, fields with
  1535. // empty values are omitted from API requests. However, any non-pointer,
  1536. // non-interface field appearing in ForceSendFields will be sent to the
  1537. // server regardless of whether the field is empty or not. This may be
  1538. // used to include empty fields in Patch requests.
  1539. ForceSendFields []string `json:"-"`
  1540. // NullFields is a list of field names (e.g. "Fields") to include in API
  1541. // requests with the JSON null value. By default, fields with empty
  1542. // values are omitted from API requests. However, any field with an
  1543. // empty value appearing in NullFields will be sent to the server as
  1544. // null. It is an error if a field in this list has a non-empty value.
  1545. // This may be used to include null fields in Patch requests.
  1546. NullFields []string `json:"-"`
  1547. }
  1548. func (s *GoogleFirestoreAdminV1Index) MarshalJSON() ([]byte, error) {
  1549. type NoMethod GoogleFirestoreAdminV1Index
  1550. raw := NoMethod(*s)
  1551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1552. }
  1553. // GoogleFirestoreAdminV1IndexConfig: The index configuration for this
  1554. // field.
  1555. type GoogleFirestoreAdminV1IndexConfig struct {
  1556. // AncestorField: Output only.
  1557. // Specifies the resource name of the `Field` from which this
  1558. // field's
  1559. // index configuration is set (when `uses_ancestor_config` is true),
  1560. // or from which it *would* be set if this field had no index
  1561. // configuration
  1562. // (when `uses_ancestor_config` is false).
  1563. AncestorField string `json:"ancestorField,omitempty"`
  1564. // Indexes: The indexes supported for this field.
  1565. Indexes []*GoogleFirestoreAdminV1Index `json:"indexes,omitempty"`
  1566. // Reverting: Output only
  1567. // When true, the `Field`'s index configuration is in the process of
  1568. // being
  1569. // reverted. Once complete, the index config will transition to the
  1570. // same
  1571. // state as the field specified by `ancestor_field`, at which
  1572. // point
  1573. // `uses_ancestor_config` will be `true` and `reverting` will be
  1574. // `false`.
  1575. Reverting bool `json:"reverting,omitempty"`
  1576. // UsesAncestorConfig: Output only.
  1577. // When true, the `Field`'s index configuration is set from
  1578. // the
  1579. // configuration specified by the `ancestor_field`.
  1580. // When false, the `Field`'s index configuration is defined explicitly.
  1581. UsesAncestorConfig bool `json:"usesAncestorConfig,omitempty"`
  1582. // ForceSendFields is a list of field names (e.g. "AncestorField") to
  1583. // unconditionally include in API requests. By default, fields with
  1584. // empty values are omitted from API requests. However, any non-pointer,
  1585. // non-interface field appearing in ForceSendFields will be sent to the
  1586. // server regardless of whether the field is empty or not. This may be
  1587. // used to include empty fields in Patch requests.
  1588. ForceSendFields []string `json:"-"`
  1589. // NullFields is a list of field names (e.g. "AncestorField") to include
  1590. // in API requests with the JSON null value. By default, fields with
  1591. // empty values are omitted from API requests. However, any field with
  1592. // an empty value appearing in NullFields will be sent to the server as
  1593. // null. It is an error if a field in this list has a non-empty value.
  1594. // This may be used to include null fields in Patch requests.
  1595. NullFields []string `json:"-"`
  1596. }
  1597. func (s *GoogleFirestoreAdminV1IndexConfig) MarshalJSON() ([]byte, error) {
  1598. type NoMethod GoogleFirestoreAdminV1IndexConfig
  1599. raw := NoMethod(*s)
  1600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1601. }
  1602. // GoogleFirestoreAdminV1IndexConfigDelta: Information about an index
  1603. // configuration change.
  1604. type GoogleFirestoreAdminV1IndexConfigDelta struct {
  1605. // ChangeType: Specifies how the index is changing.
  1606. //
  1607. // Possible values:
  1608. // "CHANGE_TYPE_UNSPECIFIED" - The type of change is not specified or
  1609. // known.
  1610. // "ADD" - The single field index is being added.
  1611. // "REMOVE" - The single field index is being removed.
  1612. ChangeType string `json:"changeType,omitempty"`
  1613. // Index: The index being changed.
  1614. Index *GoogleFirestoreAdminV1Index `json:"index,omitempty"`
  1615. // ForceSendFields is a list of field names (e.g. "ChangeType") to
  1616. // unconditionally include in API requests. By default, fields with
  1617. // empty values are omitted from API requests. However, any non-pointer,
  1618. // non-interface field appearing in ForceSendFields will be sent to the
  1619. // server regardless of whether the field is empty or not. This may be
  1620. // used to include empty fields in Patch requests.
  1621. ForceSendFields []string `json:"-"`
  1622. // NullFields is a list of field names (e.g. "ChangeType") to include in
  1623. // API requests with the JSON null value. By default, fields with empty
  1624. // values are omitted from API requests. However, any field with an
  1625. // empty value appearing in NullFields will be sent to the server as
  1626. // null. It is an error if a field in this list has a non-empty value.
  1627. // This may be used to include null fields in Patch requests.
  1628. NullFields []string `json:"-"`
  1629. }
  1630. func (s *GoogleFirestoreAdminV1IndexConfigDelta) MarshalJSON() ([]byte, error) {
  1631. type NoMethod GoogleFirestoreAdminV1IndexConfigDelta
  1632. raw := NoMethod(*s)
  1633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1634. }
  1635. // GoogleFirestoreAdminV1IndexField: A field in an index.
  1636. // The field_path describes which field is indexed, the value_mode
  1637. // describes
  1638. // how the field value is indexed.
  1639. type GoogleFirestoreAdminV1IndexField struct {
  1640. // ArrayConfig: Indicates that this field supports operations on
  1641. // `array_value`s.
  1642. //
  1643. // Possible values:
  1644. // "ARRAY_CONFIG_UNSPECIFIED" - The index does not support additional
  1645. // array queries.
  1646. // "CONTAINS" - The index supports array containment queries.
  1647. ArrayConfig string `json:"arrayConfig,omitempty"`
  1648. // FieldPath: Can be __name__.
  1649. // For single field indexes, this must match the name of the field or
  1650. // may
  1651. // be omitted.
  1652. FieldPath string `json:"fieldPath,omitempty"`
  1653. // Order: Indicates that this field supports ordering by the specified
  1654. // order or
  1655. // comparing using =, <, <=, >, >=.
  1656. //
  1657. // Possible values:
  1658. // "ORDER_UNSPECIFIED" - The ordering is unspecified. Not a valid
  1659. // option.
  1660. // "ASCENDING" - The field is ordered by ascending field value.
  1661. // "DESCENDING" - The field is ordered by descending field value.
  1662. Order string `json:"order,omitempty"`
  1663. // ForceSendFields is a list of field names (e.g. "ArrayConfig") to
  1664. // unconditionally include in API requests. By default, fields with
  1665. // empty values are omitted from API requests. However, any non-pointer,
  1666. // non-interface field appearing in ForceSendFields will be sent to the
  1667. // server regardless of whether the field is empty or not. This may be
  1668. // used to include empty fields in Patch requests.
  1669. ForceSendFields []string `json:"-"`
  1670. // NullFields is a list of field names (e.g. "ArrayConfig") to include
  1671. // in API requests with the JSON null value. By default, fields with
  1672. // empty values are omitted from API requests. However, any field with
  1673. // an empty value appearing in NullFields will be sent to the server as
  1674. // null. It is an error if a field in this list has a non-empty value.
  1675. // This may be used to include null fields in Patch requests.
  1676. NullFields []string `json:"-"`
  1677. }
  1678. func (s *GoogleFirestoreAdminV1IndexField) MarshalJSON() ([]byte, error) {
  1679. type NoMethod GoogleFirestoreAdminV1IndexField
  1680. raw := NoMethod(*s)
  1681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1682. }
  1683. // GoogleFirestoreAdminV1IndexOperationMetadata: Metadata for
  1684. // google.longrunning.Operation results from
  1685. // FirestoreAdmin.CreateIndex.
  1686. type GoogleFirestoreAdminV1IndexOperationMetadata struct {
  1687. // EndTime: The time this operation completed. Will be unset if
  1688. // operation still in
  1689. // progress.
  1690. EndTime string `json:"endTime,omitempty"`
  1691. // Index: The index resource that this operation is acting on. For
  1692. // example:
  1693. // `projects/{project_id}/databases/{database_id}/collectionGrou
  1694. // ps/{collection_id}/indexes/{index_id}`
  1695. Index string `json:"index,omitempty"`
  1696. // ProgressBytes: The progress, in bytes, of this operation.
  1697. ProgressBytes *GoogleFirestoreAdminV1Progress `json:"progressBytes,omitempty"`
  1698. // ProgressDocuments: The progress, in documents, of this operation.
  1699. ProgressDocuments *GoogleFirestoreAdminV1Progress `json:"progressDocuments,omitempty"`
  1700. // StartTime: The time this operation started.
  1701. StartTime string `json:"startTime,omitempty"`
  1702. // State: The state of the operation.
  1703. //
  1704. // Possible values:
  1705. // "OPERATION_STATE_UNSPECIFIED" - Unspecified.
  1706. // "INITIALIZING" - Request is being prepared for processing.
  1707. // "PROCESSING" - Request is actively being processed.
  1708. // "CANCELLING" - Request is in the process of being cancelled after
  1709. // user called
  1710. // google.longrunning.Operations.CancelOperation on the operation.
  1711. // "FINALIZING" - Request has been processed and is in its
  1712. // finalization stage.
  1713. // "SUCCESSFUL" - Request has completed successfully.
  1714. // "FAILED" - Request has finished being processed, but encountered an
  1715. // error.
  1716. // "CANCELLED" - Request has finished being cancelled after user
  1717. // called
  1718. // google.longrunning.Operations.CancelOperation.
  1719. State string `json:"state,omitempty"`
  1720. // ForceSendFields is a list of field names (e.g. "EndTime") to
  1721. // unconditionally include in API requests. By default, fields with
  1722. // empty values are omitted from API requests. However, any non-pointer,
  1723. // non-interface field appearing in ForceSendFields will be sent to the
  1724. // server regardless of whether the field is empty or not. This may be
  1725. // used to include empty fields in Patch requests.
  1726. ForceSendFields []string `json:"-"`
  1727. // NullFields is a list of field names (e.g. "EndTime") to include in
  1728. // API requests with the JSON null value. By default, fields with empty
  1729. // values are omitted from API requests. However, any field with an
  1730. // empty value appearing in NullFields will be sent to the server as
  1731. // null. It is an error if a field in this list has a non-empty value.
  1732. // This may be used to include null fields in Patch requests.
  1733. NullFields []string `json:"-"`
  1734. }
  1735. func (s *GoogleFirestoreAdminV1IndexOperationMetadata) MarshalJSON() ([]byte, error) {
  1736. type NoMethod GoogleFirestoreAdminV1IndexOperationMetadata
  1737. raw := NoMethod(*s)
  1738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1739. }
  1740. // GoogleFirestoreAdminV1ListFieldsResponse: The response for
  1741. // FirestoreAdmin.ListFields.
  1742. type GoogleFirestoreAdminV1ListFieldsResponse struct {
  1743. // Fields: The requested fields.
  1744. Fields []*GoogleFirestoreAdminV1Field `json:"fields,omitempty"`
  1745. // NextPageToken: A page token that may be used to request another page
  1746. // of results. If blank,
  1747. // this is the last page.
  1748. NextPageToken string `json:"nextPageToken,omitempty"`
  1749. // ServerResponse contains the HTTP response code and headers from the
  1750. // server.
  1751. googleapi.ServerResponse `json:"-"`
  1752. // ForceSendFields is a list of field names (e.g. "Fields") to
  1753. // unconditionally include in API requests. By default, fields with
  1754. // empty values are omitted from API requests. However, any non-pointer,
  1755. // non-interface field appearing in ForceSendFields will be sent to the
  1756. // server regardless of whether the field is empty or not. This may be
  1757. // used to include empty fields in Patch requests.
  1758. ForceSendFields []string `json:"-"`
  1759. // NullFields is a list of field names (e.g. "Fields") to include in API
  1760. // requests with the JSON null value. By default, fields with empty
  1761. // values are omitted from API requests. However, any field with an
  1762. // empty value appearing in NullFields will be sent to the server as
  1763. // null. It is an error if a field in this list has a non-empty value.
  1764. // This may be used to include null fields in Patch requests.
  1765. NullFields []string `json:"-"`
  1766. }
  1767. func (s *GoogleFirestoreAdminV1ListFieldsResponse) MarshalJSON() ([]byte, error) {
  1768. type NoMethod GoogleFirestoreAdminV1ListFieldsResponse
  1769. raw := NoMethod(*s)
  1770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1771. }
  1772. // GoogleFirestoreAdminV1ListIndexesResponse: The response for
  1773. // FirestoreAdmin.ListIndexes.
  1774. type GoogleFirestoreAdminV1ListIndexesResponse struct {
  1775. // Indexes: The requested indexes.
  1776. Indexes []*GoogleFirestoreAdminV1Index `json:"indexes,omitempty"`
  1777. // NextPageToken: A page token that may be used to request another page
  1778. // of results. If blank,
  1779. // this is the last page.
  1780. NextPageToken string `json:"nextPageToken,omitempty"`
  1781. // ServerResponse contains the HTTP response code and headers from the
  1782. // server.
  1783. googleapi.ServerResponse `json:"-"`
  1784. // ForceSendFields is a list of field names (e.g. "Indexes") to
  1785. // unconditionally include in API requests. By default, fields with
  1786. // empty values are omitted from API requests. However, any non-pointer,
  1787. // non-interface field appearing in ForceSendFields will be sent to the
  1788. // server regardless of whether the field is empty or not. This may be
  1789. // used to include empty fields in Patch requests.
  1790. ForceSendFields []string `json:"-"`
  1791. // NullFields is a list of field names (e.g. "Indexes") to include in
  1792. // API requests with the JSON null value. By default, fields with empty
  1793. // values are omitted from API requests. However, any field with an
  1794. // empty value appearing in NullFields will be sent to the server as
  1795. // null. It is an error if a field in this list has a non-empty value.
  1796. // This may be used to include null fields in Patch requests.
  1797. NullFields []string `json:"-"`
  1798. }
  1799. func (s *GoogleFirestoreAdminV1ListIndexesResponse) MarshalJSON() ([]byte, error) {
  1800. type NoMethod GoogleFirestoreAdminV1ListIndexesResponse
  1801. raw := NoMethod(*s)
  1802. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1803. }
  1804. // GoogleFirestoreAdminV1LocationMetadata: The metadata message for
  1805. // google.cloud.location.Location.metadata.
  1806. type GoogleFirestoreAdminV1LocationMetadata struct {
  1807. }
  1808. // GoogleFirestoreAdminV1Progress: Describes the progress of the
  1809. // operation.
  1810. // Unit of work is generic and must be interpreted based on where
  1811. // Progress
  1812. // is used.
  1813. type GoogleFirestoreAdminV1Progress struct {
  1814. // CompletedWork: The amount of work completed.
  1815. CompletedWork int64 `json:"completedWork,omitempty,string"`
  1816. // EstimatedWork: The amount of work estimated.
  1817. EstimatedWork int64 `json:"estimatedWork,omitempty,string"`
  1818. // ForceSendFields is a list of field names (e.g. "CompletedWork") to
  1819. // unconditionally include in API requests. By default, fields with
  1820. // empty values are omitted from API requests. However, any non-pointer,
  1821. // non-interface field appearing in ForceSendFields will be sent to the
  1822. // server regardless of whether the field is empty or not. This may be
  1823. // used to include empty fields in Patch requests.
  1824. ForceSendFields []string `json:"-"`
  1825. // NullFields is a list of field names (e.g. "CompletedWork") to include
  1826. // in API requests with the JSON null value. By default, fields with
  1827. // empty values are omitted from API requests. However, any field with
  1828. // an empty value appearing in NullFields will be sent to the server as
  1829. // null. It is an error if a field in this list has a non-empty value.
  1830. // This may be used to include null fields in Patch requests.
  1831. NullFields []string `json:"-"`
  1832. }
  1833. func (s *GoogleFirestoreAdminV1Progress) MarshalJSON() ([]byte, error) {
  1834. type NoMethod GoogleFirestoreAdminV1Progress
  1835. raw := NoMethod(*s)
  1836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1837. }
  1838. // GoogleLongrunningCancelOperationRequest: The request message for
  1839. // Operations.CancelOperation.
  1840. type GoogleLongrunningCancelOperationRequest struct {
  1841. }
  1842. // GoogleLongrunningListOperationsResponse: The response message for
  1843. // Operations.ListOperations.
  1844. type GoogleLongrunningListOperationsResponse struct {
  1845. // NextPageToken: The standard List next-page token.
  1846. NextPageToken string `json:"nextPageToken,omitempty"`
  1847. // Operations: A list of operations that matches the specified filter in
  1848. // the request.
  1849. Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
  1850. // ServerResponse contains the HTTP response code and headers from the
  1851. // server.
  1852. googleapi.ServerResponse `json:"-"`
  1853. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1854. // unconditionally include in API requests. By default, fields with
  1855. // empty values are omitted from API requests. However, any non-pointer,
  1856. // non-interface field appearing in ForceSendFields will be sent to the
  1857. // server regardless of whether the field is empty or not. This may be
  1858. // used to include empty fields in Patch requests.
  1859. ForceSendFields []string `json:"-"`
  1860. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1861. // in API requests with the JSON null value. By default, fields with
  1862. // empty values are omitted from API requests. However, any field with
  1863. // an empty value appearing in NullFields will be sent to the server as
  1864. // null. It is an error if a field in this list has a non-empty value.
  1865. // This may be used to include null fields in Patch requests.
  1866. NullFields []string `json:"-"`
  1867. }
  1868. func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
  1869. type NoMethod GoogleLongrunningListOperationsResponse
  1870. raw := NoMethod(*s)
  1871. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1872. }
  1873. // GoogleLongrunningOperation: This resource represents a long-running
  1874. // operation that is the result of a
  1875. // network API call.
  1876. type GoogleLongrunningOperation struct {
  1877. // Done: If the value is `false`, it means the operation is still in
  1878. // progress.
  1879. // If `true`, the operation is completed, and either `error` or
  1880. // `response` is
  1881. // available.
  1882. Done bool `json:"done,omitempty"`
  1883. // Error: The error result of the operation in case of failure or
  1884. // cancellation.
  1885. Error *Status `json:"error,omitempty"`
  1886. // Metadata: Service-specific metadata associated with the operation.
  1887. // It typically
  1888. // contains progress information and common metadata such as create
  1889. // time.
  1890. // Some services might not provide such metadata. Any method that
  1891. // returns a
  1892. // long-running operation should document the metadata type, if any.
  1893. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1894. // Name: The server-assigned name, which is only unique within the same
  1895. // service that
  1896. // originally returns it. If you use the default HTTP mapping,
  1897. // the
  1898. // `name` should have the format of `operations/some/unique/name`.
  1899. Name string `json:"name,omitempty"`
  1900. // Response: The normal response of the operation in case of success.
  1901. // If the original
  1902. // method returns no data on success, such as `Delete`, the response
  1903. // is
  1904. // `google.protobuf.Empty`. If the original method is
  1905. // standard
  1906. // `Get`/`Create`/`Update`, the response should be the resource. For
  1907. // other
  1908. // methods, the response should have the type `XxxResponse`, where
  1909. // `Xxx`
  1910. // is the original method name. For example, if the original method
  1911. // name
  1912. // is `TakeSnapshot()`, the inferred response type
  1913. // is
  1914. // `TakeSnapshotResponse`.
  1915. Response googleapi.RawMessage `json:"response,omitempty"`
  1916. // ServerResponse contains the HTTP response code and headers from the
  1917. // server.
  1918. googleapi.ServerResponse `json:"-"`
  1919. // ForceSendFields is a list of field names (e.g. "Done") to
  1920. // unconditionally include in API requests. By default, fields with
  1921. // empty values are omitted from API requests. However, any non-pointer,
  1922. // non-interface field appearing in ForceSendFields will be sent to the
  1923. // server regardless of whether the field is empty or not. This may be
  1924. // used to include empty fields in Patch requests.
  1925. ForceSendFields []string `json:"-"`
  1926. // NullFields is a list of field names (e.g. "Done") to include in API
  1927. // requests with the JSON null value. By default, fields with empty
  1928. // values are omitted from API requests. However, any field with an
  1929. // empty value appearing in NullFields will be sent to the server as
  1930. // null. It is an error if a field in this list has a non-empty value.
  1931. // This may be used to include null fields in Patch requests.
  1932. NullFields []string `json:"-"`
  1933. }
  1934. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  1935. type NoMethod GoogleLongrunningOperation
  1936. raw := NoMethod(*s)
  1937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1938. }
  1939. // LatLng: An object representing a latitude/longitude pair. This is
  1940. // expressed as a pair
  1941. // of doubles representing degrees latitude and degrees longitude.
  1942. // Unless
  1943. // specified otherwise, this must conform to the
  1944. // <a
  1945. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  1946. // st
  1947. // andard</a>. Values must be within normalized ranges.
  1948. type LatLng struct {
  1949. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  1950. // +90.0].
  1951. Latitude float64 `json:"latitude,omitempty"`
  1952. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  1953. // +180.0].
  1954. Longitude float64 `json:"longitude,omitempty"`
  1955. // ForceSendFields is a list of field names (e.g. "Latitude") to
  1956. // unconditionally include in API requests. By default, fields with
  1957. // empty values are omitted from API requests. However, any non-pointer,
  1958. // non-interface field appearing in ForceSendFields will be sent to the
  1959. // server regardless of whether the field is empty or not. This may be
  1960. // used to include empty fields in Patch requests.
  1961. ForceSendFields []string `json:"-"`
  1962. // NullFields is a list of field names (e.g. "Latitude") to include in
  1963. // API requests with the JSON null value. By default, fields with empty
  1964. // values are omitted from API requests. However, any field with an
  1965. // empty value appearing in NullFields will be sent to the server as
  1966. // null. It is an error if a field in this list has a non-empty value.
  1967. // This may be used to include null fields in Patch requests.
  1968. NullFields []string `json:"-"`
  1969. }
  1970. func (s *LatLng) MarshalJSON() ([]byte, error) {
  1971. type NoMethod LatLng
  1972. raw := NoMethod(*s)
  1973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1974. }
  1975. func (s *LatLng) UnmarshalJSON(data []byte) error {
  1976. type NoMethod LatLng
  1977. var s1 struct {
  1978. Latitude gensupport.JSONFloat64 `json:"latitude"`
  1979. Longitude gensupport.JSONFloat64 `json:"longitude"`
  1980. *NoMethod
  1981. }
  1982. s1.NoMethod = (*NoMethod)(s)
  1983. if err := json.Unmarshal(data, &s1); err != nil {
  1984. return err
  1985. }
  1986. s.Latitude = float64(s1.Latitude)
  1987. s.Longitude = float64(s1.Longitude)
  1988. return nil
  1989. }
  1990. // ListCollectionIdsRequest: The request for
  1991. // Firestore.ListCollectionIds.
  1992. type ListCollectionIdsRequest struct {
  1993. // PageSize: The maximum number of results to return.
  1994. PageSize int64 `json:"pageSize,omitempty"`
  1995. // PageToken: A page token. Must be a value
  1996. // from
  1997. // ListCollectionIdsResponse.
  1998. PageToken string `json:"pageToken,omitempty"`
  1999. // ForceSendFields is a list of field names (e.g. "PageSize") to
  2000. // unconditionally include in API requests. By default, fields with
  2001. // empty values are omitted from API requests. However, any non-pointer,
  2002. // non-interface field appearing in ForceSendFields will be sent to the
  2003. // server regardless of whether the field is empty or not. This may be
  2004. // used to include empty fields in Patch requests.
  2005. ForceSendFields []string `json:"-"`
  2006. // NullFields is a list of field names (e.g. "PageSize") to include in
  2007. // API requests with the JSON null value. By default, fields with empty
  2008. // values are omitted from API requests. However, any field with an
  2009. // empty value appearing in NullFields will be sent to the server as
  2010. // null. It is an error if a field in this list has a non-empty value.
  2011. // This may be used to include null fields in Patch requests.
  2012. NullFields []string `json:"-"`
  2013. }
  2014. func (s *ListCollectionIdsRequest) MarshalJSON() ([]byte, error) {
  2015. type NoMethod ListCollectionIdsRequest
  2016. raw := NoMethod(*s)
  2017. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2018. }
  2019. // ListCollectionIdsResponse: The response from
  2020. // Firestore.ListCollectionIds.
  2021. type ListCollectionIdsResponse struct {
  2022. // CollectionIds: The collection ids.
  2023. CollectionIds []string `json:"collectionIds,omitempty"`
  2024. // NextPageToken: A page token that may be used to continue the list.
  2025. NextPageToken string `json:"nextPageToken,omitempty"`
  2026. // ServerResponse contains the HTTP response code and headers from the
  2027. // server.
  2028. googleapi.ServerResponse `json:"-"`
  2029. // ForceSendFields is a list of field names (e.g. "CollectionIds") to
  2030. // unconditionally include in API requests. By default, fields with
  2031. // empty values are omitted from API requests. However, any non-pointer,
  2032. // non-interface field appearing in ForceSendFields will be sent to the
  2033. // server regardless of whether the field is empty or not. This may be
  2034. // used to include empty fields in Patch requests.
  2035. ForceSendFields []string `json:"-"`
  2036. // NullFields is a list of field names (e.g. "CollectionIds") to include
  2037. // in API requests with the JSON null value. By default, fields with
  2038. // empty values are omitted from API requests. However, any field with
  2039. // an empty value appearing in NullFields will be sent to the server as
  2040. // null. It is an error if a field in this list has a non-empty value.
  2041. // This may be used to include null fields in Patch requests.
  2042. NullFields []string `json:"-"`
  2043. }
  2044. func (s *ListCollectionIdsResponse) MarshalJSON() ([]byte, error) {
  2045. type NoMethod ListCollectionIdsResponse
  2046. raw := NoMethod(*s)
  2047. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2048. }
  2049. // ListDocumentsResponse: The response for Firestore.ListDocuments.
  2050. type ListDocumentsResponse struct {
  2051. // Documents: The Documents found.
  2052. Documents []*Document `json:"documents,omitempty"`
  2053. // NextPageToken: The next page token.
  2054. NextPageToken string `json:"nextPageToken,omitempty"`
  2055. // ServerResponse contains the HTTP response code and headers from the
  2056. // server.
  2057. googleapi.ServerResponse `json:"-"`
  2058. // ForceSendFields is a list of field names (e.g. "Documents") to
  2059. // unconditionally include in API requests. By default, fields with
  2060. // empty values are omitted from API requests. However, any non-pointer,
  2061. // non-interface field appearing in ForceSendFields will be sent to the
  2062. // server regardless of whether the field is empty or not. This may be
  2063. // used to include empty fields in Patch requests.
  2064. ForceSendFields []string `json:"-"`
  2065. // NullFields is a list of field names (e.g. "Documents") to include in
  2066. // API requests with the JSON null value. By default, fields with empty
  2067. // values are omitted from API requests. However, any field with an
  2068. // empty value appearing in NullFields will be sent to the server as
  2069. // null. It is an error if a field in this list has a non-empty value.
  2070. // This may be used to include null fields in Patch requests.
  2071. NullFields []string `json:"-"`
  2072. }
  2073. func (s *ListDocumentsResponse) MarshalJSON() ([]byte, error) {
  2074. type NoMethod ListDocumentsResponse
  2075. raw := NoMethod(*s)
  2076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2077. }
  2078. // ListLocationsResponse: The response message for
  2079. // Locations.ListLocations.
  2080. type ListLocationsResponse struct {
  2081. // Locations: A list of locations that matches the specified filter in
  2082. // the request.
  2083. Locations []*Location `json:"locations,omitempty"`
  2084. // NextPageToken: The standard List next-page token.
  2085. NextPageToken string `json:"nextPageToken,omitempty"`
  2086. // ServerResponse contains the HTTP response code and headers from the
  2087. // server.
  2088. googleapi.ServerResponse `json:"-"`
  2089. // ForceSendFields is a list of field names (e.g. "Locations") to
  2090. // unconditionally include in API requests. By default, fields with
  2091. // empty values are omitted from API requests. However, any non-pointer,
  2092. // non-interface field appearing in ForceSendFields will be sent to the
  2093. // server regardless of whether the field is empty or not. This may be
  2094. // used to include empty fields in Patch requests.
  2095. ForceSendFields []string `json:"-"`
  2096. // NullFields is a list of field names (e.g. "Locations") to include in
  2097. // API requests with the JSON null value. By default, fields with empty
  2098. // values are omitted from API requests. However, any field with an
  2099. // empty value appearing in NullFields will be sent to the server as
  2100. // null. It is an error if a field in this list has a non-empty value.
  2101. // This may be used to include null fields in Patch requests.
  2102. NullFields []string `json:"-"`
  2103. }
  2104. func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
  2105. type NoMethod ListLocationsResponse
  2106. raw := NoMethod(*s)
  2107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2108. }
  2109. // ListenRequest: A request for Firestore.Listen
  2110. type ListenRequest struct {
  2111. // AddTarget: A target to add to this stream.
  2112. AddTarget *Target `json:"addTarget,omitempty"`
  2113. // Labels: Labels associated with this target change.
  2114. Labels map[string]string `json:"labels,omitempty"`
  2115. // RemoveTarget: The ID of a target to remove from this stream.
  2116. RemoveTarget int64 `json:"removeTarget,omitempty"`
  2117. // ForceSendFields is a list of field names (e.g. "AddTarget") to
  2118. // unconditionally include in API requests. By default, fields with
  2119. // empty values are omitted from API requests. However, any non-pointer,
  2120. // non-interface field appearing in ForceSendFields will be sent to the
  2121. // server regardless of whether the field is empty or not. This may be
  2122. // used to include empty fields in Patch requests.
  2123. ForceSendFields []string `json:"-"`
  2124. // NullFields is a list of field names (e.g. "AddTarget") to include in
  2125. // API requests with the JSON null value. By default, fields with empty
  2126. // values are omitted from API requests. However, any field with an
  2127. // empty value appearing in NullFields will be sent to the server as
  2128. // null. It is an error if a field in this list has a non-empty value.
  2129. // This may be used to include null fields in Patch requests.
  2130. NullFields []string `json:"-"`
  2131. }
  2132. func (s *ListenRequest) MarshalJSON() ([]byte, error) {
  2133. type NoMethod ListenRequest
  2134. raw := NoMethod(*s)
  2135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2136. }
  2137. // ListenResponse: The response for Firestore.Listen.
  2138. type ListenResponse struct {
  2139. // DocumentChange: A Document has changed.
  2140. DocumentChange *DocumentChange `json:"documentChange,omitempty"`
  2141. // DocumentDelete: A Document has been deleted.
  2142. DocumentDelete *DocumentDelete `json:"documentDelete,omitempty"`
  2143. // DocumentRemove: A Document has been removed from a target (because it
  2144. // is no longer
  2145. // relevant to that target).
  2146. DocumentRemove *DocumentRemove `json:"documentRemove,omitempty"`
  2147. // Filter: A filter to apply to the set of documents previously returned
  2148. // for the
  2149. // given target.
  2150. //
  2151. // Returned when documents may have been removed from the given target,
  2152. // but
  2153. // the exact documents are unknown.
  2154. Filter *ExistenceFilter `json:"filter,omitempty"`
  2155. // TargetChange: Targets have changed.
  2156. TargetChange *TargetChange `json:"targetChange,omitempty"`
  2157. // ServerResponse contains the HTTP response code and headers from the
  2158. // server.
  2159. googleapi.ServerResponse `json:"-"`
  2160. // ForceSendFields is a list of field names (e.g. "DocumentChange") to
  2161. // unconditionally include in API requests. By default, fields with
  2162. // empty values are omitted from API requests. However, any non-pointer,
  2163. // non-interface field appearing in ForceSendFields will be sent to the
  2164. // server regardless of whether the field is empty or not. This may be
  2165. // used to include empty fields in Patch requests.
  2166. ForceSendFields []string `json:"-"`
  2167. // NullFields is a list of field names (e.g. "DocumentChange") to
  2168. // include in API requests with the JSON null value. By default, fields
  2169. // with empty values are omitted from API requests. However, any field
  2170. // with an empty value appearing in NullFields will be sent to the
  2171. // server as null. It is an error if a field in this list has a
  2172. // non-empty value. This may be used to include null fields in Patch
  2173. // requests.
  2174. NullFields []string `json:"-"`
  2175. }
  2176. func (s *ListenResponse) MarshalJSON() ([]byte, error) {
  2177. type NoMethod ListenResponse
  2178. raw := NoMethod(*s)
  2179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2180. }
  2181. // Location: A resource that represents Google Cloud Platform location.
  2182. type Location struct {
  2183. // DisplayName: The friendly name for this location, typically a nearby
  2184. // city name.
  2185. // For example, "Tokyo".
  2186. DisplayName string `json:"displayName,omitempty"`
  2187. // Labels: Cross-service attributes for the location. For example
  2188. //
  2189. // {"cloud.googleapis.com/region": "us-east1"}
  2190. Labels map[string]string `json:"labels,omitempty"`
  2191. // LocationId: The canonical id for this location. For example:
  2192. // "us-east1".
  2193. LocationId string `json:"locationId,omitempty"`
  2194. // Metadata: Service-specific metadata. For example the available
  2195. // capacity at the given
  2196. // location.
  2197. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  2198. // Name: Resource name for the location, which may vary between
  2199. // implementations.
  2200. // For example: "projects/example-project/locations/us-east1"
  2201. Name string `json:"name,omitempty"`
  2202. // ServerResponse contains the HTTP response code and headers from the
  2203. // server.
  2204. googleapi.ServerResponse `json:"-"`
  2205. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  2206. // unconditionally include in API requests. By default, fields with
  2207. // empty values are omitted from API requests. However, any non-pointer,
  2208. // non-interface field appearing in ForceSendFields will be sent to the
  2209. // server regardless of whether the field is empty or not. This may be
  2210. // used to include empty fields in Patch requests.
  2211. ForceSendFields []string `json:"-"`
  2212. // NullFields is a list of field names (e.g. "DisplayName") to include
  2213. // in API requests with the JSON null value. By default, fields with
  2214. // empty values are omitted from API requests. However, any field with
  2215. // an empty value appearing in NullFields will be sent to the server as
  2216. // null. It is an error if a field in this list has a non-empty value.
  2217. // This may be used to include null fields in Patch requests.
  2218. NullFields []string `json:"-"`
  2219. }
  2220. func (s *Location) MarshalJSON() ([]byte, error) {
  2221. type NoMethod Location
  2222. raw := NoMethod(*s)
  2223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2224. }
  2225. // MapValue: A map value.
  2226. type MapValue struct {
  2227. // Fields: The map's fields.
  2228. //
  2229. // The map keys represent field names. Field names matching the
  2230. // regular
  2231. // expression `__.*__` are reserved. Reserved field names are forbidden
  2232. // except
  2233. // in certain documented contexts. The map keys, represented as UTF-8,
  2234. // must
  2235. // not exceed 1,500 bytes and cannot be empty.
  2236. Fields map[string]Value `json:"fields,omitempty"`
  2237. // ForceSendFields is a list of field names (e.g. "Fields") to
  2238. // unconditionally include in API requests. By default, fields with
  2239. // empty values are omitted from API requests. However, any non-pointer,
  2240. // non-interface field appearing in ForceSendFields will be sent to the
  2241. // server regardless of whether the field is empty or not. This may be
  2242. // used to include empty fields in Patch requests.
  2243. ForceSendFields []string `json:"-"`
  2244. // NullFields is a list of field names (e.g. "Fields") to include in API
  2245. // requests with the JSON null value. By default, fields with empty
  2246. // values are omitted from API requests. However, any field with an
  2247. // empty value appearing in NullFields will be sent to the server as
  2248. // null. It is an error if a field in this list has a non-empty value.
  2249. // This may be used to include null fields in Patch requests.
  2250. NullFields []string `json:"-"`
  2251. }
  2252. func (s *MapValue) MarshalJSON() ([]byte, error) {
  2253. type NoMethod MapValue
  2254. raw := NoMethod(*s)
  2255. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2256. }
  2257. // Order: An order on a field.
  2258. type Order struct {
  2259. // Direction: The direction to order by. Defaults to `ASCENDING`.
  2260. //
  2261. // Possible values:
  2262. // "DIRECTION_UNSPECIFIED" - Unspecified.
  2263. // "ASCENDING" - Ascending.
  2264. // "DESCENDING" - Descending.
  2265. Direction string `json:"direction,omitempty"`
  2266. // Field: The field to order by.
  2267. Field *FieldReference `json:"field,omitempty"`
  2268. // ForceSendFields is a list of field names (e.g. "Direction") to
  2269. // unconditionally include in API requests. By default, fields with
  2270. // empty values are omitted from API requests. However, any non-pointer,
  2271. // non-interface field appearing in ForceSendFields will be sent to the
  2272. // server regardless of whether the field is empty or not. This may be
  2273. // used to include empty fields in Patch requests.
  2274. ForceSendFields []string `json:"-"`
  2275. // NullFields is a list of field names (e.g. "Direction") to include in
  2276. // API requests with the JSON null value. By default, fields with empty
  2277. // values are omitted from API requests. However, any field with an
  2278. // empty value appearing in NullFields will be sent to the server as
  2279. // null. It is an error if a field in this list has a non-empty value.
  2280. // This may be used to include null fields in Patch requests.
  2281. NullFields []string `json:"-"`
  2282. }
  2283. func (s *Order) MarshalJSON() ([]byte, error) {
  2284. type NoMethod Order
  2285. raw := NoMethod(*s)
  2286. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2287. }
  2288. // Precondition: A precondition on a document, used for conditional
  2289. // operations.
  2290. type Precondition struct {
  2291. // Exists: When set to `true`, the target document must exist.
  2292. // When set to `false`, the target document must not exist.
  2293. Exists bool `json:"exists,omitempty"`
  2294. // UpdateTime: When set, the target document must exist and have been
  2295. // last updated at
  2296. // that time.
  2297. UpdateTime string `json:"updateTime,omitempty"`
  2298. // ForceSendFields is a list of field names (e.g. "Exists") to
  2299. // unconditionally include in API requests. By default, fields with
  2300. // empty values are omitted from API requests. However, any non-pointer,
  2301. // non-interface field appearing in ForceSendFields will be sent to the
  2302. // server regardless of whether the field is empty or not. This may be
  2303. // used to include empty fields in Patch requests.
  2304. ForceSendFields []string `json:"-"`
  2305. // NullFields is a list of field names (e.g. "Exists") to include in API
  2306. // requests with the JSON null value. By default, fields with empty
  2307. // values are omitted from API requests. However, any field with an
  2308. // empty value appearing in NullFields will be sent to the server as
  2309. // null. It is an error if a field in this list has a non-empty value.
  2310. // This may be used to include null fields in Patch requests.
  2311. NullFields []string `json:"-"`
  2312. }
  2313. func (s *Precondition) MarshalJSON() ([]byte, error) {
  2314. type NoMethod Precondition
  2315. raw := NoMethod(*s)
  2316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2317. }
  2318. // Projection: The projection of document's fields to return.
  2319. type Projection struct {
  2320. // Fields: The fields to return.
  2321. //
  2322. // If empty, all fields are returned. To only return the name
  2323. // of the document, use `['__name__']`.
  2324. Fields []*FieldReference `json:"fields,omitempty"`
  2325. // ForceSendFields is a list of field names (e.g. "Fields") to
  2326. // unconditionally include in API requests. By default, fields with
  2327. // empty values are omitted from API requests. However, any non-pointer,
  2328. // non-interface field appearing in ForceSendFields will be sent to the
  2329. // server regardless of whether the field is empty or not. This may be
  2330. // used to include empty fields in Patch requests.
  2331. ForceSendFields []string `json:"-"`
  2332. // NullFields is a list of field names (e.g. "Fields") to include in API
  2333. // requests with the JSON null value. By default, fields with empty
  2334. // values are omitted from API requests. However, any field with an
  2335. // empty value appearing in NullFields will be sent to the server as
  2336. // null. It is an error if a field in this list has a non-empty value.
  2337. // This may be used to include null fields in Patch requests.
  2338. NullFields []string `json:"-"`
  2339. }
  2340. func (s *Projection) MarshalJSON() ([]byte, error) {
  2341. type NoMethod Projection
  2342. raw := NoMethod(*s)
  2343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2344. }
  2345. // QueryTarget: A target specified by a query.
  2346. type QueryTarget struct {
  2347. // Parent: The parent resource name. In the
  2348. // format:
  2349. // `projects/{project_id}/databases/{database_id}/documents`
  2350. // or
  2351. // `projects/{project_id}/databases/{database_id}/documents/{document_
  2352. // path}`.
  2353. // For example:
  2354. // `projects/my-project/databases/my-database/documents`
  2355. // or
  2356. // `projects/my-project/databases/my-database/documents/chatrooms/my-c
  2357. // hatroom`
  2358. Parent string `json:"parent,omitempty"`
  2359. // StructuredQuery: A structured query.
  2360. StructuredQuery *StructuredQuery `json:"structuredQuery,omitempty"`
  2361. // ForceSendFields is a list of field names (e.g. "Parent") to
  2362. // unconditionally include in API requests. By default, fields with
  2363. // empty values are omitted from API requests. However, any non-pointer,
  2364. // non-interface field appearing in ForceSendFields will be sent to the
  2365. // server regardless of whether the field is empty or not. This may be
  2366. // used to include empty fields in Patch requests.
  2367. ForceSendFields []string `json:"-"`
  2368. // NullFields is a list of field names (e.g. "Parent") to include in API
  2369. // requests with the JSON null value. By default, fields with empty
  2370. // values are omitted from API requests. However, any field with an
  2371. // empty value appearing in NullFields will be sent to the server as
  2372. // null. It is an error if a field in this list has a non-empty value.
  2373. // This may be used to include null fields in Patch requests.
  2374. NullFields []string `json:"-"`
  2375. }
  2376. func (s *QueryTarget) MarshalJSON() ([]byte, error) {
  2377. type NoMethod QueryTarget
  2378. raw := NoMethod(*s)
  2379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2380. }
  2381. // ReadOnly: Options for a transaction that can only be used to read
  2382. // documents.
  2383. type ReadOnly struct {
  2384. // ReadTime: Reads documents at the given time.
  2385. // This may not be older than 60 seconds.
  2386. ReadTime string `json:"readTime,omitempty"`
  2387. // ForceSendFields is a list of field names (e.g. "ReadTime") to
  2388. // unconditionally include in API requests. By default, fields with
  2389. // empty values are omitted from API requests. However, any non-pointer,
  2390. // non-interface field appearing in ForceSendFields will be sent to the
  2391. // server regardless of whether the field is empty or not. This may be
  2392. // used to include empty fields in Patch requests.
  2393. ForceSendFields []string `json:"-"`
  2394. // NullFields is a list of field names (e.g. "ReadTime") to include in
  2395. // API requests with the JSON null value. By default, fields with empty
  2396. // values are omitted from API requests. However, any field with an
  2397. // empty value appearing in NullFields will be sent to the server as
  2398. // null. It is an error if a field in this list has a non-empty value.
  2399. // This may be used to include null fields in Patch requests.
  2400. NullFields []string `json:"-"`
  2401. }
  2402. func (s *ReadOnly) MarshalJSON() ([]byte, error) {
  2403. type NoMethod ReadOnly
  2404. raw := NoMethod(*s)
  2405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2406. }
  2407. // ReadWrite: Options for a transaction that can be used to read and
  2408. // write documents.
  2409. type ReadWrite struct {
  2410. // RetryTransaction: An optional transaction to retry.
  2411. RetryTransaction string `json:"retryTransaction,omitempty"`
  2412. // ForceSendFields is a list of field names (e.g. "RetryTransaction") to
  2413. // unconditionally include in API requests. By default, fields with
  2414. // empty values are omitted from API requests. However, any non-pointer,
  2415. // non-interface field appearing in ForceSendFields will be sent to the
  2416. // server regardless of whether the field is empty or not. This may be
  2417. // used to include empty fields in Patch requests.
  2418. ForceSendFields []string `json:"-"`
  2419. // NullFields is a list of field names (e.g. "RetryTransaction") to
  2420. // include in API requests with the JSON null value. By default, fields
  2421. // with empty values are omitted from API requests. However, any field
  2422. // with an empty value appearing in NullFields will be sent to the
  2423. // server as null. It is an error if a field in this list has a
  2424. // non-empty value. This may be used to include null fields in Patch
  2425. // requests.
  2426. NullFields []string `json:"-"`
  2427. }
  2428. func (s *ReadWrite) MarshalJSON() ([]byte, error) {
  2429. type NoMethod ReadWrite
  2430. raw := NoMethod(*s)
  2431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2432. }
  2433. // RollbackRequest: The request for Firestore.Rollback.
  2434. type RollbackRequest struct {
  2435. // Transaction: The transaction to roll back.
  2436. Transaction string `json:"transaction,omitempty"`
  2437. // ForceSendFields is a list of field names (e.g. "Transaction") to
  2438. // unconditionally include in API requests. By default, fields with
  2439. // empty values are omitted from API requests. However, any non-pointer,
  2440. // non-interface field appearing in ForceSendFields will be sent to the
  2441. // server regardless of whether the field is empty or not. This may be
  2442. // used to include empty fields in Patch requests.
  2443. ForceSendFields []string `json:"-"`
  2444. // NullFields is a list of field names (e.g. "Transaction") to include
  2445. // in API requests with the JSON null value. By default, fields with
  2446. // empty values are omitted from API requests. However, any field with
  2447. // an empty value appearing in NullFields will be sent to the server as
  2448. // null. It is an error if a field in this list has a non-empty value.
  2449. // This may be used to include null fields in Patch requests.
  2450. NullFields []string `json:"-"`
  2451. }
  2452. func (s *RollbackRequest) MarshalJSON() ([]byte, error) {
  2453. type NoMethod RollbackRequest
  2454. raw := NoMethod(*s)
  2455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2456. }
  2457. // RunQueryRequest: The request for Firestore.RunQuery.
  2458. type RunQueryRequest struct {
  2459. // NewTransaction: Starts a new transaction and reads the
  2460. // documents.
  2461. // Defaults to a read-only transaction.
  2462. // The new transaction ID will be returned as the first response in
  2463. // the
  2464. // stream.
  2465. NewTransaction *TransactionOptions `json:"newTransaction,omitempty"`
  2466. // ReadTime: Reads documents as they were at the given time.
  2467. // This may not be older than 60 seconds.
  2468. ReadTime string `json:"readTime,omitempty"`
  2469. // StructuredQuery: A structured query.
  2470. StructuredQuery *StructuredQuery `json:"structuredQuery,omitempty"`
  2471. // Transaction: Reads documents in a transaction.
  2472. Transaction string `json:"transaction,omitempty"`
  2473. // ForceSendFields is a list of field names (e.g. "NewTransaction") to
  2474. // unconditionally include in API requests. By default, fields with
  2475. // empty values are omitted from API requests. However, any non-pointer,
  2476. // non-interface field appearing in ForceSendFields will be sent to the
  2477. // server regardless of whether the field is empty or not. This may be
  2478. // used to include empty fields in Patch requests.
  2479. ForceSendFields []string `json:"-"`
  2480. // NullFields is a list of field names (e.g. "NewTransaction") to
  2481. // include in API requests with the JSON null value. By default, fields
  2482. // with empty values are omitted from API requests. However, any field
  2483. // with an empty value appearing in NullFields will be sent to the
  2484. // server as null. It is an error if a field in this list has a
  2485. // non-empty value. This may be used to include null fields in Patch
  2486. // requests.
  2487. NullFields []string `json:"-"`
  2488. }
  2489. func (s *RunQueryRequest) MarshalJSON() ([]byte, error) {
  2490. type NoMethod RunQueryRequest
  2491. raw := NoMethod(*s)
  2492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2493. }
  2494. // RunQueryResponse: The response for Firestore.RunQuery.
  2495. type RunQueryResponse struct {
  2496. // Document: A query result.
  2497. // Not set when reporting partial progress.
  2498. Document *Document `json:"document,omitempty"`
  2499. // ReadTime: The time at which the document was read. This may be
  2500. // monotonically
  2501. // increasing; in this case, the previous documents in the result stream
  2502. // are
  2503. // guaranteed not to have changed between their `read_time` and this
  2504. // one.
  2505. //
  2506. // If the query returns no results, a response with `read_time` and
  2507. // no
  2508. // `document` will be sent, and this represents the time at which the
  2509. // query
  2510. // was run.
  2511. ReadTime string `json:"readTime,omitempty"`
  2512. // SkippedResults: The number of results that have been skipped due to
  2513. // an offset between
  2514. // the last response and the current response.
  2515. SkippedResults int64 `json:"skippedResults,omitempty"`
  2516. // Transaction: The transaction that was started as part of this
  2517. // request.
  2518. // Can only be set in the first response, and only
  2519. // if
  2520. // RunQueryRequest.new_transaction was set in the request.
  2521. // If set, no other fields will be set in this response.
  2522. Transaction string `json:"transaction,omitempty"`
  2523. // ServerResponse contains the HTTP response code and headers from the
  2524. // server.
  2525. googleapi.ServerResponse `json:"-"`
  2526. // ForceSendFields is a list of field names (e.g. "Document") to
  2527. // unconditionally include in API requests. By default, fields with
  2528. // empty values are omitted from API requests. However, any non-pointer,
  2529. // non-interface field appearing in ForceSendFields will be sent to the
  2530. // server regardless of whether the field is empty or not. This may be
  2531. // used to include empty fields in Patch requests.
  2532. ForceSendFields []string `json:"-"`
  2533. // NullFields is a list of field names (e.g. "Document") to include in
  2534. // API requests with the JSON null value. By default, fields with empty
  2535. // values are omitted from API requests. However, any field with an
  2536. // empty value appearing in NullFields will be sent to the server as
  2537. // null. It is an error if a field in this list has a non-empty value.
  2538. // This may be used to include null fields in Patch requests.
  2539. NullFields []string `json:"-"`
  2540. }
  2541. func (s *RunQueryResponse) MarshalJSON() ([]byte, error) {
  2542. type NoMethod RunQueryResponse
  2543. raw := NoMethod(*s)
  2544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2545. }
  2546. // Status: The `Status` type defines a logical error model that is
  2547. // suitable for different
  2548. // programming environments, including REST APIs and RPC APIs. It is
  2549. // used by
  2550. // [gRPC](https://github.com/grpc). The error model is designed to
  2551. // be:
  2552. //
  2553. // - Simple to use and understand for most users
  2554. // - Flexible enough to meet unexpected needs
  2555. //
  2556. // # Overview
  2557. //
  2558. // The `Status` message contains three pieces of data: error code, error
  2559. // message,
  2560. // and error details. The error code should be an enum value
  2561. // of
  2562. // google.rpc.Code, but it may accept additional error codes if needed.
  2563. // The
  2564. // error message should be a developer-facing English message that
  2565. // helps
  2566. // developers *understand* and *resolve* the error. If a localized
  2567. // user-facing
  2568. // error message is needed, put the localized message in the error
  2569. // details or
  2570. // localize it in the client. The optional error details may contain
  2571. // arbitrary
  2572. // information about the error. There is a predefined set of error
  2573. // detail types
  2574. // in the package `google.rpc` that can be used for common error
  2575. // conditions.
  2576. //
  2577. // # Language mapping
  2578. //
  2579. // The `Status` message is the logical representation of the error
  2580. // model, but it
  2581. // is not necessarily the actual wire format. When the `Status` message
  2582. // is
  2583. // exposed in different client libraries and different wire protocols,
  2584. // it can be
  2585. // mapped differently. For example, it will likely be mapped to some
  2586. // exceptions
  2587. // in Java, but more likely mapped to some error codes in C.
  2588. //
  2589. // # Other uses
  2590. //
  2591. // The error model and the `Status` message can be used in a variety
  2592. // of
  2593. // environments, either with or without APIs, to provide a
  2594. // consistent developer experience across different
  2595. // environments.
  2596. //
  2597. // Example uses of this error model include:
  2598. //
  2599. // - Partial errors. If a service needs to return partial errors to the
  2600. // client,
  2601. // it may embed the `Status` in the normal response to indicate the
  2602. // partial
  2603. // errors.
  2604. //
  2605. // - Workflow errors. A typical workflow has multiple steps. Each step
  2606. // may
  2607. // have a `Status` message for error reporting.
  2608. //
  2609. // - Batch operations. If a client uses batch request and batch
  2610. // response, the
  2611. // `Status` message should be used directly inside batch response,
  2612. // one for
  2613. // each error sub-response.
  2614. //
  2615. // - Asynchronous operations. If an API call embeds asynchronous
  2616. // operation
  2617. // results in its response, the status of those operations should
  2618. // be
  2619. // represented directly using the `Status` message.
  2620. //
  2621. // - Logging. If some API errors are stored in logs, the message
  2622. // `Status` could
  2623. // be used directly after any stripping needed for security/privacy
  2624. // reasons.
  2625. type Status struct {
  2626. // Code: The status code, which should be an enum value of
  2627. // google.rpc.Code.
  2628. Code int64 `json:"code,omitempty"`
  2629. // Details: A list of messages that carry the error details. There is a
  2630. // common set of
  2631. // message types for APIs to use.
  2632. Details []googleapi.RawMessage `json:"details,omitempty"`
  2633. // Message: A developer-facing error message, which should be in
  2634. // English. Any
  2635. // user-facing error message should be localized and sent in
  2636. // the
  2637. // google.rpc.Status.details field, or localized by the client.
  2638. Message string `json:"message,omitempty"`
  2639. // ForceSendFields is a list of field names (e.g. "Code") to
  2640. // unconditionally include in API requests. By default, fields with
  2641. // empty values are omitted from API requests. However, any non-pointer,
  2642. // non-interface field appearing in ForceSendFields will be sent to the
  2643. // server regardless of whether the field is empty or not. This may be
  2644. // used to include empty fields in Patch requests.
  2645. ForceSendFields []string `json:"-"`
  2646. // NullFields is a list of field names (e.g. "Code") to include in API
  2647. // requests with the JSON null value. By default, fields with empty
  2648. // values are omitted from API requests. However, any field with an
  2649. // empty value appearing in NullFields will be sent to the server as
  2650. // null. It is an error if a field in this list has a non-empty value.
  2651. // This may be used to include null fields in Patch requests.
  2652. NullFields []string `json:"-"`
  2653. }
  2654. func (s *Status) MarshalJSON() ([]byte, error) {
  2655. type NoMethod Status
  2656. raw := NoMethod(*s)
  2657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2658. }
  2659. // StructuredQuery: A Firestore query.
  2660. type StructuredQuery struct {
  2661. // EndAt: A end point for the query results.
  2662. EndAt *Cursor `json:"endAt,omitempty"`
  2663. // From: The collections to query.
  2664. From []*CollectionSelector `json:"from,omitempty"`
  2665. // Limit: The maximum number of results to return.
  2666. //
  2667. // Applies after all other constraints.
  2668. // Must be >= 0 if specified.
  2669. Limit int64 `json:"limit,omitempty"`
  2670. // Offset: The number of results to skip.
  2671. //
  2672. // Applies before limit, but after all other constraints. Must be >= 0
  2673. // if
  2674. // specified.
  2675. Offset int64 `json:"offset,omitempty"`
  2676. // OrderBy: The order to apply to the query results.
  2677. //
  2678. // Firestore guarantees a stable ordering through the following rules:
  2679. //
  2680. // * Any field required to appear in `order_by`, that is not already
  2681. // specified in `order_by`, is appended to the order in field name
  2682. // order
  2683. // by default.
  2684. // * If an order on `__name__` is not specified, it is appended by
  2685. // default.
  2686. //
  2687. // Fields are appended with the same sort direction as the last
  2688. // order
  2689. // specified, or 'ASCENDING' if no order was specified. For example:
  2690. //
  2691. // * `SELECT * FROM Foo ORDER BY A` becomes
  2692. // `SELECT * FROM Foo ORDER BY A, __name__`
  2693. // * `SELECT * FROM Foo ORDER BY A DESC` becomes
  2694. // `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC`
  2695. // * `SELECT * FROM Foo WHERE A > 1` becomes
  2696. // `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__`
  2697. OrderBy []*Order `json:"orderBy,omitempty"`
  2698. // Select: The projection to return.
  2699. Select *Projection `json:"select,omitempty"`
  2700. // StartAt: A starting point for the query results.
  2701. StartAt *Cursor `json:"startAt,omitempty"`
  2702. // Where: The filter to apply.
  2703. Where *Filter `json:"where,omitempty"`
  2704. // ForceSendFields is a list of field names (e.g. "EndAt") to
  2705. // unconditionally include in API requests. By default, fields with
  2706. // empty values are omitted from API requests. However, any non-pointer,
  2707. // non-interface field appearing in ForceSendFields will be sent to the
  2708. // server regardless of whether the field is empty or not. This may be
  2709. // used to include empty fields in Patch requests.
  2710. ForceSendFields []string `json:"-"`
  2711. // NullFields is a list of field names (e.g. "EndAt") to include in API
  2712. // requests with the JSON null value. By default, fields with empty
  2713. // values are omitted from API requests. However, any field with an
  2714. // empty value appearing in NullFields will be sent to the server as
  2715. // null. It is an error if a field in this list has a non-empty value.
  2716. // This may be used to include null fields in Patch requests.
  2717. NullFields []string `json:"-"`
  2718. }
  2719. func (s *StructuredQuery) MarshalJSON() ([]byte, error) {
  2720. type NoMethod StructuredQuery
  2721. raw := NoMethod(*s)
  2722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2723. }
  2724. // Target: A specification of a set of documents to listen to.
  2725. type Target struct {
  2726. // Documents: A target specified by a set of document names.
  2727. Documents *DocumentsTarget `json:"documents,omitempty"`
  2728. // Once: If the target should be removed once it is current and
  2729. // consistent.
  2730. Once bool `json:"once,omitempty"`
  2731. // Query: A target specified by a query.
  2732. Query *QueryTarget `json:"query,omitempty"`
  2733. // ReadTime: Start listening after a specific `read_time`.
  2734. //
  2735. // The client must know the state of matching documents at this time.
  2736. ReadTime string `json:"readTime,omitempty"`
  2737. // ResumeToken: A resume token from a prior TargetChange for an
  2738. // identical target.
  2739. //
  2740. // Using a resume token with a different target is unsupported and may
  2741. // fail.
  2742. ResumeToken string `json:"resumeToken,omitempty"`
  2743. // TargetId: A client provided target ID.
  2744. //
  2745. // If not set, the server will assign an ID for the target.
  2746. //
  2747. // Used for resuming a target without changing IDs. The IDs can either
  2748. // be
  2749. // client-assigned or be server-assigned in a previous stream. All
  2750. // targets
  2751. // with client provided IDs must be added before adding a target that
  2752. // needs
  2753. // a server-assigned id.
  2754. TargetId int64 `json:"targetId,omitempty"`
  2755. // ForceSendFields is a list of field names (e.g. "Documents") to
  2756. // unconditionally include in API requests. By default, fields with
  2757. // empty values are omitted from API requests. However, any non-pointer,
  2758. // non-interface field appearing in ForceSendFields will be sent to the
  2759. // server regardless of whether the field is empty or not. This may be
  2760. // used to include empty fields in Patch requests.
  2761. ForceSendFields []string `json:"-"`
  2762. // NullFields is a list of field names (e.g. "Documents") to include in
  2763. // API requests with the JSON null value. By default, fields with empty
  2764. // values are omitted from API requests. However, any field with an
  2765. // empty value appearing in NullFields will be sent to the server as
  2766. // null. It is an error if a field in this list has a non-empty value.
  2767. // This may be used to include null fields in Patch requests.
  2768. NullFields []string `json:"-"`
  2769. }
  2770. func (s *Target) MarshalJSON() ([]byte, error) {
  2771. type NoMethod Target
  2772. raw := NoMethod(*s)
  2773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2774. }
  2775. // TargetChange: Targets being watched have changed.
  2776. type TargetChange struct {
  2777. // Cause: The error that resulted in this change, if applicable.
  2778. Cause *Status `json:"cause,omitempty"`
  2779. // ReadTime: The consistent `read_time` for the given `target_ids`
  2780. // (omitted when the
  2781. // target_ids are not at a consistent snapshot).
  2782. //
  2783. // The stream is guaranteed to send a `read_time` with `target_ids`
  2784. // empty
  2785. // whenever the entire stream reaches a new consistent snapshot.
  2786. // ADD,
  2787. // CURRENT, and RESET messages are guaranteed to (eventually) result in
  2788. // a
  2789. // new consistent snapshot (while NO_CHANGE and REMOVE messages are
  2790. // not).
  2791. //
  2792. // For a given stream, `read_time` is guaranteed to be
  2793. // monotonically
  2794. // increasing.
  2795. ReadTime string `json:"readTime,omitempty"`
  2796. // ResumeToken: A token that can be used to resume the stream for the
  2797. // given `target_ids`,
  2798. // or all targets if `target_ids` is empty.
  2799. //
  2800. // Not set on every target change.
  2801. ResumeToken string `json:"resumeToken,omitempty"`
  2802. // TargetChangeType: The type of change that occurred.
  2803. //
  2804. // Possible values:
  2805. // "NO_CHANGE" - No change has occurred. Used only to send an updated
  2806. // `resume_token`.
  2807. // "ADD" - The targets have been added.
  2808. // "REMOVE" - The targets have been removed.
  2809. // "CURRENT" - The targets reflect all changes committed before the
  2810. // targets were added
  2811. // to the stream.
  2812. //
  2813. // This will be sent after or with a `read_time` that is greater than
  2814. // or
  2815. // equal to the time at which the targets were added.
  2816. //
  2817. // Listeners can wait for this change if read-after-write semantics
  2818. // are desired.
  2819. // "RESET" - The targets have been reset, and a new initial state for
  2820. // the targets
  2821. // will be returned in subsequent changes.
  2822. //
  2823. // After the initial state is complete, `CURRENT` will be returned
  2824. // even
  2825. // if the target was previously indicated to be `CURRENT`.
  2826. TargetChangeType string `json:"targetChangeType,omitempty"`
  2827. // TargetIds: The target IDs of targets that have changed.
  2828. //
  2829. // If empty, the change applies to all targets.
  2830. //
  2831. // For `target_change_type=ADD`, the order of the target IDs matches the
  2832. // order
  2833. // of the requests to add the targets. This allows clients to
  2834. // unambiguously
  2835. // associate server-assigned target IDs with added targets.
  2836. //
  2837. // For other states, the order of the target IDs is not defined.
  2838. TargetIds []int64 `json:"targetIds,omitempty"`
  2839. // ForceSendFields is a list of field names (e.g. "Cause") to
  2840. // unconditionally include in API requests. By default, fields with
  2841. // empty values are omitted from API requests. However, any non-pointer,
  2842. // non-interface field appearing in ForceSendFields will be sent to the
  2843. // server regardless of whether the field is empty or not. This may be
  2844. // used to include empty fields in Patch requests.
  2845. ForceSendFields []string `json:"-"`
  2846. // NullFields is a list of field names (e.g. "Cause") to include in API
  2847. // requests with the JSON null value. By default, fields with empty
  2848. // values are omitted from API requests. However, any field with an
  2849. // empty value appearing in NullFields will be sent to the server as
  2850. // null. It is an error if a field in this list has a non-empty value.
  2851. // This may be used to include null fields in Patch requests.
  2852. NullFields []string `json:"-"`
  2853. }
  2854. func (s *TargetChange) MarshalJSON() ([]byte, error) {
  2855. type NoMethod TargetChange
  2856. raw := NoMethod(*s)
  2857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2858. }
  2859. // TransactionOptions: Options for creating a new transaction.
  2860. type TransactionOptions struct {
  2861. // ReadOnly: The transaction can only be used for read operations.
  2862. ReadOnly *ReadOnly `json:"readOnly,omitempty"`
  2863. // ReadWrite: The transaction can be used for both read and write
  2864. // operations.
  2865. ReadWrite *ReadWrite `json:"readWrite,omitempty"`
  2866. // ForceSendFields is a list of field names (e.g. "ReadOnly") to
  2867. // unconditionally include in API requests. By default, fields with
  2868. // empty values are omitted from API requests. However, any non-pointer,
  2869. // non-interface field appearing in ForceSendFields will be sent to the
  2870. // server regardless of whether the field is empty or not. This may be
  2871. // used to include empty fields in Patch requests.
  2872. ForceSendFields []string `json:"-"`
  2873. // NullFields is a list of field names (e.g. "ReadOnly") to include in
  2874. // API requests with the JSON null value. By default, fields with empty
  2875. // values are omitted from API requests. However, any field with an
  2876. // empty value appearing in NullFields will be sent to the server as
  2877. // null. It is an error if a field in this list has a non-empty value.
  2878. // This may be used to include null fields in Patch requests.
  2879. NullFields []string `json:"-"`
  2880. }
  2881. func (s *TransactionOptions) MarshalJSON() ([]byte, error) {
  2882. type NoMethod TransactionOptions
  2883. raw := NoMethod(*s)
  2884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2885. }
  2886. // UnaryFilter: A filter with a single operand.
  2887. type UnaryFilter struct {
  2888. // Field: The field to which to apply the operator.
  2889. Field *FieldReference `json:"field,omitempty"`
  2890. // Op: The unary operator to apply.
  2891. //
  2892. // Possible values:
  2893. // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used.
  2894. // "IS_NAN" - Test if a field is equal to NaN.
  2895. // "IS_NULL" - Test if an exprestion evaluates to Null.
  2896. Op string `json:"op,omitempty"`
  2897. // ForceSendFields is a list of field names (e.g. "Field") to
  2898. // unconditionally include in API requests. By default, fields with
  2899. // empty values are omitted from API requests. However, any non-pointer,
  2900. // non-interface field appearing in ForceSendFields will be sent to the
  2901. // server regardless of whether the field is empty or not. This may be
  2902. // used to include empty fields in Patch requests.
  2903. ForceSendFields []string `json:"-"`
  2904. // NullFields is a list of field names (e.g. "Field") to include in API
  2905. // requests with the JSON null value. By default, fields with empty
  2906. // values are omitted from API requests. However, any field with an
  2907. // empty value appearing in NullFields will be sent to the server as
  2908. // null. It is an error if a field in this list has a non-empty value.
  2909. // This may be used to include null fields in Patch requests.
  2910. NullFields []string `json:"-"`
  2911. }
  2912. func (s *UnaryFilter) MarshalJSON() ([]byte, error) {
  2913. type NoMethod UnaryFilter
  2914. raw := NoMethod(*s)
  2915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2916. }
  2917. // Value: A message that can hold any of the supported value types.
  2918. type Value struct {
  2919. // ArrayValue: An array value.
  2920. //
  2921. // Cannot directly contain another array value, though can contain
  2922. // an
  2923. // map which contains another array.
  2924. ArrayValue *ArrayValue `json:"arrayValue,omitempty"`
  2925. // BooleanValue: A boolean value.
  2926. BooleanValue bool `json:"booleanValue,omitempty"`
  2927. // BytesValue: A bytes value.
  2928. //
  2929. // Must not exceed 1 MiB - 89 bytes.
  2930. // Only the first 1,500 bytes are considered by queries.
  2931. BytesValue string `json:"bytesValue,omitempty"`
  2932. // DoubleValue: A double value.
  2933. DoubleValue float64 `json:"doubleValue,omitempty"`
  2934. // GeoPointValue: A geo point value representing a point on the surface
  2935. // of Earth.
  2936. GeoPointValue *LatLng `json:"geoPointValue,omitempty"`
  2937. // IntegerValue: An integer value.
  2938. IntegerValue int64 `json:"integerValue,omitempty,string"`
  2939. // MapValue: A map value.
  2940. MapValue *MapValue `json:"mapValue,omitempty"`
  2941. // NullValue: A null value.
  2942. //
  2943. // Possible values:
  2944. // "NULL_VALUE" - Null value.
  2945. NullValue string `json:"nullValue,omitempty"`
  2946. // ReferenceValue: A reference to a document. For
  2947. // example:
  2948. // `projects/{project_id}/databases/{database_id}/documents/{doc
  2949. // ument_path}`.
  2950. ReferenceValue string `json:"referenceValue,omitempty"`
  2951. // StringValue: A string value.
  2952. //
  2953. // The string, represented as UTF-8, must not exceed 1 MiB - 89
  2954. // bytes.
  2955. // Only the first 1,500 bytes of the UTF-8 representation are considered
  2956. // by
  2957. // queries.
  2958. StringValue string `json:"stringValue,omitempty"`
  2959. // TimestampValue: A timestamp value.
  2960. //
  2961. // Precise only to microseconds. When stored, any additional precision
  2962. // is
  2963. // rounded down.
  2964. TimestampValue string `json:"timestampValue,omitempty"`
  2965. // ForceSendFields is a list of field names (e.g. "ArrayValue") to
  2966. // unconditionally include in API requests. By default, fields with
  2967. // empty values are omitted from API requests. However, any non-pointer,
  2968. // non-interface field appearing in ForceSendFields will be sent to the
  2969. // server regardless of whether the field is empty or not. This may be
  2970. // used to include empty fields in Patch requests.
  2971. ForceSendFields []string `json:"-"`
  2972. // NullFields is a list of field names (e.g. "ArrayValue") to include in
  2973. // API requests with the JSON null value. By default, fields with empty
  2974. // values are omitted from API requests. However, any field with an
  2975. // empty value appearing in NullFields will be sent to the server as
  2976. // null. It is an error if a field in this list has a non-empty value.
  2977. // This may be used to include null fields in Patch requests.
  2978. NullFields []string `json:"-"`
  2979. }
  2980. func (s *Value) MarshalJSON() ([]byte, error) {
  2981. type NoMethod Value
  2982. raw := NoMethod(*s)
  2983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2984. }
  2985. func (s *Value) UnmarshalJSON(data []byte) error {
  2986. type NoMethod Value
  2987. var s1 struct {
  2988. DoubleValue gensupport.JSONFloat64 `json:"doubleValue"`
  2989. *NoMethod
  2990. }
  2991. s1.NoMethod = (*NoMethod)(s)
  2992. if err := json.Unmarshal(data, &s1); err != nil {
  2993. return err
  2994. }
  2995. s.DoubleValue = float64(s1.DoubleValue)
  2996. return nil
  2997. }
  2998. // Write: A write on a document.
  2999. type Write struct {
  3000. // CurrentDocument: An optional precondition on the document.
  3001. //
  3002. // The write will fail if this is set and not met by the target
  3003. // document.
  3004. CurrentDocument *Precondition `json:"currentDocument,omitempty"`
  3005. // Delete: A document name to delete. In the
  3006. // format:
  3007. // `projects/{project_id}/databases/{database_id}/documents/{docu
  3008. // ment_path}`.
  3009. Delete string `json:"delete,omitempty"`
  3010. // Transform: Applies a tranformation to a document.
  3011. // At most one `transform` per document is allowed in a given
  3012. // request.
  3013. // An `update` cannot follow a `transform` on the same document in a
  3014. // given
  3015. // request.
  3016. Transform *DocumentTransform `json:"transform,omitempty"`
  3017. // Update: A document to write.
  3018. Update *Document `json:"update,omitempty"`
  3019. // UpdateMask: The fields to update in this write.
  3020. //
  3021. // This field can be set only when the operation is `update`.
  3022. // If the mask is not set for an `update` and the document exists,
  3023. // any
  3024. // existing data will be overwritten.
  3025. // If the mask is set and the document on the server has fields not
  3026. // covered by
  3027. // the mask, they are left unchanged.
  3028. // Fields referenced in the mask, but not present in the input document,
  3029. // are
  3030. // deleted from the document on the server.
  3031. // The field paths in this mask must not contain a reserved field name.
  3032. UpdateMask *DocumentMask `json:"updateMask,omitempty"`
  3033. // ForceSendFields is a list of field names (e.g. "CurrentDocument") to
  3034. // unconditionally include in API requests. By default, fields with
  3035. // empty values are omitted from API requests. However, any non-pointer,
  3036. // non-interface field appearing in ForceSendFields will be sent to the
  3037. // server regardless of whether the field is empty or not. This may be
  3038. // used to include empty fields in Patch requests.
  3039. ForceSendFields []string `json:"-"`
  3040. // NullFields is a list of field names (e.g. "CurrentDocument") to
  3041. // include in API requests with the JSON null value. By default, fields
  3042. // with empty values are omitted from API requests. However, any field
  3043. // with an empty value appearing in NullFields will be sent to the
  3044. // server as null. It is an error if a field in this list has a
  3045. // non-empty value. This may be used to include null fields in Patch
  3046. // requests.
  3047. NullFields []string `json:"-"`
  3048. }
  3049. func (s *Write) MarshalJSON() ([]byte, error) {
  3050. type NoMethod Write
  3051. raw := NoMethod(*s)
  3052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3053. }
  3054. // WriteRequest: The request for Firestore.Write.
  3055. //
  3056. // The first request creates a stream, or resumes an existing one from a
  3057. // token.
  3058. //
  3059. // When creating a new stream, the server replies with a response
  3060. // containing
  3061. // only an ID and a token, to use in the next request.
  3062. //
  3063. // When resuming a stream, the server first streams any responses later
  3064. // than the
  3065. // given token, then a response containing only an up-to-date token, to
  3066. // use in
  3067. // the next request.
  3068. type WriteRequest struct {
  3069. // Labels: Labels associated with this write request.
  3070. Labels map[string]string `json:"labels,omitempty"`
  3071. // StreamId: The ID of the write stream to resume.
  3072. // This may only be set in the first message. When left empty, a new
  3073. // write
  3074. // stream will be created.
  3075. StreamId string `json:"streamId,omitempty"`
  3076. // StreamToken: A stream token that was previously sent by the
  3077. // server.
  3078. //
  3079. // The client should set this field to the token from the most
  3080. // recent
  3081. // WriteResponse it has received. This acknowledges that the client
  3082. // has
  3083. // received responses up to this token. After sending this token,
  3084. // earlier
  3085. // tokens may not be used anymore.
  3086. //
  3087. // The server may close the stream if there are too many
  3088. // unacknowledged
  3089. // responses.
  3090. //
  3091. // Leave this field unset when creating a new stream. To resume a stream
  3092. // at
  3093. // a specific point, set this field and the `stream_id` field.
  3094. //
  3095. // Leave this field unset when creating a new stream.
  3096. StreamToken string `json:"streamToken,omitempty"`
  3097. // Writes: The writes to apply.
  3098. //
  3099. // Always executed atomically and in order.
  3100. // This must be empty on the first request.
  3101. // This may be empty on the last request.
  3102. // This must not be empty on all other requests.
  3103. Writes []*Write `json:"writes,omitempty"`
  3104. // ForceSendFields is a list of field names (e.g. "Labels") to
  3105. // unconditionally include in API requests. By default, fields with
  3106. // empty values are omitted from API requests. However, any non-pointer,
  3107. // non-interface field appearing in ForceSendFields will be sent to the
  3108. // server regardless of whether the field is empty or not. This may be
  3109. // used to include empty fields in Patch requests.
  3110. ForceSendFields []string `json:"-"`
  3111. // NullFields is a list of field names (e.g. "Labels") to include in API
  3112. // requests with the JSON null value. By default, fields with empty
  3113. // values are omitted from API requests. However, any field with an
  3114. // empty value appearing in NullFields will be sent to the server as
  3115. // null. It is an error if a field in this list has a non-empty value.
  3116. // This may be used to include null fields in Patch requests.
  3117. NullFields []string `json:"-"`
  3118. }
  3119. func (s *WriteRequest) MarshalJSON() ([]byte, error) {
  3120. type NoMethod WriteRequest
  3121. raw := NoMethod(*s)
  3122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3123. }
  3124. // WriteResponse: The response for Firestore.Write.
  3125. type WriteResponse struct {
  3126. // CommitTime: The time at which the commit occurred.
  3127. CommitTime string `json:"commitTime,omitempty"`
  3128. // StreamId: The ID of the stream.
  3129. // Only set on the first message, when a new stream was created.
  3130. StreamId string `json:"streamId,omitempty"`
  3131. // StreamToken: A token that represents the position of this response in
  3132. // the stream.
  3133. // This can be used by a client to resume the stream at this
  3134. // point.
  3135. //
  3136. // This field is always set.
  3137. StreamToken string `json:"streamToken,omitempty"`
  3138. // WriteResults: The result of applying the writes.
  3139. //
  3140. // This i-th write result corresponds to the i-th write in the
  3141. // request.
  3142. WriteResults []*WriteResult `json:"writeResults,omitempty"`
  3143. // ServerResponse contains the HTTP response code and headers from the
  3144. // server.
  3145. googleapi.ServerResponse `json:"-"`
  3146. // ForceSendFields is a list of field names (e.g. "CommitTime") to
  3147. // unconditionally include in API requests. By default, fields with
  3148. // empty values are omitted from API requests. However, any non-pointer,
  3149. // non-interface field appearing in ForceSendFields will be sent to the
  3150. // server regardless of whether the field is empty or not. This may be
  3151. // used to include empty fields in Patch requests.
  3152. ForceSendFields []string `json:"-"`
  3153. // NullFields is a list of field names (e.g. "CommitTime") to include in
  3154. // API requests with the JSON null value. By default, fields with empty
  3155. // values are omitted from API requests. However, any field with an
  3156. // empty value appearing in NullFields will be sent to the server as
  3157. // null. It is an error if a field in this list has a non-empty value.
  3158. // This may be used to include null fields in Patch requests.
  3159. NullFields []string `json:"-"`
  3160. }
  3161. func (s *WriteResponse) MarshalJSON() ([]byte, error) {
  3162. type NoMethod WriteResponse
  3163. raw := NoMethod(*s)
  3164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3165. }
  3166. // WriteResult: The result of applying a write.
  3167. type WriteResult struct {
  3168. // TransformResults: The results of applying each
  3169. // DocumentTransform.FieldTransform, in the
  3170. // same order.
  3171. TransformResults []*Value `json:"transformResults,omitempty"`
  3172. // UpdateTime: The last update time of the document after applying the
  3173. // write. Not set
  3174. // after a `delete`.
  3175. //
  3176. // If the write did not actually change the document, this will be
  3177. // the
  3178. // previous update_time.
  3179. UpdateTime string `json:"updateTime,omitempty"`
  3180. // ForceSendFields is a list of field names (e.g. "TransformResults") to
  3181. // unconditionally include in API requests. By default, fields with
  3182. // empty values are omitted from API requests. However, any non-pointer,
  3183. // non-interface field appearing in ForceSendFields will be sent to the
  3184. // server regardless of whether the field is empty or not. This may be
  3185. // used to include empty fields in Patch requests.
  3186. ForceSendFields []string `json:"-"`
  3187. // NullFields is a list of field names (e.g. "TransformResults") to
  3188. // include in API requests with the JSON null value. By default, fields
  3189. // with empty values are omitted from API requests. However, any field
  3190. // with an empty value appearing in NullFields will be sent to the
  3191. // server as null. It is an error if a field in this list has a
  3192. // non-empty value. This may be used to include null fields in Patch
  3193. // requests.
  3194. NullFields []string `json:"-"`
  3195. }
  3196. func (s *WriteResult) MarshalJSON() ([]byte, error) {
  3197. type NoMethod WriteResult
  3198. raw := NoMethod(*s)
  3199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3200. }
  3201. // method id "firestore.projects.databases.exportDocuments":
  3202. type ProjectsDatabasesExportDocumentsCall struct {
  3203. s *Service
  3204. name string
  3205. googlefirestoreadminv1exportdocumentsrequest *GoogleFirestoreAdminV1ExportDocumentsRequest
  3206. urlParams_ gensupport.URLParams
  3207. ctx_ context.Context
  3208. header_ http.Header
  3209. }
  3210. // ExportDocuments: Exports a copy of all or a subset of documents from
  3211. // Google Cloud Firestore
  3212. // to another storage system, such as Google Cloud Storage. Recent
  3213. // updates to
  3214. // documents may not be reflected in the export. The export occurs in
  3215. // the
  3216. // background and its progress can be monitored and managed via
  3217. // the
  3218. // Operation resource that is created. The output of an export may only
  3219. // be
  3220. // used once the associated operation is done. If an export operation
  3221. // is
  3222. // cancelled before completion it may leave partial data behind in
  3223. // Google
  3224. // Cloud Storage.
  3225. func (r *ProjectsDatabasesService) ExportDocuments(name string, googlefirestoreadminv1exportdocumentsrequest *GoogleFirestoreAdminV1ExportDocumentsRequest) *ProjectsDatabasesExportDocumentsCall {
  3226. c := &ProjectsDatabasesExportDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3227. c.name = name
  3228. c.googlefirestoreadminv1exportdocumentsrequest = googlefirestoreadminv1exportdocumentsrequest
  3229. return c
  3230. }
  3231. // Fields allows partial responses to be retrieved. See
  3232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3233. // for more information.
  3234. func (c *ProjectsDatabasesExportDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesExportDocumentsCall {
  3235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3236. return c
  3237. }
  3238. // Context sets the context to be used in this call's Do method. Any
  3239. // pending HTTP request will be aborted if the provided context is
  3240. // canceled.
  3241. func (c *ProjectsDatabasesExportDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesExportDocumentsCall {
  3242. c.ctx_ = ctx
  3243. return c
  3244. }
  3245. // Header returns an http.Header that can be modified by the caller to
  3246. // add HTTP headers to the request.
  3247. func (c *ProjectsDatabasesExportDocumentsCall) Header() http.Header {
  3248. if c.header_ == nil {
  3249. c.header_ = make(http.Header)
  3250. }
  3251. return c.header_
  3252. }
  3253. func (c *ProjectsDatabasesExportDocumentsCall) doRequest(alt string) (*http.Response, error) {
  3254. reqHeaders := make(http.Header)
  3255. for k, v := range c.header_ {
  3256. reqHeaders[k] = v
  3257. }
  3258. reqHeaders.Set("User-Agent", c.s.userAgent())
  3259. var body io.Reader = nil
  3260. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1exportdocumentsrequest)
  3261. if err != nil {
  3262. return nil, err
  3263. }
  3264. reqHeaders.Set("Content-Type", "application/json")
  3265. c.urlParams_.Set("alt", alt)
  3266. c.urlParams_.Set("prettyPrint", "false")
  3267. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:exportDocuments")
  3268. urls += "?" + c.urlParams_.Encode()
  3269. req, err := http.NewRequest("POST", urls, body)
  3270. if err != nil {
  3271. return nil, err
  3272. }
  3273. req.Header = reqHeaders
  3274. googleapi.Expand(req.URL, map[string]string{
  3275. "name": c.name,
  3276. })
  3277. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3278. }
  3279. // Do executes the "firestore.projects.databases.exportDocuments" call.
  3280. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  3281. // Any non-2xx status code is an error. Response headers are in either
  3282. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  3283. // was returned at all) in error.(*googleapi.Error).Header. Use
  3284. // googleapi.IsNotModified to check whether the returned error was
  3285. // because http.StatusNotModified was returned.
  3286. func (c *ProjectsDatabasesExportDocumentsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3287. gensupport.SetOptions(c.urlParams_, opts...)
  3288. res, err := c.doRequest("json")
  3289. if res != nil && res.StatusCode == http.StatusNotModified {
  3290. if res.Body != nil {
  3291. res.Body.Close()
  3292. }
  3293. return nil, &googleapi.Error{
  3294. Code: res.StatusCode,
  3295. Header: res.Header,
  3296. }
  3297. }
  3298. if err != nil {
  3299. return nil, err
  3300. }
  3301. defer googleapi.CloseBody(res)
  3302. if err := googleapi.CheckResponse(res); err != nil {
  3303. return nil, err
  3304. }
  3305. ret := &GoogleLongrunningOperation{
  3306. ServerResponse: googleapi.ServerResponse{
  3307. Header: res.Header,
  3308. HTTPStatusCode: res.StatusCode,
  3309. },
  3310. }
  3311. target := &ret
  3312. if err := gensupport.DecodeResponse(target, res); err != nil {
  3313. return nil, err
  3314. }
  3315. return ret, nil
  3316. // {
  3317. // "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.",
  3318. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}:exportDocuments",
  3319. // "httpMethod": "POST",
  3320. // "id": "firestore.projects.databases.exportDocuments",
  3321. // "parameterOrder": [
  3322. // "name"
  3323. // ],
  3324. // "parameters": {
  3325. // "name": {
  3326. // "description": "Database to export. Should be of the form:\n`projects/{project_id}/databases/{database_id}`.",
  3327. // "location": "path",
  3328. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  3329. // "required": true,
  3330. // "type": "string"
  3331. // }
  3332. // },
  3333. // "path": "v1/{+name}:exportDocuments",
  3334. // "request": {
  3335. // "$ref": "GoogleFirestoreAdminV1ExportDocumentsRequest"
  3336. // },
  3337. // "response": {
  3338. // "$ref": "GoogleLongrunningOperation"
  3339. // },
  3340. // "scopes": [
  3341. // "https://www.googleapis.com/auth/cloud-platform",
  3342. // "https://www.googleapis.com/auth/datastore"
  3343. // ]
  3344. // }
  3345. }
  3346. // method id "firestore.projects.databases.importDocuments":
  3347. type ProjectsDatabasesImportDocumentsCall struct {
  3348. s *Service
  3349. name string
  3350. googlefirestoreadminv1importdocumentsrequest *GoogleFirestoreAdminV1ImportDocumentsRequest
  3351. urlParams_ gensupport.URLParams
  3352. ctx_ context.Context
  3353. header_ http.Header
  3354. }
  3355. // ImportDocuments: Imports documents into Google Cloud Firestore.
  3356. // Existing documents with the
  3357. // same name are overwritten. The import occurs in the background and
  3358. // its
  3359. // progress can be monitored and managed via the Operation resource that
  3360. // is
  3361. // created. If an ImportDocuments operation is cancelled, it is
  3362. // possible
  3363. // that a subset of the data has already been imported to Cloud
  3364. // Firestore.
  3365. func (r *ProjectsDatabasesService) ImportDocuments(name string, googlefirestoreadminv1importdocumentsrequest *GoogleFirestoreAdminV1ImportDocumentsRequest) *ProjectsDatabasesImportDocumentsCall {
  3366. c := &ProjectsDatabasesImportDocumentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3367. c.name = name
  3368. c.googlefirestoreadminv1importdocumentsrequest = googlefirestoreadminv1importdocumentsrequest
  3369. return c
  3370. }
  3371. // Fields allows partial responses to be retrieved. See
  3372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3373. // for more information.
  3374. func (c *ProjectsDatabasesImportDocumentsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesImportDocumentsCall {
  3375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3376. return c
  3377. }
  3378. // Context sets the context to be used in this call's Do method. Any
  3379. // pending HTTP request will be aborted if the provided context is
  3380. // canceled.
  3381. func (c *ProjectsDatabasesImportDocumentsCall) Context(ctx context.Context) *ProjectsDatabasesImportDocumentsCall {
  3382. c.ctx_ = ctx
  3383. return c
  3384. }
  3385. // Header returns an http.Header that can be modified by the caller to
  3386. // add HTTP headers to the request.
  3387. func (c *ProjectsDatabasesImportDocumentsCall) Header() http.Header {
  3388. if c.header_ == nil {
  3389. c.header_ = make(http.Header)
  3390. }
  3391. return c.header_
  3392. }
  3393. func (c *ProjectsDatabasesImportDocumentsCall) doRequest(alt string) (*http.Response, error) {
  3394. reqHeaders := make(http.Header)
  3395. for k, v := range c.header_ {
  3396. reqHeaders[k] = v
  3397. }
  3398. reqHeaders.Set("User-Agent", c.s.userAgent())
  3399. var body io.Reader = nil
  3400. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1importdocumentsrequest)
  3401. if err != nil {
  3402. return nil, err
  3403. }
  3404. reqHeaders.Set("Content-Type", "application/json")
  3405. c.urlParams_.Set("alt", alt)
  3406. c.urlParams_.Set("prettyPrint", "false")
  3407. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:importDocuments")
  3408. urls += "?" + c.urlParams_.Encode()
  3409. req, err := http.NewRequest("POST", urls, body)
  3410. if err != nil {
  3411. return nil, err
  3412. }
  3413. req.Header = reqHeaders
  3414. googleapi.Expand(req.URL, map[string]string{
  3415. "name": c.name,
  3416. })
  3417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3418. }
  3419. // Do executes the "firestore.projects.databases.importDocuments" call.
  3420. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  3421. // Any non-2xx status code is an error. Response headers are in either
  3422. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  3423. // was returned at all) in error.(*googleapi.Error).Header. Use
  3424. // googleapi.IsNotModified to check whether the returned error was
  3425. // because http.StatusNotModified was returned.
  3426. func (c *ProjectsDatabasesImportDocumentsCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3427. gensupport.SetOptions(c.urlParams_, opts...)
  3428. res, err := c.doRequest("json")
  3429. if res != nil && res.StatusCode == http.StatusNotModified {
  3430. if res.Body != nil {
  3431. res.Body.Close()
  3432. }
  3433. return nil, &googleapi.Error{
  3434. Code: res.StatusCode,
  3435. Header: res.Header,
  3436. }
  3437. }
  3438. if err != nil {
  3439. return nil, err
  3440. }
  3441. defer googleapi.CloseBody(res)
  3442. if err := googleapi.CheckResponse(res); err != nil {
  3443. return nil, err
  3444. }
  3445. ret := &GoogleLongrunningOperation{
  3446. ServerResponse: googleapi.ServerResponse{
  3447. Header: res.Header,
  3448. HTTPStatusCode: res.StatusCode,
  3449. },
  3450. }
  3451. target := &ret
  3452. if err := gensupport.DecodeResponse(target, res); err != nil {
  3453. return nil, err
  3454. }
  3455. return ret, nil
  3456. // {
  3457. // "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.",
  3458. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}:importDocuments",
  3459. // "httpMethod": "POST",
  3460. // "id": "firestore.projects.databases.importDocuments",
  3461. // "parameterOrder": [
  3462. // "name"
  3463. // ],
  3464. // "parameters": {
  3465. // "name": {
  3466. // "description": "Database to import into. Should be of the form:\n`projects/{project_id}/databases/{database_id}`.",
  3467. // "location": "path",
  3468. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  3469. // "required": true,
  3470. // "type": "string"
  3471. // }
  3472. // },
  3473. // "path": "v1/{+name}:importDocuments",
  3474. // "request": {
  3475. // "$ref": "GoogleFirestoreAdminV1ImportDocumentsRequest"
  3476. // },
  3477. // "response": {
  3478. // "$ref": "GoogleLongrunningOperation"
  3479. // },
  3480. // "scopes": [
  3481. // "https://www.googleapis.com/auth/cloud-platform",
  3482. // "https://www.googleapis.com/auth/datastore"
  3483. // ]
  3484. // }
  3485. }
  3486. // method id "firestore.projects.databases.collectionGroups.fields.get":
  3487. type ProjectsDatabasesCollectionGroupsFieldsGetCall struct {
  3488. s *Service
  3489. name string
  3490. urlParams_ gensupport.URLParams
  3491. ifNoneMatch_ string
  3492. ctx_ context.Context
  3493. header_ http.Header
  3494. }
  3495. // Get: Gets the metadata and configuration for a Field.
  3496. func (r *ProjectsDatabasesCollectionGroupsFieldsService) Get(name string) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  3497. c := &ProjectsDatabasesCollectionGroupsFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3498. c.name = name
  3499. return c
  3500. }
  3501. // Fields allows partial responses to be retrieved. See
  3502. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3503. // for more information.
  3504. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  3505. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3506. return c
  3507. }
  3508. // IfNoneMatch sets the optional parameter which makes the operation
  3509. // fail if the object's ETag matches the given value. This is useful for
  3510. // getting updates only after the object has changed since the last
  3511. // request. Use googleapi.IsNotModified to check whether the response
  3512. // error from Do is the result of In-None-Match.
  3513. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  3514. c.ifNoneMatch_ = entityTag
  3515. return c
  3516. }
  3517. // Context sets the context to be used in this call's Do method. Any
  3518. // pending HTTP request will be aborted if the provided context is
  3519. // canceled.
  3520. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsGetCall {
  3521. c.ctx_ = ctx
  3522. return c
  3523. }
  3524. // Header returns an http.Header that can be modified by the caller to
  3525. // add HTTP headers to the request.
  3526. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Header() http.Header {
  3527. if c.header_ == nil {
  3528. c.header_ = make(http.Header)
  3529. }
  3530. return c.header_
  3531. }
  3532. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  3533. reqHeaders := make(http.Header)
  3534. for k, v := range c.header_ {
  3535. reqHeaders[k] = v
  3536. }
  3537. reqHeaders.Set("User-Agent", c.s.userAgent())
  3538. if c.ifNoneMatch_ != "" {
  3539. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3540. }
  3541. var body io.Reader = nil
  3542. c.urlParams_.Set("alt", alt)
  3543. c.urlParams_.Set("prettyPrint", "false")
  3544. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3545. urls += "?" + c.urlParams_.Encode()
  3546. req, err := http.NewRequest("GET", urls, body)
  3547. if err != nil {
  3548. return nil, err
  3549. }
  3550. req.Header = reqHeaders
  3551. googleapi.Expand(req.URL, map[string]string{
  3552. "name": c.name,
  3553. })
  3554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3555. }
  3556. // Do executes the "firestore.projects.databases.collectionGroups.fields.get" call.
  3557. // Exactly one of *GoogleFirestoreAdminV1Field or error will be non-nil.
  3558. // Any non-2xx status code is an error. Response headers are in either
  3559. // *GoogleFirestoreAdminV1Field.ServerResponse.Header or (if a response
  3560. // was returned at all) in error.(*googleapi.Error).Header. Use
  3561. // googleapi.IsNotModified to check whether the returned error was
  3562. // because http.StatusNotModified was returned.
  3563. func (c *ProjectsDatabasesCollectionGroupsFieldsGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1Field, error) {
  3564. gensupport.SetOptions(c.urlParams_, opts...)
  3565. res, err := c.doRequest("json")
  3566. if res != nil && res.StatusCode == http.StatusNotModified {
  3567. if res.Body != nil {
  3568. res.Body.Close()
  3569. }
  3570. return nil, &googleapi.Error{
  3571. Code: res.StatusCode,
  3572. Header: res.Header,
  3573. }
  3574. }
  3575. if err != nil {
  3576. return nil, err
  3577. }
  3578. defer googleapi.CloseBody(res)
  3579. if err := googleapi.CheckResponse(res); err != nil {
  3580. return nil, err
  3581. }
  3582. ret := &GoogleFirestoreAdminV1Field{
  3583. ServerResponse: googleapi.ServerResponse{
  3584. Header: res.Header,
  3585. HTTPStatusCode: res.StatusCode,
  3586. },
  3587. }
  3588. target := &ret
  3589. if err := gensupport.DecodeResponse(target, res); err != nil {
  3590. return nil, err
  3591. }
  3592. return ret, nil
  3593. // {
  3594. // "description": "Gets the metadata and configuration for a Field.",
  3595. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/fields/{fieldsId}",
  3596. // "httpMethod": "GET",
  3597. // "id": "firestore.projects.databases.collectionGroups.fields.get",
  3598. // "parameterOrder": [
  3599. // "name"
  3600. // ],
  3601. // "parameters": {
  3602. // "name": {
  3603. // "description": "A name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}`",
  3604. // "location": "path",
  3605. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+$",
  3606. // "required": true,
  3607. // "type": "string"
  3608. // }
  3609. // },
  3610. // "path": "v1/{+name}",
  3611. // "response": {
  3612. // "$ref": "GoogleFirestoreAdminV1Field"
  3613. // },
  3614. // "scopes": [
  3615. // "https://www.googleapis.com/auth/cloud-platform",
  3616. // "https://www.googleapis.com/auth/datastore"
  3617. // ]
  3618. // }
  3619. }
  3620. // method id "firestore.projects.databases.collectionGroups.fields.list":
  3621. type ProjectsDatabasesCollectionGroupsFieldsListCall struct {
  3622. s *Service
  3623. parent string
  3624. urlParams_ gensupport.URLParams
  3625. ifNoneMatch_ string
  3626. ctx_ context.Context
  3627. header_ http.Header
  3628. }
  3629. // List: Lists the field configuration and metadata for this
  3630. // database.
  3631. //
  3632. // Currently, FirestoreAdmin.ListFields only supports listing
  3633. // fields
  3634. // that have been explicitly overridden. To issue this query,
  3635. // call
  3636. // FirestoreAdmin.ListFields with the filter set
  3637. // to
  3638. // `indexConfig.usesAncestorConfig:false`.
  3639. func (r *ProjectsDatabasesCollectionGroupsFieldsService) List(parent string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  3640. c := &ProjectsDatabasesCollectionGroupsFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3641. c.parent = parent
  3642. return c
  3643. }
  3644. // Filter sets the optional parameter "filter": The filter to apply to
  3645. // list results. Currently,
  3646. // FirestoreAdmin.ListFields only supports listing fields
  3647. // that have been explicitly overridden. To issue this query,
  3648. // call
  3649. // FirestoreAdmin.ListFields with the filter set
  3650. // to
  3651. // `indexConfig.usesAncestorConfig:false`.
  3652. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Filter(filter string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  3653. c.urlParams_.Set("filter", filter)
  3654. return c
  3655. }
  3656. // PageSize sets the optional parameter "pageSize": The number of
  3657. // results to return.
  3658. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) PageSize(pageSize int64) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  3659. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3660. return c
  3661. }
  3662. // PageToken sets the optional parameter "pageToken": A page token,
  3663. // returned from a previous call to
  3664. // FirestoreAdmin.ListFields, that may be used to get the next
  3665. // page of results.
  3666. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) PageToken(pageToken string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  3667. c.urlParams_.Set("pageToken", pageToken)
  3668. return c
  3669. }
  3670. // Fields allows partial responses to be retrieved. See
  3671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3672. // for more information.
  3673. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  3674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3675. return c
  3676. }
  3677. // IfNoneMatch sets the optional parameter which makes the operation
  3678. // fail if the object's ETag matches the given value. This is useful for
  3679. // getting updates only after the object has changed since the last
  3680. // request. Use googleapi.IsNotModified to check whether the response
  3681. // error from Do is the result of In-None-Match.
  3682. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  3683. c.ifNoneMatch_ = entityTag
  3684. return c
  3685. }
  3686. // Context sets the context to be used in this call's Do method. Any
  3687. // pending HTTP request will be aborted if the provided context is
  3688. // canceled.
  3689. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsListCall {
  3690. c.ctx_ = ctx
  3691. return c
  3692. }
  3693. // Header returns an http.Header that can be modified by the caller to
  3694. // add HTTP headers to the request.
  3695. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Header() http.Header {
  3696. if c.header_ == nil {
  3697. c.header_ = make(http.Header)
  3698. }
  3699. return c.header_
  3700. }
  3701. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) doRequest(alt string) (*http.Response, error) {
  3702. reqHeaders := make(http.Header)
  3703. for k, v := range c.header_ {
  3704. reqHeaders[k] = v
  3705. }
  3706. reqHeaders.Set("User-Agent", c.s.userAgent())
  3707. if c.ifNoneMatch_ != "" {
  3708. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3709. }
  3710. var body io.Reader = nil
  3711. c.urlParams_.Set("alt", alt)
  3712. c.urlParams_.Set("prettyPrint", "false")
  3713. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/fields")
  3714. urls += "?" + c.urlParams_.Encode()
  3715. req, err := http.NewRequest("GET", urls, body)
  3716. if err != nil {
  3717. return nil, err
  3718. }
  3719. req.Header = reqHeaders
  3720. googleapi.Expand(req.URL, map[string]string{
  3721. "parent": c.parent,
  3722. })
  3723. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3724. }
  3725. // Do executes the "firestore.projects.databases.collectionGroups.fields.list" call.
  3726. // Exactly one of *GoogleFirestoreAdminV1ListFieldsResponse or error
  3727. // will be non-nil. Any non-2xx status code is an error. Response
  3728. // headers are in either
  3729. // *GoogleFirestoreAdminV1ListFieldsResponse.ServerResponse.Header or
  3730. // (if a response was returned at all) in
  3731. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3732. // whether the returned error was because http.StatusNotModified was
  3733. // returned.
  3734. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1ListFieldsResponse, error) {
  3735. gensupport.SetOptions(c.urlParams_, opts...)
  3736. res, err := c.doRequest("json")
  3737. if res != nil && res.StatusCode == http.StatusNotModified {
  3738. if res.Body != nil {
  3739. res.Body.Close()
  3740. }
  3741. return nil, &googleapi.Error{
  3742. Code: res.StatusCode,
  3743. Header: res.Header,
  3744. }
  3745. }
  3746. if err != nil {
  3747. return nil, err
  3748. }
  3749. defer googleapi.CloseBody(res)
  3750. if err := googleapi.CheckResponse(res); err != nil {
  3751. return nil, err
  3752. }
  3753. ret := &GoogleFirestoreAdminV1ListFieldsResponse{
  3754. ServerResponse: googleapi.ServerResponse{
  3755. Header: res.Header,
  3756. HTTPStatusCode: res.StatusCode,
  3757. },
  3758. }
  3759. target := &ret
  3760. if err := gensupport.DecodeResponse(target, res); err != nil {
  3761. return nil, err
  3762. }
  3763. return ret, nil
  3764. // {
  3765. // "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`.",
  3766. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/fields",
  3767. // "httpMethod": "GET",
  3768. // "id": "firestore.projects.databases.collectionGroups.fields.list",
  3769. // "parameterOrder": [
  3770. // "parent"
  3771. // ],
  3772. // "parameters": {
  3773. // "filter": {
  3774. // "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`.",
  3775. // "location": "query",
  3776. // "type": "string"
  3777. // },
  3778. // "pageSize": {
  3779. // "description": "The number of results to return.",
  3780. // "format": "int32",
  3781. // "location": "query",
  3782. // "type": "integer"
  3783. // },
  3784. // "pageToken": {
  3785. // "description": "A page token, returned from a previous call to\nFirestoreAdmin.ListFields, that may be used to get the next\npage of results.",
  3786. // "location": "query",
  3787. // "type": "string"
  3788. // },
  3789. // "parent": {
  3790. // "description": "A parent name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`",
  3791. // "location": "path",
  3792. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+$",
  3793. // "required": true,
  3794. // "type": "string"
  3795. // }
  3796. // },
  3797. // "path": "v1/{+parent}/fields",
  3798. // "response": {
  3799. // "$ref": "GoogleFirestoreAdminV1ListFieldsResponse"
  3800. // },
  3801. // "scopes": [
  3802. // "https://www.googleapis.com/auth/cloud-platform",
  3803. // "https://www.googleapis.com/auth/datastore"
  3804. // ]
  3805. // }
  3806. }
  3807. // Pages invokes f for each page of results.
  3808. // A non-nil error returned from f will halt the iteration.
  3809. // The provided context supersedes any context provided to the Context method.
  3810. func (c *ProjectsDatabasesCollectionGroupsFieldsListCall) Pages(ctx context.Context, f func(*GoogleFirestoreAdminV1ListFieldsResponse) error) error {
  3811. c.ctx_ = ctx
  3812. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3813. for {
  3814. x, err := c.Do()
  3815. if err != nil {
  3816. return err
  3817. }
  3818. if err := f(x); err != nil {
  3819. return err
  3820. }
  3821. if x.NextPageToken == "" {
  3822. return nil
  3823. }
  3824. c.PageToken(x.NextPageToken)
  3825. }
  3826. }
  3827. // method id "firestore.projects.databases.collectionGroups.fields.patch":
  3828. type ProjectsDatabasesCollectionGroupsFieldsPatchCall struct {
  3829. s *Service
  3830. name string
  3831. googlefirestoreadminv1field *GoogleFirestoreAdminV1Field
  3832. urlParams_ gensupport.URLParams
  3833. ctx_ context.Context
  3834. header_ http.Header
  3835. }
  3836. // Patch: Updates a field configuration. Currently, field updates apply
  3837. // only to
  3838. // single field index configuration. However, calls
  3839. // to
  3840. // FirestoreAdmin.UpdateField should provide a field mask to
  3841. // avoid
  3842. // changing any configuration that the caller isn't aware of. The field
  3843. // mask
  3844. // should be specified as: `{ paths: "index_config" }`.
  3845. //
  3846. // This call returns a google.longrunning.Operation which may be used
  3847. // to
  3848. // track the status of the field update. The metadata for
  3849. // the operation will be the type FieldOperationMetadata.
  3850. //
  3851. // To configure the default field settings for the database, use
  3852. // the special `Field` with resource
  3853. // name:
  3854. // `projects/{project_id}/databases/{database_id}/collectionGroups/
  3855. // __default__/fields/*`.
  3856. func (r *ProjectsDatabasesCollectionGroupsFieldsService) Patch(name string, googlefirestoreadminv1field *GoogleFirestoreAdminV1Field) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  3857. c := &ProjectsDatabasesCollectionGroupsFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3858. c.name = name
  3859. c.googlefirestoreadminv1field = googlefirestoreadminv1field
  3860. return c
  3861. }
  3862. // UpdateMask sets the optional parameter "updateMask": A mask, relative
  3863. // to the field. If specified, only configuration specified
  3864. // by this field_mask will be updated in the field.
  3865. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) UpdateMask(updateMask string) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  3866. c.urlParams_.Set("updateMask", updateMask)
  3867. return c
  3868. }
  3869. // Fields allows partial responses to be retrieved. See
  3870. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3871. // for more information.
  3872. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  3873. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3874. return c
  3875. }
  3876. // Context sets the context to be used in this call's Do method. Any
  3877. // pending HTTP request will be aborted if the provided context is
  3878. // canceled.
  3879. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsFieldsPatchCall {
  3880. c.ctx_ = ctx
  3881. return c
  3882. }
  3883. // Header returns an http.Header that can be modified by the caller to
  3884. // add HTTP headers to the request.
  3885. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Header() http.Header {
  3886. if c.header_ == nil {
  3887. c.header_ = make(http.Header)
  3888. }
  3889. return c.header_
  3890. }
  3891. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  3892. reqHeaders := make(http.Header)
  3893. for k, v := range c.header_ {
  3894. reqHeaders[k] = v
  3895. }
  3896. reqHeaders.Set("User-Agent", c.s.userAgent())
  3897. var body io.Reader = nil
  3898. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1field)
  3899. if err != nil {
  3900. return nil, err
  3901. }
  3902. reqHeaders.Set("Content-Type", "application/json")
  3903. c.urlParams_.Set("alt", alt)
  3904. c.urlParams_.Set("prettyPrint", "false")
  3905. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3906. urls += "?" + c.urlParams_.Encode()
  3907. req, err := http.NewRequest("PATCH", urls, body)
  3908. if err != nil {
  3909. return nil, err
  3910. }
  3911. req.Header = reqHeaders
  3912. googleapi.Expand(req.URL, map[string]string{
  3913. "name": c.name,
  3914. })
  3915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3916. }
  3917. // Do executes the "firestore.projects.databases.collectionGroups.fields.patch" call.
  3918. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  3919. // Any non-2xx status code is an error. Response headers are in either
  3920. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  3921. // was returned at all) in error.(*googleapi.Error).Header. Use
  3922. // googleapi.IsNotModified to check whether the returned error was
  3923. // because http.StatusNotModified was returned.
  3924. func (c *ProjectsDatabasesCollectionGroupsFieldsPatchCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3925. gensupport.SetOptions(c.urlParams_, opts...)
  3926. res, err := c.doRequest("json")
  3927. if res != nil && res.StatusCode == http.StatusNotModified {
  3928. if res.Body != nil {
  3929. res.Body.Close()
  3930. }
  3931. return nil, &googleapi.Error{
  3932. Code: res.StatusCode,
  3933. Header: res.Header,
  3934. }
  3935. }
  3936. if err != nil {
  3937. return nil, err
  3938. }
  3939. defer googleapi.CloseBody(res)
  3940. if err := googleapi.CheckResponse(res); err != nil {
  3941. return nil, err
  3942. }
  3943. ret := &GoogleLongrunningOperation{
  3944. ServerResponse: googleapi.ServerResponse{
  3945. Header: res.Header,
  3946. HTTPStatusCode: res.StatusCode,
  3947. },
  3948. }
  3949. target := &ret
  3950. if err := gensupport.DecodeResponse(target, res); err != nil {
  3951. return nil, err
  3952. }
  3953. return ret, nil
  3954. // {
  3955. // "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/*`.",
  3956. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/fields/{fieldsId}",
  3957. // "httpMethod": "PATCH",
  3958. // "id": "firestore.projects.databases.collectionGroups.fields.patch",
  3959. // "parameterOrder": [
  3960. // "name"
  3961. // ],
  3962. // "parameters": {
  3963. // "name": {
  3964. // "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.",
  3965. // "location": "path",
  3966. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/fields/[^/]+$",
  3967. // "required": true,
  3968. // "type": "string"
  3969. // },
  3970. // "updateMask": {
  3971. // "description": "A mask, relative to the field. If specified, only configuration specified\nby this field_mask will be updated in the field.",
  3972. // "format": "google-fieldmask",
  3973. // "location": "query",
  3974. // "type": "string"
  3975. // }
  3976. // },
  3977. // "path": "v1/{+name}",
  3978. // "request": {
  3979. // "$ref": "GoogleFirestoreAdminV1Field"
  3980. // },
  3981. // "response": {
  3982. // "$ref": "GoogleLongrunningOperation"
  3983. // },
  3984. // "scopes": [
  3985. // "https://www.googleapis.com/auth/cloud-platform",
  3986. // "https://www.googleapis.com/auth/datastore"
  3987. // ]
  3988. // }
  3989. }
  3990. // method id "firestore.projects.databases.collectionGroups.indexes.create":
  3991. type ProjectsDatabasesCollectionGroupsIndexesCreateCall struct {
  3992. s *Service
  3993. parent string
  3994. googlefirestoreadminv1index *GoogleFirestoreAdminV1Index
  3995. urlParams_ gensupport.URLParams
  3996. ctx_ context.Context
  3997. header_ http.Header
  3998. }
  3999. // Create: Creates a composite index. This returns a
  4000. // google.longrunning.Operation
  4001. // which may be used to track the status of the creation. The metadata
  4002. // for
  4003. // the operation will be the type IndexOperationMetadata.
  4004. func (r *ProjectsDatabasesCollectionGroupsIndexesService) Create(parent string, googlefirestoreadminv1index *GoogleFirestoreAdminV1Index) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  4005. c := &ProjectsDatabasesCollectionGroupsIndexesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4006. c.parent = parent
  4007. c.googlefirestoreadminv1index = googlefirestoreadminv1index
  4008. return c
  4009. }
  4010. // Fields allows partial responses to be retrieved. See
  4011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4012. // for more information.
  4013. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  4014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4015. return c
  4016. }
  4017. // Context sets the context to be used in this call's Do method. Any
  4018. // pending HTTP request will be aborted if the provided context is
  4019. // canceled.
  4020. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesCreateCall {
  4021. c.ctx_ = ctx
  4022. return c
  4023. }
  4024. // Header returns an http.Header that can be modified by the caller to
  4025. // add HTTP headers to the request.
  4026. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Header() http.Header {
  4027. if c.header_ == nil {
  4028. c.header_ = make(http.Header)
  4029. }
  4030. return c.header_
  4031. }
  4032. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) doRequest(alt string) (*http.Response, error) {
  4033. reqHeaders := make(http.Header)
  4034. for k, v := range c.header_ {
  4035. reqHeaders[k] = v
  4036. }
  4037. reqHeaders.Set("User-Agent", c.s.userAgent())
  4038. var body io.Reader = nil
  4039. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlefirestoreadminv1index)
  4040. if err != nil {
  4041. return nil, err
  4042. }
  4043. reqHeaders.Set("Content-Type", "application/json")
  4044. c.urlParams_.Set("alt", alt)
  4045. c.urlParams_.Set("prettyPrint", "false")
  4046. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/indexes")
  4047. urls += "?" + c.urlParams_.Encode()
  4048. req, err := http.NewRequest("POST", urls, body)
  4049. if err != nil {
  4050. return nil, err
  4051. }
  4052. req.Header = reqHeaders
  4053. googleapi.Expand(req.URL, map[string]string{
  4054. "parent": c.parent,
  4055. })
  4056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4057. }
  4058. // Do executes the "firestore.projects.databases.collectionGroups.indexes.create" call.
  4059. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  4060. // Any non-2xx status code is an error. Response headers are in either
  4061. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  4062. // was returned at all) in error.(*googleapi.Error).Header. Use
  4063. // googleapi.IsNotModified to check whether the returned error was
  4064. // because http.StatusNotModified was returned.
  4065. func (c *ProjectsDatabasesCollectionGroupsIndexesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4066. gensupport.SetOptions(c.urlParams_, opts...)
  4067. res, err := c.doRequest("json")
  4068. if res != nil && res.StatusCode == http.StatusNotModified {
  4069. if res.Body != nil {
  4070. res.Body.Close()
  4071. }
  4072. return nil, &googleapi.Error{
  4073. Code: res.StatusCode,
  4074. Header: res.Header,
  4075. }
  4076. }
  4077. if err != nil {
  4078. return nil, err
  4079. }
  4080. defer googleapi.CloseBody(res)
  4081. if err := googleapi.CheckResponse(res); err != nil {
  4082. return nil, err
  4083. }
  4084. ret := &GoogleLongrunningOperation{
  4085. ServerResponse: googleapi.ServerResponse{
  4086. Header: res.Header,
  4087. HTTPStatusCode: res.StatusCode,
  4088. },
  4089. }
  4090. target := &ret
  4091. if err := gensupport.DecodeResponse(target, res); err != nil {
  4092. return nil, err
  4093. }
  4094. return ret, nil
  4095. // {
  4096. // "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.",
  4097. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/indexes",
  4098. // "httpMethod": "POST",
  4099. // "id": "firestore.projects.databases.collectionGroups.indexes.create",
  4100. // "parameterOrder": [
  4101. // "parent"
  4102. // ],
  4103. // "parameters": {
  4104. // "parent": {
  4105. // "description": "A parent name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`",
  4106. // "location": "path",
  4107. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+$",
  4108. // "required": true,
  4109. // "type": "string"
  4110. // }
  4111. // },
  4112. // "path": "v1/{+parent}/indexes",
  4113. // "request": {
  4114. // "$ref": "GoogleFirestoreAdminV1Index"
  4115. // },
  4116. // "response": {
  4117. // "$ref": "GoogleLongrunningOperation"
  4118. // },
  4119. // "scopes": [
  4120. // "https://www.googleapis.com/auth/cloud-platform",
  4121. // "https://www.googleapis.com/auth/datastore"
  4122. // ]
  4123. // }
  4124. }
  4125. // method id "firestore.projects.databases.collectionGroups.indexes.delete":
  4126. type ProjectsDatabasesCollectionGroupsIndexesDeleteCall struct {
  4127. s *Service
  4128. name string
  4129. urlParams_ gensupport.URLParams
  4130. ctx_ context.Context
  4131. header_ http.Header
  4132. }
  4133. // Delete: Deletes a composite index.
  4134. func (r *ProjectsDatabasesCollectionGroupsIndexesService) Delete(name string) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  4135. c := &ProjectsDatabasesCollectionGroupsIndexesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4136. c.name = name
  4137. return c
  4138. }
  4139. // Fields allows partial responses to be retrieved. See
  4140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4141. // for more information.
  4142. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  4143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4144. return c
  4145. }
  4146. // Context sets the context to be used in this call's Do method. Any
  4147. // pending HTTP request will be aborted if the provided context is
  4148. // canceled.
  4149. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesDeleteCall {
  4150. c.ctx_ = ctx
  4151. return c
  4152. }
  4153. // Header returns an http.Header that can be modified by the caller to
  4154. // add HTTP headers to the request.
  4155. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Header() http.Header {
  4156. if c.header_ == nil {
  4157. c.header_ = make(http.Header)
  4158. }
  4159. return c.header_
  4160. }
  4161. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4162. reqHeaders := make(http.Header)
  4163. for k, v := range c.header_ {
  4164. reqHeaders[k] = v
  4165. }
  4166. reqHeaders.Set("User-Agent", c.s.userAgent())
  4167. var body io.Reader = nil
  4168. c.urlParams_.Set("alt", alt)
  4169. c.urlParams_.Set("prettyPrint", "false")
  4170. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4171. urls += "?" + c.urlParams_.Encode()
  4172. req, err := http.NewRequest("DELETE", urls, body)
  4173. if err != nil {
  4174. return nil, err
  4175. }
  4176. req.Header = reqHeaders
  4177. googleapi.Expand(req.URL, map[string]string{
  4178. "name": c.name,
  4179. })
  4180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4181. }
  4182. // Do executes the "firestore.projects.databases.collectionGroups.indexes.delete" call.
  4183. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4184. // code is an error. Response headers are in either
  4185. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4186. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4187. // check whether the returned error was because http.StatusNotModified
  4188. // was returned.
  4189. func (c *ProjectsDatabasesCollectionGroupsIndexesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4190. gensupport.SetOptions(c.urlParams_, opts...)
  4191. res, err := c.doRequest("json")
  4192. if res != nil && res.StatusCode == http.StatusNotModified {
  4193. if res.Body != nil {
  4194. res.Body.Close()
  4195. }
  4196. return nil, &googleapi.Error{
  4197. Code: res.StatusCode,
  4198. Header: res.Header,
  4199. }
  4200. }
  4201. if err != nil {
  4202. return nil, err
  4203. }
  4204. defer googleapi.CloseBody(res)
  4205. if err := googleapi.CheckResponse(res); err != nil {
  4206. return nil, err
  4207. }
  4208. ret := &Empty{
  4209. ServerResponse: googleapi.ServerResponse{
  4210. Header: res.Header,
  4211. HTTPStatusCode: res.StatusCode,
  4212. },
  4213. }
  4214. target := &ret
  4215. if err := gensupport.DecodeResponse(target, res); err != nil {
  4216. return nil, err
  4217. }
  4218. return ret, nil
  4219. // {
  4220. // "description": "Deletes a composite index.",
  4221. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/indexes/{indexesId}",
  4222. // "httpMethod": "DELETE",
  4223. // "id": "firestore.projects.databases.collectionGroups.indexes.delete",
  4224. // "parameterOrder": [
  4225. // "name"
  4226. // ],
  4227. // "parameters": {
  4228. // "name": {
  4229. // "description": "A name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`",
  4230. // "location": "path",
  4231. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+$",
  4232. // "required": true,
  4233. // "type": "string"
  4234. // }
  4235. // },
  4236. // "path": "v1/{+name}",
  4237. // "response": {
  4238. // "$ref": "Empty"
  4239. // },
  4240. // "scopes": [
  4241. // "https://www.googleapis.com/auth/cloud-platform",
  4242. // "https://www.googleapis.com/auth/datastore"
  4243. // ]
  4244. // }
  4245. }
  4246. // method id "firestore.projects.databases.collectionGroups.indexes.get":
  4247. type ProjectsDatabasesCollectionGroupsIndexesGetCall struct {
  4248. s *Service
  4249. name string
  4250. urlParams_ gensupport.URLParams
  4251. ifNoneMatch_ string
  4252. ctx_ context.Context
  4253. header_ http.Header
  4254. }
  4255. // Get: Gets a composite index.
  4256. func (r *ProjectsDatabasesCollectionGroupsIndexesService) Get(name string) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  4257. c := &ProjectsDatabasesCollectionGroupsIndexesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4258. c.name = name
  4259. return c
  4260. }
  4261. // Fields allows partial responses to be retrieved. See
  4262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4263. // for more information.
  4264. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  4265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4266. return c
  4267. }
  4268. // IfNoneMatch sets the optional parameter which makes the operation
  4269. // fail if the object's ETag matches the given value. This is useful for
  4270. // getting updates only after the object has changed since the last
  4271. // request. Use googleapi.IsNotModified to check whether the response
  4272. // error from Do is the result of In-None-Match.
  4273. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  4274. c.ifNoneMatch_ = entityTag
  4275. return c
  4276. }
  4277. // Context sets the context to be used in this call's Do method. Any
  4278. // pending HTTP request will be aborted if the provided context is
  4279. // canceled.
  4280. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesGetCall {
  4281. c.ctx_ = ctx
  4282. return c
  4283. }
  4284. // Header returns an http.Header that can be modified by the caller to
  4285. // add HTTP headers to the request.
  4286. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Header() http.Header {
  4287. if c.header_ == nil {
  4288. c.header_ = make(http.Header)
  4289. }
  4290. return c.header_
  4291. }
  4292. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) doRequest(alt string) (*http.Response, error) {
  4293. reqHeaders := make(http.Header)
  4294. for k, v := range c.header_ {
  4295. reqHeaders[k] = v
  4296. }
  4297. reqHeaders.Set("User-Agent", c.s.userAgent())
  4298. if c.ifNoneMatch_ != "" {
  4299. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4300. }
  4301. var body io.Reader = nil
  4302. c.urlParams_.Set("alt", alt)
  4303. c.urlParams_.Set("prettyPrint", "false")
  4304. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4305. urls += "?" + c.urlParams_.Encode()
  4306. req, err := http.NewRequest("GET", urls, body)
  4307. if err != nil {
  4308. return nil, err
  4309. }
  4310. req.Header = reqHeaders
  4311. googleapi.Expand(req.URL, map[string]string{
  4312. "name": c.name,
  4313. })
  4314. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4315. }
  4316. // Do executes the "firestore.projects.databases.collectionGroups.indexes.get" call.
  4317. // Exactly one of *GoogleFirestoreAdminV1Index or error will be non-nil.
  4318. // Any non-2xx status code is an error. Response headers are in either
  4319. // *GoogleFirestoreAdminV1Index.ServerResponse.Header or (if a response
  4320. // was returned at all) in error.(*googleapi.Error).Header. Use
  4321. // googleapi.IsNotModified to check whether the returned error was
  4322. // because http.StatusNotModified was returned.
  4323. func (c *ProjectsDatabasesCollectionGroupsIndexesGetCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1Index, error) {
  4324. gensupport.SetOptions(c.urlParams_, opts...)
  4325. res, err := c.doRequest("json")
  4326. if res != nil && res.StatusCode == http.StatusNotModified {
  4327. if res.Body != nil {
  4328. res.Body.Close()
  4329. }
  4330. return nil, &googleapi.Error{
  4331. Code: res.StatusCode,
  4332. Header: res.Header,
  4333. }
  4334. }
  4335. if err != nil {
  4336. return nil, err
  4337. }
  4338. defer googleapi.CloseBody(res)
  4339. if err := googleapi.CheckResponse(res); err != nil {
  4340. return nil, err
  4341. }
  4342. ret := &GoogleFirestoreAdminV1Index{
  4343. ServerResponse: googleapi.ServerResponse{
  4344. Header: res.Header,
  4345. HTTPStatusCode: res.StatusCode,
  4346. },
  4347. }
  4348. target := &ret
  4349. if err := gensupport.DecodeResponse(target, res); err != nil {
  4350. return nil, err
  4351. }
  4352. return ret, nil
  4353. // {
  4354. // "description": "Gets a composite index.",
  4355. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/indexes/{indexesId}",
  4356. // "httpMethod": "GET",
  4357. // "id": "firestore.projects.databases.collectionGroups.indexes.get",
  4358. // "parameterOrder": [
  4359. // "name"
  4360. // ],
  4361. // "parameters": {
  4362. // "name": {
  4363. // "description": "A name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}`",
  4364. // "location": "path",
  4365. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+/indexes/[^/]+$",
  4366. // "required": true,
  4367. // "type": "string"
  4368. // }
  4369. // },
  4370. // "path": "v1/{+name}",
  4371. // "response": {
  4372. // "$ref": "GoogleFirestoreAdminV1Index"
  4373. // },
  4374. // "scopes": [
  4375. // "https://www.googleapis.com/auth/cloud-platform",
  4376. // "https://www.googleapis.com/auth/datastore"
  4377. // ]
  4378. // }
  4379. }
  4380. // method id "firestore.projects.databases.collectionGroups.indexes.list":
  4381. type ProjectsDatabasesCollectionGroupsIndexesListCall struct {
  4382. s *Service
  4383. parent string
  4384. urlParams_ gensupport.URLParams
  4385. ifNoneMatch_ string
  4386. ctx_ context.Context
  4387. header_ http.Header
  4388. }
  4389. // List: Lists composite indexes.
  4390. func (r *ProjectsDatabasesCollectionGroupsIndexesService) List(parent string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  4391. c := &ProjectsDatabasesCollectionGroupsIndexesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4392. c.parent = parent
  4393. return c
  4394. }
  4395. // Filter sets the optional parameter "filter": The filter to apply to
  4396. // list results.
  4397. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Filter(filter string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  4398. c.urlParams_.Set("filter", filter)
  4399. return c
  4400. }
  4401. // PageSize sets the optional parameter "pageSize": The number of
  4402. // results to return.
  4403. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) PageSize(pageSize int64) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  4404. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4405. return c
  4406. }
  4407. // PageToken sets the optional parameter "pageToken": A page token,
  4408. // returned from a previous call to
  4409. // FirestoreAdmin.ListIndexes, that may be used to get the next
  4410. // page of results.
  4411. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) PageToken(pageToken string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  4412. c.urlParams_.Set("pageToken", pageToken)
  4413. return c
  4414. }
  4415. // Fields allows partial responses to be retrieved. See
  4416. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4417. // for more information.
  4418. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  4419. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4420. return c
  4421. }
  4422. // IfNoneMatch sets the optional parameter which makes the operation
  4423. // fail if the object's ETag matches the given value. This is useful for
  4424. // getting updates only after the object has changed since the last
  4425. // request. Use googleapi.IsNotModified to check whether the response
  4426. // error from Do is the result of In-None-Match.
  4427. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  4428. c.ifNoneMatch_ = entityTag
  4429. return c
  4430. }
  4431. // Context sets the context to be used in this call's Do method. Any
  4432. // pending HTTP request will be aborted if the provided context is
  4433. // canceled.
  4434. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Context(ctx context.Context) *ProjectsDatabasesCollectionGroupsIndexesListCall {
  4435. c.ctx_ = ctx
  4436. return c
  4437. }
  4438. // Header returns an http.Header that can be modified by the caller to
  4439. // add HTTP headers to the request.
  4440. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Header() http.Header {
  4441. if c.header_ == nil {
  4442. c.header_ = make(http.Header)
  4443. }
  4444. return c.header_
  4445. }
  4446. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) doRequest(alt string) (*http.Response, error) {
  4447. reqHeaders := make(http.Header)
  4448. for k, v := range c.header_ {
  4449. reqHeaders[k] = v
  4450. }
  4451. reqHeaders.Set("User-Agent", c.s.userAgent())
  4452. if c.ifNoneMatch_ != "" {
  4453. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4454. }
  4455. var body io.Reader = nil
  4456. c.urlParams_.Set("alt", alt)
  4457. c.urlParams_.Set("prettyPrint", "false")
  4458. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/indexes")
  4459. urls += "?" + c.urlParams_.Encode()
  4460. req, err := http.NewRequest("GET", urls, body)
  4461. if err != nil {
  4462. return nil, err
  4463. }
  4464. req.Header = reqHeaders
  4465. googleapi.Expand(req.URL, map[string]string{
  4466. "parent": c.parent,
  4467. })
  4468. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4469. }
  4470. // Do executes the "firestore.projects.databases.collectionGroups.indexes.list" call.
  4471. // Exactly one of *GoogleFirestoreAdminV1ListIndexesResponse or error
  4472. // will be non-nil. Any non-2xx status code is an error. Response
  4473. // headers are in either
  4474. // *GoogleFirestoreAdminV1ListIndexesResponse.ServerResponse.Header or
  4475. // (if a response was returned at all) in
  4476. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4477. // whether the returned error was because http.StatusNotModified was
  4478. // returned.
  4479. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Do(opts ...googleapi.CallOption) (*GoogleFirestoreAdminV1ListIndexesResponse, error) {
  4480. gensupport.SetOptions(c.urlParams_, opts...)
  4481. res, err := c.doRequest("json")
  4482. if res != nil && res.StatusCode == http.StatusNotModified {
  4483. if res.Body != nil {
  4484. res.Body.Close()
  4485. }
  4486. return nil, &googleapi.Error{
  4487. Code: res.StatusCode,
  4488. Header: res.Header,
  4489. }
  4490. }
  4491. if err != nil {
  4492. return nil, err
  4493. }
  4494. defer googleapi.CloseBody(res)
  4495. if err := googleapi.CheckResponse(res); err != nil {
  4496. return nil, err
  4497. }
  4498. ret := &GoogleFirestoreAdminV1ListIndexesResponse{
  4499. ServerResponse: googleapi.ServerResponse{
  4500. Header: res.Header,
  4501. HTTPStatusCode: res.StatusCode,
  4502. },
  4503. }
  4504. target := &ret
  4505. if err := gensupport.DecodeResponse(target, res); err != nil {
  4506. return nil, err
  4507. }
  4508. return ret, nil
  4509. // {
  4510. // "description": "Lists composite indexes.",
  4511. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/collectionGroups/{collectionGroupsId}/indexes",
  4512. // "httpMethod": "GET",
  4513. // "id": "firestore.projects.databases.collectionGroups.indexes.list",
  4514. // "parameterOrder": [
  4515. // "parent"
  4516. // ],
  4517. // "parameters": {
  4518. // "filter": {
  4519. // "description": "The filter to apply to list results.",
  4520. // "location": "query",
  4521. // "type": "string"
  4522. // },
  4523. // "pageSize": {
  4524. // "description": "The number of results to return.",
  4525. // "format": "int32",
  4526. // "location": "query",
  4527. // "type": "integer"
  4528. // },
  4529. // "pageToken": {
  4530. // "description": "A page token, returned from a previous call to\nFirestoreAdmin.ListIndexes, that may be used to get the next\npage of results.",
  4531. // "location": "query",
  4532. // "type": "string"
  4533. // },
  4534. // "parent": {
  4535. // "description": "A parent name of the form\n`projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`",
  4536. // "location": "path",
  4537. // "pattern": "^projects/[^/]+/databases/[^/]+/collectionGroups/[^/]+$",
  4538. // "required": true,
  4539. // "type": "string"
  4540. // }
  4541. // },
  4542. // "path": "v1/{+parent}/indexes",
  4543. // "response": {
  4544. // "$ref": "GoogleFirestoreAdminV1ListIndexesResponse"
  4545. // },
  4546. // "scopes": [
  4547. // "https://www.googleapis.com/auth/cloud-platform",
  4548. // "https://www.googleapis.com/auth/datastore"
  4549. // ]
  4550. // }
  4551. }
  4552. // Pages invokes f for each page of results.
  4553. // A non-nil error returned from f will halt the iteration.
  4554. // The provided context supersedes any context provided to the Context method.
  4555. func (c *ProjectsDatabasesCollectionGroupsIndexesListCall) Pages(ctx context.Context, f func(*GoogleFirestoreAdminV1ListIndexesResponse) error) error {
  4556. c.ctx_ = ctx
  4557. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4558. for {
  4559. x, err := c.Do()
  4560. if err != nil {
  4561. return err
  4562. }
  4563. if err := f(x); err != nil {
  4564. return err
  4565. }
  4566. if x.NextPageToken == "" {
  4567. return nil
  4568. }
  4569. c.PageToken(x.NextPageToken)
  4570. }
  4571. }
  4572. // method id "firestore.projects.databases.documents.batchGet":
  4573. type ProjectsDatabasesDocumentsBatchGetCall struct {
  4574. s *Service
  4575. database string
  4576. batchgetdocumentsrequest *BatchGetDocumentsRequest
  4577. urlParams_ gensupport.URLParams
  4578. ctx_ context.Context
  4579. header_ http.Header
  4580. }
  4581. // BatchGet: Gets multiple documents.
  4582. //
  4583. // Documents returned by this method are not guaranteed to be returned
  4584. // in the
  4585. // same order that they were requested.
  4586. func (r *ProjectsDatabasesDocumentsService) BatchGet(database string, batchgetdocumentsrequest *BatchGetDocumentsRequest) *ProjectsDatabasesDocumentsBatchGetCall {
  4587. c := &ProjectsDatabasesDocumentsBatchGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4588. c.database = database
  4589. c.batchgetdocumentsrequest = batchgetdocumentsrequest
  4590. return c
  4591. }
  4592. // Fields allows partial responses to be retrieved. See
  4593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4594. // for more information.
  4595. func (c *ProjectsDatabasesDocumentsBatchGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsBatchGetCall {
  4596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4597. return c
  4598. }
  4599. // Context sets the context to be used in this call's Do method. Any
  4600. // pending HTTP request will be aborted if the provided context is
  4601. // canceled.
  4602. func (c *ProjectsDatabasesDocumentsBatchGetCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsBatchGetCall {
  4603. c.ctx_ = ctx
  4604. return c
  4605. }
  4606. // Header returns an http.Header that can be modified by the caller to
  4607. // add HTTP headers to the request.
  4608. func (c *ProjectsDatabasesDocumentsBatchGetCall) Header() http.Header {
  4609. if c.header_ == nil {
  4610. c.header_ = make(http.Header)
  4611. }
  4612. return c.header_
  4613. }
  4614. func (c *ProjectsDatabasesDocumentsBatchGetCall) doRequest(alt string) (*http.Response, error) {
  4615. reqHeaders := make(http.Header)
  4616. for k, v := range c.header_ {
  4617. reqHeaders[k] = v
  4618. }
  4619. reqHeaders.Set("User-Agent", c.s.userAgent())
  4620. var body io.Reader = nil
  4621. body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchgetdocumentsrequest)
  4622. if err != nil {
  4623. return nil, err
  4624. }
  4625. reqHeaders.Set("Content-Type", "application/json")
  4626. c.urlParams_.Set("alt", alt)
  4627. c.urlParams_.Set("prettyPrint", "false")
  4628. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}/documents:batchGet")
  4629. urls += "?" + c.urlParams_.Encode()
  4630. req, err := http.NewRequest("POST", urls, body)
  4631. if err != nil {
  4632. return nil, err
  4633. }
  4634. req.Header = reqHeaders
  4635. googleapi.Expand(req.URL, map[string]string{
  4636. "database": c.database,
  4637. })
  4638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4639. }
  4640. // Do executes the "firestore.projects.databases.documents.batchGet" call.
  4641. // Exactly one of *BatchGetDocumentsResponse or error will be non-nil.
  4642. // Any non-2xx status code is an error. Response headers are in either
  4643. // *BatchGetDocumentsResponse.ServerResponse.Header or (if a response
  4644. // was returned at all) in error.(*googleapi.Error).Header. Use
  4645. // googleapi.IsNotModified to check whether the returned error was
  4646. // because http.StatusNotModified was returned.
  4647. func (c *ProjectsDatabasesDocumentsBatchGetCall) Do(opts ...googleapi.CallOption) (*BatchGetDocumentsResponse, error) {
  4648. gensupport.SetOptions(c.urlParams_, opts...)
  4649. res, err := c.doRequest("json")
  4650. if res != nil && res.StatusCode == http.StatusNotModified {
  4651. if res.Body != nil {
  4652. res.Body.Close()
  4653. }
  4654. return nil, &googleapi.Error{
  4655. Code: res.StatusCode,
  4656. Header: res.Header,
  4657. }
  4658. }
  4659. if err != nil {
  4660. return nil, err
  4661. }
  4662. defer googleapi.CloseBody(res)
  4663. if err := googleapi.CheckResponse(res); err != nil {
  4664. return nil, err
  4665. }
  4666. ret := &BatchGetDocumentsResponse{
  4667. ServerResponse: googleapi.ServerResponse{
  4668. Header: res.Header,
  4669. HTTPStatusCode: res.StatusCode,
  4670. },
  4671. }
  4672. target := &ret
  4673. if err := gensupport.DecodeResponse(target, res); err != nil {
  4674. return nil, err
  4675. }
  4676. return ret, nil
  4677. // {
  4678. // "description": "Gets multiple documents.\n\nDocuments returned by this method are not guaranteed to be returned in the\nsame order that they were requested.",
  4679. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:batchGet",
  4680. // "httpMethod": "POST",
  4681. // "id": "firestore.projects.databases.documents.batchGet",
  4682. // "parameterOrder": [
  4683. // "database"
  4684. // ],
  4685. // "parameters": {
  4686. // "database": {
  4687. // "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.",
  4688. // "location": "path",
  4689. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  4690. // "required": true,
  4691. // "type": "string"
  4692. // }
  4693. // },
  4694. // "path": "v1/{+database}/documents:batchGet",
  4695. // "request": {
  4696. // "$ref": "BatchGetDocumentsRequest"
  4697. // },
  4698. // "response": {
  4699. // "$ref": "BatchGetDocumentsResponse"
  4700. // },
  4701. // "scopes": [
  4702. // "https://www.googleapis.com/auth/cloud-platform",
  4703. // "https://www.googleapis.com/auth/datastore"
  4704. // ]
  4705. // }
  4706. }
  4707. // method id "firestore.projects.databases.documents.beginTransaction":
  4708. type ProjectsDatabasesDocumentsBeginTransactionCall struct {
  4709. s *Service
  4710. database string
  4711. begintransactionrequest *BeginTransactionRequest
  4712. urlParams_ gensupport.URLParams
  4713. ctx_ context.Context
  4714. header_ http.Header
  4715. }
  4716. // BeginTransaction: Starts a new transaction.
  4717. func (r *ProjectsDatabasesDocumentsService) BeginTransaction(database string, begintransactionrequest *BeginTransactionRequest) *ProjectsDatabasesDocumentsBeginTransactionCall {
  4718. c := &ProjectsDatabasesDocumentsBeginTransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4719. c.database = database
  4720. c.begintransactionrequest = begintransactionrequest
  4721. return c
  4722. }
  4723. // Fields allows partial responses to be retrieved. See
  4724. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4725. // for more information.
  4726. func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsBeginTransactionCall {
  4727. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4728. return c
  4729. }
  4730. // Context sets the context to be used in this call's Do method. Any
  4731. // pending HTTP request will be aborted if the provided context is
  4732. // canceled.
  4733. func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsBeginTransactionCall {
  4734. c.ctx_ = ctx
  4735. return c
  4736. }
  4737. // Header returns an http.Header that can be modified by the caller to
  4738. // add HTTP headers to the request.
  4739. func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Header() http.Header {
  4740. if c.header_ == nil {
  4741. c.header_ = make(http.Header)
  4742. }
  4743. return c.header_
  4744. }
  4745. func (c *ProjectsDatabasesDocumentsBeginTransactionCall) doRequest(alt string) (*http.Response, error) {
  4746. reqHeaders := make(http.Header)
  4747. for k, v := range c.header_ {
  4748. reqHeaders[k] = v
  4749. }
  4750. reqHeaders.Set("User-Agent", c.s.userAgent())
  4751. var body io.Reader = nil
  4752. body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest)
  4753. if err != nil {
  4754. return nil, err
  4755. }
  4756. reqHeaders.Set("Content-Type", "application/json")
  4757. c.urlParams_.Set("alt", alt)
  4758. c.urlParams_.Set("prettyPrint", "false")
  4759. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}/documents:beginTransaction")
  4760. urls += "?" + c.urlParams_.Encode()
  4761. req, err := http.NewRequest("POST", urls, body)
  4762. if err != nil {
  4763. return nil, err
  4764. }
  4765. req.Header = reqHeaders
  4766. googleapi.Expand(req.URL, map[string]string{
  4767. "database": c.database,
  4768. })
  4769. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4770. }
  4771. // Do executes the "firestore.projects.databases.documents.beginTransaction" call.
  4772. // Exactly one of *BeginTransactionResponse or error will be non-nil.
  4773. // Any non-2xx status code is an error. Response headers are in either
  4774. // *BeginTransactionResponse.ServerResponse.Header or (if a response was
  4775. // returned at all) in error.(*googleapi.Error).Header. Use
  4776. // googleapi.IsNotModified to check whether the returned error was
  4777. // because http.StatusNotModified was returned.
  4778. func (c *ProjectsDatabasesDocumentsBeginTransactionCall) Do(opts ...googleapi.CallOption) (*BeginTransactionResponse, error) {
  4779. gensupport.SetOptions(c.urlParams_, opts...)
  4780. res, err := c.doRequest("json")
  4781. if res != nil && res.StatusCode == http.StatusNotModified {
  4782. if res.Body != nil {
  4783. res.Body.Close()
  4784. }
  4785. return nil, &googleapi.Error{
  4786. Code: res.StatusCode,
  4787. Header: res.Header,
  4788. }
  4789. }
  4790. if err != nil {
  4791. return nil, err
  4792. }
  4793. defer googleapi.CloseBody(res)
  4794. if err := googleapi.CheckResponse(res); err != nil {
  4795. return nil, err
  4796. }
  4797. ret := &BeginTransactionResponse{
  4798. ServerResponse: googleapi.ServerResponse{
  4799. Header: res.Header,
  4800. HTTPStatusCode: res.StatusCode,
  4801. },
  4802. }
  4803. target := &ret
  4804. if err := gensupport.DecodeResponse(target, res); err != nil {
  4805. return nil, err
  4806. }
  4807. return ret, nil
  4808. // {
  4809. // "description": "Starts a new transaction.",
  4810. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:beginTransaction",
  4811. // "httpMethod": "POST",
  4812. // "id": "firestore.projects.databases.documents.beginTransaction",
  4813. // "parameterOrder": [
  4814. // "database"
  4815. // ],
  4816. // "parameters": {
  4817. // "database": {
  4818. // "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.",
  4819. // "location": "path",
  4820. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  4821. // "required": true,
  4822. // "type": "string"
  4823. // }
  4824. // },
  4825. // "path": "v1/{+database}/documents:beginTransaction",
  4826. // "request": {
  4827. // "$ref": "BeginTransactionRequest"
  4828. // },
  4829. // "response": {
  4830. // "$ref": "BeginTransactionResponse"
  4831. // },
  4832. // "scopes": [
  4833. // "https://www.googleapis.com/auth/cloud-platform",
  4834. // "https://www.googleapis.com/auth/datastore"
  4835. // ]
  4836. // }
  4837. }
  4838. // method id "firestore.projects.databases.documents.commit":
  4839. type ProjectsDatabasesDocumentsCommitCall struct {
  4840. s *Service
  4841. database string
  4842. commitrequest *CommitRequest
  4843. urlParams_ gensupport.URLParams
  4844. ctx_ context.Context
  4845. header_ http.Header
  4846. }
  4847. // Commit: Commits a transaction, while optionally updating documents.
  4848. func (r *ProjectsDatabasesDocumentsService) Commit(database string, commitrequest *CommitRequest) *ProjectsDatabasesDocumentsCommitCall {
  4849. c := &ProjectsDatabasesDocumentsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4850. c.database = database
  4851. c.commitrequest = commitrequest
  4852. return c
  4853. }
  4854. // Fields allows partial responses to be retrieved. See
  4855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4856. // for more information.
  4857. func (c *ProjectsDatabasesDocumentsCommitCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsCommitCall {
  4858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4859. return c
  4860. }
  4861. // Context sets the context to be used in this call's Do method. Any
  4862. // pending HTTP request will be aborted if the provided context is
  4863. // canceled.
  4864. func (c *ProjectsDatabasesDocumentsCommitCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsCommitCall {
  4865. c.ctx_ = ctx
  4866. return c
  4867. }
  4868. // Header returns an http.Header that can be modified by the caller to
  4869. // add HTTP headers to the request.
  4870. func (c *ProjectsDatabasesDocumentsCommitCall) Header() http.Header {
  4871. if c.header_ == nil {
  4872. c.header_ = make(http.Header)
  4873. }
  4874. return c.header_
  4875. }
  4876. func (c *ProjectsDatabasesDocumentsCommitCall) doRequest(alt string) (*http.Response, error) {
  4877. reqHeaders := make(http.Header)
  4878. for k, v := range c.header_ {
  4879. reqHeaders[k] = v
  4880. }
  4881. reqHeaders.Set("User-Agent", c.s.userAgent())
  4882. var body io.Reader = nil
  4883. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest)
  4884. if err != nil {
  4885. return nil, err
  4886. }
  4887. reqHeaders.Set("Content-Type", "application/json")
  4888. c.urlParams_.Set("alt", alt)
  4889. c.urlParams_.Set("prettyPrint", "false")
  4890. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}/documents:commit")
  4891. urls += "?" + c.urlParams_.Encode()
  4892. req, err := http.NewRequest("POST", urls, body)
  4893. if err != nil {
  4894. return nil, err
  4895. }
  4896. req.Header = reqHeaders
  4897. googleapi.Expand(req.URL, map[string]string{
  4898. "database": c.database,
  4899. })
  4900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4901. }
  4902. // Do executes the "firestore.projects.databases.documents.commit" call.
  4903. // Exactly one of *CommitResponse or error will be non-nil. Any non-2xx
  4904. // status code is an error. Response headers are in either
  4905. // *CommitResponse.ServerResponse.Header or (if a response was returned
  4906. // at all) in error.(*googleapi.Error).Header. Use
  4907. // googleapi.IsNotModified to check whether the returned error was
  4908. // because http.StatusNotModified was returned.
  4909. func (c *ProjectsDatabasesDocumentsCommitCall) Do(opts ...googleapi.CallOption) (*CommitResponse, error) {
  4910. gensupport.SetOptions(c.urlParams_, opts...)
  4911. res, err := c.doRequest("json")
  4912. if res != nil && res.StatusCode == http.StatusNotModified {
  4913. if res.Body != nil {
  4914. res.Body.Close()
  4915. }
  4916. return nil, &googleapi.Error{
  4917. Code: res.StatusCode,
  4918. Header: res.Header,
  4919. }
  4920. }
  4921. if err != nil {
  4922. return nil, err
  4923. }
  4924. defer googleapi.CloseBody(res)
  4925. if err := googleapi.CheckResponse(res); err != nil {
  4926. return nil, err
  4927. }
  4928. ret := &CommitResponse{
  4929. ServerResponse: googleapi.ServerResponse{
  4930. Header: res.Header,
  4931. HTTPStatusCode: res.StatusCode,
  4932. },
  4933. }
  4934. target := &ret
  4935. if err := gensupport.DecodeResponse(target, res); err != nil {
  4936. return nil, err
  4937. }
  4938. return ret, nil
  4939. // {
  4940. // "description": "Commits a transaction, while optionally updating documents.",
  4941. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:commit",
  4942. // "httpMethod": "POST",
  4943. // "id": "firestore.projects.databases.documents.commit",
  4944. // "parameterOrder": [
  4945. // "database"
  4946. // ],
  4947. // "parameters": {
  4948. // "database": {
  4949. // "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.",
  4950. // "location": "path",
  4951. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  4952. // "required": true,
  4953. // "type": "string"
  4954. // }
  4955. // },
  4956. // "path": "v1/{+database}/documents:commit",
  4957. // "request": {
  4958. // "$ref": "CommitRequest"
  4959. // },
  4960. // "response": {
  4961. // "$ref": "CommitResponse"
  4962. // },
  4963. // "scopes": [
  4964. // "https://www.googleapis.com/auth/cloud-platform",
  4965. // "https://www.googleapis.com/auth/datastore"
  4966. // ]
  4967. // }
  4968. }
  4969. // method id "firestore.projects.databases.documents.createDocument":
  4970. type ProjectsDatabasesDocumentsCreateDocumentCall struct {
  4971. s *Service
  4972. parent string
  4973. collectionId string
  4974. document *Document
  4975. urlParams_ gensupport.URLParams
  4976. ctx_ context.Context
  4977. header_ http.Header
  4978. }
  4979. // CreateDocument: Creates a new document.
  4980. func (r *ProjectsDatabasesDocumentsService) CreateDocument(parent string, collectionId string, document *Document) *ProjectsDatabasesDocumentsCreateDocumentCall {
  4981. c := &ProjectsDatabasesDocumentsCreateDocumentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4982. c.parent = parent
  4983. c.collectionId = collectionId
  4984. c.document = document
  4985. return c
  4986. }
  4987. // DocumentId sets the optional parameter "documentId": The
  4988. // client-assigned document ID to use for this document.
  4989. //
  4990. // If not specified, an ID will be assigned by the service.
  4991. func (c *ProjectsDatabasesDocumentsCreateDocumentCall) DocumentId(documentId string) *ProjectsDatabasesDocumentsCreateDocumentCall {
  4992. c.urlParams_.Set("documentId", documentId)
  4993. return c
  4994. }
  4995. // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The
  4996. // list of field paths in the mask. See Document.fields for a field
  4997. // path syntax reference.
  4998. func (c *ProjectsDatabasesDocumentsCreateDocumentCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsCreateDocumentCall {
  4999. c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...))
  5000. return c
  5001. }
  5002. // Fields allows partial responses to be retrieved. See
  5003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5004. // for more information.
  5005. func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsCreateDocumentCall {
  5006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5007. return c
  5008. }
  5009. // Context sets the context to be used in this call's Do method. Any
  5010. // pending HTTP request will be aborted if the provided context is
  5011. // canceled.
  5012. func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsCreateDocumentCall {
  5013. c.ctx_ = ctx
  5014. return c
  5015. }
  5016. // Header returns an http.Header that can be modified by the caller to
  5017. // add HTTP headers to the request.
  5018. func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Header() http.Header {
  5019. if c.header_ == nil {
  5020. c.header_ = make(http.Header)
  5021. }
  5022. return c.header_
  5023. }
  5024. func (c *ProjectsDatabasesDocumentsCreateDocumentCall) doRequest(alt string) (*http.Response, error) {
  5025. reqHeaders := make(http.Header)
  5026. for k, v := range c.header_ {
  5027. reqHeaders[k] = v
  5028. }
  5029. reqHeaders.Set("User-Agent", c.s.userAgent())
  5030. var body io.Reader = nil
  5031. body, err := googleapi.WithoutDataWrapper.JSONReader(c.document)
  5032. if err != nil {
  5033. return nil, err
  5034. }
  5035. reqHeaders.Set("Content-Type", "application/json")
  5036. c.urlParams_.Set("alt", alt)
  5037. c.urlParams_.Set("prettyPrint", "false")
  5038. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/{collectionId}")
  5039. urls += "?" + c.urlParams_.Encode()
  5040. req, err := http.NewRequest("POST", urls, body)
  5041. if err != nil {
  5042. return nil, err
  5043. }
  5044. req.Header = reqHeaders
  5045. googleapi.Expand(req.URL, map[string]string{
  5046. "parent": c.parent,
  5047. "collectionId": c.collectionId,
  5048. })
  5049. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5050. }
  5051. // Do executes the "firestore.projects.databases.documents.createDocument" call.
  5052. // Exactly one of *Document or error will be non-nil. Any non-2xx status
  5053. // code is an error. Response headers are in either
  5054. // *Document.ServerResponse.Header or (if a response was returned at
  5055. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5056. // to check whether the returned error was because
  5057. // http.StatusNotModified was returned.
  5058. func (c *ProjectsDatabasesDocumentsCreateDocumentCall) Do(opts ...googleapi.CallOption) (*Document, error) {
  5059. gensupport.SetOptions(c.urlParams_, opts...)
  5060. res, err := c.doRequest("json")
  5061. if res != nil && res.StatusCode == http.StatusNotModified {
  5062. if res.Body != nil {
  5063. res.Body.Close()
  5064. }
  5065. return nil, &googleapi.Error{
  5066. Code: res.StatusCode,
  5067. Header: res.Header,
  5068. }
  5069. }
  5070. if err != nil {
  5071. return nil, err
  5072. }
  5073. defer googleapi.CloseBody(res)
  5074. if err := googleapi.CheckResponse(res); err != nil {
  5075. return nil, err
  5076. }
  5077. ret := &Document{
  5078. ServerResponse: googleapi.ServerResponse{
  5079. Header: res.Header,
  5080. HTTPStatusCode: res.StatusCode,
  5081. },
  5082. }
  5083. target := &ret
  5084. if err := gensupport.DecodeResponse(target, res); err != nil {
  5085. return nil, err
  5086. }
  5087. return ret, nil
  5088. // {
  5089. // "description": "Creates a new document.",
  5090. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{collectionId}",
  5091. // "httpMethod": "POST",
  5092. // "id": "firestore.projects.databases.documents.createDocument",
  5093. // "parameterOrder": [
  5094. // "parent",
  5095. // "collectionId"
  5096. // ],
  5097. // "parameters": {
  5098. // "collectionId": {
  5099. // "description": "The collection ID, relative to `parent`, to list. For example: `chatrooms`.",
  5100. // "location": "path",
  5101. // "required": true,
  5102. // "type": "string"
  5103. // },
  5104. // "documentId": {
  5105. // "description": "The client-assigned document ID to use for this document.\n\nOptional. If not specified, an ID will be assigned by the service.",
  5106. // "location": "query",
  5107. // "type": "string"
  5108. // },
  5109. // "mask.fieldPaths": {
  5110. // "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.",
  5111. // "location": "query",
  5112. // "repeated": true,
  5113. // "type": "string"
  5114. // },
  5115. // "parent": {
  5116. // "description": "The parent resource. For example:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}`",
  5117. // "location": "path",
  5118. // "pattern": "^projects/[^/]+/databases/[^/]+/documents/.+$",
  5119. // "required": true,
  5120. // "type": "string"
  5121. // }
  5122. // },
  5123. // "path": "v1/{+parent}/{collectionId}",
  5124. // "request": {
  5125. // "$ref": "Document"
  5126. // },
  5127. // "response": {
  5128. // "$ref": "Document"
  5129. // },
  5130. // "scopes": [
  5131. // "https://www.googleapis.com/auth/cloud-platform",
  5132. // "https://www.googleapis.com/auth/datastore"
  5133. // ]
  5134. // }
  5135. }
  5136. // method id "firestore.projects.databases.documents.delete":
  5137. type ProjectsDatabasesDocumentsDeleteCall struct {
  5138. s *Service
  5139. name string
  5140. urlParams_ gensupport.URLParams
  5141. ctx_ context.Context
  5142. header_ http.Header
  5143. }
  5144. // Delete: Deletes a document.
  5145. func (r *ProjectsDatabasesDocumentsService) Delete(name string) *ProjectsDatabasesDocumentsDeleteCall {
  5146. c := &ProjectsDatabasesDocumentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5147. c.name = name
  5148. return c
  5149. }
  5150. // CurrentDocumentExists sets the optional parameter
  5151. // "currentDocument.exists": When set to `true`, the target document
  5152. // must exist.
  5153. // When set to `false`, the target document must not exist.
  5154. func (c *ProjectsDatabasesDocumentsDeleteCall) CurrentDocumentExists(currentDocumentExists bool) *ProjectsDatabasesDocumentsDeleteCall {
  5155. c.urlParams_.Set("currentDocument.exists", fmt.Sprint(currentDocumentExists))
  5156. return c
  5157. }
  5158. // CurrentDocumentUpdateTime sets the optional parameter
  5159. // "currentDocument.updateTime": When set, the target document must
  5160. // exist and have been last updated at
  5161. // that time.
  5162. func (c *ProjectsDatabasesDocumentsDeleteCall) CurrentDocumentUpdateTime(currentDocumentUpdateTime string) *ProjectsDatabasesDocumentsDeleteCall {
  5163. c.urlParams_.Set("currentDocument.updateTime", currentDocumentUpdateTime)
  5164. return c
  5165. }
  5166. // Fields allows partial responses to be retrieved. See
  5167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5168. // for more information.
  5169. func (c *ProjectsDatabasesDocumentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsDeleteCall {
  5170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5171. return c
  5172. }
  5173. // Context sets the context to be used in this call's Do method. Any
  5174. // pending HTTP request will be aborted if the provided context is
  5175. // canceled.
  5176. func (c *ProjectsDatabasesDocumentsDeleteCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsDeleteCall {
  5177. c.ctx_ = ctx
  5178. return c
  5179. }
  5180. // Header returns an http.Header that can be modified by the caller to
  5181. // add HTTP headers to the request.
  5182. func (c *ProjectsDatabasesDocumentsDeleteCall) Header() http.Header {
  5183. if c.header_ == nil {
  5184. c.header_ = make(http.Header)
  5185. }
  5186. return c.header_
  5187. }
  5188. func (c *ProjectsDatabasesDocumentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5189. reqHeaders := make(http.Header)
  5190. for k, v := range c.header_ {
  5191. reqHeaders[k] = v
  5192. }
  5193. reqHeaders.Set("User-Agent", c.s.userAgent())
  5194. var body io.Reader = nil
  5195. c.urlParams_.Set("alt", alt)
  5196. c.urlParams_.Set("prettyPrint", "false")
  5197. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5198. urls += "?" + c.urlParams_.Encode()
  5199. req, err := http.NewRequest("DELETE", urls, body)
  5200. if err != nil {
  5201. return nil, err
  5202. }
  5203. req.Header = reqHeaders
  5204. googleapi.Expand(req.URL, map[string]string{
  5205. "name": c.name,
  5206. })
  5207. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5208. }
  5209. // Do executes the "firestore.projects.databases.documents.delete" call.
  5210. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5211. // code is an error. Response headers are in either
  5212. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5213. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5214. // check whether the returned error was because http.StatusNotModified
  5215. // was returned.
  5216. func (c *ProjectsDatabasesDocumentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5217. gensupport.SetOptions(c.urlParams_, opts...)
  5218. res, err := c.doRequest("json")
  5219. if res != nil && res.StatusCode == http.StatusNotModified {
  5220. if res.Body != nil {
  5221. res.Body.Close()
  5222. }
  5223. return nil, &googleapi.Error{
  5224. Code: res.StatusCode,
  5225. Header: res.Header,
  5226. }
  5227. }
  5228. if err != nil {
  5229. return nil, err
  5230. }
  5231. defer googleapi.CloseBody(res)
  5232. if err := googleapi.CheckResponse(res); err != nil {
  5233. return nil, err
  5234. }
  5235. ret := &Empty{
  5236. ServerResponse: googleapi.ServerResponse{
  5237. Header: res.Header,
  5238. HTTPStatusCode: res.StatusCode,
  5239. },
  5240. }
  5241. target := &ret
  5242. if err := gensupport.DecodeResponse(target, res); err != nil {
  5243. return nil, err
  5244. }
  5245. return ret, nil
  5246. // {
  5247. // "description": "Deletes a document.",
  5248. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}",
  5249. // "httpMethod": "DELETE",
  5250. // "id": "firestore.projects.databases.documents.delete",
  5251. // "parameterOrder": [
  5252. // "name"
  5253. // ],
  5254. // "parameters": {
  5255. // "currentDocument.exists": {
  5256. // "description": "When set to `true`, the target document must exist.\nWhen set to `false`, the target document must not exist.",
  5257. // "location": "query",
  5258. // "type": "boolean"
  5259. // },
  5260. // "currentDocument.updateTime": {
  5261. // "description": "When set, the target document must exist and have been last updated at\nthat time.",
  5262. // "format": "google-datetime",
  5263. // "location": "query",
  5264. // "type": "string"
  5265. // },
  5266. // "name": {
  5267. // "description": "The resource name of the Document to delete. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.",
  5268. // "location": "path",
  5269. // "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$",
  5270. // "required": true,
  5271. // "type": "string"
  5272. // }
  5273. // },
  5274. // "path": "v1/{+name}",
  5275. // "response": {
  5276. // "$ref": "Empty"
  5277. // },
  5278. // "scopes": [
  5279. // "https://www.googleapis.com/auth/cloud-platform",
  5280. // "https://www.googleapis.com/auth/datastore"
  5281. // ]
  5282. // }
  5283. }
  5284. // method id "firestore.projects.databases.documents.get":
  5285. type ProjectsDatabasesDocumentsGetCall struct {
  5286. s *Service
  5287. name string
  5288. urlParams_ gensupport.URLParams
  5289. ifNoneMatch_ string
  5290. ctx_ context.Context
  5291. header_ http.Header
  5292. }
  5293. // Get: Gets a single document.
  5294. func (r *ProjectsDatabasesDocumentsService) Get(name string) *ProjectsDatabasesDocumentsGetCall {
  5295. c := &ProjectsDatabasesDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5296. c.name = name
  5297. return c
  5298. }
  5299. // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The
  5300. // list of field paths in the mask. See Document.fields for a field
  5301. // path syntax reference.
  5302. func (c *ProjectsDatabasesDocumentsGetCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsGetCall {
  5303. c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...))
  5304. return c
  5305. }
  5306. // ReadTime sets the optional parameter "readTime": Reads the version of
  5307. // the document at the given time.
  5308. // This may not be older than 60 seconds.
  5309. func (c *ProjectsDatabasesDocumentsGetCall) ReadTime(readTime string) *ProjectsDatabasesDocumentsGetCall {
  5310. c.urlParams_.Set("readTime", readTime)
  5311. return c
  5312. }
  5313. // Transaction sets the optional parameter "transaction": Reads the
  5314. // document in a transaction.
  5315. func (c *ProjectsDatabasesDocumentsGetCall) Transaction(transaction string) *ProjectsDatabasesDocumentsGetCall {
  5316. c.urlParams_.Set("transaction", transaction)
  5317. return c
  5318. }
  5319. // Fields allows partial responses to be retrieved. See
  5320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5321. // for more information.
  5322. func (c *ProjectsDatabasesDocumentsGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsGetCall {
  5323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5324. return c
  5325. }
  5326. // IfNoneMatch sets the optional parameter which makes the operation
  5327. // fail if the object's ETag matches the given value. This is useful for
  5328. // getting updates only after the object has changed since the last
  5329. // request. Use googleapi.IsNotModified to check whether the response
  5330. // error from Do is the result of In-None-Match.
  5331. func (c *ProjectsDatabasesDocumentsGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesDocumentsGetCall {
  5332. c.ifNoneMatch_ = entityTag
  5333. return c
  5334. }
  5335. // Context sets the context to be used in this call's Do method. Any
  5336. // pending HTTP request will be aborted if the provided context is
  5337. // canceled.
  5338. func (c *ProjectsDatabasesDocumentsGetCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsGetCall {
  5339. c.ctx_ = ctx
  5340. return c
  5341. }
  5342. // Header returns an http.Header that can be modified by the caller to
  5343. // add HTTP headers to the request.
  5344. func (c *ProjectsDatabasesDocumentsGetCall) Header() http.Header {
  5345. if c.header_ == nil {
  5346. c.header_ = make(http.Header)
  5347. }
  5348. return c.header_
  5349. }
  5350. func (c *ProjectsDatabasesDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  5351. reqHeaders := make(http.Header)
  5352. for k, v := range c.header_ {
  5353. reqHeaders[k] = v
  5354. }
  5355. reqHeaders.Set("User-Agent", c.s.userAgent())
  5356. if c.ifNoneMatch_ != "" {
  5357. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5358. }
  5359. var body io.Reader = nil
  5360. c.urlParams_.Set("alt", alt)
  5361. c.urlParams_.Set("prettyPrint", "false")
  5362. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  5363. urls += "?" + c.urlParams_.Encode()
  5364. req, err := http.NewRequest("GET", urls, body)
  5365. if err != nil {
  5366. return nil, err
  5367. }
  5368. req.Header = reqHeaders
  5369. googleapi.Expand(req.URL, map[string]string{
  5370. "name": c.name,
  5371. })
  5372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5373. }
  5374. // Do executes the "firestore.projects.databases.documents.get" call.
  5375. // Exactly one of *Document or error will be non-nil. Any non-2xx status
  5376. // code is an error. Response headers are in either
  5377. // *Document.ServerResponse.Header or (if a response was returned at
  5378. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5379. // to check whether the returned error was because
  5380. // http.StatusNotModified was returned.
  5381. func (c *ProjectsDatabasesDocumentsGetCall) Do(opts ...googleapi.CallOption) (*Document, error) {
  5382. gensupport.SetOptions(c.urlParams_, opts...)
  5383. res, err := c.doRequest("json")
  5384. if res != nil && res.StatusCode == http.StatusNotModified {
  5385. if res.Body != nil {
  5386. res.Body.Close()
  5387. }
  5388. return nil, &googleapi.Error{
  5389. Code: res.StatusCode,
  5390. Header: res.Header,
  5391. }
  5392. }
  5393. if err != nil {
  5394. return nil, err
  5395. }
  5396. defer googleapi.CloseBody(res)
  5397. if err := googleapi.CheckResponse(res); err != nil {
  5398. return nil, err
  5399. }
  5400. ret := &Document{
  5401. ServerResponse: googleapi.ServerResponse{
  5402. Header: res.Header,
  5403. HTTPStatusCode: res.StatusCode,
  5404. },
  5405. }
  5406. target := &ret
  5407. if err := gensupport.DecodeResponse(target, res); err != nil {
  5408. return nil, err
  5409. }
  5410. return ret, nil
  5411. // {
  5412. // "description": "Gets a single document.",
  5413. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}",
  5414. // "httpMethod": "GET",
  5415. // "id": "firestore.projects.databases.documents.get",
  5416. // "parameterOrder": [
  5417. // "name"
  5418. // ],
  5419. // "parameters": {
  5420. // "mask.fieldPaths": {
  5421. // "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.",
  5422. // "location": "query",
  5423. // "repeated": true,
  5424. // "type": "string"
  5425. // },
  5426. // "name": {
  5427. // "description": "The resource name of the Document to get. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.",
  5428. // "location": "path",
  5429. // "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$",
  5430. // "required": true,
  5431. // "type": "string"
  5432. // },
  5433. // "readTime": {
  5434. // "description": "Reads the version of the document at the given time.\nThis may not be older than 60 seconds.",
  5435. // "format": "google-datetime",
  5436. // "location": "query",
  5437. // "type": "string"
  5438. // },
  5439. // "transaction": {
  5440. // "description": "Reads the document in a transaction.",
  5441. // "format": "byte",
  5442. // "location": "query",
  5443. // "type": "string"
  5444. // }
  5445. // },
  5446. // "path": "v1/{+name}",
  5447. // "response": {
  5448. // "$ref": "Document"
  5449. // },
  5450. // "scopes": [
  5451. // "https://www.googleapis.com/auth/cloud-platform",
  5452. // "https://www.googleapis.com/auth/datastore"
  5453. // ]
  5454. // }
  5455. }
  5456. // method id "firestore.projects.databases.documents.list":
  5457. type ProjectsDatabasesDocumentsListCall struct {
  5458. s *Service
  5459. parent string
  5460. collectionId string
  5461. urlParams_ gensupport.URLParams
  5462. ifNoneMatch_ string
  5463. ctx_ context.Context
  5464. header_ http.Header
  5465. }
  5466. // List: Lists documents.
  5467. func (r *ProjectsDatabasesDocumentsService) List(parent string, collectionId string) *ProjectsDatabasesDocumentsListCall {
  5468. c := &ProjectsDatabasesDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5469. c.parent = parent
  5470. c.collectionId = collectionId
  5471. return c
  5472. }
  5473. // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The
  5474. // list of field paths in the mask. See Document.fields for a field
  5475. // path syntax reference.
  5476. func (c *ProjectsDatabasesDocumentsListCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsListCall {
  5477. c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...))
  5478. return c
  5479. }
  5480. // OrderBy sets the optional parameter "orderBy": The order to sort
  5481. // results by. For example: `priority desc, name`.
  5482. func (c *ProjectsDatabasesDocumentsListCall) OrderBy(orderBy string) *ProjectsDatabasesDocumentsListCall {
  5483. c.urlParams_.Set("orderBy", orderBy)
  5484. return c
  5485. }
  5486. // PageSize sets the optional parameter "pageSize": The maximum number
  5487. // of documents to return.
  5488. func (c *ProjectsDatabasesDocumentsListCall) PageSize(pageSize int64) *ProjectsDatabasesDocumentsListCall {
  5489. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5490. return c
  5491. }
  5492. // PageToken sets the optional parameter "pageToken": The
  5493. // `next_page_token` value returned from a previous List request, if
  5494. // any.
  5495. func (c *ProjectsDatabasesDocumentsListCall) PageToken(pageToken string) *ProjectsDatabasesDocumentsListCall {
  5496. c.urlParams_.Set("pageToken", pageToken)
  5497. return c
  5498. }
  5499. // ReadTime sets the optional parameter "readTime": Reads documents as
  5500. // they were at the given time.
  5501. // This may not be older than 60 seconds.
  5502. func (c *ProjectsDatabasesDocumentsListCall) ReadTime(readTime string) *ProjectsDatabasesDocumentsListCall {
  5503. c.urlParams_.Set("readTime", readTime)
  5504. return c
  5505. }
  5506. // ShowMissing sets the optional parameter "showMissing": If the list
  5507. // should show missing documents. A missing document is a
  5508. // document that does not exist but has sub-documents. These documents
  5509. // will
  5510. // be returned with a key but will not have fields,
  5511. // Document.create_time,
  5512. // or Document.update_time set.
  5513. //
  5514. // Requests with `show_missing` may not specify `where` or
  5515. // `order_by`.
  5516. func (c *ProjectsDatabasesDocumentsListCall) ShowMissing(showMissing bool) *ProjectsDatabasesDocumentsListCall {
  5517. c.urlParams_.Set("showMissing", fmt.Sprint(showMissing))
  5518. return c
  5519. }
  5520. // Transaction sets the optional parameter "transaction": Reads
  5521. // documents in a transaction.
  5522. func (c *ProjectsDatabasesDocumentsListCall) Transaction(transaction string) *ProjectsDatabasesDocumentsListCall {
  5523. c.urlParams_.Set("transaction", transaction)
  5524. return c
  5525. }
  5526. // Fields allows partial responses to be retrieved. See
  5527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5528. // for more information.
  5529. func (c *ProjectsDatabasesDocumentsListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsListCall {
  5530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5531. return c
  5532. }
  5533. // IfNoneMatch sets the optional parameter which makes the operation
  5534. // fail if the object's ETag matches the given value. This is useful for
  5535. // getting updates only after the object has changed since the last
  5536. // request. Use googleapi.IsNotModified to check whether the response
  5537. // error from Do is the result of In-None-Match.
  5538. func (c *ProjectsDatabasesDocumentsListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesDocumentsListCall {
  5539. c.ifNoneMatch_ = entityTag
  5540. return c
  5541. }
  5542. // Context sets the context to be used in this call's Do method. Any
  5543. // pending HTTP request will be aborted if the provided context is
  5544. // canceled.
  5545. func (c *ProjectsDatabasesDocumentsListCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsListCall {
  5546. c.ctx_ = ctx
  5547. return c
  5548. }
  5549. // Header returns an http.Header that can be modified by the caller to
  5550. // add HTTP headers to the request.
  5551. func (c *ProjectsDatabasesDocumentsListCall) Header() http.Header {
  5552. if c.header_ == nil {
  5553. c.header_ = make(http.Header)
  5554. }
  5555. return c.header_
  5556. }
  5557. func (c *ProjectsDatabasesDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  5558. reqHeaders := make(http.Header)
  5559. for k, v := range c.header_ {
  5560. reqHeaders[k] = v
  5561. }
  5562. reqHeaders.Set("User-Agent", c.s.userAgent())
  5563. if c.ifNoneMatch_ != "" {
  5564. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5565. }
  5566. var body io.Reader = nil
  5567. c.urlParams_.Set("alt", alt)
  5568. c.urlParams_.Set("prettyPrint", "false")
  5569. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/{collectionId}")
  5570. urls += "?" + c.urlParams_.Encode()
  5571. req, err := http.NewRequest("GET", urls, body)
  5572. if err != nil {
  5573. return nil, err
  5574. }
  5575. req.Header = reqHeaders
  5576. googleapi.Expand(req.URL, map[string]string{
  5577. "parent": c.parent,
  5578. "collectionId": c.collectionId,
  5579. })
  5580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5581. }
  5582. // Do executes the "firestore.projects.databases.documents.list" call.
  5583. // Exactly one of *ListDocumentsResponse or error will be non-nil. Any
  5584. // non-2xx status code is an error. Response headers are in either
  5585. // *ListDocumentsResponse.ServerResponse.Header or (if a response was
  5586. // returned at all) in error.(*googleapi.Error).Header. Use
  5587. // googleapi.IsNotModified to check whether the returned error was
  5588. // because http.StatusNotModified was returned.
  5589. func (c *ProjectsDatabasesDocumentsListCall) Do(opts ...googleapi.CallOption) (*ListDocumentsResponse, error) {
  5590. gensupport.SetOptions(c.urlParams_, opts...)
  5591. res, err := c.doRequest("json")
  5592. if res != nil && res.StatusCode == http.StatusNotModified {
  5593. if res.Body != nil {
  5594. res.Body.Close()
  5595. }
  5596. return nil, &googleapi.Error{
  5597. Code: res.StatusCode,
  5598. Header: res.Header,
  5599. }
  5600. }
  5601. if err != nil {
  5602. return nil, err
  5603. }
  5604. defer googleapi.CloseBody(res)
  5605. if err := googleapi.CheckResponse(res); err != nil {
  5606. return nil, err
  5607. }
  5608. ret := &ListDocumentsResponse{
  5609. ServerResponse: googleapi.ServerResponse{
  5610. Header: res.Header,
  5611. HTTPStatusCode: res.StatusCode,
  5612. },
  5613. }
  5614. target := &ret
  5615. if err := gensupport.DecodeResponse(target, res); err != nil {
  5616. return nil, err
  5617. }
  5618. return ret, nil
  5619. // {
  5620. // "description": "Lists documents.",
  5621. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}/{collectionId}",
  5622. // "httpMethod": "GET",
  5623. // "id": "firestore.projects.databases.documents.list",
  5624. // "parameterOrder": [
  5625. // "parent",
  5626. // "collectionId"
  5627. // ],
  5628. // "parameters": {
  5629. // "collectionId": {
  5630. // "description": "The collection ID, relative to `parent`, to list. For example: `chatrooms`\nor `messages`.",
  5631. // "location": "path",
  5632. // "required": true,
  5633. // "type": "string"
  5634. // },
  5635. // "mask.fieldPaths": {
  5636. // "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.",
  5637. // "location": "query",
  5638. // "repeated": true,
  5639. // "type": "string"
  5640. // },
  5641. // "orderBy": {
  5642. // "description": "The order to sort results by. For example: `priority desc, name`.",
  5643. // "location": "query",
  5644. // "type": "string"
  5645. // },
  5646. // "pageSize": {
  5647. // "description": "The maximum number of documents to return.",
  5648. // "format": "int32",
  5649. // "location": "query",
  5650. // "type": "integer"
  5651. // },
  5652. // "pageToken": {
  5653. // "description": "The `next_page_token` value returned from a previous List request, if any.",
  5654. // "location": "query",
  5655. // "type": "string"
  5656. // },
  5657. // "parent": {
  5658. // "description": "The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`",
  5659. // "location": "path",
  5660. // "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$",
  5661. // "required": true,
  5662. // "type": "string"
  5663. // },
  5664. // "readTime": {
  5665. // "description": "Reads documents as they were at the given time.\nThis may not be older than 60 seconds.",
  5666. // "format": "google-datetime",
  5667. // "location": "query",
  5668. // "type": "string"
  5669. // },
  5670. // "showMissing": {
  5671. // "description": "If the list should show missing documents. A missing document is a\ndocument that does not exist but has sub-documents. These documents will\nbe returned with a key but will not have fields, Document.create_time,\nor Document.update_time set.\n\nRequests with `show_missing` may not specify `where` or\n`order_by`.",
  5672. // "location": "query",
  5673. // "type": "boolean"
  5674. // },
  5675. // "transaction": {
  5676. // "description": "Reads documents in a transaction.",
  5677. // "format": "byte",
  5678. // "location": "query",
  5679. // "type": "string"
  5680. // }
  5681. // },
  5682. // "path": "v1/{+parent}/{collectionId}",
  5683. // "response": {
  5684. // "$ref": "ListDocumentsResponse"
  5685. // },
  5686. // "scopes": [
  5687. // "https://www.googleapis.com/auth/cloud-platform",
  5688. // "https://www.googleapis.com/auth/datastore"
  5689. // ]
  5690. // }
  5691. }
  5692. // Pages invokes f for each page of results.
  5693. // A non-nil error returned from f will halt the iteration.
  5694. // The provided context supersedes any context provided to the Context method.
  5695. func (c *ProjectsDatabasesDocumentsListCall) Pages(ctx context.Context, f func(*ListDocumentsResponse) error) error {
  5696. c.ctx_ = ctx
  5697. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5698. for {
  5699. x, err := c.Do()
  5700. if err != nil {
  5701. return err
  5702. }
  5703. if err := f(x); err != nil {
  5704. return err
  5705. }
  5706. if x.NextPageToken == "" {
  5707. return nil
  5708. }
  5709. c.PageToken(x.NextPageToken)
  5710. }
  5711. }
  5712. // method id "firestore.projects.databases.documents.listCollectionIds":
  5713. type ProjectsDatabasesDocumentsListCollectionIdsCall struct {
  5714. s *Service
  5715. parent string
  5716. listcollectionidsrequest *ListCollectionIdsRequest
  5717. urlParams_ gensupport.URLParams
  5718. ctx_ context.Context
  5719. header_ http.Header
  5720. }
  5721. // ListCollectionIds: Lists all the collection IDs underneath a
  5722. // document.
  5723. func (r *ProjectsDatabasesDocumentsService) ListCollectionIds(parent string, listcollectionidsrequest *ListCollectionIdsRequest) *ProjectsDatabasesDocumentsListCollectionIdsCall {
  5724. c := &ProjectsDatabasesDocumentsListCollectionIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5725. c.parent = parent
  5726. c.listcollectionidsrequest = listcollectionidsrequest
  5727. return c
  5728. }
  5729. // Fields allows partial responses to be retrieved. See
  5730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5731. // for more information.
  5732. func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsListCollectionIdsCall {
  5733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5734. return c
  5735. }
  5736. // Context sets the context to be used in this call's Do method. Any
  5737. // pending HTTP request will be aborted if the provided context is
  5738. // canceled.
  5739. func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsListCollectionIdsCall {
  5740. c.ctx_ = ctx
  5741. return c
  5742. }
  5743. // Header returns an http.Header that can be modified by the caller to
  5744. // add HTTP headers to the request.
  5745. func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Header() http.Header {
  5746. if c.header_ == nil {
  5747. c.header_ = make(http.Header)
  5748. }
  5749. return c.header_
  5750. }
  5751. func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) doRequest(alt string) (*http.Response, error) {
  5752. reqHeaders := make(http.Header)
  5753. for k, v := range c.header_ {
  5754. reqHeaders[k] = v
  5755. }
  5756. reqHeaders.Set("User-Agent", c.s.userAgent())
  5757. var body io.Reader = nil
  5758. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listcollectionidsrequest)
  5759. if err != nil {
  5760. return nil, err
  5761. }
  5762. reqHeaders.Set("Content-Type", "application/json")
  5763. c.urlParams_.Set("alt", alt)
  5764. c.urlParams_.Set("prettyPrint", "false")
  5765. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:listCollectionIds")
  5766. urls += "?" + c.urlParams_.Encode()
  5767. req, err := http.NewRequest("POST", urls, body)
  5768. if err != nil {
  5769. return nil, err
  5770. }
  5771. req.Header = reqHeaders
  5772. googleapi.Expand(req.URL, map[string]string{
  5773. "parent": c.parent,
  5774. })
  5775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5776. }
  5777. // Do executes the "firestore.projects.databases.documents.listCollectionIds" call.
  5778. // Exactly one of *ListCollectionIdsResponse or error will be non-nil.
  5779. // Any non-2xx status code is an error. Response headers are in either
  5780. // *ListCollectionIdsResponse.ServerResponse.Header or (if a response
  5781. // was returned at all) in error.(*googleapi.Error).Header. Use
  5782. // googleapi.IsNotModified to check whether the returned error was
  5783. // because http.StatusNotModified was returned.
  5784. func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Do(opts ...googleapi.CallOption) (*ListCollectionIdsResponse, error) {
  5785. gensupport.SetOptions(c.urlParams_, opts...)
  5786. res, err := c.doRequest("json")
  5787. if res != nil && res.StatusCode == http.StatusNotModified {
  5788. if res.Body != nil {
  5789. res.Body.Close()
  5790. }
  5791. return nil, &googleapi.Error{
  5792. Code: res.StatusCode,
  5793. Header: res.Header,
  5794. }
  5795. }
  5796. if err != nil {
  5797. return nil, err
  5798. }
  5799. defer googleapi.CloseBody(res)
  5800. if err := googleapi.CheckResponse(res); err != nil {
  5801. return nil, err
  5802. }
  5803. ret := &ListCollectionIdsResponse{
  5804. ServerResponse: googleapi.ServerResponse{
  5805. Header: res.Header,
  5806. HTTPStatusCode: res.StatusCode,
  5807. },
  5808. }
  5809. target := &ret
  5810. if err := gensupport.DecodeResponse(target, res); err != nil {
  5811. return nil, err
  5812. }
  5813. return ret, nil
  5814. // {
  5815. // "description": "Lists all the collection IDs underneath a document.",
  5816. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}:listCollectionIds",
  5817. // "httpMethod": "POST",
  5818. // "id": "firestore.projects.databases.documents.listCollectionIds",
  5819. // "parameterOrder": [
  5820. // "parent"
  5821. // ],
  5822. // "parameters": {
  5823. // "parent": {
  5824. // "description": "The parent document. In the format:\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`",
  5825. // "location": "path",
  5826. // "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$",
  5827. // "required": true,
  5828. // "type": "string"
  5829. // }
  5830. // },
  5831. // "path": "v1/{+parent}:listCollectionIds",
  5832. // "request": {
  5833. // "$ref": "ListCollectionIdsRequest"
  5834. // },
  5835. // "response": {
  5836. // "$ref": "ListCollectionIdsResponse"
  5837. // },
  5838. // "scopes": [
  5839. // "https://www.googleapis.com/auth/cloud-platform",
  5840. // "https://www.googleapis.com/auth/datastore"
  5841. // ]
  5842. // }
  5843. }
  5844. // Pages invokes f for each page of results.
  5845. // A non-nil error returned from f will halt the iteration.
  5846. // The provided context supersedes any context provided to the Context method.
  5847. func (c *ProjectsDatabasesDocumentsListCollectionIdsCall) Pages(ctx context.Context, f func(*ListCollectionIdsResponse) error) error {
  5848. c.ctx_ = ctx
  5849. defer func(pt string) { c.listcollectionidsrequest.PageToken = pt }(c.listcollectionidsrequest.PageToken) // reset paging to original point
  5850. for {
  5851. x, err := c.Do()
  5852. if err != nil {
  5853. return err
  5854. }
  5855. if err := f(x); err != nil {
  5856. return err
  5857. }
  5858. if x.NextPageToken == "" {
  5859. return nil
  5860. }
  5861. c.listcollectionidsrequest.PageToken = x.NextPageToken
  5862. }
  5863. }
  5864. // method id "firestore.projects.databases.documents.listen":
  5865. type ProjectsDatabasesDocumentsListenCall struct {
  5866. s *Service
  5867. database string
  5868. listenrequest *ListenRequest
  5869. urlParams_ gensupport.URLParams
  5870. ctx_ context.Context
  5871. header_ http.Header
  5872. }
  5873. // Listen: Listens to changes.
  5874. func (r *ProjectsDatabasesDocumentsService) Listen(database string, listenrequest *ListenRequest) *ProjectsDatabasesDocumentsListenCall {
  5875. c := &ProjectsDatabasesDocumentsListenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5876. c.database = database
  5877. c.listenrequest = listenrequest
  5878. return c
  5879. }
  5880. // Fields allows partial responses to be retrieved. See
  5881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5882. // for more information.
  5883. func (c *ProjectsDatabasesDocumentsListenCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsListenCall {
  5884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5885. return c
  5886. }
  5887. // Context sets the context to be used in this call's Do method. Any
  5888. // pending HTTP request will be aborted if the provided context is
  5889. // canceled.
  5890. func (c *ProjectsDatabasesDocumentsListenCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsListenCall {
  5891. c.ctx_ = ctx
  5892. return c
  5893. }
  5894. // Header returns an http.Header that can be modified by the caller to
  5895. // add HTTP headers to the request.
  5896. func (c *ProjectsDatabasesDocumentsListenCall) Header() http.Header {
  5897. if c.header_ == nil {
  5898. c.header_ = make(http.Header)
  5899. }
  5900. return c.header_
  5901. }
  5902. func (c *ProjectsDatabasesDocumentsListenCall) doRequest(alt string) (*http.Response, error) {
  5903. reqHeaders := make(http.Header)
  5904. for k, v := range c.header_ {
  5905. reqHeaders[k] = v
  5906. }
  5907. reqHeaders.Set("User-Agent", c.s.userAgent())
  5908. var body io.Reader = nil
  5909. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listenrequest)
  5910. if err != nil {
  5911. return nil, err
  5912. }
  5913. reqHeaders.Set("Content-Type", "application/json")
  5914. c.urlParams_.Set("alt", alt)
  5915. c.urlParams_.Set("prettyPrint", "false")
  5916. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}/documents:listen")
  5917. urls += "?" + c.urlParams_.Encode()
  5918. req, err := http.NewRequest("POST", urls, body)
  5919. if err != nil {
  5920. return nil, err
  5921. }
  5922. req.Header = reqHeaders
  5923. googleapi.Expand(req.URL, map[string]string{
  5924. "database": c.database,
  5925. })
  5926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5927. }
  5928. // Do executes the "firestore.projects.databases.documents.listen" call.
  5929. // Exactly one of *ListenResponse or error will be non-nil. Any non-2xx
  5930. // status code is an error. Response headers are in either
  5931. // *ListenResponse.ServerResponse.Header or (if a response was returned
  5932. // at all) in error.(*googleapi.Error).Header. Use
  5933. // googleapi.IsNotModified to check whether the returned error was
  5934. // because http.StatusNotModified was returned.
  5935. func (c *ProjectsDatabasesDocumentsListenCall) Do(opts ...googleapi.CallOption) (*ListenResponse, error) {
  5936. gensupport.SetOptions(c.urlParams_, opts...)
  5937. res, err := c.doRequest("json")
  5938. if res != nil && res.StatusCode == http.StatusNotModified {
  5939. if res.Body != nil {
  5940. res.Body.Close()
  5941. }
  5942. return nil, &googleapi.Error{
  5943. Code: res.StatusCode,
  5944. Header: res.Header,
  5945. }
  5946. }
  5947. if err != nil {
  5948. return nil, err
  5949. }
  5950. defer googleapi.CloseBody(res)
  5951. if err := googleapi.CheckResponse(res); err != nil {
  5952. return nil, err
  5953. }
  5954. ret := &ListenResponse{
  5955. ServerResponse: googleapi.ServerResponse{
  5956. Header: res.Header,
  5957. HTTPStatusCode: res.StatusCode,
  5958. },
  5959. }
  5960. target := &ret
  5961. if err := gensupport.DecodeResponse(target, res); err != nil {
  5962. return nil, err
  5963. }
  5964. return ret, nil
  5965. // {
  5966. // "description": "Listens to changes.",
  5967. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:listen",
  5968. // "httpMethod": "POST",
  5969. // "id": "firestore.projects.databases.documents.listen",
  5970. // "parameterOrder": [
  5971. // "database"
  5972. // ],
  5973. // "parameters": {
  5974. // "database": {
  5975. // "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.",
  5976. // "location": "path",
  5977. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  5978. // "required": true,
  5979. // "type": "string"
  5980. // }
  5981. // },
  5982. // "path": "v1/{+database}/documents:listen",
  5983. // "request": {
  5984. // "$ref": "ListenRequest"
  5985. // },
  5986. // "response": {
  5987. // "$ref": "ListenResponse"
  5988. // },
  5989. // "scopes": [
  5990. // "https://www.googleapis.com/auth/cloud-platform",
  5991. // "https://www.googleapis.com/auth/datastore"
  5992. // ]
  5993. // }
  5994. }
  5995. // method id "firestore.projects.databases.documents.patch":
  5996. type ProjectsDatabasesDocumentsPatchCall struct {
  5997. s *Service
  5998. name string
  5999. document *Document
  6000. urlParams_ gensupport.URLParams
  6001. ctx_ context.Context
  6002. header_ http.Header
  6003. }
  6004. // Patch: Updates or inserts a document.
  6005. func (r *ProjectsDatabasesDocumentsService) Patch(name string, document *Document) *ProjectsDatabasesDocumentsPatchCall {
  6006. c := &ProjectsDatabasesDocumentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6007. c.name = name
  6008. c.document = document
  6009. return c
  6010. }
  6011. // CurrentDocumentExists sets the optional parameter
  6012. // "currentDocument.exists": When set to `true`, the target document
  6013. // must exist.
  6014. // When set to `false`, the target document must not exist.
  6015. func (c *ProjectsDatabasesDocumentsPatchCall) CurrentDocumentExists(currentDocumentExists bool) *ProjectsDatabasesDocumentsPatchCall {
  6016. c.urlParams_.Set("currentDocument.exists", fmt.Sprint(currentDocumentExists))
  6017. return c
  6018. }
  6019. // CurrentDocumentUpdateTime sets the optional parameter
  6020. // "currentDocument.updateTime": When set, the target document must
  6021. // exist and have been last updated at
  6022. // that time.
  6023. func (c *ProjectsDatabasesDocumentsPatchCall) CurrentDocumentUpdateTime(currentDocumentUpdateTime string) *ProjectsDatabasesDocumentsPatchCall {
  6024. c.urlParams_.Set("currentDocument.updateTime", currentDocumentUpdateTime)
  6025. return c
  6026. }
  6027. // MaskFieldPaths sets the optional parameter "mask.fieldPaths": The
  6028. // list of field paths in the mask. See Document.fields for a field
  6029. // path syntax reference.
  6030. func (c *ProjectsDatabasesDocumentsPatchCall) MaskFieldPaths(maskFieldPaths ...string) *ProjectsDatabasesDocumentsPatchCall {
  6031. c.urlParams_.SetMulti("mask.fieldPaths", append([]string{}, maskFieldPaths...))
  6032. return c
  6033. }
  6034. // UpdateMaskFieldPaths sets the optional parameter
  6035. // "updateMask.fieldPaths": The list of field paths in the mask. See
  6036. // Document.fields for a field
  6037. // path syntax reference.
  6038. func (c *ProjectsDatabasesDocumentsPatchCall) UpdateMaskFieldPaths(updateMaskFieldPaths ...string) *ProjectsDatabasesDocumentsPatchCall {
  6039. c.urlParams_.SetMulti("updateMask.fieldPaths", append([]string{}, updateMaskFieldPaths...))
  6040. return c
  6041. }
  6042. // Fields allows partial responses to be retrieved. See
  6043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6044. // for more information.
  6045. func (c *ProjectsDatabasesDocumentsPatchCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsPatchCall {
  6046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6047. return c
  6048. }
  6049. // Context sets the context to be used in this call's Do method. Any
  6050. // pending HTTP request will be aborted if the provided context is
  6051. // canceled.
  6052. func (c *ProjectsDatabasesDocumentsPatchCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsPatchCall {
  6053. c.ctx_ = ctx
  6054. return c
  6055. }
  6056. // Header returns an http.Header that can be modified by the caller to
  6057. // add HTTP headers to the request.
  6058. func (c *ProjectsDatabasesDocumentsPatchCall) Header() http.Header {
  6059. if c.header_ == nil {
  6060. c.header_ = make(http.Header)
  6061. }
  6062. return c.header_
  6063. }
  6064. func (c *ProjectsDatabasesDocumentsPatchCall) doRequest(alt string) (*http.Response, error) {
  6065. reqHeaders := make(http.Header)
  6066. for k, v := range c.header_ {
  6067. reqHeaders[k] = v
  6068. }
  6069. reqHeaders.Set("User-Agent", c.s.userAgent())
  6070. var body io.Reader = nil
  6071. body, err := googleapi.WithoutDataWrapper.JSONReader(c.document)
  6072. if err != nil {
  6073. return nil, err
  6074. }
  6075. reqHeaders.Set("Content-Type", "application/json")
  6076. c.urlParams_.Set("alt", alt)
  6077. c.urlParams_.Set("prettyPrint", "false")
  6078. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6079. urls += "?" + c.urlParams_.Encode()
  6080. req, err := http.NewRequest("PATCH", urls, body)
  6081. if err != nil {
  6082. return nil, err
  6083. }
  6084. req.Header = reqHeaders
  6085. googleapi.Expand(req.URL, map[string]string{
  6086. "name": c.name,
  6087. })
  6088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6089. }
  6090. // Do executes the "firestore.projects.databases.documents.patch" call.
  6091. // Exactly one of *Document or error will be non-nil. Any non-2xx status
  6092. // code is an error. Response headers are in either
  6093. // *Document.ServerResponse.Header or (if a response was returned at
  6094. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6095. // to check whether the returned error was because
  6096. // http.StatusNotModified was returned.
  6097. func (c *ProjectsDatabasesDocumentsPatchCall) Do(opts ...googleapi.CallOption) (*Document, error) {
  6098. gensupport.SetOptions(c.urlParams_, opts...)
  6099. res, err := c.doRequest("json")
  6100. if res != nil && res.StatusCode == http.StatusNotModified {
  6101. if res.Body != nil {
  6102. res.Body.Close()
  6103. }
  6104. return nil, &googleapi.Error{
  6105. Code: res.StatusCode,
  6106. Header: res.Header,
  6107. }
  6108. }
  6109. if err != nil {
  6110. return nil, err
  6111. }
  6112. defer googleapi.CloseBody(res)
  6113. if err := googleapi.CheckResponse(res); err != nil {
  6114. return nil, err
  6115. }
  6116. ret := &Document{
  6117. ServerResponse: googleapi.ServerResponse{
  6118. Header: res.Header,
  6119. HTTPStatusCode: res.StatusCode,
  6120. },
  6121. }
  6122. target := &ret
  6123. if err := gensupport.DecodeResponse(target, res); err != nil {
  6124. return nil, err
  6125. }
  6126. return ret, nil
  6127. // {
  6128. // "description": "Updates or inserts a document.",
  6129. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}",
  6130. // "httpMethod": "PATCH",
  6131. // "id": "firestore.projects.databases.documents.patch",
  6132. // "parameterOrder": [
  6133. // "name"
  6134. // ],
  6135. // "parameters": {
  6136. // "currentDocument.exists": {
  6137. // "description": "When set to `true`, the target document must exist.\nWhen set to `false`, the target document must not exist.",
  6138. // "location": "query",
  6139. // "type": "boolean"
  6140. // },
  6141. // "currentDocument.updateTime": {
  6142. // "description": "When set, the target document must exist and have been last updated at\nthat time.",
  6143. // "format": "google-datetime",
  6144. // "location": "query",
  6145. // "type": "string"
  6146. // },
  6147. // "mask.fieldPaths": {
  6148. // "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.",
  6149. // "location": "query",
  6150. // "repeated": true,
  6151. // "type": "string"
  6152. // },
  6153. // "name": {
  6154. // "description": "The resource name of the document, for example\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.",
  6155. // "location": "path",
  6156. // "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$",
  6157. // "required": true,
  6158. // "type": "string"
  6159. // },
  6160. // "updateMask.fieldPaths": {
  6161. // "description": "The list of field paths in the mask. See Document.fields for a field\npath syntax reference.",
  6162. // "location": "query",
  6163. // "repeated": true,
  6164. // "type": "string"
  6165. // }
  6166. // },
  6167. // "path": "v1/{+name}",
  6168. // "request": {
  6169. // "$ref": "Document"
  6170. // },
  6171. // "response": {
  6172. // "$ref": "Document"
  6173. // },
  6174. // "scopes": [
  6175. // "https://www.googleapis.com/auth/cloud-platform",
  6176. // "https://www.googleapis.com/auth/datastore"
  6177. // ]
  6178. // }
  6179. }
  6180. // method id "firestore.projects.databases.documents.rollback":
  6181. type ProjectsDatabasesDocumentsRollbackCall struct {
  6182. s *Service
  6183. database string
  6184. rollbackrequest *RollbackRequest
  6185. urlParams_ gensupport.URLParams
  6186. ctx_ context.Context
  6187. header_ http.Header
  6188. }
  6189. // Rollback: Rolls back a transaction.
  6190. func (r *ProjectsDatabasesDocumentsService) Rollback(database string, rollbackrequest *RollbackRequest) *ProjectsDatabasesDocumentsRollbackCall {
  6191. c := &ProjectsDatabasesDocumentsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6192. c.database = database
  6193. c.rollbackrequest = rollbackrequest
  6194. return c
  6195. }
  6196. // Fields allows partial responses to be retrieved. See
  6197. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6198. // for more information.
  6199. func (c *ProjectsDatabasesDocumentsRollbackCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsRollbackCall {
  6200. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6201. return c
  6202. }
  6203. // Context sets the context to be used in this call's Do method. Any
  6204. // pending HTTP request will be aborted if the provided context is
  6205. // canceled.
  6206. func (c *ProjectsDatabasesDocumentsRollbackCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsRollbackCall {
  6207. c.ctx_ = ctx
  6208. return c
  6209. }
  6210. // Header returns an http.Header that can be modified by the caller to
  6211. // add HTTP headers to the request.
  6212. func (c *ProjectsDatabasesDocumentsRollbackCall) Header() http.Header {
  6213. if c.header_ == nil {
  6214. c.header_ = make(http.Header)
  6215. }
  6216. return c.header_
  6217. }
  6218. func (c *ProjectsDatabasesDocumentsRollbackCall) doRequest(alt string) (*http.Response, error) {
  6219. reqHeaders := make(http.Header)
  6220. for k, v := range c.header_ {
  6221. reqHeaders[k] = v
  6222. }
  6223. reqHeaders.Set("User-Agent", c.s.userAgent())
  6224. var body io.Reader = nil
  6225. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest)
  6226. if err != nil {
  6227. return nil, err
  6228. }
  6229. reqHeaders.Set("Content-Type", "application/json")
  6230. c.urlParams_.Set("alt", alt)
  6231. c.urlParams_.Set("prettyPrint", "false")
  6232. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}/documents:rollback")
  6233. urls += "?" + c.urlParams_.Encode()
  6234. req, err := http.NewRequest("POST", urls, body)
  6235. if err != nil {
  6236. return nil, err
  6237. }
  6238. req.Header = reqHeaders
  6239. googleapi.Expand(req.URL, map[string]string{
  6240. "database": c.database,
  6241. })
  6242. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6243. }
  6244. // Do executes the "firestore.projects.databases.documents.rollback" call.
  6245. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  6246. // code is an error. Response headers are in either
  6247. // *Empty.ServerResponse.Header or (if a response was returned at all)
  6248. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6249. // check whether the returned error was because http.StatusNotModified
  6250. // was returned.
  6251. func (c *ProjectsDatabasesDocumentsRollbackCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6252. gensupport.SetOptions(c.urlParams_, opts...)
  6253. res, err := c.doRequest("json")
  6254. if res != nil && res.StatusCode == http.StatusNotModified {
  6255. if res.Body != nil {
  6256. res.Body.Close()
  6257. }
  6258. return nil, &googleapi.Error{
  6259. Code: res.StatusCode,
  6260. Header: res.Header,
  6261. }
  6262. }
  6263. if err != nil {
  6264. return nil, err
  6265. }
  6266. defer googleapi.CloseBody(res)
  6267. if err := googleapi.CheckResponse(res); err != nil {
  6268. return nil, err
  6269. }
  6270. ret := &Empty{
  6271. ServerResponse: googleapi.ServerResponse{
  6272. Header: res.Header,
  6273. HTTPStatusCode: res.StatusCode,
  6274. },
  6275. }
  6276. target := &ret
  6277. if err := gensupport.DecodeResponse(target, res); err != nil {
  6278. return nil, err
  6279. }
  6280. return ret, nil
  6281. // {
  6282. // "description": "Rolls back a transaction.",
  6283. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:rollback",
  6284. // "httpMethod": "POST",
  6285. // "id": "firestore.projects.databases.documents.rollback",
  6286. // "parameterOrder": [
  6287. // "database"
  6288. // ],
  6289. // "parameters": {
  6290. // "database": {
  6291. // "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.",
  6292. // "location": "path",
  6293. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  6294. // "required": true,
  6295. // "type": "string"
  6296. // }
  6297. // },
  6298. // "path": "v1/{+database}/documents:rollback",
  6299. // "request": {
  6300. // "$ref": "RollbackRequest"
  6301. // },
  6302. // "response": {
  6303. // "$ref": "Empty"
  6304. // },
  6305. // "scopes": [
  6306. // "https://www.googleapis.com/auth/cloud-platform",
  6307. // "https://www.googleapis.com/auth/datastore"
  6308. // ]
  6309. // }
  6310. }
  6311. // method id "firestore.projects.databases.documents.runQuery":
  6312. type ProjectsDatabasesDocumentsRunQueryCall struct {
  6313. s *Service
  6314. parent string
  6315. runqueryrequest *RunQueryRequest
  6316. urlParams_ gensupport.URLParams
  6317. ctx_ context.Context
  6318. header_ http.Header
  6319. }
  6320. // RunQuery: Runs a query.
  6321. func (r *ProjectsDatabasesDocumentsService) RunQuery(parent string, runqueryrequest *RunQueryRequest) *ProjectsDatabasesDocumentsRunQueryCall {
  6322. c := &ProjectsDatabasesDocumentsRunQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6323. c.parent = parent
  6324. c.runqueryrequest = runqueryrequest
  6325. return c
  6326. }
  6327. // Fields allows partial responses to be retrieved. See
  6328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6329. // for more information.
  6330. func (c *ProjectsDatabasesDocumentsRunQueryCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsRunQueryCall {
  6331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6332. return c
  6333. }
  6334. // Context sets the context to be used in this call's Do method. Any
  6335. // pending HTTP request will be aborted if the provided context is
  6336. // canceled.
  6337. func (c *ProjectsDatabasesDocumentsRunQueryCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsRunQueryCall {
  6338. c.ctx_ = ctx
  6339. return c
  6340. }
  6341. // Header returns an http.Header that can be modified by the caller to
  6342. // add HTTP headers to the request.
  6343. func (c *ProjectsDatabasesDocumentsRunQueryCall) Header() http.Header {
  6344. if c.header_ == nil {
  6345. c.header_ = make(http.Header)
  6346. }
  6347. return c.header_
  6348. }
  6349. func (c *ProjectsDatabasesDocumentsRunQueryCall) doRequest(alt string) (*http.Response, error) {
  6350. reqHeaders := make(http.Header)
  6351. for k, v := range c.header_ {
  6352. reqHeaders[k] = v
  6353. }
  6354. reqHeaders.Set("User-Agent", c.s.userAgent())
  6355. var body io.Reader = nil
  6356. body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest)
  6357. if err != nil {
  6358. return nil, err
  6359. }
  6360. reqHeaders.Set("Content-Type", "application/json")
  6361. c.urlParams_.Set("alt", alt)
  6362. c.urlParams_.Set("prettyPrint", "false")
  6363. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}:runQuery")
  6364. urls += "?" + c.urlParams_.Encode()
  6365. req, err := http.NewRequest("POST", urls, body)
  6366. if err != nil {
  6367. return nil, err
  6368. }
  6369. req.Header = reqHeaders
  6370. googleapi.Expand(req.URL, map[string]string{
  6371. "parent": c.parent,
  6372. })
  6373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6374. }
  6375. // Do executes the "firestore.projects.databases.documents.runQuery" call.
  6376. // Exactly one of *RunQueryResponse or error will be non-nil. Any
  6377. // non-2xx status code is an error. Response headers are in either
  6378. // *RunQueryResponse.ServerResponse.Header or (if a response was
  6379. // returned at all) in error.(*googleapi.Error).Header. Use
  6380. // googleapi.IsNotModified to check whether the returned error was
  6381. // because http.StatusNotModified was returned.
  6382. func (c *ProjectsDatabasesDocumentsRunQueryCall) Do(opts ...googleapi.CallOption) (*RunQueryResponse, error) {
  6383. gensupport.SetOptions(c.urlParams_, opts...)
  6384. res, err := c.doRequest("json")
  6385. if res != nil && res.StatusCode == http.StatusNotModified {
  6386. if res.Body != nil {
  6387. res.Body.Close()
  6388. }
  6389. return nil, &googleapi.Error{
  6390. Code: res.StatusCode,
  6391. Header: res.Header,
  6392. }
  6393. }
  6394. if err != nil {
  6395. return nil, err
  6396. }
  6397. defer googleapi.CloseBody(res)
  6398. if err := googleapi.CheckResponse(res); err != nil {
  6399. return nil, err
  6400. }
  6401. ret := &RunQueryResponse{
  6402. ServerResponse: googleapi.ServerResponse{
  6403. Header: res.Header,
  6404. HTTPStatusCode: res.StatusCode,
  6405. },
  6406. }
  6407. target := &ret
  6408. if err := gensupport.DecodeResponse(target, res); err != nil {
  6409. return nil, err
  6410. }
  6411. return ret, nil
  6412. // {
  6413. // "description": "Runs a query.",
  6414. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents/{documentsId}/{documentsId1}:runQuery",
  6415. // "httpMethod": "POST",
  6416. // "id": "firestore.projects.databases.documents.runQuery",
  6417. // "parameterOrder": [
  6418. // "parent"
  6419. // ],
  6420. // "parameters": {
  6421. // "parent": {
  6422. // "description": "The parent resource name. In the format:\n`projects/{project_id}/databases/{database_id}/documents` or\n`projects/{project_id}/databases/{database_id}/documents/{document_path}`.\nFor example:\n`projects/my-project/databases/my-database/documents` or\n`projects/my-project/databases/my-database/documents/chatrooms/my-chatroom`",
  6423. // "location": "path",
  6424. // "pattern": "^projects/[^/]+/databases/[^/]+/documents/[^/]+/.+$",
  6425. // "required": true,
  6426. // "type": "string"
  6427. // }
  6428. // },
  6429. // "path": "v1/{+parent}:runQuery",
  6430. // "request": {
  6431. // "$ref": "RunQueryRequest"
  6432. // },
  6433. // "response": {
  6434. // "$ref": "RunQueryResponse"
  6435. // },
  6436. // "scopes": [
  6437. // "https://www.googleapis.com/auth/cloud-platform",
  6438. // "https://www.googleapis.com/auth/datastore"
  6439. // ]
  6440. // }
  6441. }
  6442. // method id "firestore.projects.databases.documents.write":
  6443. type ProjectsDatabasesDocumentsWriteCall struct {
  6444. s *Service
  6445. database string
  6446. writerequest *WriteRequest
  6447. urlParams_ gensupport.URLParams
  6448. ctx_ context.Context
  6449. header_ http.Header
  6450. }
  6451. // Write: Streams batches of document updates and deletes, in order.
  6452. func (r *ProjectsDatabasesDocumentsService) Write(database string, writerequest *WriteRequest) *ProjectsDatabasesDocumentsWriteCall {
  6453. c := &ProjectsDatabasesDocumentsWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6454. c.database = database
  6455. c.writerequest = writerequest
  6456. return c
  6457. }
  6458. // Fields allows partial responses to be retrieved. See
  6459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6460. // for more information.
  6461. func (c *ProjectsDatabasesDocumentsWriteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesDocumentsWriteCall {
  6462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6463. return c
  6464. }
  6465. // Context sets the context to be used in this call's Do method. Any
  6466. // pending HTTP request will be aborted if the provided context is
  6467. // canceled.
  6468. func (c *ProjectsDatabasesDocumentsWriteCall) Context(ctx context.Context) *ProjectsDatabasesDocumentsWriteCall {
  6469. c.ctx_ = ctx
  6470. return c
  6471. }
  6472. // Header returns an http.Header that can be modified by the caller to
  6473. // add HTTP headers to the request.
  6474. func (c *ProjectsDatabasesDocumentsWriteCall) Header() http.Header {
  6475. if c.header_ == nil {
  6476. c.header_ = make(http.Header)
  6477. }
  6478. return c.header_
  6479. }
  6480. func (c *ProjectsDatabasesDocumentsWriteCall) doRequest(alt string) (*http.Response, error) {
  6481. reqHeaders := make(http.Header)
  6482. for k, v := range c.header_ {
  6483. reqHeaders[k] = v
  6484. }
  6485. reqHeaders.Set("User-Agent", c.s.userAgent())
  6486. var body io.Reader = nil
  6487. body, err := googleapi.WithoutDataWrapper.JSONReader(c.writerequest)
  6488. if err != nil {
  6489. return nil, err
  6490. }
  6491. reqHeaders.Set("Content-Type", "application/json")
  6492. c.urlParams_.Set("alt", alt)
  6493. c.urlParams_.Set("prettyPrint", "false")
  6494. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+database}/documents:write")
  6495. urls += "?" + c.urlParams_.Encode()
  6496. req, err := http.NewRequest("POST", urls, body)
  6497. if err != nil {
  6498. return nil, err
  6499. }
  6500. req.Header = reqHeaders
  6501. googleapi.Expand(req.URL, map[string]string{
  6502. "database": c.database,
  6503. })
  6504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6505. }
  6506. // Do executes the "firestore.projects.databases.documents.write" call.
  6507. // Exactly one of *WriteResponse or error will be non-nil. Any non-2xx
  6508. // status code is an error. Response headers are in either
  6509. // *WriteResponse.ServerResponse.Header or (if a response was returned
  6510. // at all) in error.(*googleapi.Error).Header. Use
  6511. // googleapi.IsNotModified to check whether the returned error was
  6512. // because http.StatusNotModified was returned.
  6513. func (c *ProjectsDatabasesDocumentsWriteCall) Do(opts ...googleapi.CallOption) (*WriteResponse, error) {
  6514. gensupport.SetOptions(c.urlParams_, opts...)
  6515. res, err := c.doRequest("json")
  6516. if res != nil && res.StatusCode == http.StatusNotModified {
  6517. if res.Body != nil {
  6518. res.Body.Close()
  6519. }
  6520. return nil, &googleapi.Error{
  6521. Code: res.StatusCode,
  6522. Header: res.Header,
  6523. }
  6524. }
  6525. if err != nil {
  6526. return nil, err
  6527. }
  6528. defer googleapi.CloseBody(res)
  6529. if err := googleapi.CheckResponse(res); err != nil {
  6530. return nil, err
  6531. }
  6532. ret := &WriteResponse{
  6533. ServerResponse: googleapi.ServerResponse{
  6534. Header: res.Header,
  6535. HTTPStatusCode: res.StatusCode,
  6536. },
  6537. }
  6538. target := &ret
  6539. if err := gensupport.DecodeResponse(target, res); err != nil {
  6540. return nil, err
  6541. }
  6542. return ret, nil
  6543. // {
  6544. // "description": "Streams batches of document updates and deletes, in order.",
  6545. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/documents:write",
  6546. // "httpMethod": "POST",
  6547. // "id": "firestore.projects.databases.documents.write",
  6548. // "parameterOrder": [
  6549. // "database"
  6550. // ],
  6551. // "parameters": {
  6552. // "database": {
  6553. // "description": "The database name. In the format:\n`projects/{project_id}/databases/{database_id}`.\nThis is only required in the first message.",
  6554. // "location": "path",
  6555. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  6556. // "required": true,
  6557. // "type": "string"
  6558. // }
  6559. // },
  6560. // "path": "v1/{+database}/documents:write",
  6561. // "request": {
  6562. // "$ref": "WriteRequest"
  6563. // },
  6564. // "response": {
  6565. // "$ref": "WriteResponse"
  6566. // },
  6567. // "scopes": [
  6568. // "https://www.googleapis.com/auth/cloud-platform",
  6569. // "https://www.googleapis.com/auth/datastore"
  6570. // ]
  6571. // }
  6572. }
  6573. // method id "firestore.projects.databases.operations.cancel":
  6574. type ProjectsDatabasesOperationsCancelCall struct {
  6575. s *Service
  6576. name string
  6577. googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest
  6578. urlParams_ gensupport.URLParams
  6579. ctx_ context.Context
  6580. header_ http.Header
  6581. }
  6582. // Cancel: Starts asynchronous cancellation on a long-running operation.
  6583. // The server
  6584. // makes a best effort to cancel the operation, but success is
  6585. // not
  6586. // guaranteed. If the server doesn't support this method, it
  6587. // returns
  6588. // `google.rpc.Code.UNIMPLEMENTED`. Clients can
  6589. // use
  6590. // Operations.GetOperation or
  6591. // other methods to check whether the cancellation succeeded or whether
  6592. // the
  6593. // operation completed despite cancellation. On successful
  6594. // cancellation,
  6595. // the operation is not deleted; instead, it becomes an operation
  6596. // with
  6597. // an Operation.error value with a google.rpc.Status.code of
  6598. // 1,
  6599. // corresponding to `Code.CANCELLED`.
  6600. func (r *ProjectsDatabasesOperationsService) Cancel(name string, googlelongrunningcanceloperationrequest *GoogleLongrunningCancelOperationRequest) *ProjectsDatabasesOperationsCancelCall {
  6601. c := &ProjectsDatabasesOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6602. c.name = name
  6603. c.googlelongrunningcanceloperationrequest = googlelongrunningcanceloperationrequest
  6604. return c
  6605. }
  6606. // Fields allows partial responses to be retrieved. See
  6607. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6608. // for more information.
  6609. func (c *ProjectsDatabasesOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsDatabasesOperationsCancelCall {
  6610. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6611. return c
  6612. }
  6613. // Context sets the context to be used in this call's Do method. Any
  6614. // pending HTTP request will be aborted if the provided context is
  6615. // canceled.
  6616. func (c *ProjectsDatabasesOperationsCancelCall) Context(ctx context.Context) *ProjectsDatabasesOperationsCancelCall {
  6617. c.ctx_ = ctx
  6618. return c
  6619. }
  6620. // Header returns an http.Header that can be modified by the caller to
  6621. // add HTTP headers to the request.
  6622. func (c *ProjectsDatabasesOperationsCancelCall) Header() http.Header {
  6623. if c.header_ == nil {
  6624. c.header_ = make(http.Header)
  6625. }
  6626. return c.header_
  6627. }
  6628. func (c *ProjectsDatabasesOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  6629. reqHeaders := make(http.Header)
  6630. for k, v := range c.header_ {
  6631. reqHeaders[k] = v
  6632. }
  6633. reqHeaders.Set("User-Agent", c.s.userAgent())
  6634. var body io.Reader = nil
  6635. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningcanceloperationrequest)
  6636. if err != nil {
  6637. return nil, err
  6638. }
  6639. reqHeaders.Set("Content-Type", "application/json")
  6640. c.urlParams_.Set("alt", alt)
  6641. c.urlParams_.Set("prettyPrint", "false")
  6642. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  6643. urls += "?" + c.urlParams_.Encode()
  6644. req, err := http.NewRequest("POST", urls, body)
  6645. if err != nil {
  6646. return nil, err
  6647. }
  6648. req.Header = reqHeaders
  6649. googleapi.Expand(req.URL, map[string]string{
  6650. "name": c.name,
  6651. })
  6652. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6653. }
  6654. // Do executes the "firestore.projects.databases.operations.cancel" call.
  6655. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  6656. // code is an error. Response headers are in either
  6657. // *Empty.ServerResponse.Header or (if a response was returned at all)
  6658. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6659. // check whether the returned error was because http.StatusNotModified
  6660. // was returned.
  6661. func (c *ProjectsDatabasesOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6662. gensupport.SetOptions(c.urlParams_, opts...)
  6663. res, err := c.doRequest("json")
  6664. if res != nil && res.StatusCode == http.StatusNotModified {
  6665. if res.Body != nil {
  6666. res.Body.Close()
  6667. }
  6668. return nil, &googleapi.Error{
  6669. Code: res.StatusCode,
  6670. Header: res.Header,
  6671. }
  6672. }
  6673. if err != nil {
  6674. return nil, err
  6675. }
  6676. defer googleapi.CloseBody(res)
  6677. if err := googleapi.CheckResponse(res); err != nil {
  6678. return nil, err
  6679. }
  6680. ret := &Empty{
  6681. ServerResponse: googleapi.ServerResponse{
  6682. Header: res.Header,
  6683. HTTPStatusCode: res.StatusCode,
  6684. },
  6685. }
  6686. target := &ret
  6687. if err := gensupport.DecodeResponse(target, res); err != nil {
  6688. return nil, err
  6689. }
  6690. return ret, nil
  6691. // {
  6692. // "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.",
  6693. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/operations/{operationsId}:cancel",
  6694. // "httpMethod": "POST",
  6695. // "id": "firestore.projects.databases.operations.cancel",
  6696. // "parameterOrder": [
  6697. // "name"
  6698. // ],
  6699. // "parameters": {
  6700. // "name": {
  6701. // "description": "The name of the operation resource to be cancelled.",
  6702. // "location": "path",
  6703. // "pattern": "^projects/[^/]+/databases/[^/]+/operations/[^/]+$",
  6704. // "required": true,
  6705. // "type": "string"
  6706. // }
  6707. // },
  6708. // "path": "v1/{+name}:cancel",
  6709. // "request": {
  6710. // "$ref": "GoogleLongrunningCancelOperationRequest"
  6711. // },
  6712. // "response": {
  6713. // "$ref": "Empty"
  6714. // },
  6715. // "scopes": [
  6716. // "https://www.googleapis.com/auth/cloud-platform",
  6717. // "https://www.googleapis.com/auth/datastore"
  6718. // ]
  6719. // }
  6720. }
  6721. // method id "firestore.projects.databases.operations.delete":
  6722. type ProjectsDatabasesOperationsDeleteCall struct {
  6723. s *Service
  6724. name string
  6725. urlParams_ gensupport.URLParams
  6726. ctx_ context.Context
  6727. header_ http.Header
  6728. }
  6729. // Delete: Deletes a long-running operation. This method indicates that
  6730. // the client is
  6731. // no longer interested in the operation result. It does not cancel
  6732. // the
  6733. // operation. If the server doesn't support this method, it
  6734. // returns
  6735. // `google.rpc.Code.UNIMPLEMENTED`.
  6736. func (r *ProjectsDatabasesOperationsService) Delete(name string) *ProjectsDatabasesOperationsDeleteCall {
  6737. c := &ProjectsDatabasesOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6738. c.name = name
  6739. return c
  6740. }
  6741. // Fields allows partial responses to be retrieved. See
  6742. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6743. // for more information.
  6744. func (c *ProjectsDatabasesOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDatabasesOperationsDeleteCall {
  6745. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6746. return c
  6747. }
  6748. // Context sets the context to be used in this call's Do method. Any
  6749. // pending HTTP request will be aborted if the provided context is
  6750. // canceled.
  6751. func (c *ProjectsDatabasesOperationsDeleteCall) Context(ctx context.Context) *ProjectsDatabasesOperationsDeleteCall {
  6752. c.ctx_ = ctx
  6753. return c
  6754. }
  6755. // Header returns an http.Header that can be modified by the caller to
  6756. // add HTTP headers to the request.
  6757. func (c *ProjectsDatabasesOperationsDeleteCall) Header() http.Header {
  6758. if c.header_ == nil {
  6759. c.header_ = make(http.Header)
  6760. }
  6761. return c.header_
  6762. }
  6763. func (c *ProjectsDatabasesOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6764. reqHeaders := make(http.Header)
  6765. for k, v := range c.header_ {
  6766. reqHeaders[k] = v
  6767. }
  6768. reqHeaders.Set("User-Agent", c.s.userAgent())
  6769. var body io.Reader = nil
  6770. c.urlParams_.Set("alt", alt)
  6771. c.urlParams_.Set("prettyPrint", "false")
  6772. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6773. urls += "?" + c.urlParams_.Encode()
  6774. req, err := http.NewRequest("DELETE", urls, body)
  6775. if err != nil {
  6776. return nil, err
  6777. }
  6778. req.Header = reqHeaders
  6779. googleapi.Expand(req.URL, map[string]string{
  6780. "name": c.name,
  6781. })
  6782. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6783. }
  6784. // Do executes the "firestore.projects.databases.operations.delete" call.
  6785. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  6786. // code is an error. Response headers are in either
  6787. // *Empty.ServerResponse.Header or (if a response was returned at all)
  6788. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6789. // check whether the returned error was because http.StatusNotModified
  6790. // was returned.
  6791. func (c *ProjectsDatabasesOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6792. gensupport.SetOptions(c.urlParams_, opts...)
  6793. res, err := c.doRequest("json")
  6794. if res != nil && res.StatusCode == http.StatusNotModified {
  6795. if res.Body != nil {
  6796. res.Body.Close()
  6797. }
  6798. return nil, &googleapi.Error{
  6799. Code: res.StatusCode,
  6800. Header: res.Header,
  6801. }
  6802. }
  6803. if err != nil {
  6804. return nil, err
  6805. }
  6806. defer googleapi.CloseBody(res)
  6807. if err := googleapi.CheckResponse(res); err != nil {
  6808. return nil, err
  6809. }
  6810. ret := &Empty{
  6811. ServerResponse: googleapi.ServerResponse{
  6812. Header: res.Header,
  6813. HTTPStatusCode: res.StatusCode,
  6814. },
  6815. }
  6816. target := &ret
  6817. if err := gensupport.DecodeResponse(target, res); err != nil {
  6818. return nil, err
  6819. }
  6820. return ret, nil
  6821. // {
  6822. // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
  6823. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/operations/{operationsId}",
  6824. // "httpMethod": "DELETE",
  6825. // "id": "firestore.projects.databases.operations.delete",
  6826. // "parameterOrder": [
  6827. // "name"
  6828. // ],
  6829. // "parameters": {
  6830. // "name": {
  6831. // "description": "The name of the operation resource to be deleted.",
  6832. // "location": "path",
  6833. // "pattern": "^projects/[^/]+/databases/[^/]+/operations/[^/]+$",
  6834. // "required": true,
  6835. // "type": "string"
  6836. // }
  6837. // },
  6838. // "path": "v1/{+name}",
  6839. // "response": {
  6840. // "$ref": "Empty"
  6841. // },
  6842. // "scopes": [
  6843. // "https://www.googleapis.com/auth/cloud-platform",
  6844. // "https://www.googleapis.com/auth/datastore"
  6845. // ]
  6846. // }
  6847. }
  6848. // method id "firestore.projects.databases.operations.get":
  6849. type ProjectsDatabasesOperationsGetCall struct {
  6850. s *Service
  6851. name string
  6852. urlParams_ gensupport.URLParams
  6853. ifNoneMatch_ string
  6854. ctx_ context.Context
  6855. header_ http.Header
  6856. }
  6857. // Get: Gets the latest state of a long-running operation. Clients can
  6858. // use this
  6859. // method to poll the operation result at intervals as recommended by
  6860. // the API
  6861. // service.
  6862. func (r *ProjectsDatabasesOperationsService) Get(name string) *ProjectsDatabasesOperationsGetCall {
  6863. c := &ProjectsDatabasesOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6864. c.name = name
  6865. return c
  6866. }
  6867. // Fields allows partial responses to be retrieved. See
  6868. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6869. // for more information.
  6870. func (c *ProjectsDatabasesOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsDatabasesOperationsGetCall {
  6871. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6872. return c
  6873. }
  6874. // IfNoneMatch sets the optional parameter which makes the operation
  6875. // fail if the object's ETag matches the given value. This is useful for
  6876. // getting updates only after the object has changed since the last
  6877. // request. Use googleapi.IsNotModified to check whether the response
  6878. // error from Do is the result of In-None-Match.
  6879. func (c *ProjectsDatabasesOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsDatabasesOperationsGetCall {
  6880. c.ifNoneMatch_ = entityTag
  6881. return c
  6882. }
  6883. // Context sets the context to be used in this call's Do method. Any
  6884. // pending HTTP request will be aborted if the provided context is
  6885. // canceled.
  6886. func (c *ProjectsDatabasesOperationsGetCall) Context(ctx context.Context) *ProjectsDatabasesOperationsGetCall {
  6887. c.ctx_ = ctx
  6888. return c
  6889. }
  6890. // Header returns an http.Header that can be modified by the caller to
  6891. // add HTTP headers to the request.
  6892. func (c *ProjectsDatabasesOperationsGetCall) Header() http.Header {
  6893. if c.header_ == nil {
  6894. c.header_ = make(http.Header)
  6895. }
  6896. return c.header_
  6897. }
  6898. func (c *ProjectsDatabasesOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  6899. reqHeaders := make(http.Header)
  6900. for k, v := range c.header_ {
  6901. reqHeaders[k] = v
  6902. }
  6903. reqHeaders.Set("User-Agent", c.s.userAgent())
  6904. if c.ifNoneMatch_ != "" {
  6905. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6906. }
  6907. var body io.Reader = nil
  6908. c.urlParams_.Set("alt", alt)
  6909. c.urlParams_.Set("prettyPrint", "false")
  6910. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  6911. urls += "?" + c.urlParams_.Encode()
  6912. req, err := http.NewRequest("GET", urls, body)
  6913. if err != nil {
  6914. return nil, err
  6915. }
  6916. req.Header = reqHeaders
  6917. googleapi.Expand(req.URL, map[string]string{
  6918. "name": c.name,
  6919. })
  6920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6921. }
  6922. // Do executes the "firestore.projects.databases.operations.get" call.
  6923. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  6924. // Any non-2xx status code is an error. Response headers are in either
  6925. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  6926. // was returned at all) in error.(*googleapi.Error).Header. Use
  6927. // googleapi.IsNotModified to check whether the returned error was
  6928. // because http.StatusNotModified was returned.
  6929. func (c *ProjectsDatabasesOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  6930. gensupport.SetOptions(c.urlParams_, opts...)
  6931. res, err := c.doRequest("json")
  6932. if res != nil && res.StatusCode == http.StatusNotModified {
  6933. if res.Body != nil {
  6934. res.Body.Close()
  6935. }
  6936. return nil, &googleapi.Error{
  6937. Code: res.StatusCode,
  6938. Header: res.Header,
  6939. }
  6940. }
  6941. if err != nil {
  6942. return nil, err
  6943. }
  6944. defer googleapi.CloseBody(res)
  6945. if err := googleapi.CheckResponse(res); err != nil {
  6946. return nil, err
  6947. }
  6948. ret := &GoogleLongrunningOperation{
  6949. ServerResponse: googleapi.ServerResponse{
  6950. Header: res.Header,
  6951. HTTPStatusCode: res.StatusCode,
  6952. },
  6953. }
  6954. target := &ret
  6955. if err := gensupport.DecodeResponse(target, res); err != nil {
  6956. return nil, err
  6957. }
  6958. return ret, nil
  6959. // {
  6960. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  6961. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/operations/{operationsId}",
  6962. // "httpMethod": "GET",
  6963. // "id": "firestore.projects.databases.operations.get",
  6964. // "parameterOrder": [
  6965. // "name"
  6966. // ],
  6967. // "parameters": {
  6968. // "name": {
  6969. // "description": "The name of the operation resource.",
  6970. // "location": "path",
  6971. // "pattern": "^projects/[^/]+/databases/[^/]+/operations/[^/]+$",
  6972. // "required": true,
  6973. // "type": "string"
  6974. // }
  6975. // },
  6976. // "path": "v1/{+name}",
  6977. // "response": {
  6978. // "$ref": "GoogleLongrunningOperation"
  6979. // },
  6980. // "scopes": [
  6981. // "https://www.googleapis.com/auth/cloud-platform",
  6982. // "https://www.googleapis.com/auth/datastore"
  6983. // ]
  6984. // }
  6985. }
  6986. // method id "firestore.projects.databases.operations.list":
  6987. type ProjectsDatabasesOperationsListCall struct {
  6988. s *Service
  6989. name string
  6990. urlParams_ gensupport.URLParams
  6991. ifNoneMatch_ string
  6992. ctx_ context.Context
  6993. header_ http.Header
  6994. }
  6995. // List: Lists operations that match the specified filter in the
  6996. // request. If the
  6997. // server doesn't support this method, it returns
  6998. // `UNIMPLEMENTED`.
  6999. //
  7000. // NOTE: the `name` binding allows API services to override the
  7001. // binding
  7002. // to use different resource name schemes, such as `users/*/operations`.
  7003. // To
  7004. // override the binding, API services can add a binding such
  7005. // as
  7006. // "/v1/{name=users/*}/operations" to their service configuration.
  7007. // For backwards compatibility, the default name includes the
  7008. // operations
  7009. // collection id, however overriding users must ensure the name
  7010. // binding
  7011. // is the parent resource, without the operations collection id.
  7012. func (r *ProjectsDatabasesOperationsService) List(name string) *ProjectsDatabasesOperationsListCall {
  7013. c := &ProjectsDatabasesOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7014. c.name = name
  7015. return c
  7016. }
  7017. // Filter sets the optional parameter "filter": The standard list
  7018. // filter.
  7019. func (c *ProjectsDatabasesOperationsListCall) Filter(filter string) *ProjectsDatabasesOperationsListCall {
  7020. c.urlParams_.Set("filter", filter)
  7021. return c
  7022. }
  7023. // PageSize sets the optional parameter "pageSize": The standard list
  7024. // page size.
  7025. func (c *ProjectsDatabasesOperationsListCall) PageSize(pageSize int64) *ProjectsDatabasesOperationsListCall {
  7026. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7027. return c
  7028. }
  7029. // PageToken sets the optional parameter "pageToken": The standard list
  7030. // page token.
  7031. func (c *ProjectsDatabasesOperationsListCall) PageToken(pageToken string) *ProjectsDatabasesOperationsListCall {
  7032. c.urlParams_.Set("pageToken", pageToken)
  7033. return c
  7034. }
  7035. // Fields allows partial responses to be retrieved. See
  7036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7037. // for more information.
  7038. func (c *ProjectsDatabasesOperationsListCall) Fields(s ...googleapi.Field) *ProjectsDatabasesOperationsListCall {
  7039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7040. return c
  7041. }
  7042. // IfNoneMatch sets the optional parameter which makes the operation
  7043. // fail if the object's ETag matches the given value. This is useful for
  7044. // getting updates only after the object has changed since the last
  7045. // request. Use googleapi.IsNotModified to check whether the response
  7046. // error from Do is the result of In-None-Match.
  7047. func (c *ProjectsDatabasesOperationsListCall) IfNoneMatch(entityTag string) *ProjectsDatabasesOperationsListCall {
  7048. c.ifNoneMatch_ = entityTag
  7049. return c
  7050. }
  7051. // Context sets the context to be used in this call's Do method. Any
  7052. // pending HTTP request will be aborted if the provided context is
  7053. // canceled.
  7054. func (c *ProjectsDatabasesOperationsListCall) Context(ctx context.Context) *ProjectsDatabasesOperationsListCall {
  7055. c.ctx_ = ctx
  7056. return c
  7057. }
  7058. // Header returns an http.Header that can be modified by the caller to
  7059. // add HTTP headers to the request.
  7060. func (c *ProjectsDatabasesOperationsListCall) Header() http.Header {
  7061. if c.header_ == nil {
  7062. c.header_ = make(http.Header)
  7063. }
  7064. return c.header_
  7065. }
  7066. func (c *ProjectsDatabasesOperationsListCall) doRequest(alt string) (*http.Response, error) {
  7067. reqHeaders := make(http.Header)
  7068. for k, v := range c.header_ {
  7069. reqHeaders[k] = v
  7070. }
  7071. reqHeaders.Set("User-Agent", c.s.userAgent())
  7072. if c.ifNoneMatch_ != "" {
  7073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7074. }
  7075. var body io.Reader = nil
  7076. c.urlParams_.Set("alt", alt)
  7077. c.urlParams_.Set("prettyPrint", "false")
  7078. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  7079. urls += "?" + c.urlParams_.Encode()
  7080. req, err := http.NewRequest("GET", urls, body)
  7081. if err != nil {
  7082. return nil, err
  7083. }
  7084. req.Header = reqHeaders
  7085. googleapi.Expand(req.URL, map[string]string{
  7086. "name": c.name,
  7087. })
  7088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7089. }
  7090. // Do executes the "firestore.projects.databases.operations.list" call.
  7091. // Exactly one of *GoogleLongrunningListOperationsResponse or error will
  7092. // be non-nil. Any non-2xx status code is an error. Response headers are
  7093. // in either
  7094. // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if
  7095. // a response was returned at all) in error.(*googleapi.Error).Header.
  7096. // Use googleapi.IsNotModified to check whether the returned error was
  7097. // because http.StatusNotModified was returned.
  7098. func (c *ProjectsDatabasesOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
  7099. gensupport.SetOptions(c.urlParams_, opts...)
  7100. res, err := c.doRequest("json")
  7101. if res != nil && res.StatusCode == http.StatusNotModified {
  7102. if res.Body != nil {
  7103. res.Body.Close()
  7104. }
  7105. return nil, &googleapi.Error{
  7106. Code: res.StatusCode,
  7107. Header: res.Header,
  7108. }
  7109. }
  7110. if err != nil {
  7111. return nil, err
  7112. }
  7113. defer googleapi.CloseBody(res)
  7114. if err := googleapi.CheckResponse(res); err != nil {
  7115. return nil, err
  7116. }
  7117. ret := &GoogleLongrunningListOperationsResponse{
  7118. ServerResponse: googleapi.ServerResponse{
  7119. Header: res.Header,
  7120. HTTPStatusCode: res.StatusCode,
  7121. },
  7122. }
  7123. target := &ret
  7124. if err := gensupport.DecodeResponse(target, res); err != nil {
  7125. return nil, err
  7126. }
  7127. return ret, nil
  7128. // {
  7129. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  7130. // "flatPath": "v1/projects/{projectsId}/databases/{databasesId}/operations",
  7131. // "httpMethod": "GET",
  7132. // "id": "firestore.projects.databases.operations.list",
  7133. // "parameterOrder": [
  7134. // "name"
  7135. // ],
  7136. // "parameters": {
  7137. // "filter": {
  7138. // "description": "The standard list filter.",
  7139. // "location": "query",
  7140. // "type": "string"
  7141. // },
  7142. // "name": {
  7143. // "description": "The name of the operation's parent resource.",
  7144. // "location": "path",
  7145. // "pattern": "^projects/[^/]+/databases/[^/]+$",
  7146. // "required": true,
  7147. // "type": "string"
  7148. // },
  7149. // "pageSize": {
  7150. // "description": "The standard list page size.",
  7151. // "format": "int32",
  7152. // "location": "query",
  7153. // "type": "integer"
  7154. // },
  7155. // "pageToken": {
  7156. // "description": "The standard list page token.",
  7157. // "location": "query",
  7158. // "type": "string"
  7159. // }
  7160. // },
  7161. // "path": "v1/{+name}/operations",
  7162. // "response": {
  7163. // "$ref": "GoogleLongrunningListOperationsResponse"
  7164. // },
  7165. // "scopes": [
  7166. // "https://www.googleapis.com/auth/cloud-platform",
  7167. // "https://www.googleapis.com/auth/datastore"
  7168. // ]
  7169. // }
  7170. }
  7171. // Pages invokes f for each page of results.
  7172. // A non-nil error returned from f will halt the iteration.
  7173. // The provided context supersedes any context provided to the Context method.
  7174. func (c *ProjectsDatabasesOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
  7175. c.ctx_ = ctx
  7176. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7177. for {
  7178. x, err := c.Do()
  7179. if err != nil {
  7180. return err
  7181. }
  7182. if err := f(x); err != nil {
  7183. return err
  7184. }
  7185. if x.NextPageToken == "" {
  7186. return nil
  7187. }
  7188. c.PageToken(x.NextPageToken)
  7189. }
  7190. }
  7191. // method id "firestore.projects.locations.get":
  7192. type ProjectsLocationsGetCall struct {
  7193. s *Service
  7194. name string
  7195. urlParams_ gensupport.URLParams
  7196. ifNoneMatch_ string
  7197. ctx_ context.Context
  7198. header_ http.Header
  7199. }
  7200. // Get: Gets information about a location.
  7201. func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
  7202. c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7203. c.name = name
  7204. return c
  7205. }
  7206. // Fields allows partial responses to be retrieved. See
  7207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7208. // for more information.
  7209. func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
  7210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7211. return c
  7212. }
  7213. // IfNoneMatch sets the optional parameter which makes the operation
  7214. // fail if the object's ETag matches the given value. This is useful for
  7215. // getting updates only after the object has changed since the last
  7216. // request. Use googleapi.IsNotModified to check whether the response
  7217. // error from Do is the result of In-None-Match.
  7218. func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
  7219. c.ifNoneMatch_ = entityTag
  7220. return c
  7221. }
  7222. // Context sets the context to be used in this call's Do method. Any
  7223. // pending HTTP request will be aborted if the provided context is
  7224. // canceled.
  7225. func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
  7226. c.ctx_ = ctx
  7227. return c
  7228. }
  7229. // Header returns an http.Header that can be modified by the caller to
  7230. // add HTTP headers to the request.
  7231. func (c *ProjectsLocationsGetCall) Header() http.Header {
  7232. if c.header_ == nil {
  7233. c.header_ = make(http.Header)
  7234. }
  7235. return c.header_
  7236. }
  7237. func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
  7238. reqHeaders := make(http.Header)
  7239. for k, v := range c.header_ {
  7240. reqHeaders[k] = v
  7241. }
  7242. reqHeaders.Set("User-Agent", c.s.userAgent())
  7243. if c.ifNoneMatch_ != "" {
  7244. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7245. }
  7246. var body io.Reader = nil
  7247. c.urlParams_.Set("alt", alt)
  7248. c.urlParams_.Set("prettyPrint", "false")
  7249. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  7250. urls += "?" + c.urlParams_.Encode()
  7251. req, err := http.NewRequest("GET", urls, body)
  7252. if err != nil {
  7253. return nil, err
  7254. }
  7255. req.Header = reqHeaders
  7256. googleapi.Expand(req.URL, map[string]string{
  7257. "name": c.name,
  7258. })
  7259. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7260. }
  7261. // Do executes the "firestore.projects.locations.get" call.
  7262. // Exactly one of *Location or error will be non-nil. Any non-2xx status
  7263. // code is an error. Response headers are in either
  7264. // *Location.ServerResponse.Header or (if a response was returned at
  7265. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7266. // to check whether the returned error was because
  7267. // http.StatusNotModified was returned.
  7268. func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  7269. gensupport.SetOptions(c.urlParams_, opts...)
  7270. res, err := c.doRequest("json")
  7271. if res != nil && res.StatusCode == http.StatusNotModified {
  7272. if res.Body != nil {
  7273. res.Body.Close()
  7274. }
  7275. return nil, &googleapi.Error{
  7276. Code: res.StatusCode,
  7277. Header: res.Header,
  7278. }
  7279. }
  7280. if err != nil {
  7281. return nil, err
  7282. }
  7283. defer googleapi.CloseBody(res)
  7284. if err := googleapi.CheckResponse(res); err != nil {
  7285. return nil, err
  7286. }
  7287. ret := &Location{
  7288. ServerResponse: googleapi.ServerResponse{
  7289. Header: res.Header,
  7290. HTTPStatusCode: res.StatusCode,
  7291. },
  7292. }
  7293. target := &ret
  7294. if err := gensupport.DecodeResponse(target, res); err != nil {
  7295. return nil, err
  7296. }
  7297. return ret, nil
  7298. // {
  7299. // "description": "Gets information about a location.",
  7300. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}",
  7301. // "httpMethod": "GET",
  7302. // "id": "firestore.projects.locations.get",
  7303. // "parameterOrder": [
  7304. // "name"
  7305. // ],
  7306. // "parameters": {
  7307. // "name": {
  7308. // "description": "Resource name for the location.",
  7309. // "location": "path",
  7310. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  7311. // "required": true,
  7312. // "type": "string"
  7313. // }
  7314. // },
  7315. // "path": "v1/{+name}",
  7316. // "response": {
  7317. // "$ref": "Location"
  7318. // },
  7319. // "scopes": [
  7320. // "https://www.googleapis.com/auth/cloud-platform",
  7321. // "https://www.googleapis.com/auth/datastore"
  7322. // ]
  7323. // }
  7324. }
  7325. // method id "firestore.projects.locations.list":
  7326. type ProjectsLocationsListCall struct {
  7327. s *Service
  7328. name string
  7329. urlParams_ gensupport.URLParams
  7330. ifNoneMatch_ string
  7331. ctx_ context.Context
  7332. header_ http.Header
  7333. }
  7334. // List: Lists information about the supported locations for this
  7335. // service.
  7336. func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
  7337. c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7338. c.name = name
  7339. return c
  7340. }
  7341. // Filter sets the optional parameter "filter": The standard list
  7342. // filter.
  7343. func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
  7344. c.urlParams_.Set("filter", filter)
  7345. return c
  7346. }
  7347. // PageSize sets the optional parameter "pageSize": The standard list
  7348. // page size.
  7349. func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
  7350. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7351. return c
  7352. }
  7353. // PageToken sets the optional parameter "pageToken": The standard list
  7354. // page token.
  7355. func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
  7356. c.urlParams_.Set("pageToken", pageToken)
  7357. return c
  7358. }
  7359. // Fields allows partial responses to be retrieved. See
  7360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7361. // for more information.
  7362. func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
  7363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7364. return c
  7365. }
  7366. // IfNoneMatch sets the optional parameter which makes the operation
  7367. // fail if the object's ETag matches the given value. This is useful for
  7368. // getting updates only after the object has changed since the last
  7369. // request. Use googleapi.IsNotModified to check whether the response
  7370. // error from Do is the result of In-None-Match.
  7371. func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
  7372. c.ifNoneMatch_ = entityTag
  7373. return c
  7374. }
  7375. // Context sets the context to be used in this call's Do method. Any
  7376. // pending HTTP request will be aborted if the provided context is
  7377. // canceled.
  7378. func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
  7379. c.ctx_ = ctx
  7380. return c
  7381. }
  7382. // Header returns an http.Header that can be modified by the caller to
  7383. // add HTTP headers to the request.
  7384. func (c *ProjectsLocationsListCall) Header() http.Header {
  7385. if c.header_ == nil {
  7386. c.header_ = make(http.Header)
  7387. }
  7388. return c.header_
  7389. }
  7390. func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
  7391. reqHeaders := make(http.Header)
  7392. for k, v := range c.header_ {
  7393. reqHeaders[k] = v
  7394. }
  7395. reqHeaders.Set("User-Agent", c.s.userAgent())
  7396. if c.ifNoneMatch_ != "" {
  7397. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7398. }
  7399. var body io.Reader = nil
  7400. c.urlParams_.Set("alt", alt)
  7401. c.urlParams_.Set("prettyPrint", "false")
  7402. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/locations")
  7403. urls += "?" + c.urlParams_.Encode()
  7404. req, err := http.NewRequest("GET", urls, body)
  7405. if err != nil {
  7406. return nil, err
  7407. }
  7408. req.Header = reqHeaders
  7409. googleapi.Expand(req.URL, map[string]string{
  7410. "name": c.name,
  7411. })
  7412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7413. }
  7414. // Do executes the "firestore.projects.locations.list" call.
  7415. // Exactly one of *ListLocationsResponse or error will be non-nil. Any
  7416. // non-2xx status code is an error. Response headers are in either
  7417. // *ListLocationsResponse.ServerResponse.Header or (if a response was
  7418. // returned at all) in error.(*googleapi.Error).Header. Use
  7419. // googleapi.IsNotModified to check whether the returned error was
  7420. // because http.StatusNotModified was returned.
  7421. func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
  7422. gensupport.SetOptions(c.urlParams_, opts...)
  7423. res, err := c.doRequest("json")
  7424. if res != nil && res.StatusCode == http.StatusNotModified {
  7425. if res.Body != nil {
  7426. res.Body.Close()
  7427. }
  7428. return nil, &googleapi.Error{
  7429. Code: res.StatusCode,
  7430. Header: res.Header,
  7431. }
  7432. }
  7433. if err != nil {
  7434. return nil, err
  7435. }
  7436. defer googleapi.CloseBody(res)
  7437. if err := googleapi.CheckResponse(res); err != nil {
  7438. return nil, err
  7439. }
  7440. ret := &ListLocationsResponse{
  7441. ServerResponse: googleapi.ServerResponse{
  7442. Header: res.Header,
  7443. HTTPStatusCode: res.StatusCode,
  7444. },
  7445. }
  7446. target := &ret
  7447. if err := gensupport.DecodeResponse(target, res); err != nil {
  7448. return nil, err
  7449. }
  7450. return ret, nil
  7451. // {
  7452. // "description": "Lists information about the supported locations for this service.",
  7453. // "flatPath": "v1/projects/{projectsId}/locations",
  7454. // "httpMethod": "GET",
  7455. // "id": "firestore.projects.locations.list",
  7456. // "parameterOrder": [
  7457. // "name"
  7458. // ],
  7459. // "parameters": {
  7460. // "filter": {
  7461. // "description": "The standard list filter.",
  7462. // "location": "query",
  7463. // "type": "string"
  7464. // },
  7465. // "name": {
  7466. // "description": "The resource that owns the locations collection, if applicable.",
  7467. // "location": "path",
  7468. // "pattern": "^projects/[^/]+$",
  7469. // "required": true,
  7470. // "type": "string"
  7471. // },
  7472. // "pageSize": {
  7473. // "description": "The standard list page size.",
  7474. // "format": "int32",
  7475. // "location": "query",
  7476. // "type": "integer"
  7477. // },
  7478. // "pageToken": {
  7479. // "description": "The standard list page token.",
  7480. // "location": "query",
  7481. // "type": "string"
  7482. // }
  7483. // },
  7484. // "path": "v1/{+name}/locations",
  7485. // "response": {
  7486. // "$ref": "ListLocationsResponse"
  7487. // },
  7488. // "scopes": [
  7489. // "https://www.googleapis.com/auth/cloud-platform",
  7490. // "https://www.googleapis.com/auth/datastore"
  7491. // ]
  7492. // }
  7493. }
  7494. // Pages invokes f for each page of results.
  7495. // A non-nil error returned from f will halt the iteration.
  7496. // The provided context supersedes any context provided to the Context method.
  7497. func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
  7498. c.ctx_ = ctx
  7499. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7500. for {
  7501. x, err := c.Do()
  7502. if err != nil {
  7503. return err
  7504. }
  7505. if err := f(x); err != nil {
  7506. return err
  7507. }
  7508. if x.NextPageToken == "" {
  7509. return nil
  7510. }
  7511. c.PageToken(x.NextPageToken)
  7512. }
  7513. }