1 // Copyright 2024 Google LLC. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated file. DO NOT EDIT. 6 7 // Package datastore provides access to the Cloud Datastore API. 8 // 9 // This package is DEPRECATED. Use package cloud.google.com/go/datastore instead. 10 // 11 // For product documentation, see: https://cloud.google.com/datastore/ 12 // 13 // # Library status 14 // 15 // These client libraries are officially supported by Google. However, this 16 // library is considered complete and is in maintenance mode. This means 17 // that we will address critical bugs and security issues but will not add 18 // any new features. 19 // 20 // When possible, we recommend using our newer 21 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 22 // that are still actively being worked and iterated on. 23 // 24 // # Creating a client 25 // 26 // Usage example: 27 // 28 // import "google.golang.org/api/datastore/v1beta1" 29 // ... 30 // ctx := context.Background() 31 // datastoreService, err := datastore.NewService(ctx) 32 // 33 // In this example, Google Application Default Credentials are used for 34 // authentication. For information on how to create and obtain Application 35 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 36 // 37 // # Other authentication options 38 // 39 // By default, all available scopes (see "Constants") are used to authenticate. 40 // To restrict scopes, use [google.golang.org/api/option.WithScopes]: 41 // 42 // datastoreService, err := datastore.NewService(ctx, option.WithScopes(datastore.DatastoreScope)) 43 // 44 // To use an API key for authentication (note: some APIs do not support API 45 // keys), use [google.golang.org/api/option.WithAPIKey]: 46 // 47 // datastoreService, err := datastore.NewService(ctx, option.WithAPIKey("AIza...")) 48 // 49 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 50 // flow, use [google.golang.org/api/option.WithTokenSource]: 51 // 52 // config := &oauth2.Config{...} 53 // // ... 54 // token, err := config.Exchange(ctx, ...) 55 // datastoreService, err := datastore.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 56 // 57 // See [google.golang.org/api/option.ClientOption] for details on options. 58 package datastore // import "google.golang.org/api/datastore/v1beta1" 59 60 import ( 61 "bytes" 62 "context" 63 "encoding/json" 64 "errors" 65 "fmt" 66 "io" 67 "net/http" 68 "net/url" 69 "strconv" 70 "strings" 71 72 googleapi "google.golang.org/api/googleapi" 73 internal "google.golang.org/api/internal" 74 gensupport "google.golang.org/api/internal/gensupport" 75 option "google.golang.org/api/option" 76 internaloption "google.golang.org/api/option/internaloption" 77 htransport "google.golang.org/api/transport/http" 78 ) 79 80 // Always reference these packages, just in case the auto-generated code 81 // below doesn't. 82 var _ = bytes.NewBuffer 83 var _ = strconv.Itoa 84 var _ = fmt.Sprintf 85 var _ = json.NewDecoder 86 var _ = io.Copy 87 var _ = url.Parse 88 var _ = gensupport.MarshalJSON 89 var _ = googleapi.Version 90 var _ = errors.New 91 var _ = strings.Replace 92 var _ = context.Canceled 93 var _ = internaloption.WithDefaultEndpoint 94 var _ = internal.Version 95 96 const apiId = "datastore:v1beta1" 97 const apiName = "datastore" 98 const apiVersion = "v1beta1" 99 const basePath = "https://datastore.googleapis.com/" 100 const basePathTemplate = "https://datastore.UNIVERSE_DOMAIN/" 101 const mtlsBasePath = "https://datastore.mtls.googleapis.com/" 102 103 // OAuth2 scopes used by this API. 104 const ( 105 // See, edit, configure, and delete your Google Cloud data and see the email 106 // address for your Google Account. 107 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 108 109 // View and manage your Google Cloud Datastore data 110 DatastoreScope = "https://www.googleapis.com/auth/datastore" 111 ) 112 113 // NewService creates a new Service. 114 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 115 scopesOption := internaloption.WithDefaultScopes( 116 "https://www.googleapis.com/auth/cloud-platform", 117 "https://www.googleapis.com/auth/datastore", 118 ) 119 // NOTE: prepend, so we don't override user-specified scopes. 120 opts = append([]option.ClientOption{scopesOption}, opts...) 121 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 122 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 123 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 124 opts = append(opts, internaloption.EnableNewAuthLibrary()) 125 client, endpoint, err := htransport.NewClient(ctx, opts...) 126 if err != nil { 127 return nil, err 128 } 129 s, err := New(client) 130 if err != nil { 131 return nil, err 132 } 133 if endpoint != "" { 134 s.BasePath = endpoint 135 } 136 return s, nil 137 } 138 139 // New creates a new Service. It uses the provided http.Client for requests. 140 // 141 // Deprecated: please use NewService instead. 142 // To provide a custom HTTP client, use option.WithHTTPClient. 143 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 144 func New(client *http.Client) (*Service, error) { 145 if client == nil { 146 return nil, errors.New("client is nil") 147 } 148 s := &Service{client: client, BasePath: basePath} 149 s.Projects = NewProjectsService(s) 150 return s, nil 151 } 152 153 type Service struct { 154 client *http.Client 155 BasePath string // API endpoint base URL 156 UserAgent string // optional additional User-Agent fragment 157 158 Projects *ProjectsService 159 } 160 161 func (s *Service) userAgent() string { 162 if s.UserAgent == "" { 163 return googleapi.UserAgent 164 } 165 return googleapi.UserAgent + " " + s.UserAgent 166 } 167 168 func NewProjectsService(s *Service) *ProjectsService { 169 rs := &ProjectsService{s: s} 170 return rs 171 } 172 173 type ProjectsService struct { 174 s *Service 175 } 176 177 // GoogleDatastoreAdminV1CommonMetadata: Metadata common to all Datastore Admin 178 // operations. 179 type GoogleDatastoreAdminV1CommonMetadata struct { 180 // EndTime: The time the operation ended, either successfully or otherwise. 181 EndTime string `json:"endTime,omitempty"` 182 // Labels: The client-assigned labels which were provided when the operation 183 // was created. May also include additional labels. 184 Labels map[string]string `json:"labels,omitempty"` 185 // OperationType: The type of the operation. Can be used as a filter in 186 // ListOperationsRequest. 187 // 188 // Possible values: 189 // "OPERATION_TYPE_UNSPECIFIED" - Unspecified. 190 // "EXPORT_ENTITIES" - ExportEntities. 191 // "IMPORT_ENTITIES" - ImportEntities. 192 // "CREATE_INDEX" - CreateIndex. 193 // "DELETE_INDEX" - DeleteIndex. 194 OperationType string `json:"operationType,omitempty"` 195 // StartTime: The time that work began on the operation. 196 StartTime string `json:"startTime,omitempty"` 197 // State: The current state of the Operation. 198 // 199 // Possible values: 200 // "STATE_UNSPECIFIED" - Unspecified. 201 // "INITIALIZING" - Request is being prepared for processing. 202 // "PROCESSING" - Request is actively being processed. 203 // "CANCELLING" - Request is in the process of being cancelled after user 204 // called google.longrunning.Operations.CancelOperation on the operation. 205 // "FINALIZING" - Request has been processed and is in its finalization 206 // stage. 207 // "SUCCESSFUL" - Request has completed successfully. 208 // "FAILED" - Request has finished being processed, but encountered an error. 209 // "CANCELLED" - Request has finished being cancelled after user called 210 // google.longrunning.Operations.CancelOperation. 211 State string `json:"state,omitempty"` 212 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 213 // include in API requests. By default, fields with empty or default values are 214 // omitted from API requests. See 215 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 216 // details. 217 ForceSendFields []string `json:"-"` 218 // NullFields is a list of field names (e.g. "EndTime") to include in API 219 // requests with the JSON null value. By default, fields with empty values are 220 // omitted from API requests. See 221 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 222 NullFields []string `json:"-"` 223 } 224 225 func (s *GoogleDatastoreAdminV1CommonMetadata) MarshalJSON() ([]byte, error) { 226 type NoMethod GoogleDatastoreAdminV1CommonMetadata 227 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 228 } 229 230 // GoogleDatastoreAdminV1DatastoreFirestoreMigrationMetadata: Metadata for 231 // Datastore to Firestore migration operations. The DatastoreFirestoreMigration 232 // operation is not started by the end-user via an explicit "creation" method. 233 // This is an intentional deviation from the LRO design pattern. This singleton 234 // resource can be accessed at: 235 // "projects/{project_id}/operations/datastore-firestore-migration" 236 type GoogleDatastoreAdminV1DatastoreFirestoreMigrationMetadata struct { 237 // MigrationState: The current state of migration from Cloud Datastore to Cloud 238 // Firestore in Datastore mode. 239 // 240 // Possible values: 241 // "MIGRATION_STATE_UNSPECIFIED" - Unspecified. 242 // "RUNNING" - The migration is running. 243 // "PAUSED" - The migration is paused. 244 // "COMPLETE" - The migration is complete. 245 MigrationState string `json:"migrationState,omitempty"` 246 // MigrationStep: The current step of migration from Cloud Datastore to Cloud 247 // Firestore in Datastore mode. 248 // 249 // Possible values: 250 // "MIGRATION_STEP_UNSPECIFIED" - Unspecified. 251 // "PREPARE" - Pre-migration: the database is prepared for migration. 252 // "START" - Start of migration. 253 // "APPLY_WRITES_SYNCHRONOUSLY" - Writes are applied synchronously to at 254 // least one replica. 255 // "COPY_AND_VERIFY" - Data is copied to Cloud Firestore and then verified to 256 // match the data in Cloud Datastore. 257 // "REDIRECT_EVENTUALLY_CONSISTENT_READS" - Eventually-consistent reads are 258 // redirected to Cloud Firestore. 259 // "REDIRECT_STRONGLY_CONSISTENT_READS" - Strongly-consistent reads are 260 // redirected to Cloud Firestore. 261 // "REDIRECT_WRITES" - Writes are redirected to Cloud Firestore. 262 MigrationStep string `json:"migrationStep,omitempty"` 263 // ForceSendFields is a list of field names (e.g. "MigrationState") to 264 // unconditionally include in API requests. By default, fields with empty or 265 // default values are omitted from API requests. See 266 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 267 // details. 268 ForceSendFields []string `json:"-"` 269 // NullFields is a list of field names (e.g. "MigrationState") to include in 270 // API requests with the JSON null value. By default, fields with empty values 271 // are omitted from API requests. See 272 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 273 NullFields []string `json:"-"` 274 } 275 276 func (s *GoogleDatastoreAdminV1DatastoreFirestoreMigrationMetadata) MarshalJSON() ([]byte, error) { 277 type NoMethod GoogleDatastoreAdminV1DatastoreFirestoreMigrationMetadata 278 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 279 } 280 281 // GoogleDatastoreAdminV1EntityFilter: Identifies a subset of entities in a 282 // project. This is specified as combinations of kinds and namespaces (either 283 // or both of which may be all, as described in the following examples). 284 // Example usage: Entire project: kinds=[], namespace_ids=[] Kinds Foo and Bar 285 // in all namespaces: kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar 286 // only in the default namespace: kinds=['Foo', 'Bar'], namespace_ids=[”] 287 // Kinds Foo and Bar in both the default and Baz namespaces: kinds=['Foo', 288 // 'Bar'], namespace_ids=[”, 'Baz'] The entire Baz namespace: kinds=[], 289 // namespace_ids=['Baz'] 290 type GoogleDatastoreAdminV1EntityFilter struct { 291 // Kinds: If empty, then this represents all kinds. 292 Kinds []string `json:"kinds,omitempty"` 293 // NamespaceIds: An empty list represents all namespaces. This is the preferred 294 // usage for projects that don't use namespaces. An empty string element 295 // represents the default namespace. This should be used if the project has 296 // data in non-default namespaces, but doesn't want to include them. Each 297 // namespace in this list must be unique. 298 NamespaceIds []string `json:"namespaceIds,omitempty"` 299 // ForceSendFields is a list of field names (e.g. "Kinds") to unconditionally 300 // include in API requests. By default, fields with empty or default values are 301 // omitted from API requests. See 302 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 303 // details. 304 ForceSendFields []string `json:"-"` 305 // NullFields is a list of field names (e.g. "Kinds") to include in API 306 // requests with the JSON null value. By default, fields with empty values are 307 // omitted from API requests. See 308 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 309 NullFields []string `json:"-"` 310 } 311 312 func (s *GoogleDatastoreAdminV1EntityFilter) MarshalJSON() ([]byte, error) { 313 type NoMethod GoogleDatastoreAdminV1EntityFilter 314 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 315 } 316 317 // GoogleDatastoreAdminV1ExportEntitiesMetadata: Metadata for ExportEntities 318 // operations. 319 type GoogleDatastoreAdminV1ExportEntitiesMetadata struct { 320 // Common: Metadata common to all Datastore Admin operations. 321 Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"` 322 // EntityFilter: Description of which entities are being exported. 323 EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"` 324 // OutputUrlPrefix: Location for the export metadata and data files. This will 325 // be the same value as the 326 // google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix field. The 327 // final output location is provided in 328 // google.datastore.admin.v1.ExportEntitiesResponse.output_url. 329 OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"` 330 // ProgressBytes: An estimate of the number of bytes processed. 331 ProgressBytes *GoogleDatastoreAdminV1Progress `json:"progressBytes,omitempty"` 332 // ProgressEntities: An estimate of the number of entities processed. 333 ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"` 334 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 335 // include in API requests. By default, fields with empty or default values are 336 // omitted from API requests. See 337 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 338 // details. 339 ForceSendFields []string `json:"-"` 340 // NullFields is a list of field names (e.g. "Common") to include in API 341 // requests with the JSON null value. By default, fields with empty values are 342 // omitted from API requests. See 343 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 344 NullFields []string `json:"-"` 345 } 346 347 func (s *GoogleDatastoreAdminV1ExportEntitiesMetadata) MarshalJSON() ([]byte, error) { 348 type NoMethod GoogleDatastoreAdminV1ExportEntitiesMetadata 349 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 350 } 351 352 // GoogleDatastoreAdminV1ExportEntitiesResponse: The response for 353 // google.datastore.admin.v1.DatastoreAdmin.ExportEntities. 354 type GoogleDatastoreAdminV1ExportEntitiesResponse struct { 355 // OutputUrl: Location of the output metadata file. This can be used to begin 356 // an import into Cloud Datastore (this project or another project). See 357 // google.datastore.admin.v1.ImportEntitiesRequest.input_url. Only present if 358 // the operation completed successfully. 359 OutputUrl string `json:"outputUrl,omitempty"` 360 // ForceSendFields is a list of field names (e.g. "OutputUrl") to 361 // unconditionally include in API requests. By default, fields with empty or 362 // default values are omitted from API requests. See 363 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 364 // details. 365 ForceSendFields []string `json:"-"` 366 // NullFields is a list of field names (e.g. "OutputUrl") to include in API 367 // requests with the JSON null value. By default, fields with empty values are 368 // omitted from API requests. See 369 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 370 NullFields []string `json:"-"` 371 } 372 373 func (s *GoogleDatastoreAdminV1ExportEntitiesResponse) MarshalJSON() ([]byte, error) { 374 type NoMethod GoogleDatastoreAdminV1ExportEntitiesResponse 375 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 376 } 377 378 // GoogleDatastoreAdminV1ImportEntitiesMetadata: Metadata for ImportEntities 379 // operations. 380 type GoogleDatastoreAdminV1ImportEntitiesMetadata struct { 381 // Common: Metadata common to all Datastore Admin operations. 382 Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"` 383 // EntityFilter: Description of which entities are being imported. 384 EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"` 385 // InputUrl: The location of the import metadata file. This will be the same 386 // value as the google.datastore.admin.v1.ExportEntitiesResponse.output_url 387 // field. 388 InputUrl string `json:"inputUrl,omitempty"` 389 // ProgressBytes: An estimate of the number of bytes processed. 390 ProgressBytes *GoogleDatastoreAdminV1Progress `json:"progressBytes,omitempty"` 391 // ProgressEntities: An estimate of the number of entities processed. 392 ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"` 393 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 394 // include in API requests. By default, fields with empty or default values are 395 // omitted from API requests. See 396 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 397 // details. 398 ForceSendFields []string `json:"-"` 399 // NullFields is a list of field names (e.g. "Common") to include in API 400 // requests with the JSON null value. By default, fields with empty values are 401 // omitted from API requests. See 402 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 403 NullFields []string `json:"-"` 404 } 405 406 func (s *GoogleDatastoreAdminV1ImportEntitiesMetadata) MarshalJSON() ([]byte, error) { 407 type NoMethod GoogleDatastoreAdminV1ImportEntitiesMetadata 408 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 409 } 410 411 // GoogleDatastoreAdminV1IndexOperationMetadata: Metadata for Index operations. 412 type GoogleDatastoreAdminV1IndexOperationMetadata struct { 413 // Common: Metadata common to all Datastore Admin operations. 414 Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"` 415 // IndexId: The index resource ID that this operation is acting on. 416 IndexId string `json:"indexId,omitempty"` 417 // ProgressEntities: An estimate of the number of entities processed. 418 ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"` 419 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 420 // include in API requests. By default, fields with empty or default values are 421 // omitted from API requests. See 422 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 423 // details. 424 ForceSendFields []string `json:"-"` 425 // NullFields is a list of field names (e.g. "Common") to include in API 426 // requests with the JSON null value. By default, fields with empty values are 427 // omitted from API requests. See 428 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 429 NullFields []string `json:"-"` 430 } 431 432 func (s *GoogleDatastoreAdminV1IndexOperationMetadata) MarshalJSON() ([]byte, error) { 433 type NoMethod GoogleDatastoreAdminV1IndexOperationMetadata 434 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 435 } 436 437 // GoogleDatastoreAdminV1MigrationProgressEvent: An event signifying the start 438 // of a new step in a migration from Cloud Datastore to Cloud Firestore in 439 // Datastore mode 440 // (https://cloud.google.com/datastore/docs/upgrade-to-firestore). 441 type GoogleDatastoreAdminV1MigrationProgressEvent struct { 442 // PrepareStepDetails: Details for the `PREPARE` step. 443 PrepareStepDetails *GoogleDatastoreAdminV1PrepareStepDetails `json:"prepareStepDetails,omitempty"` 444 // RedirectWritesStepDetails: Details for the `REDIRECT_WRITES` step. 445 RedirectWritesStepDetails *GoogleDatastoreAdminV1RedirectWritesStepDetails `json:"redirectWritesStepDetails,omitempty"` 446 // Step: The step that is starting. An event with step set to `START` indicates 447 // that the migration has been reverted back to the initial pre-migration 448 // state. 449 // 450 // Possible values: 451 // "MIGRATION_STEP_UNSPECIFIED" - Unspecified. 452 // "PREPARE" - Pre-migration: the database is prepared for migration. 453 // "START" - Start of migration. 454 // "APPLY_WRITES_SYNCHRONOUSLY" - Writes are applied synchronously to at 455 // least one replica. 456 // "COPY_AND_VERIFY" - Data is copied to Cloud Firestore and then verified to 457 // match the data in Cloud Datastore. 458 // "REDIRECT_EVENTUALLY_CONSISTENT_READS" - Eventually-consistent reads are 459 // redirected to Cloud Firestore. 460 // "REDIRECT_STRONGLY_CONSISTENT_READS" - Strongly-consistent reads are 461 // redirected to Cloud Firestore. 462 // "REDIRECT_WRITES" - Writes are redirected to Cloud Firestore. 463 Step string `json:"step,omitempty"` 464 // ForceSendFields is a list of field names (e.g. "PrepareStepDetails") to 465 // unconditionally include in API requests. By default, fields with empty or 466 // default values are omitted from API requests. See 467 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 468 // details. 469 ForceSendFields []string `json:"-"` 470 // NullFields is a list of field names (e.g. "PrepareStepDetails") to include 471 // in API requests with the JSON null value. By default, fields with empty 472 // values are omitted from API requests. See 473 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 474 NullFields []string `json:"-"` 475 } 476 477 func (s *GoogleDatastoreAdminV1MigrationProgressEvent) MarshalJSON() ([]byte, error) { 478 type NoMethod GoogleDatastoreAdminV1MigrationProgressEvent 479 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 480 } 481 482 // GoogleDatastoreAdminV1MigrationStateEvent: An event signifying a change in 483 // state of a migration from Cloud Datastore to Cloud Firestore in Datastore 484 // mode (https://cloud.google.com/datastore/docs/upgrade-to-firestore). 485 type GoogleDatastoreAdminV1MigrationStateEvent struct { 486 // State: The new state of the migration. 487 // 488 // Possible values: 489 // "MIGRATION_STATE_UNSPECIFIED" - Unspecified. 490 // "RUNNING" - The migration is running. 491 // "PAUSED" - The migration is paused. 492 // "COMPLETE" - The migration is complete. 493 State string `json:"state,omitempty"` 494 // ForceSendFields is a list of field names (e.g. "State") to unconditionally 495 // include in API requests. By default, fields with empty or default values are 496 // omitted from API requests. See 497 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 498 // details. 499 ForceSendFields []string `json:"-"` 500 // NullFields is a list of field names (e.g. "State") to include in API 501 // requests with the JSON null value. By default, fields with empty values are 502 // omitted from API requests. See 503 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 504 NullFields []string `json:"-"` 505 } 506 507 func (s *GoogleDatastoreAdminV1MigrationStateEvent) MarshalJSON() ([]byte, error) { 508 type NoMethod GoogleDatastoreAdminV1MigrationStateEvent 509 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 510 } 511 512 // GoogleDatastoreAdminV1PrepareStepDetails: Details for the `PREPARE` step. 513 type GoogleDatastoreAdminV1PrepareStepDetails struct { 514 // ConcurrencyMode: The concurrency mode this database will use when it reaches 515 // the `REDIRECT_WRITES` step. 516 // 517 // Possible values: 518 // "CONCURRENCY_MODE_UNSPECIFIED" - Unspecified. 519 // "PESSIMISTIC" - Pessimistic concurrency. 520 // "OPTIMISTIC" - Optimistic concurrency. 521 // "OPTIMISTIC_WITH_ENTITY_GROUPS" - Optimistic concurrency with entity 522 // groups. 523 ConcurrencyMode string `json:"concurrencyMode,omitempty"` 524 // ForceSendFields is a list of field names (e.g. "ConcurrencyMode") to 525 // unconditionally include in API requests. By default, fields with empty or 526 // default values are omitted from API requests. See 527 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 528 // details. 529 ForceSendFields []string `json:"-"` 530 // NullFields is a list of field names (e.g. "ConcurrencyMode") to include in 531 // API requests with the JSON null value. By default, fields with empty values 532 // are omitted from API requests. See 533 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 534 NullFields []string `json:"-"` 535 } 536 537 func (s *GoogleDatastoreAdminV1PrepareStepDetails) MarshalJSON() ([]byte, error) { 538 type NoMethod GoogleDatastoreAdminV1PrepareStepDetails 539 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 540 } 541 542 // GoogleDatastoreAdminV1Progress: Measures the progress of a particular 543 // metric. 544 type GoogleDatastoreAdminV1Progress struct { 545 // WorkCompleted: The amount of work that has been completed. Note that this 546 // may be greater than work_estimated. 547 WorkCompleted int64 `json:"workCompleted,omitempty,string"` 548 // WorkEstimated: An estimate of how much work needs to be performed. May be 549 // zero if the work estimate is unavailable. 550 WorkEstimated int64 `json:"workEstimated,omitempty,string"` 551 // ForceSendFields is a list of field names (e.g. "WorkCompleted") to 552 // unconditionally include in API requests. By default, fields with empty or 553 // default values are omitted from API requests. See 554 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 555 // details. 556 ForceSendFields []string `json:"-"` 557 // NullFields is a list of field names (e.g. "WorkCompleted") to include in API 558 // requests with the JSON null value. By default, fields with empty values are 559 // omitted from API requests. See 560 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 561 NullFields []string `json:"-"` 562 } 563 564 func (s *GoogleDatastoreAdminV1Progress) MarshalJSON() ([]byte, error) { 565 type NoMethod GoogleDatastoreAdminV1Progress 566 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 567 } 568 569 // GoogleDatastoreAdminV1RedirectWritesStepDetails: Details for the 570 // `REDIRECT_WRITES` step. 571 type GoogleDatastoreAdminV1RedirectWritesStepDetails struct { 572 // ConcurrencyMode: Ths concurrency mode for this database. 573 // 574 // Possible values: 575 // "CONCURRENCY_MODE_UNSPECIFIED" - Unspecified. 576 // "PESSIMISTIC" - Pessimistic concurrency. 577 // "OPTIMISTIC" - Optimistic concurrency. 578 // "OPTIMISTIC_WITH_ENTITY_GROUPS" - Optimistic concurrency with entity 579 // groups. 580 ConcurrencyMode string `json:"concurrencyMode,omitempty"` 581 // ForceSendFields is a list of field names (e.g. "ConcurrencyMode") to 582 // unconditionally include in API requests. By default, fields with empty or 583 // default values are omitted from API requests. See 584 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 585 // details. 586 ForceSendFields []string `json:"-"` 587 // NullFields is a list of field names (e.g. "ConcurrencyMode") to include in 588 // API requests with the JSON null value. By default, fields with empty values 589 // are omitted from API requests. See 590 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 591 NullFields []string `json:"-"` 592 } 593 594 func (s *GoogleDatastoreAdminV1RedirectWritesStepDetails) MarshalJSON() ([]byte, error) { 595 type NoMethod GoogleDatastoreAdminV1RedirectWritesStepDetails 596 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 597 } 598 599 // GoogleDatastoreAdminV1beta1CommonMetadata: Metadata common to all Datastore 600 // Admin operations. 601 type GoogleDatastoreAdminV1beta1CommonMetadata struct { 602 // EndTime: The time the operation ended, either successfully or otherwise. 603 EndTime string `json:"endTime,omitempty"` 604 // Labels: The client-assigned labels which were provided when the operation 605 // was created. May also include additional labels. 606 Labels map[string]string `json:"labels,omitempty"` 607 // OperationType: The type of the operation. Can be used as a filter in 608 // ListOperationsRequest. 609 // 610 // Possible values: 611 // "OPERATION_TYPE_UNSPECIFIED" - Unspecified. 612 // "EXPORT_ENTITIES" - ExportEntities. 613 // "IMPORT_ENTITIES" - ImportEntities. 614 OperationType string `json:"operationType,omitempty"` 615 // StartTime: The time that work began on the operation. 616 StartTime string `json:"startTime,omitempty"` 617 // State: The current state of the Operation. 618 // 619 // Possible values: 620 // "STATE_UNSPECIFIED" - Unspecified. 621 // "INITIALIZING" - Request is being prepared for processing. 622 // "PROCESSING" - Request is actively being processed. 623 // "CANCELLING" - Request is in the process of being cancelled after user 624 // called google.longrunning.Operations.CancelOperation on the operation. 625 // "FINALIZING" - Request has been processed and is in its finalization 626 // stage. 627 // "SUCCESSFUL" - Request has completed successfully. 628 // "FAILED" - Request has finished being processed, but encountered an error. 629 // "CANCELLED" - Request has finished being cancelled after user called 630 // google.longrunning.Operations.CancelOperation. 631 State string `json:"state,omitempty"` 632 // ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally 633 // include in API requests. By default, fields with empty or default values are 634 // omitted from API requests. See 635 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 636 // details. 637 ForceSendFields []string `json:"-"` 638 // NullFields is a list of field names (e.g. "EndTime") to include in API 639 // requests with the JSON null value. By default, fields with empty values are 640 // omitted from API requests. See 641 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 642 NullFields []string `json:"-"` 643 } 644 645 func (s *GoogleDatastoreAdminV1beta1CommonMetadata) MarshalJSON() ([]byte, error) { 646 type NoMethod GoogleDatastoreAdminV1beta1CommonMetadata 647 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 648 } 649 650 // GoogleDatastoreAdminV1beta1EntityFilter: Identifies a subset of entities in 651 // a project. This is specified as combinations of kinds and namespaces (either 652 // or both of which may be all, as described in the following examples). 653 // Example usage: Entire project: kinds=[], namespace_ids=[] Kinds Foo and Bar 654 // in all namespaces: kinds=['Foo', 'Bar'], namespace_ids=[] Kinds Foo and Bar 655 // only in the default namespace: kinds=['Foo', 'Bar'], namespace_ids=[”] 656 // Kinds Foo and Bar in both the default and Baz namespaces: kinds=['Foo', 657 // 'Bar'], namespace_ids=[”, 'Baz'] The entire Baz namespace: kinds=[], 658 // namespace_ids=['Baz'] 659 type GoogleDatastoreAdminV1beta1EntityFilter struct { 660 // Kinds: If empty, then this represents all kinds. 661 Kinds []string `json:"kinds,omitempty"` 662 // NamespaceIds: An empty list represents all namespaces. This is the preferred 663 // usage for projects that don't use namespaces. An empty string element 664 // represents the default namespace. This should be used if the project has 665 // data in non-default namespaces, but doesn't want to include them. Each 666 // namespace in this list must be unique. 667 NamespaceIds []string `json:"namespaceIds,omitempty"` 668 // ForceSendFields is a list of field names (e.g. "Kinds") to unconditionally 669 // include in API requests. By default, fields with empty or default values are 670 // omitted from API requests. See 671 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 672 // details. 673 ForceSendFields []string `json:"-"` 674 // NullFields is a list of field names (e.g. "Kinds") to include in API 675 // requests with the JSON null value. By default, fields with empty values are 676 // omitted from API requests. See 677 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 678 NullFields []string `json:"-"` 679 } 680 681 func (s *GoogleDatastoreAdminV1beta1EntityFilter) MarshalJSON() ([]byte, error) { 682 type NoMethod GoogleDatastoreAdminV1beta1EntityFilter 683 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 684 } 685 686 // GoogleDatastoreAdminV1beta1ExportEntitiesMetadata: Metadata for 687 // ExportEntities operations. 688 type GoogleDatastoreAdminV1beta1ExportEntitiesMetadata struct { 689 // Common: Metadata common to all Datastore Admin operations. 690 Common *GoogleDatastoreAdminV1beta1CommonMetadata `json:"common,omitempty"` 691 // EntityFilter: Description of which entities are being exported. 692 EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"` 693 // OutputUrlPrefix: Location for the export metadata and data files. This will 694 // be the same value as the 695 // google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_prefix 696 // field. The final output location is provided in 697 // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. 698 OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"` 699 // ProgressBytes: An estimate of the number of bytes processed. 700 ProgressBytes *GoogleDatastoreAdminV1beta1Progress `json:"progressBytes,omitempty"` 701 // ProgressEntities: An estimate of the number of entities processed. 702 ProgressEntities *GoogleDatastoreAdminV1beta1Progress `json:"progressEntities,omitempty"` 703 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 704 // include in API requests. By default, fields with empty or default values are 705 // omitted from API requests. See 706 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 707 // details. 708 ForceSendFields []string `json:"-"` 709 // NullFields is a list of field names (e.g. "Common") to include in API 710 // requests with the JSON null value. By default, fields with empty values are 711 // omitted from API requests. See 712 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 713 NullFields []string `json:"-"` 714 } 715 716 func (s *GoogleDatastoreAdminV1beta1ExportEntitiesMetadata) MarshalJSON() ([]byte, error) { 717 type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesMetadata 718 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 719 } 720 721 // GoogleDatastoreAdminV1beta1ExportEntitiesRequest: The request for 722 // google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. 723 type GoogleDatastoreAdminV1beta1ExportEntitiesRequest struct { 724 // EntityFilter: Description of what data from the project is included in the 725 // export. 726 EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"` 727 // Labels: Client-assigned labels. 728 Labels map[string]string `json:"labels,omitempty"` 729 // OutputUrlPrefix: Location for the export metadata and data files. The full 730 // resource URL of the external storage location. Currently, only Google Cloud 731 // Storage is supported. So output_url_prefix should be of the form: 732 // `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the name of the 733 // Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud Storage 734 // namespace path (this is not a Cloud Datastore namespace). For more 735 // information about Cloud Storage namespace paths, see Object name 736 // considerations 737 // (https://cloud.google.com/storage/docs/naming#object-considerations). The 738 // resulting files will be nested deeper than the specified URL prefix. The 739 // final output URL will be provided in the 740 // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. That 741 // value should be used for subsequent ImportEntities operations. By nesting 742 // the data files deeper, the same Cloud Storage bucket can be used in multiple 743 // ExportEntities operations without conflict. 744 OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"` 745 // ForceSendFields is a list of field names (e.g. "EntityFilter") to 746 // unconditionally include in API requests. By default, fields with empty or 747 // default values are omitted from API requests. See 748 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 749 // details. 750 ForceSendFields []string `json:"-"` 751 // NullFields is a list of field names (e.g. "EntityFilter") to include in API 752 // requests with the JSON null value. By default, fields with empty values are 753 // omitted from API requests. See 754 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 755 NullFields []string `json:"-"` 756 } 757 758 func (s *GoogleDatastoreAdminV1beta1ExportEntitiesRequest) MarshalJSON() ([]byte, error) { 759 type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesRequest 760 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 761 } 762 763 // GoogleDatastoreAdminV1beta1ExportEntitiesResponse: The response for 764 // google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities. 765 type GoogleDatastoreAdminV1beta1ExportEntitiesResponse struct { 766 // OutputUrl: Location of the output metadata file. This can be used to begin 767 // an import into Cloud Datastore (this project or another project). See 768 // google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url. Only present 769 // if the operation completed successfully. 770 OutputUrl string `json:"outputUrl,omitempty"` 771 // ForceSendFields is a list of field names (e.g. "OutputUrl") to 772 // unconditionally include in API requests. By default, fields with empty or 773 // default values are omitted from API requests. See 774 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 775 // details. 776 ForceSendFields []string `json:"-"` 777 // NullFields is a list of field names (e.g. "OutputUrl") to include in API 778 // requests with the JSON null value. By default, fields with empty values are 779 // omitted from API requests. See 780 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 781 NullFields []string `json:"-"` 782 } 783 784 func (s *GoogleDatastoreAdminV1beta1ExportEntitiesResponse) MarshalJSON() ([]byte, error) { 785 type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesResponse 786 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 787 } 788 789 // GoogleDatastoreAdminV1beta1ImportEntitiesMetadata: Metadata for 790 // ImportEntities operations. 791 type GoogleDatastoreAdminV1beta1ImportEntitiesMetadata struct { 792 // Common: Metadata common to all Datastore Admin operations. 793 Common *GoogleDatastoreAdminV1beta1CommonMetadata `json:"common,omitempty"` 794 // EntityFilter: Description of which entities are being imported. 795 EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"` 796 // InputUrl: The location of the import metadata file. This will be the same 797 // value as the 798 // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url field. 799 InputUrl string `json:"inputUrl,omitempty"` 800 // ProgressBytes: An estimate of the number of bytes processed. 801 ProgressBytes *GoogleDatastoreAdminV1beta1Progress `json:"progressBytes,omitempty"` 802 // ProgressEntities: An estimate of the number of entities processed. 803 ProgressEntities *GoogleDatastoreAdminV1beta1Progress `json:"progressEntities,omitempty"` 804 // ForceSendFields is a list of field names (e.g. "Common") to unconditionally 805 // include in API requests. By default, fields with empty or default values are 806 // omitted from API requests. See 807 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 808 // details. 809 ForceSendFields []string `json:"-"` 810 // NullFields is a list of field names (e.g. "Common") to include in API 811 // requests with the JSON null value. By default, fields with empty values are 812 // omitted from API requests. See 813 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 814 NullFields []string `json:"-"` 815 } 816 817 func (s *GoogleDatastoreAdminV1beta1ImportEntitiesMetadata) MarshalJSON() ([]byte, error) { 818 type NoMethod GoogleDatastoreAdminV1beta1ImportEntitiesMetadata 819 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 820 } 821 822 // GoogleDatastoreAdminV1beta1ImportEntitiesRequest: The request for 823 // google.datastore.admin.v1beta1.DatastoreAdmin.ImportEntities. 824 type GoogleDatastoreAdminV1beta1ImportEntitiesRequest struct { 825 // EntityFilter: Optionally specify which kinds/namespaces are to be imported. 826 // If provided, the list must be a subset of the EntityFilter used in creating 827 // the export, otherwise a FAILED_PRECONDITION error will be returned. If no 828 // filter is specified then all entities from the export are imported. 829 EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"` 830 // InputUrl: The full resource URL of the external storage location. Currently, 831 // only Google Cloud Storage is supported. So input_url should be of the form: 832 // `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where 833 // `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is 834 // an optional Cloud Storage namespace path (this is not a Cloud Datastore 835 // namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written 836 // by the ExportEntities operation. For more information about Cloud Storage 837 // namespace paths, see Object name considerations 838 // (https://cloud.google.com/storage/docs/naming#object-considerations). For 839 // more information, see 840 // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url. 841 InputUrl string `json:"inputUrl,omitempty"` 842 // Labels: Client-assigned labels. 843 Labels map[string]string `json:"labels,omitempty"` 844 // ForceSendFields is a list of field names (e.g. "EntityFilter") to 845 // unconditionally include in API requests. By default, fields with empty or 846 // default values are omitted from API requests. See 847 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 848 // details. 849 ForceSendFields []string `json:"-"` 850 // NullFields is a list of field names (e.g. "EntityFilter") to include in API 851 // requests with the JSON null value. By default, fields with empty values are 852 // omitted from API requests. See 853 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 854 NullFields []string `json:"-"` 855 } 856 857 func (s *GoogleDatastoreAdminV1beta1ImportEntitiesRequest) MarshalJSON() ([]byte, error) { 858 type NoMethod GoogleDatastoreAdminV1beta1ImportEntitiesRequest 859 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 860 } 861 862 // GoogleDatastoreAdminV1beta1Progress: Measures the progress of a particular 863 // metric. 864 type GoogleDatastoreAdminV1beta1Progress struct { 865 // WorkCompleted: The amount of work that has been completed. Note that this 866 // may be greater than work_estimated. 867 WorkCompleted int64 `json:"workCompleted,omitempty,string"` 868 // WorkEstimated: An estimate of how much work needs to be performed. May be 869 // zero if the work estimate is unavailable. 870 WorkEstimated int64 `json:"workEstimated,omitempty,string"` 871 // ForceSendFields is a list of field names (e.g. "WorkCompleted") to 872 // unconditionally include in API requests. By default, fields with empty or 873 // default values are omitted from API requests. See 874 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 875 // details. 876 ForceSendFields []string `json:"-"` 877 // NullFields is a list of field names (e.g. "WorkCompleted") to include in API 878 // requests with the JSON null value. By default, fields with empty values are 879 // omitted from API requests. See 880 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 881 NullFields []string `json:"-"` 882 } 883 884 func (s *GoogleDatastoreAdminV1beta1Progress) MarshalJSON() ([]byte, error) { 885 type NoMethod GoogleDatastoreAdminV1beta1Progress 886 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 887 } 888 889 // GoogleLongrunningOperation: This resource represents a long-running 890 // operation that is the result of a network API call. 891 type GoogleLongrunningOperation struct { 892 // Done: If the value is `false`, it means the operation is still in progress. 893 // If `true`, the operation is completed, and either `error` or `response` is 894 // available. 895 Done bool `json:"done,omitempty"` 896 // Error: The error result of the operation in case of failure or cancellation. 897 Error *Status `json:"error,omitempty"` 898 // Metadata: Service-specific metadata associated with the operation. It 899 // typically contains progress information and common metadata such as create 900 // time. Some services might not provide such metadata. Any method that returns 901 // a long-running operation should document the metadata type, if any. 902 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 903 // Name: The server-assigned name, which is only unique within the same service 904 // that originally returns it. If you use the default HTTP mapping, the `name` 905 // should be a resource name ending with `operations/{unique_id}`. 906 Name string `json:"name,omitempty"` 907 // Response: The normal, successful response of the operation. If the original 908 // method returns no data on success, such as `Delete`, the response is 909 // `google.protobuf.Empty`. If the original method is standard 910 // `Get`/`Create`/`Update`, the response should be the resource. For other 911 // methods, the response should have the type `XxxResponse`, where `Xxx` is the 912 // original method name. For example, if the original method name is 913 // `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. 914 Response googleapi.RawMessage `json:"response,omitempty"` 915 916 // ServerResponse contains the HTTP response code and headers from the server. 917 googleapi.ServerResponse `json:"-"` 918 // ForceSendFields is a list of field names (e.g. "Done") to unconditionally 919 // include in API requests. By default, fields with empty or default values are 920 // omitted from API requests. See 921 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 922 // details. 923 ForceSendFields []string `json:"-"` 924 // NullFields is a list of field names (e.g. "Done") to include in API requests 925 // with the JSON null value. By default, fields with empty values are omitted 926 // from API requests. See 927 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 928 NullFields []string `json:"-"` 929 } 930 931 func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) { 932 type NoMethod GoogleLongrunningOperation 933 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 934 } 935 936 // Status: The `Status` type defines a logical error model that is suitable for 937 // different programming environments, including REST APIs and RPC APIs. It is 938 // used by gRPC (https://github.com/grpc). Each `Status` message contains three 939 // pieces of data: error code, error message, and error details. You can find 940 // out more about this error model and how to work with it in the API Design 941 // Guide (https://cloud.google.com/apis/design/errors). 942 type Status struct { 943 // Code: The status code, which should be an enum value of google.rpc.Code. 944 Code int64 `json:"code,omitempty"` 945 // Details: A list of messages that carry the error details. There is a common 946 // set of message types for APIs to use. 947 Details []googleapi.RawMessage `json:"details,omitempty"` 948 // Message: A developer-facing error message, which should be in English. Any 949 // user-facing error message should be localized and sent in the 950 // google.rpc.Status.details field, or localized by the client. 951 Message string `json:"message,omitempty"` 952 // ForceSendFields is a list of field names (e.g. "Code") to unconditionally 953 // include in API requests. By default, fields with empty or default values are 954 // omitted from API requests. See 955 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 956 // details. 957 ForceSendFields []string `json:"-"` 958 // NullFields is a list of field names (e.g. "Code") to include in API requests 959 // with the JSON null value. By default, fields with empty values are omitted 960 // from API requests. See 961 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 962 NullFields []string `json:"-"` 963 } 964 965 func (s *Status) MarshalJSON() ([]byte, error) { 966 type NoMethod Status 967 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 968 } 969 970 type ProjectsExportCall struct { 971 s *Service 972 projectId string 973 googledatastoreadminv1beta1exportentitiesrequest *GoogleDatastoreAdminV1beta1ExportEntitiesRequest 974 urlParams_ gensupport.URLParams 975 ctx_ context.Context 976 header_ http.Header 977 } 978 979 // Export: Exports a copy of all or a subset of entities from Google Cloud 980 // Datastore to another storage system, such as Google Cloud Storage. Recent 981 // updates to entities may not be reflected in the export. The export occurs in 982 // the background and its progress can be monitored and managed via the 983 // Operation resource that is created. The output of an export may only be used 984 // once the associated operation is done. If an export operation is cancelled 985 // before completion it may leave partial data behind in Google Cloud Storage. 986 // 987 // - projectId: Project ID against which to make the request. 988 func (r *ProjectsService) Export(projectId string, googledatastoreadminv1beta1exportentitiesrequest *GoogleDatastoreAdminV1beta1ExportEntitiesRequest) *ProjectsExportCall { 989 c := &ProjectsExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 990 c.projectId = projectId 991 c.googledatastoreadminv1beta1exportentitiesrequest = googledatastoreadminv1beta1exportentitiesrequest 992 return c 993 } 994 995 // Fields allows partial responses to be retrieved. See 996 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 997 // details. 998 func (c *ProjectsExportCall) Fields(s ...googleapi.Field) *ProjectsExportCall { 999 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1000 return c 1001 } 1002 1003 // Context sets the context to be used in this call's Do method. 1004 func (c *ProjectsExportCall) Context(ctx context.Context) *ProjectsExportCall { 1005 c.ctx_ = ctx 1006 return c 1007 } 1008 1009 // Header returns a http.Header that can be modified by the caller to add 1010 // headers to the request. 1011 func (c *ProjectsExportCall) Header() http.Header { 1012 if c.header_ == nil { 1013 c.header_ = make(http.Header) 1014 } 1015 return c.header_ 1016 } 1017 1018 func (c *ProjectsExportCall) doRequest(alt string) (*http.Response, error) { 1019 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1020 var body io.Reader = nil 1021 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1beta1exportentitiesrequest) 1022 if err != nil { 1023 return nil, err 1024 } 1025 c.urlParams_.Set("alt", alt) 1026 c.urlParams_.Set("prettyPrint", "false") 1027 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:export") 1028 urls += "?" + c.urlParams_.Encode() 1029 req, err := http.NewRequest("POST", urls, body) 1030 if err != nil { 1031 return nil, err 1032 } 1033 req.Header = reqHeaders 1034 googleapi.Expand(req.URL, map[string]string{ 1035 "projectId": c.projectId, 1036 }) 1037 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1038 } 1039 1040 // Do executes the "datastore.projects.export" call. 1041 // Any non-2xx status code is an error. Response headers are in either 1042 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 1043 // returned at all) in error.(*googleapi.Error).Header. Use 1044 // googleapi.IsNotModified to check whether the returned error was because 1045 // http.StatusNotModified was returned. 1046 func (c *ProjectsExportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 1047 gensupport.SetOptions(c.urlParams_, opts...) 1048 res, err := c.doRequest("json") 1049 if res != nil && res.StatusCode == http.StatusNotModified { 1050 if res.Body != nil { 1051 res.Body.Close() 1052 } 1053 return nil, gensupport.WrapError(&googleapi.Error{ 1054 Code: res.StatusCode, 1055 Header: res.Header, 1056 }) 1057 } 1058 if err != nil { 1059 return nil, err 1060 } 1061 defer googleapi.CloseBody(res) 1062 if err := googleapi.CheckResponse(res); err != nil { 1063 return nil, gensupport.WrapError(err) 1064 } 1065 ret := &GoogleLongrunningOperation{ 1066 ServerResponse: googleapi.ServerResponse{ 1067 Header: res.Header, 1068 HTTPStatusCode: res.StatusCode, 1069 }, 1070 } 1071 target := &ret 1072 if err := gensupport.DecodeResponse(target, res); err != nil { 1073 return nil, err 1074 } 1075 return ret, nil 1076 } 1077 1078 type ProjectsImportCall struct { 1079 s *Service 1080 projectId string 1081 googledatastoreadminv1beta1importentitiesrequest *GoogleDatastoreAdminV1beta1ImportEntitiesRequest 1082 urlParams_ gensupport.URLParams 1083 ctx_ context.Context 1084 header_ http.Header 1085 } 1086 1087 // Import: Imports entities into Google Cloud Datastore. Existing entities with 1088 // the same key are overwritten. The import occurs in the background and its 1089 // progress can be monitored and managed via the Operation resource that is 1090 // created. If an ImportEntities operation is cancelled, it is possible that a 1091 // subset of the data has already been imported to Cloud Datastore. 1092 // 1093 // - projectId: Project ID against which to make the request. 1094 func (r *ProjectsService) Import(projectId string, googledatastoreadminv1beta1importentitiesrequest *GoogleDatastoreAdminV1beta1ImportEntitiesRequest) *ProjectsImportCall { 1095 c := &ProjectsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1096 c.projectId = projectId 1097 c.googledatastoreadminv1beta1importentitiesrequest = googledatastoreadminv1beta1importentitiesrequest 1098 return c 1099 } 1100 1101 // Fields allows partial responses to be retrieved. See 1102 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 1103 // details. 1104 func (c *ProjectsImportCall) Fields(s ...googleapi.Field) *ProjectsImportCall { 1105 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1106 return c 1107 } 1108 1109 // Context sets the context to be used in this call's Do method. 1110 func (c *ProjectsImportCall) Context(ctx context.Context) *ProjectsImportCall { 1111 c.ctx_ = ctx 1112 return c 1113 } 1114 1115 // Header returns a http.Header that can be modified by the caller to add 1116 // headers to the request. 1117 func (c *ProjectsImportCall) Header() http.Header { 1118 if c.header_ == nil { 1119 c.header_ = make(http.Header) 1120 } 1121 return c.header_ 1122 } 1123 1124 func (c *ProjectsImportCall) doRequest(alt string) (*http.Response, error) { 1125 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 1126 var body io.Reader = nil 1127 body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1beta1importentitiesrequest) 1128 if err != nil { 1129 return nil, err 1130 } 1131 c.urlParams_.Set("alt", alt) 1132 c.urlParams_.Set("prettyPrint", "false") 1133 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/projects/{projectId}:import") 1134 urls += "?" + c.urlParams_.Encode() 1135 req, err := http.NewRequest("POST", urls, body) 1136 if err != nil { 1137 return nil, err 1138 } 1139 req.Header = reqHeaders 1140 googleapi.Expand(req.URL, map[string]string{ 1141 "projectId": c.projectId, 1142 }) 1143 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1144 } 1145 1146 // Do executes the "datastore.projects.import" call. 1147 // Any non-2xx status code is an error. Response headers are in either 1148 // *GoogleLongrunningOperation.ServerResponse.Header or (if a response was 1149 // returned at all) in error.(*googleapi.Error).Header. Use 1150 // googleapi.IsNotModified to check whether the returned error was because 1151 // http.StatusNotModified was returned. 1152 func (c *ProjectsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) { 1153 gensupport.SetOptions(c.urlParams_, opts...) 1154 res, err := c.doRequest("json") 1155 if res != nil && res.StatusCode == http.StatusNotModified { 1156 if res.Body != nil { 1157 res.Body.Close() 1158 } 1159 return nil, gensupport.WrapError(&googleapi.Error{ 1160 Code: res.StatusCode, 1161 Header: res.Header, 1162 }) 1163 } 1164 if err != nil { 1165 return nil, err 1166 } 1167 defer googleapi.CloseBody(res) 1168 if err := googleapi.CheckResponse(res); err != nil { 1169 return nil, gensupport.WrapError(err) 1170 } 1171 ret := &GoogleLongrunningOperation{ 1172 ServerResponse: googleapi.ServerResponse{ 1173 Header: res.Header, 1174 HTTPStatusCode: res.StatusCode, 1175 }, 1176 } 1177 target := &ret 1178 if err := gensupport.DecodeResponse(target, res); err != nil { 1179 return nil, err 1180 } 1181 return ret, nil 1182 } 1183