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.
 
 
 

1399 lines
54 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 datastore provides access to the Cloud Datastore API.
  6. //
  7. // This package is DEPRECATED. Use package cloud.google.com/go/datastore instead.
  8. //
  9. // For product documentation, see: https://cloud.google.com/datastore/
  10. //
  11. // Creating a client
  12. //
  13. // Usage example:
  14. //
  15. // import "google.golang.org/api/datastore/v1beta1"
  16. // ...
  17. // ctx := context.Background()
  18. // datastoreService, err := datastore.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. // datastoreService, err := datastore.NewService(ctx, option.WithScopes(datastore.DatastoreScope))
  29. //
  30. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  31. //
  32. // datastoreService, err := datastore.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. // datastoreService, err := datastore.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 datastore // import "google.golang.org/api/datastore/v1beta1"
  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 = "datastore:v1beta1"
  73. const apiName = "datastore"
  74. const apiVersion = "v1beta1"
  75. const basePath = "https://datastore.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. return rs
  132. }
  133. type ProjectsService struct {
  134. s *Service
  135. }
  136. // GoogleDatastoreAdminV1CommonMetadata: Metadata common to all
  137. // Datastore Admin operations.
  138. type GoogleDatastoreAdminV1CommonMetadata struct {
  139. // EndTime: The time the operation ended, either successfully or
  140. // otherwise.
  141. EndTime string `json:"endTime,omitempty"`
  142. // Labels: The client-assigned labels which were provided when the
  143. // operation was
  144. // created. May also include additional labels.
  145. Labels map[string]string `json:"labels,omitempty"`
  146. // OperationType: The type of the operation. Can be used as a filter
  147. // in
  148. // ListOperationsRequest.
  149. //
  150. // Possible values:
  151. // "OPERATION_TYPE_UNSPECIFIED" - Unspecified.
  152. // "EXPORT_ENTITIES" - ExportEntities.
  153. // "IMPORT_ENTITIES" - ImportEntities.
  154. // "CREATE_INDEX" - CreateIndex.
  155. // "DELETE_INDEX" - DeleteIndex.
  156. OperationType string `json:"operationType,omitempty"`
  157. // StartTime: The time that work began on the operation.
  158. StartTime string `json:"startTime,omitempty"`
  159. // State: The current state of the Operation.
  160. //
  161. // Possible values:
  162. // "STATE_UNSPECIFIED" - Unspecified.
  163. // "INITIALIZING" - Request is being prepared for processing.
  164. // "PROCESSING" - Request is actively being processed.
  165. // "CANCELLING" - Request is in the process of being cancelled after
  166. // user called
  167. // google.longrunning.Operations.CancelOperation on the operation.
  168. // "FINALIZING" - Request has been processed and is in its
  169. // finalization stage.
  170. // "SUCCESSFUL" - Request has completed successfully.
  171. // "FAILED" - Request has finished being processed, but encountered an
  172. // error.
  173. // "CANCELLED" - Request has finished being cancelled after user
  174. // called
  175. // google.longrunning.Operations.CancelOperation.
  176. State string `json:"state,omitempty"`
  177. // ForceSendFields is a list of field names (e.g. "EndTime") to
  178. // unconditionally include in API requests. By default, fields with
  179. // empty values are omitted from API requests. However, any non-pointer,
  180. // non-interface field appearing in ForceSendFields will be sent to the
  181. // server regardless of whether the field is empty or not. This may be
  182. // used to include empty fields in Patch requests.
  183. ForceSendFields []string `json:"-"`
  184. // NullFields is a list of field names (e.g. "EndTime") to include in
  185. // API requests with the JSON null value. By default, fields with empty
  186. // values are omitted from API requests. However, any field with an
  187. // empty value appearing in NullFields will be sent to the server as
  188. // null. It is an error if a field in this list has a non-empty value.
  189. // This may be used to include null fields in Patch requests.
  190. NullFields []string `json:"-"`
  191. }
  192. func (s *GoogleDatastoreAdminV1CommonMetadata) MarshalJSON() ([]byte, error) {
  193. type NoMethod GoogleDatastoreAdminV1CommonMetadata
  194. raw := NoMethod(*s)
  195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  196. }
  197. // GoogleDatastoreAdminV1EntityFilter: Identifies a subset of entities
  198. // in a project. This is specified as
  199. // combinations of kinds and namespaces (either or both of which may be
  200. // all, as
  201. // described in the following examples).
  202. // Example usage:
  203. //
  204. // Entire project:
  205. // kinds=[], namespace_ids=[]
  206. //
  207. // Kinds Foo and Bar in all namespaces:
  208. // kinds=['Foo', 'Bar'], namespace_ids=[]
  209. //
  210. // Kinds Foo and Bar only in the default namespace:
  211. // kinds=['Foo', 'Bar'], namespace_ids=['']
  212. //
  213. // Kinds Foo and Bar in both the default and Baz namespaces:
  214. // kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
  215. //
  216. // The entire Baz namespace:
  217. // kinds=[], namespace_ids=['Baz']
  218. type GoogleDatastoreAdminV1EntityFilter struct {
  219. // Kinds: If empty, then this represents all kinds.
  220. Kinds []string `json:"kinds,omitempty"`
  221. // NamespaceIds: An empty list represents all namespaces. This is the
  222. // preferred
  223. // usage for projects that don't use namespaces.
  224. //
  225. // An empty string element represents the default namespace. This should
  226. // be
  227. // used if the project has data in non-default namespaces, but doesn't
  228. // want to
  229. // include them.
  230. // Each namespace in this list must be unique.
  231. NamespaceIds []string `json:"namespaceIds,omitempty"`
  232. // ForceSendFields is a list of field names (e.g. "Kinds") to
  233. // unconditionally include in API requests. By default, fields with
  234. // empty values are omitted from API requests. However, any non-pointer,
  235. // non-interface field appearing in ForceSendFields will be sent to the
  236. // server regardless of whether the field is empty or not. This may be
  237. // used to include empty fields in Patch requests.
  238. ForceSendFields []string `json:"-"`
  239. // NullFields is a list of field names (e.g. "Kinds") to include in API
  240. // requests with the JSON null value. By default, fields with empty
  241. // values are omitted from API requests. However, any field with an
  242. // empty value appearing in NullFields will be sent to the server as
  243. // null. It is an error if a field in this list has a non-empty value.
  244. // This may be used to include null fields in Patch requests.
  245. NullFields []string `json:"-"`
  246. }
  247. func (s *GoogleDatastoreAdminV1EntityFilter) MarshalJSON() ([]byte, error) {
  248. type NoMethod GoogleDatastoreAdminV1EntityFilter
  249. raw := NoMethod(*s)
  250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  251. }
  252. // GoogleDatastoreAdminV1ExportEntitiesMetadata: Metadata for
  253. // ExportEntities operations.
  254. type GoogleDatastoreAdminV1ExportEntitiesMetadata struct {
  255. // Common: Metadata common to all Datastore Admin operations.
  256. Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"`
  257. // EntityFilter: Description of which entities are being exported.
  258. EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"`
  259. // OutputUrlPrefix: Location for the export metadata and data files.
  260. // This will be the same
  261. // value as
  262. // the
  263. // google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix
  264. //
  265. // field. The final output location is provided
  266. // in
  267. // google.datastore.admin.v1.ExportEntitiesResponse.output_url.
  268. OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"`
  269. // ProgressBytes: An estimate of the number of bytes processed.
  270. ProgressBytes *GoogleDatastoreAdminV1Progress `json:"progressBytes,omitempty"`
  271. // ProgressEntities: An estimate of the number of entities processed.
  272. ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"`
  273. // ForceSendFields is a list of field names (e.g. "Common") to
  274. // unconditionally include in API requests. By default, fields with
  275. // empty values are omitted from API requests. However, any non-pointer,
  276. // non-interface field appearing in ForceSendFields will be sent to the
  277. // server regardless of whether the field is empty or not. This may be
  278. // used to include empty fields in Patch requests.
  279. ForceSendFields []string `json:"-"`
  280. // NullFields is a list of field names (e.g. "Common") to include in API
  281. // requests with the JSON null value. By default, fields with empty
  282. // values are omitted from API requests. However, any field with an
  283. // empty value appearing in NullFields will be sent to the server as
  284. // null. It is an error if a field in this list has a non-empty value.
  285. // This may be used to include null fields in Patch requests.
  286. NullFields []string `json:"-"`
  287. }
  288. func (s *GoogleDatastoreAdminV1ExportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  289. type NoMethod GoogleDatastoreAdminV1ExportEntitiesMetadata
  290. raw := NoMethod(*s)
  291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  292. }
  293. // GoogleDatastoreAdminV1ExportEntitiesResponse: The response
  294. // for
  295. // google.datastore.admin.v1.DatastoreAdmin.ExportEntities.
  296. type GoogleDatastoreAdminV1ExportEntitiesResponse struct {
  297. // OutputUrl: Location of the output metadata file. This can be used to
  298. // begin an import
  299. // into Cloud Datastore (this project or another project).
  300. // See
  301. // google.datastore.admin.v1.ImportEntitiesRequest.input_url.
  302. // Only present if the operation completed successfully.
  303. OutputUrl string `json:"outputUrl,omitempty"`
  304. // ForceSendFields is a list of field names (e.g. "OutputUrl") to
  305. // unconditionally include in API requests. By default, fields with
  306. // empty values are omitted from API requests. However, any non-pointer,
  307. // non-interface field appearing in ForceSendFields will be sent to the
  308. // server regardless of whether the field is empty or not. This may be
  309. // used to include empty fields in Patch requests.
  310. ForceSendFields []string `json:"-"`
  311. // NullFields is a list of field names (e.g. "OutputUrl") to include in
  312. // API requests with the JSON null value. By default, fields with empty
  313. // values are omitted from API requests. However, any field with an
  314. // empty value appearing in NullFields will be sent to the server as
  315. // null. It is an error if a field in this list has a non-empty value.
  316. // This may be used to include null fields in Patch requests.
  317. NullFields []string `json:"-"`
  318. }
  319. func (s *GoogleDatastoreAdminV1ExportEntitiesResponse) MarshalJSON() ([]byte, error) {
  320. type NoMethod GoogleDatastoreAdminV1ExportEntitiesResponse
  321. raw := NoMethod(*s)
  322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  323. }
  324. // GoogleDatastoreAdminV1ImportEntitiesMetadata: Metadata for
  325. // ImportEntities operations.
  326. type GoogleDatastoreAdminV1ImportEntitiesMetadata struct {
  327. // Common: Metadata common to all Datastore Admin operations.
  328. Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"`
  329. // EntityFilter: Description of which entities are being imported.
  330. EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"`
  331. // InputUrl: The location of the import metadata file. This will be the
  332. // same value as
  333. // the google.datastore.admin.v1.ExportEntitiesResponse.output_url
  334. // field.
  335. InputUrl string `json:"inputUrl,omitempty"`
  336. // ProgressBytes: An estimate of the number of bytes processed.
  337. ProgressBytes *GoogleDatastoreAdminV1Progress `json:"progressBytes,omitempty"`
  338. // ProgressEntities: An estimate of the number of entities processed.
  339. ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"`
  340. // ForceSendFields is a list of field names (e.g. "Common") to
  341. // unconditionally include in API requests. By default, fields with
  342. // empty values are omitted from API requests. However, any non-pointer,
  343. // non-interface field appearing in ForceSendFields will be sent to the
  344. // server regardless of whether the field is empty or not. This may be
  345. // used to include empty fields in Patch requests.
  346. ForceSendFields []string `json:"-"`
  347. // NullFields is a list of field names (e.g. "Common") to include in API
  348. // requests with the JSON null value. By default, fields with empty
  349. // values are omitted from API requests. However, any field with an
  350. // empty value appearing in NullFields will be sent to the server as
  351. // null. It is an error if a field in this list has a non-empty value.
  352. // This may be used to include null fields in Patch requests.
  353. NullFields []string `json:"-"`
  354. }
  355. func (s *GoogleDatastoreAdminV1ImportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  356. type NoMethod GoogleDatastoreAdminV1ImportEntitiesMetadata
  357. raw := NoMethod(*s)
  358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  359. }
  360. // GoogleDatastoreAdminV1IndexOperationMetadata: Metadata for Index
  361. // operations.
  362. type GoogleDatastoreAdminV1IndexOperationMetadata struct {
  363. // Common: Metadata common to all Datastore Admin operations.
  364. Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"`
  365. // IndexId: The index resource ID that this operation is acting on.
  366. IndexId string `json:"indexId,omitempty"`
  367. // ProgressEntities: An estimate of the number of entities processed.
  368. ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"`
  369. // ForceSendFields is a list of field names (e.g. "Common") to
  370. // unconditionally include in API requests. By default, fields with
  371. // empty values are omitted from API requests. However, any non-pointer,
  372. // non-interface field appearing in ForceSendFields will be sent to the
  373. // server regardless of whether the field is empty or not. This may be
  374. // used to include empty fields in Patch requests.
  375. ForceSendFields []string `json:"-"`
  376. // NullFields is a list of field names (e.g. "Common") to include in API
  377. // requests with the JSON null value. By default, fields with empty
  378. // values are omitted from API requests. However, any field with an
  379. // empty value appearing in NullFields will be sent to the server as
  380. // null. It is an error if a field in this list has a non-empty value.
  381. // This may be used to include null fields in Patch requests.
  382. NullFields []string `json:"-"`
  383. }
  384. func (s *GoogleDatastoreAdminV1IndexOperationMetadata) MarshalJSON() ([]byte, error) {
  385. type NoMethod GoogleDatastoreAdminV1IndexOperationMetadata
  386. raw := NoMethod(*s)
  387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  388. }
  389. // GoogleDatastoreAdminV1Progress: Measures the progress of a particular
  390. // metric.
  391. type GoogleDatastoreAdminV1Progress struct {
  392. // WorkCompleted: The amount of work that has been completed. Note that
  393. // this may be greater
  394. // than work_estimated.
  395. WorkCompleted int64 `json:"workCompleted,omitempty,string"`
  396. // WorkEstimated: An estimate of how much work needs to be performed.
  397. // May be zero if the
  398. // work estimate is unavailable.
  399. WorkEstimated int64 `json:"workEstimated,omitempty,string"`
  400. // ForceSendFields is a list of field names (e.g. "WorkCompleted") to
  401. // unconditionally include in API requests. By default, fields with
  402. // empty values are omitted from API requests. However, any non-pointer,
  403. // non-interface field appearing in ForceSendFields will be sent to the
  404. // server regardless of whether the field is empty or not. This may be
  405. // used to include empty fields in Patch requests.
  406. ForceSendFields []string `json:"-"`
  407. // NullFields is a list of field names (e.g. "WorkCompleted") to include
  408. // in API requests with the JSON null value. By default, fields with
  409. // empty values are omitted from API requests. However, any field with
  410. // an empty value appearing in NullFields will be sent to the server as
  411. // null. It is an error if a field in this list has a non-empty value.
  412. // This may be used to include null fields in Patch requests.
  413. NullFields []string `json:"-"`
  414. }
  415. func (s *GoogleDatastoreAdminV1Progress) MarshalJSON() ([]byte, error) {
  416. type NoMethod GoogleDatastoreAdminV1Progress
  417. raw := NoMethod(*s)
  418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  419. }
  420. // GoogleDatastoreAdminV1beta1CommonMetadata: Metadata common to all
  421. // Datastore Admin operations.
  422. type GoogleDatastoreAdminV1beta1CommonMetadata struct {
  423. // EndTime: The time the operation ended, either successfully or
  424. // otherwise.
  425. EndTime string `json:"endTime,omitempty"`
  426. // Labels: The client-assigned labels which were provided when the
  427. // operation was
  428. // created. May also include additional labels.
  429. Labels map[string]string `json:"labels,omitempty"`
  430. // OperationType: The type of the operation. Can be used as a filter
  431. // in
  432. // ListOperationsRequest.
  433. //
  434. // Possible values:
  435. // "OPERATION_TYPE_UNSPECIFIED" - Unspecified.
  436. // "EXPORT_ENTITIES" - ExportEntities.
  437. // "IMPORT_ENTITIES" - ImportEntities.
  438. OperationType string `json:"operationType,omitempty"`
  439. // StartTime: The time that work began on the operation.
  440. StartTime string `json:"startTime,omitempty"`
  441. // State: The current state of the Operation.
  442. //
  443. // Possible values:
  444. // "STATE_UNSPECIFIED" - Unspecified.
  445. // "INITIALIZING" - Request is being prepared for processing.
  446. // "PROCESSING" - Request is actively being processed.
  447. // "CANCELLING" - Request is in the process of being cancelled after
  448. // user called
  449. // google.longrunning.Operations.CancelOperation on the operation.
  450. // "FINALIZING" - Request has been processed and is in its
  451. // finalization stage.
  452. // "SUCCESSFUL" - Request has completed successfully.
  453. // "FAILED" - Request has finished being processed, but encountered an
  454. // error.
  455. // "CANCELLED" - Request has finished being cancelled after user
  456. // called
  457. // google.longrunning.Operations.CancelOperation.
  458. State string `json:"state,omitempty"`
  459. // ForceSendFields is a list of field names (e.g. "EndTime") to
  460. // unconditionally include in API requests. By default, fields with
  461. // empty values are omitted from API requests. However, any non-pointer,
  462. // non-interface field appearing in ForceSendFields will be sent to the
  463. // server regardless of whether the field is empty or not. This may be
  464. // used to include empty fields in Patch requests.
  465. ForceSendFields []string `json:"-"`
  466. // NullFields is a list of field names (e.g. "EndTime") to include in
  467. // API requests with the JSON null value. By default, fields with empty
  468. // values are omitted from API requests. However, any field with an
  469. // empty value appearing in NullFields will be sent to the server as
  470. // null. It is an error if a field in this list has a non-empty value.
  471. // This may be used to include null fields in Patch requests.
  472. NullFields []string `json:"-"`
  473. }
  474. func (s *GoogleDatastoreAdminV1beta1CommonMetadata) MarshalJSON() ([]byte, error) {
  475. type NoMethod GoogleDatastoreAdminV1beta1CommonMetadata
  476. raw := NoMethod(*s)
  477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  478. }
  479. // GoogleDatastoreAdminV1beta1EntityFilter: Identifies a subset of
  480. // entities in a project. This is specified as
  481. // combinations of kinds and namespaces (either or both of which may be
  482. // all, as
  483. // described in the following examples).
  484. // Example usage:
  485. //
  486. // Entire project:
  487. // kinds=[], namespace_ids=[]
  488. //
  489. // Kinds Foo and Bar in all namespaces:
  490. // kinds=['Foo', 'Bar'], namespace_ids=[]
  491. //
  492. // Kinds Foo and Bar only in the default namespace:
  493. // kinds=['Foo', 'Bar'], namespace_ids=['']
  494. //
  495. // Kinds Foo and Bar in both the default and Baz namespaces:
  496. // kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
  497. //
  498. // The entire Baz namespace:
  499. // kinds=[], namespace_ids=['Baz']
  500. type GoogleDatastoreAdminV1beta1EntityFilter struct {
  501. // Kinds: If empty, then this represents all kinds.
  502. Kinds []string `json:"kinds,omitempty"`
  503. // NamespaceIds: An empty list represents all namespaces. This is the
  504. // preferred
  505. // usage for projects that don't use namespaces.
  506. //
  507. // An empty string element represents the default namespace. This should
  508. // be
  509. // used if the project has data in non-default namespaces, but doesn't
  510. // want to
  511. // include them.
  512. // Each namespace in this list must be unique.
  513. NamespaceIds []string `json:"namespaceIds,omitempty"`
  514. // ForceSendFields is a list of field names (e.g. "Kinds") to
  515. // unconditionally include in API requests. By default, fields with
  516. // empty values are omitted from API requests. However, any non-pointer,
  517. // non-interface field appearing in ForceSendFields will be sent to the
  518. // server regardless of whether the field is empty or not. This may be
  519. // used to include empty fields in Patch requests.
  520. ForceSendFields []string `json:"-"`
  521. // NullFields is a list of field names (e.g. "Kinds") to include in API
  522. // requests with the JSON null value. By default, fields with empty
  523. // values are omitted from API requests. However, any field with an
  524. // empty value appearing in NullFields will be sent to the server as
  525. // null. It is an error if a field in this list has a non-empty value.
  526. // This may be used to include null fields in Patch requests.
  527. NullFields []string `json:"-"`
  528. }
  529. func (s *GoogleDatastoreAdminV1beta1EntityFilter) MarshalJSON() ([]byte, error) {
  530. type NoMethod GoogleDatastoreAdminV1beta1EntityFilter
  531. raw := NoMethod(*s)
  532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  533. }
  534. // GoogleDatastoreAdminV1beta1ExportEntitiesMetadata: Metadata for
  535. // ExportEntities operations.
  536. type GoogleDatastoreAdminV1beta1ExportEntitiesMetadata struct {
  537. // Common: Metadata common to all Datastore Admin operations.
  538. Common *GoogleDatastoreAdminV1beta1CommonMetadata `json:"common,omitempty"`
  539. // EntityFilter: Description of which entities are being exported.
  540. EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"`
  541. // OutputUrlPrefix: Location for the export metadata and data files.
  542. // This will be the same
  543. // value as
  544. // the
  545. // google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_pr
  546. // efix
  547. // field. The final output location is provided
  548. // in
  549. // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.
  550. OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"`
  551. // ProgressBytes: An estimate of the number of bytes processed.
  552. ProgressBytes *GoogleDatastoreAdminV1beta1Progress `json:"progressBytes,omitempty"`
  553. // ProgressEntities: An estimate of the number of entities processed.
  554. ProgressEntities *GoogleDatastoreAdminV1beta1Progress `json:"progressEntities,omitempty"`
  555. // ForceSendFields is a list of field names (e.g. "Common") to
  556. // unconditionally include in API requests. By default, fields with
  557. // empty values are omitted from API requests. However, any non-pointer,
  558. // non-interface field appearing in ForceSendFields will be sent to the
  559. // server regardless of whether the field is empty or not. This may be
  560. // used to include empty fields in Patch requests.
  561. ForceSendFields []string `json:"-"`
  562. // NullFields is a list of field names (e.g. "Common") to include in API
  563. // requests with the JSON null value. By default, fields with empty
  564. // values are omitted from API requests. However, any field with an
  565. // empty value appearing in NullFields will be sent to the server as
  566. // null. It is an error if a field in this list has a non-empty value.
  567. // This may be used to include null fields in Patch requests.
  568. NullFields []string `json:"-"`
  569. }
  570. func (s *GoogleDatastoreAdminV1beta1ExportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  571. type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesMetadata
  572. raw := NoMethod(*s)
  573. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  574. }
  575. // GoogleDatastoreAdminV1beta1ExportEntitiesRequest: The request
  576. // for
  577. // google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.
  578. type GoogleDatastoreAdminV1beta1ExportEntitiesRequest struct {
  579. // EntityFilter: Description of what data from the project is included
  580. // in the export.
  581. EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"`
  582. // Labels: Client-assigned labels.
  583. Labels map[string]string `json:"labels,omitempty"`
  584. // OutputUrlPrefix: Location for the export metadata and data
  585. // files.
  586. //
  587. // The full resource URL of the external storage location. Currently,
  588. // only
  589. // Google Cloud Storage is supported. So output_url_prefix should be of
  590. // the
  591. // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is
  592. // the
  593. // name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional
  594. // Cloud
  595. // Storage namespace path (this is not a Cloud Datastore namespace). For
  596. // more
  597. // information about Cloud Storage namespace paths, see
  598. // [Object
  599. // name
  600. // considerations](https://cloud.google.com/storage/docs/naming#obje
  601. // ct-considerations).
  602. //
  603. // The resulting files will be nested deeper than the specified URL
  604. // prefix.
  605. // The final output URL will be provided in
  606. // the
  607. // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url
  608. // f
  609. // ield. That value should be used for subsequent ImportEntities
  610. // operations.
  611. //
  612. // By nesting the data files deeper, the same Cloud Storage bucket can
  613. // be used
  614. // in multiple ExportEntities operations without conflict.
  615. OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"`
  616. // ForceSendFields is a list of field names (e.g. "EntityFilter") to
  617. // unconditionally include in API requests. By default, fields with
  618. // empty values are omitted from API requests. However, any non-pointer,
  619. // non-interface field appearing in ForceSendFields will be sent to the
  620. // server regardless of whether the field is empty or not. This may be
  621. // used to include empty fields in Patch requests.
  622. ForceSendFields []string `json:"-"`
  623. // NullFields is a list of field names (e.g. "EntityFilter") to include
  624. // in API requests with the JSON null value. By default, fields with
  625. // empty values are omitted from API requests. However, any field with
  626. // an empty value appearing in NullFields will be sent to the server as
  627. // null. It is an error if a field in this list has a non-empty value.
  628. // This may be used to include null fields in Patch requests.
  629. NullFields []string `json:"-"`
  630. }
  631. func (s *GoogleDatastoreAdminV1beta1ExportEntitiesRequest) MarshalJSON() ([]byte, error) {
  632. type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesRequest
  633. raw := NoMethod(*s)
  634. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  635. }
  636. // GoogleDatastoreAdminV1beta1ExportEntitiesResponse: The response
  637. // for
  638. // google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.
  639. type GoogleDatastoreAdminV1beta1ExportEntitiesResponse struct {
  640. // OutputUrl: Location of the output metadata file. This can be used to
  641. // begin an import
  642. // into Cloud Datastore (this project or another project).
  643. // See
  644. // google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url.
  645. // On
  646. // ly present if the operation completed successfully.
  647. OutputUrl string `json:"outputUrl,omitempty"`
  648. // ForceSendFields is a list of field names (e.g. "OutputUrl") to
  649. // unconditionally include in API requests. By default, fields with
  650. // empty values are omitted from API requests. However, any non-pointer,
  651. // non-interface field appearing in ForceSendFields will be sent to the
  652. // server regardless of whether the field is empty or not. This may be
  653. // used to include empty fields in Patch requests.
  654. ForceSendFields []string `json:"-"`
  655. // NullFields is a list of field names (e.g. "OutputUrl") to include in
  656. // API requests with the JSON null value. By default, fields with empty
  657. // values are omitted from API requests. However, any field with an
  658. // empty value appearing in NullFields will be sent to the server as
  659. // null. It is an error if a field in this list has a non-empty value.
  660. // This may be used to include null fields in Patch requests.
  661. NullFields []string `json:"-"`
  662. }
  663. func (s *GoogleDatastoreAdminV1beta1ExportEntitiesResponse) MarshalJSON() ([]byte, error) {
  664. type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesResponse
  665. raw := NoMethod(*s)
  666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  667. }
  668. // GoogleDatastoreAdminV1beta1ImportEntitiesMetadata: Metadata for
  669. // ImportEntities operations.
  670. type GoogleDatastoreAdminV1beta1ImportEntitiesMetadata struct {
  671. // Common: Metadata common to all Datastore Admin operations.
  672. Common *GoogleDatastoreAdminV1beta1CommonMetadata `json:"common,omitempty"`
  673. // EntityFilter: Description of which entities are being imported.
  674. EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"`
  675. // InputUrl: The location of the import metadata file. This will be the
  676. // same value as
  677. // the
  678. // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url
  679. // field
  680. // .
  681. InputUrl string `json:"inputUrl,omitempty"`
  682. // ProgressBytes: An estimate of the number of bytes processed.
  683. ProgressBytes *GoogleDatastoreAdminV1beta1Progress `json:"progressBytes,omitempty"`
  684. // ProgressEntities: An estimate of the number of entities processed.
  685. ProgressEntities *GoogleDatastoreAdminV1beta1Progress `json:"progressEntities,omitempty"`
  686. // ForceSendFields is a list of field names (e.g. "Common") to
  687. // unconditionally include in API requests. By default, fields with
  688. // empty values are omitted from API requests. However, any non-pointer,
  689. // non-interface field appearing in ForceSendFields will be sent to the
  690. // server regardless of whether the field is empty or not. This may be
  691. // used to include empty fields in Patch requests.
  692. ForceSendFields []string `json:"-"`
  693. // NullFields is a list of field names (e.g. "Common") to include in API
  694. // requests with the JSON null value. By default, fields with empty
  695. // values are omitted from API requests. However, any field with an
  696. // empty value appearing in NullFields will be sent to the server as
  697. // null. It is an error if a field in this list has a non-empty value.
  698. // This may be used to include null fields in Patch requests.
  699. NullFields []string `json:"-"`
  700. }
  701. func (s *GoogleDatastoreAdminV1beta1ImportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  702. type NoMethod GoogleDatastoreAdminV1beta1ImportEntitiesMetadata
  703. raw := NoMethod(*s)
  704. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  705. }
  706. // GoogleDatastoreAdminV1beta1ImportEntitiesRequest: The request
  707. // for
  708. // google.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities.
  709. type GoogleDatastoreAdminV1beta1ImportEntitiesRequest struct {
  710. // EntityFilter: Optionally specify which kinds/namespaces are to be
  711. // imported. If provided,
  712. // the list must be a subset of the EntityFilter used in creating the
  713. // export,
  714. // otherwise a FAILED_PRECONDITION error will be returned. If no filter
  715. // is
  716. // specified then all entities from the export are imported.
  717. EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"`
  718. // InputUrl: The full resource URL of the external storage location.
  719. // Currently, only
  720. // Google Cloud Storage is supported. So input_url should be of the
  721. // form:
  722. // `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`
  723. // , where
  724. // `BUCKET_NAME` is the name of the Cloud Storage bucket,
  725. // `NAMESPACE_PATH` is
  726. // an optional Cloud Storage namespace path (this is not a Cloud
  727. // Datastore
  728. // namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file
  729. // written
  730. // by the ExportEntities operation. For more information about Cloud
  731. // Storage
  732. // namespace paths, see
  733. // [Object
  734. // name
  735. // considerations](https://cloud.google.com/storage/docs/naming#obje
  736. // ct-considerations).
  737. //
  738. // For more information,
  739. // see
  740. // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.
  741. InputUrl string `json:"inputUrl,omitempty"`
  742. // Labels: Client-assigned labels.
  743. Labels map[string]string `json:"labels,omitempty"`
  744. // ForceSendFields is a list of field names (e.g. "EntityFilter") to
  745. // unconditionally include in API requests. By default, fields with
  746. // empty values are omitted from API requests. However, any non-pointer,
  747. // non-interface field appearing in ForceSendFields will be sent to the
  748. // server regardless of whether the field is empty or not. This may be
  749. // used to include empty fields in Patch requests.
  750. ForceSendFields []string `json:"-"`
  751. // NullFields is a list of field names (e.g. "EntityFilter") to include
  752. // in API requests with the JSON null value. By default, fields with
  753. // empty values are omitted from API requests. However, any field with
  754. // an empty value appearing in NullFields will be sent to the server as
  755. // null. It is an error if a field in this list has a non-empty value.
  756. // This may be used to include null fields in Patch requests.
  757. NullFields []string `json:"-"`
  758. }
  759. func (s *GoogleDatastoreAdminV1beta1ImportEntitiesRequest) MarshalJSON() ([]byte, error) {
  760. type NoMethod GoogleDatastoreAdminV1beta1ImportEntitiesRequest
  761. raw := NoMethod(*s)
  762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  763. }
  764. // GoogleDatastoreAdminV1beta1Progress: Measures the progress of a
  765. // particular metric.
  766. type GoogleDatastoreAdminV1beta1Progress struct {
  767. // WorkCompleted: The amount of work that has been completed. Note that
  768. // this may be greater
  769. // than work_estimated.
  770. WorkCompleted int64 `json:"workCompleted,omitempty,string"`
  771. // WorkEstimated: An estimate of how much work needs to be performed.
  772. // May be zero if the
  773. // work estimate is unavailable.
  774. WorkEstimated int64 `json:"workEstimated,omitempty,string"`
  775. // ForceSendFields is a list of field names (e.g. "WorkCompleted") to
  776. // unconditionally include in API requests. By default, fields with
  777. // empty values are omitted from API requests. However, any non-pointer,
  778. // non-interface field appearing in ForceSendFields will be sent to the
  779. // server regardless of whether the field is empty or not. This may be
  780. // used to include empty fields in Patch requests.
  781. ForceSendFields []string `json:"-"`
  782. // NullFields is a list of field names (e.g. "WorkCompleted") to include
  783. // in API requests with the JSON null value. By default, fields with
  784. // empty values are omitted from API requests. However, any field with
  785. // an empty value appearing in NullFields will be sent to the server as
  786. // null. It is an error if a field in this list has a non-empty value.
  787. // This may be used to include null fields in Patch requests.
  788. NullFields []string `json:"-"`
  789. }
  790. func (s *GoogleDatastoreAdminV1beta1Progress) MarshalJSON() ([]byte, error) {
  791. type NoMethod GoogleDatastoreAdminV1beta1Progress
  792. raw := NoMethod(*s)
  793. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  794. }
  795. // GoogleLongrunningOperation: This resource represents a long-running
  796. // operation that is the result of a
  797. // network API call.
  798. type GoogleLongrunningOperation struct {
  799. // Done: If the value is `false`, it means the operation is still in
  800. // progress.
  801. // If `true`, the operation is completed, and either `error` or
  802. // `response` is
  803. // available.
  804. Done bool `json:"done,omitempty"`
  805. // Error: The error result of the operation in case of failure or
  806. // cancellation.
  807. Error *Status `json:"error,omitempty"`
  808. // Metadata: Service-specific metadata associated with the operation.
  809. // It typically
  810. // contains progress information and common metadata such as create
  811. // time.
  812. // Some services might not provide such metadata. Any method that
  813. // returns a
  814. // long-running operation should document the metadata type, if any.
  815. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  816. // Name: The server-assigned name, which is only unique within the same
  817. // service that
  818. // originally returns it. If you use the default HTTP mapping,
  819. // the
  820. // `name` should have the format of `operations/some/unique/name`.
  821. Name string `json:"name,omitempty"`
  822. // Response: The normal response of the operation in case of success.
  823. // If the original
  824. // method returns no data on success, such as `Delete`, the response
  825. // is
  826. // `google.protobuf.Empty`. If the original method is
  827. // standard
  828. // `Get`/`Create`/`Update`, the response should be the resource. For
  829. // other
  830. // methods, the response should have the type `XxxResponse`, where
  831. // `Xxx`
  832. // is the original method name. For example, if the original method
  833. // name
  834. // is `TakeSnapshot()`, the inferred response type
  835. // is
  836. // `TakeSnapshotResponse`.
  837. Response googleapi.RawMessage `json:"response,omitempty"`
  838. // ServerResponse contains the HTTP response code and headers from the
  839. // server.
  840. googleapi.ServerResponse `json:"-"`
  841. // ForceSendFields is a list of field names (e.g. "Done") to
  842. // unconditionally include in API requests. By default, fields with
  843. // empty values are omitted from API requests. However, any non-pointer,
  844. // non-interface field appearing in ForceSendFields will be sent to the
  845. // server regardless of whether the field is empty or not. This may be
  846. // used to include empty fields in Patch requests.
  847. ForceSendFields []string `json:"-"`
  848. // NullFields is a list of field names (e.g. "Done") to include in API
  849. // requests with the JSON null value. By default, fields with empty
  850. // values are omitted from API requests. However, any field with an
  851. // empty value appearing in NullFields will be sent to the server as
  852. // null. It is an error if a field in this list has a non-empty value.
  853. // This may be used to include null fields in Patch requests.
  854. NullFields []string `json:"-"`
  855. }
  856. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  857. type NoMethod GoogleLongrunningOperation
  858. raw := NoMethod(*s)
  859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  860. }
  861. // Status: The `Status` type defines a logical error model that is
  862. // suitable for different
  863. // programming environments, including REST APIs and RPC APIs. It is
  864. // used by
  865. // [gRPC](https://github.com/grpc). The error model is designed to
  866. // be:
  867. //
  868. // - Simple to use and understand for most users
  869. // - Flexible enough to meet unexpected needs
  870. //
  871. // # Overview
  872. //
  873. // The `Status` message contains three pieces of data: error code, error
  874. // message,
  875. // and error details. The error code should be an enum value
  876. // of
  877. // google.rpc.Code, but it may accept additional error codes if needed.
  878. // The
  879. // error message should be a developer-facing English message that
  880. // helps
  881. // developers *understand* and *resolve* the error. If a localized
  882. // user-facing
  883. // error message is needed, put the localized message in the error
  884. // details or
  885. // localize it in the client. The optional error details may contain
  886. // arbitrary
  887. // information about the error. There is a predefined set of error
  888. // detail types
  889. // in the package `google.rpc` that can be used for common error
  890. // conditions.
  891. //
  892. // # Language mapping
  893. //
  894. // The `Status` message is the logical representation of the error
  895. // model, but it
  896. // is not necessarily the actual wire format. When the `Status` message
  897. // is
  898. // exposed in different client libraries and different wire protocols,
  899. // it can be
  900. // mapped differently. For example, it will likely be mapped to some
  901. // exceptions
  902. // in Java, but more likely mapped to some error codes in C.
  903. //
  904. // # Other uses
  905. //
  906. // The error model and the `Status` message can be used in a variety
  907. // of
  908. // environments, either with or without APIs, to provide a
  909. // consistent developer experience across different
  910. // environments.
  911. //
  912. // Example uses of this error model include:
  913. //
  914. // - Partial errors. If a service needs to return partial errors to the
  915. // client,
  916. // it may embed the `Status` in the normal response to indicate the
  917. // partial
  918. // errors.
  919. //
  920. // - Workflow errors. A typical workflow has multiple steps. Each step
  921. // may
  922. // have a `Status` message for error reporting.
  923. //
  924. // - Batch operations. If a client uses batch request and batch
  925. // response, the
  926. // `Status` message should be used directly inside batch response,
  927. // one for
  928. // each error sub-response.
  929. //
  930. // - Asynchronous operations. If an API call embeds asynchronous
  931. // operation
  932. // results in its response, the status of those operations should
  933. // be
  934. // represented directly using the `Status` message.
  935. //
  936. // - Logging. If some API errors are stored in logs, the message
  937. // `Status` could
  938. // be used directly after any stripping needed for security/privacy
  939. // reasons.
  940. type Status struct {
  941. // Code: The status code, which should be an enum value of
  942. // google.rpc.Code.
  943. Code int64 `json:"code,omitempty"`
  944. // Details: A list of messages that carry the error details. There is a
  945. // common set of
  946. // message types for APIs to use.
  947. Details []googleapi.RawMessage `json:"details,omitempty"`
  948. // Message: A developer-facing error message, which should be in
  949. // English. Any
  950. // user-facing error message should be localized and sent in
  951. // the
  952. // google.rpc.Status.details field, or localized by the client.
  953. Message string `json:"message,omitempty"`
  954. // ForceSendFields is a list of field names (e.g. "Code") to
  955. // unconditionally include in API requests. By default, fields with
  956. // empty values are omitted from API requests. However, any non-pointer,
  957. // non-interface field appearing in ForceSendFields will be sent to the
  958. // server regardless of whether the field is empty or not. This may be
  959. // used to include empty fields in Patch requests.
  960. ForceSendFields []string `json:"-"`
  961. // NullFields is a list of field names (e.g. "Code") to include in API
  962. // requests with the JSON null value. By default, fields with empty
  963. // values are omitted from API requests. However, any field with an
  964. // empty value appearing in NullFields will be sent to the server as
  965. // null. It is an error if a field in this list has a non-empty value.
  966. // This may be used to include null fields in Patch requests.
  967. NullFields []string `json:"-"`
  968. }
  969. func (s *Status) MarshalJSON() ([]byte, error) {
  970. type NoMethod Status
  971. raw := NoMethod(*s)
  972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  973. }
  974. // method id "datastore.projects.export":
  975. type ProjectsExportCall struct {
  976. s *Service
  977. projectId string
  978. googledatastoreadminv1beta1exportentitiesrequest *GoogleDatastoreAdminV1beta1ExportEntitiesRequest
  979. urlParams_ gensupport.URLParams
  980. ctx_ context.Context
  981. header_ http.Header
  982. }
  983. // Export: Exports a copy of all or a subset of entities from Google
  984. // Cloud Datastore
  985. // to another storage system, such as Google Cloud Storage. Recent
  986. // updates to
  987. // entities may not be reflected in the export. The export occurs in
  988. // the
  989. // background and its progress can be monitored and managed via
  990. // the
  991. // Operation resource that is created. The output of an export may only
  992. // be
  993. // used once the associated operation is done. If an export operation
  994. // is
  995. // cancelled before completion it may leave partial data behind in
  996. // Google
  997. // Cloud Storage.
  998. func (r *ProjectsService) Export(projectId string, googledatastoreadminv1beta1exportentitiesrequest *GoogleDatastoreAdminV1beta1ExportEntitiesRequest) *ProjectsExportCall {
  999. c := &ProjectsExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1000. c.projectId = projectId
  1001. c.googledatastoreadminv1beta1exportentitiesrequest = googledatastoreadminv1beta1exportentitiesrequest
  1002. return c
  1003. }
  1004. // Fields allows partial responses to be retrieved. See
  1005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1006. // for more information.
  1007. func (c *ProjectsExportCall) Fields(s ...googleapi.Field) *ProjectsExportCall {
  1008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1009. return c
  1010. }
  1011. // Context sets the context to be used in this call's Do method. Any
  1012. // pending HTTP request will be aborted if the provided context is
  1013. // canceled.
  1014. func (c *ProjectsExportCall) Context(ctx context.Context) *ProjectsExportCall {
  1015. c.ctx_ = ctx
  1016. return c
  1017. }
  1018. // Header returns an http.Header that can be modified by the caller to
  1019. // add HTTP headers to the request.
  1020. func (c *ProjectsExportCall) Header() http.Header {
  1021. if c.header_ == nil {
  1022. c.header_ = make(http.Header)
  1023. }
  1024. return c.header_
  1025. }
  1026. func (c *ProjectsExportCall) doRequest(alt string) (*http.Response, error) {
  1027. reqHeaders := make(http.Header)
  1028. for k, v := range c.header_ {
  1029. reqHeaders[k] = v
  1030. }
  1031. reqHeaders.Set("User-Agent", c.s.userAgent())
  1032. var body io.Reader = nil
  1033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1beta1exportentitiesrequest)
  1034. if err != nil {
  1035. return nil, err
  1036. }
  1037. reqHeaders.Set("Content-Type", "application/json")
  1038. c.urlParams_.Set("alt", alt)
  1039. c.urlParams_.Set("prettyPrint", "false")
  1040. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:export")
  1041. urls += "?" + c.urlParams_.Encode()
  1042. req, err := http.NewRequest("POST", urls, body)
  1043. if err != nil {
  1044. return nil, err
  1045. }
  1046. req.Header = reqHeaders
  1047. googleapi.Expand(req.URL, map[string]string{
  1048. "projectId": c.projectId,
  1049. })
  1050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1051. }
  1052. // Do executes the "datastore.projects.export" call.
  1053. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  1054. // Any non-2xx status code is an error. Response headers are in either
  1055. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  1056. // was returned at all) in error.(*googleapi.Error).Header. Use
  1057. // googleapi.IsNotModified to check whether the returned error was
  1058. // because http.StatusNotModified was returned.
  1059. func (c *ProjectsExportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1060. gensupport.SetOptions(c.urlParams_, opts...)
  1061. res, err := c.doRequest("json")
  1062. if res != nil && res.StatusCode == http.StatusNotModified {
  1063. if res.Body != nil {
  1064. res.Body.Close()
  1065. }
  1066. return nil, &googleapi.Error{
  1067. Code: res.StatusCode,
  1068. Header: res.Header,
  1069. }
  1070. }
  1071. if err != nil {
  1072. return nil, err
  1073. }
  1074. defer googleapi.CloseBody(res)
  1075. if err := googleapi.CheckResponse(res); err != nil {
  1076. return nil, err
  1077. }
  1078. ret := &GoogleLongrunningOperation{
  1079. ServerResponse: googleapi.ServerResponse{
  1080. Header: res.Header,
  1081. HTTPStatusCode: res.StatusCode,
  1082. },
  1083. }
  1084. target := &ret
  1085. if err := gensupport.DecodeResponse(target, res); err != nil {
  1086. return nil, err
  1087. }
  1088. return ret, nil
  1089. // {
  1090. // "description": "Exports a copy of all or a subset of entities from Google Cloud Datastore\nto another storage system, such as Google Cloud Storage. Recent updates to\nentities 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.",
  1091. // "flatPath": "v1beta1/projects/{projectId}:export",
  1092. // "httpMethod": "POST",
  1093. // "id": "datastore.projects.export",
  1094. // "parameterOrder": [
  1095. // "projectId"
  1096. // ],
  1097. // "parameters": {
  1098. // "projectId": {
  1099. // "description": "Project ID against which to make the request.",
  1100. // "location": "path",
  1101. // "required": true,
  1102. // "type": "string"
  1103. // }
  1104. // },
  1105. // "path": "v1beta1/projects/{projectId}:export",
  1106. // "request": {
  1107. // "$ref": "GoogleDatastoreAdminV1beta1ExportEntitiesRequest"
  1108. // },
  1109. // "response": {
  1110. // "$ref": "GoogleLongrunningOperation"
  1111. // },
  1112. // "scopes": [
  1113. // "https://www.googleapis.com/auth/cloud-platform",
  1114. // "https://www.googleapis.com/auth/datastore"
  1115. // ]
  1116. // }
  1117. }
  1118. // method id "datastore.projects.import":
  1119. type ProjectsImportCall struct {
  1120. s *Service
  1121. projectId string
  1122. googledatastoreadminv1beta1importentitiesrequest *GoogleDatastoreAdminV1beta1ImportEntitiesRequest
  1123. urlParams_ gensupport.URLParams
  1124. ctx_ context.Context
  1125. header_ http.Header
  1126. }
  1127. // Import: Imports entities into Google Cloud Datastore. Existing
  1128. // entities with the
  1129. // same key are overwritten. The import occurs in the background and
  1130. // its
  1131. // progress can be monitored and managed via the Operation resource that
  1132. // is
  1133. // created. If an ImportEntities operation is cancelled, it is
  1134. // possible
  1135. // that a subset of the data has already been imported to Cloud
  1136. // Datastore.
  1137. func (r *ProjectsService) Import(projectId string, googledatastoreadminv1beta1importentitiesrequest *GoogleDatastoreAdminV1beta1ImportEntitiesRequest) *ProjectsImportCall {
  1138. c := &ProjectsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1139. c.projectId = projectId
  1140. c.googledatastoreadminv1beta1importentitiesrequest = googledatastoreadminv1beta1importentitiesrequest
  1141. return c
  1142. }
  1143. // Fields allows partial responses to be retrieved. See
  1144. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1145. // for more information.
  1146. func (c *ProjectsImportCall) Fields(s ...googleapi.Field) *ProjectsImportCall {
  1147. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1148. return c
  1149. }
  1150. // Context sets the context to be used in this call's Do method. Any
  1151. // pending HTTP request will be aborted if the provided context is
  1152. // canceled.
  1153. func (c *ProjectsImportCall) Context(ctx context.Context) *ProjectsImportCall {
  1154. c.ctx_ = ctx
  1155. return c
  1156. }
  1157. // Header returns an http.Header that can be modified by the caller to
  1158. // add HTTP headers to the request.
  1159. func (c *ProjectsImportCall) Header() http.Header {
  1160. if c.header_ == nil {
  1161. c.header_ = make(http.Header)
  1162. }
  1163. return c.header_
  1164. }
  1165. func (c *ProjectsImportCall) doRequest(alt string) (*http.Response, error) {
  1166. reqHeaders := make(http.Header)
  1167. for k, v := range c.header_ {
  1168. reqHeaders[k] = v
  1169. }
  1170. reqHeaders.Set("User-Agent", c.s.userAgent())
  1171. var body io.Reader = nil
  1172. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1beta1importentitiesrequest)
  1173. if err != nil {
  1174. return nil, err
  1175. }
  1176. reqHeaders.Set("Content-Type", "application/json")
  1177. c.urlParams_.Set("alt", alt)
  1178. c.urlParams_.Set("prettyPrint", "false")
  1179. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:import")
  1180. urls += "?" + c.urlParams_.Encode()
  1181. req, err := http.NewRequest("POST", urls, body)
  1182. if err != nil {
  1183. return nil, err
  1184. }
  1185. req.Header = reqHeaders
  1186. googleapi.Expand(req.URL, map[string]string{
  1187. "projectId": c.projectId,
  1188. })
  1189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1190. }
  1191. // Do executes the "datastore.projects.import" call.
  1192. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  1193. // Any non-2xx status code is an error. Response headers are in either
  1194. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  1195. // was returned at all) in error.(*googleapi.Error).Header. Use
  1196. // googleapi.IsNotModified to check whether the returned error was
  1197. // because http.StatusNotModified was returned.
  1198. func (c *ProjectsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  1199. gensupport.SetOptions(c.urlParams_, opts...)
  1200. res, err := c.doRequest("json")
  1201. if res != nil && res.StatusCode == http.StatusNotModified {
  1202. if res.Body != nil {
  1203. res.Body.Close()
  1204. }
  1205. return nil, &googleapi.Error{
  1206. Code: res.StatusCode,
  1207. Header: res.Header,
  1208. }
  1209. }
  1210. if err != nil {
  1211. return nil, err
  1212. }
  1213. defer googleapi.CloseBody(res)
  1214. if err := googleapi.CheckResponse(res); err != nil {
  1215. return nil, err
  1216. }
  1217. ret := &GoogleLongrunningOperation{
  1218. ServerResponse: googleapi.ServerResponse{
  1219. Header: res.Header,
  1220. HTTPStatusCode: res.StatusCode,
  1221. },
  1222. }
  1223. target := &ret
  1224. if err := gensupport.DecodeResponse(target, res); err != nil {
  1225. return nil, err
  1226. }
  1227. return ret, nil
  1228. // {
  1229. // "description": "Imports entities into Google Cloud Datastore. Existing entities with the\nsame key 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 ImportEntities operation is cancelled, it is possible\nthat a subset of the data has already been imported to Cloud Datastore.",
  1230. // "flatPath": "v1beta1/projects/{projectId}:import",
  1231. // "httpMethod": "POST",
  1232. // "id": "datastore.projects.import",
  1233. // "parameterOrder": [
  1234. // "projectId"
  1235. // ],
  1236. // "parameters": {
  1237. // "projectId": {
  1238. // "description": "Project ID against which to make the request.",
  1239. // "location": "path",
  1240. // "required": true,
  1241. // "type": "string"
  1242. // }
  1243. // },
  1244. // "path": "v1beta1/projects/{projectId}:import",
  1245. // "request": {
  1246. // "$ref": "GoogleDatastoreAdminV1beta1ImportEntitiesRequest"
  1247. // },
  1248. // "response": {
  1249. // "$ref": "GoogleLongrunningOperation"
  1250. // },
  1251. // "scopes": [
  1252. // "https://www.googleapis.com/auth/cloud-platform",
  1253. // "https://www.googleapis.com/auth/datastore"
  1254. // ]
  1255. // }
  1256. }