1package documentdb 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2020-03-01-preview/documentdb" 22 23// ARMProxyResource the resource model definition for a ARM proxy resource. It will have everything other 24// than required location and tags 25type ARMProxyResource struct { 26 // ID - READ-ONLY; The unique resource identifier of the database account. 27 ID *string `json:"id,omitempty"` 28 // Name - READ-ONLY; The name of the database account. 29 Name *string `json:"name,omitempty"` 30 // Type - READ-ONLY; The type of Azure resource. 31 Type *string `json:"type,omitempty"` 32} 33 34// MarshalJSON is the custom marshaler for ARMProxyResource. 35func (apr ARMProxyResource) MarshalJSON() ([]byte, error) { 36 objectMap := make(map[string]interface{}) 37 return json.Marshal(objectMap) 38} 39 40// ARMResourceProperties the core properties of ARM resources. 41type ARMResourceProperties struct { 42 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 43 ID *string `json:"id,omitempty"` 44 // Name - READ-ONLY; The name of the ARM resource. 45 Name *string `json:"name,omitempty"` 46 // Type - READ-ONLY; The type of Azure resource. 47 Type *string `json:"type,omitempty"` 48 // Location - The location of the resource group to which the resource belongs. 49 Location *string `json:"location,omitempty"` 50 Tags map[string]*string `json:"tags"` 51} 52 53// MarshalJSON is the custom marshaler for ARMResourceProperties. 54func (arp ARMResourceProperties) MarshalJSON() ([]byte, error) { 55 objectMap := make(map[string]interface{}) 56 if arp.Location != nil { 57 objectMap["location"] = arp.Location 58 } 59 if arp.Tags != nil { 60 objectMap["tags"] = arp.Tags 61 } 62 return json.Marshal(objectMap) 63} 64 65// AutoUpgradePolicyResource cosmos DB resource auto-upgrade policy 66type AutoUpgradePolicyResource struct { 67 // ThroughputPolicy - Represents throughput policy which service must adhere to for auto-upgrade 68 ThroughputPolicy *ThroughputPolicyResource `json:"throughputPolicy,omitempty"` 69} 70 71// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. 72type AzureEntityResource struct { 73 // Etag - READ-ONLY; Resource Etag. 74 Etag *string `json:"etag,omitempty"` 75 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 76 ID *string `json:"id,omitempty"` 77 // Name - READ-ONLY; The name of the resource 78 Name *string `json:"name,omitempty"` 79 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 80 Type *string `json:"type,omitempty"` 81} 82 83// MarshalJSON is the custom marshaler for AzureEntityResource. 84func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { 85 objectMap := make(map[string]interface{}) 86 return json.Marshal(objectMap) 87} 88 89// Capability cosmos DB capability object 90type Capability struct { 91 // Name - Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". 92 Name *string `json:"name,omitempty"` 93} 94 95// CassandraKeyspaceCreateUpdateParameters parameters to create and update Cosmos DB Cassandra keyspace. 96type CassandraKeyspaceCreateUpdateParameters struct { 97 // CassandraKeyspaceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra keyspace. 98 *CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"` 99 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 100 ID *string `json:"id,omitempty"` 101 // Name - READ-ONLY; The name of the ARM resource. 102 Name *string `json:"name,omitempty"` 103 // Type - READ-ONLY; The type of Azure resource. 104 Type *string `json:"type,omitempty"` 105 // Location - The location of the resource group to which the resource belongs. 106 Location *string `json:"location,omitempty"` 107 Tags map[string]*string `json:"tags"` 108} 109 110// MarshalJSON is the custom marshaler for CassandraKeyspaceCreateUpdateParameters. 111func (ckcup CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { 112 objectMap := make(map[string]interface{}) 113 if ckcup.CassandraKeyspaceCreateUpdateProperties != nil { 114 objectMap["properties"] = ckcup.CassandraKeyspaceCreateUpdateProperties 115 } 116 if ckcup.Location != nil { 117 objectMap["location"] = ckcup.Location 118 } 119 if ckcup.Tags != nil { 120 objectMap["tags"] = ckcup.Tags 121 } 122 return json.Marshal(objectMap) 123} 124 125// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceCreateUpdateParameters struct. 126func (ckcup *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(body []byte) error { 127 var m map[string]*json.RawMessage 128 err := json.Unmarshal(body, &m) 129 if err != nil { 130 return err 131 } 132 for k, v := range m { 133 switch k { 134 case "properties": 135 if v != nil { 136 var cassandraKeyspaceCreateUpdateProperties CassandraKeyspaceCreateUpdateProperties 137 err = json.Unmarshal(*v, &cassandraKeyspaceCreateUpdateProperties) 138 if err != nil { 139 return err 140 } 141 ckcup.CassandraKeyspaceCreateUpdateProperties = &cassandraKeyspaceCreateUpdateProperties 142 } 143 case "id": 144 if v != nil { 145 var ID string 146 err = json.Unmarshal(*v, &ID) 147 if err != nil { 148 return err 149 } 150 ckcup.ID = &ID 151 } 152 case "name": 153 if v != nil { 154 var name string 155 err = json.Unmarshal(*v, &name) 156 if err != nil { 157 return err 158 } 159 ckcup.Name = &name 160 } 161 case "type": 162 if v != nil { 163 var typeVar string 164 err = json.Unmarshal(*v, &typeVar) 165 if err != nil { 166 return err 167 } 168 ckcup.Type = &typeVar 169 } 170 case "location": 171 if v != nil { 172 var location string 173 err = json.Unmarshal(*v, &location) 174 if err != nil { 175 return err 176 } 177 ckcup.Location = &location 178 } 179 case "tags": 180 if v != nil { 181 var tags map[string]*string 182 err = json.Unmarshal(*v, &tags) 183 if err != nil { 184 return err 185 } 186 ckcup.Tags = tags 187 } 188 } 189 } 190 191 return nil 192} 193 194// CassandraKeyspaceCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra 195// keyspace. 196type CassandraKeyspaceCreateUpdateProperties struct { 197 // Resource - The standard JSON format of a Cassandra keyspace 198 Resource *CassandraKeyspaceResource `json:"resource,omitempty"` 199 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 200 Options *CreateUpdateOptions `json:"options,omitempty"` 201} 202 203// CassandraKeyspaceGetProperties the properties of an Azure Cosmos DB Cassandra keyspace 204type CassandraKeyspaceGetProperties struct { 205 Resource *CassandraKeyspaceGetPropertiesResource `json:"resource,omitempty"` 206 Options *CassandraKeyspaceGetPropertiesOptions `json:"options,omitempty"` 207} 208 209// CassandraKeyspaceGetPropertiesOptions ... 210type CassandraKeyspaceGetPropertiesOptions struct { 211 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 212 Throughput *int32 `json:"throughput,omitempty"` 213} 214 215// CassandraKeyspaceGetPropertiesResource ... 216type CassandraKeyspaceGetPropertiesResource struct { 217 // ID - Name of the Cosmos DB Cassandra keyspace 218 ID *string `json:"id,omitempty"` 219 // Rid - READ-ONLY; A system generated property. A unique identifier. 220 Rid *string `json:"_rid,omitempty"` 221 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 222 Ts interface{} `json:"_ts,omitempty"` 223 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 224 Etag *string `json:"_etag,omitempty"` 225} 226 227// MarshalJSON is the custom marshaler for CassandraKeyspaceGetPropertiesResource. 228func (ckgp CassandraKeyspaceGetPropertiesResource) MarshalJSON() ([]byte, error) { 229 objectMap := make(map[string]interface{}) 230 if ckgp.ID != nil { 231 objectMap["id"] = ckgp.ID 232 } 233 return json.Marshal(objectMap) 234} 235 236// CassandraKeyspaceGetResults an Azure Cosmos DB Cassandra keyspace. 237type CassandraKeyspaceGetResults struct { 238 autorest.Response `json:"-"` 239 // CassandraKeyspaceGetProperties - The properties of an Azure Cosmos DB Cassandra keyspace 240 *CassandraKeyspaceGetProperties `json:"properties,omitempty"` 241 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 242 ID *string `json:"id,omitempty"` 243 // Name - READ-ONLY; The name of the ARM resource. 244 Name *string `json:"name,omitempty"` 245 // Type - READ-ONLY; The type of Azure resource. 246 Type *string `json:"type,omitempty"` 247 // Location - The location of the resource group to which the resource belongs. 248 Location *string `json:"location,omitempty"` 249 Tags map[string]*string `json:"tags"` 250} 251 252// MarshalJSON is the custom marshaler for CassandraKeyspaceGetResults. 253func (ckgr CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) { 254 objectMap := make(map[string]interface{}) 255 if ckgr.CassandraKeyspaceGetProperties != nil { 256 objectMap["properties"] = ckgr.CassandraKeyspaceGetProperties 257 } 258 if ckgr.Location != nil { 259 objectMap["location"] = ckgr.Location 260 } 261 if ckgr.Tags != nil { 262 objectMap["tags"] = ckgr.Tags 263 } 264 return json.Marshal(objectMap) 265} 266 267// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceGetResults struct. 268func (ckgr *CassandraKeyspaceGetResults) UnmarshalJSON(body []byte) error { 269 var m map[string]*json.RawMessage 270 err := json.Unmarshal(body, &m) 271 if err != nil { 272 return err 273 } 274 for k, v := range m { 275 switch k { 276 case "properties": 277 if v != nil { 278 var cassandraKeyspaceGetProperties CassandraKeyspaceGetProperties 279 err = json.Unmarshal(*v, &cassandraKeyspaceGetProperties) 280 if err != nil { 281 return err 282 } 283 ckgr.CassandraKeyspaceGetProperties = &cassandraKeyspaceGetProperties 284 } 285 case "id": 286 if v != nil { 287 var ID string 288 err = json.Unmarshal(*v, &ID) 289 if err != nil { 290 return err 291 } 292 ckgr.ID = &ID 293 } 294 case "name": 295 if v != nil { 296 var name string 297 err = json.Unmarshal(*v, &name) 298 if err != nil { 299 return err 300 } 301 ckgr.Name = &name 302 } 303 case "type": 304 if v != nil { 305 var typeVar string 306 err = json.Unmarshal(*v, &typeVar) 307 if err != nil { 308 return err 309 } 310 ckgr.Type = &typeVar 311 } 312 case "location": 313 if v != nil { 314 var location string 315 err = json.Unmarshal(*v, &location) 316 if err != nil { 317 return err 318 } 319 ckgr.Location = &location 320 } 321 case "tags": 322 if v != nil { 323 var tags map[string]*string 324 err = json.Unmarshal(*v, &tags) 325 if err != nil { 326 return err 327 } 328 ckgr.Tags = tags 329 } 330 } 331 } 332 333 return nil 334} 335 336// CassandraKeyspaceListResult the List operation response, that contains the Cassandra keyspaces and their 337// properties. 338type CassandraKeyspaceListResult struct { 339 autorest.Response `json:"-"` 340 // Value - READ-ONLY; List of Cassandra keyspaces and their properties. 341 Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"` 342} 343 344// MarshalJSON is the custom marshaler for CassandraKeyspaceListResult. 345func (cklr CassandraKeyspaceListResult) MarshalJSON() ([]byte, error) { 346 objectMap := make(map[string]interface{}) 347 return json.Marshal(objectMap) 348} 349 350// CassandraKeyspaceResource cosmos DB Cassandra keyspace resource object 351type CassandraKeyspaceResource struct { 352 // ID - Name of the Cosmos DB Cassandra keyspace 353 ID *string `json:"id,omitempty"` 354} 355 356// CassandraPartitionKey cosmos DB Cassandra table partition key 357type CassandraPartitionKey struct { 358 // Name - Name of the Cosmos DB Cassandra table partition key 359 Name *string `json:"name,omitempty"` 360} 361 362// CassandraResourcesCreateUpdateCassandraKeyspaceFuture an abstraction for monitoring and retrieving the 363// results of a long-running operation. 364type CassandraResourcesCreateUpdateCassandraKeyspaceFuture struct { 365 azure.FutureAPI 366 // Result returns the result of the asynchronous operation. 367 // If the operation has not completed it will return an error. 368 Result func(CassandraResourcesClient) (CassandraKeyspaceGetResults, error) 369} 370 371// UnmarshalJSON is the custom unmarshaller for CreateFuture. 372func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error { 373 var azFuture azure.Future 374 if err := json.Unmarshal(body, &azFuture); err != nil { 375 return err 376 } 377 future.FutureAPI = &azFuture 378 future.Result = future.result 379 return nil 380} 381 382// result is the default implementation for CassandraResourcesCreateUpdateCassandraKeyspaceFuture.Result. 383func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ckgr CassandraKeyspaceGetResults, err error) { 384 var done bool 385 done, err = future.DoneWithContext(context.Background(), client) 386 if err != nil { 387 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") 388 return 389 } 390 if !done { 391 ckgr.Response.Response = future.Response() 392 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture") 393 return 394 } 395 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 396 if ckgr.Response.Response, err = future.GetResult(sender); err == nil && ckgr.Response.Response.StatusCode != http.StatusNoContent { 397 ckgr, err = client.CreateUpdateCassandraKeyspaceResponder(ckgr.Response.Response) 398 if err != nil { 399 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", ckgr.Response.Response, "Failure responding to request") 400 } 401 } 402 return 403} 404 405// CassandraResourcesCreateUpdateCassandraTableFuture an abstraction for monitoring and retrieving the 406// results of a long-running operation. 407type CassandraResourcesCreateUpdateCassandraTableFuture struct { 408 azure.FutureAPI 409 // Result returns the result of the asynchronous operation. 410 // If the operation has not completed it will return an error. 411 Result func(CassandraResourcesClient) (CassandraTableGetResults, error) 412} 413 414// UnmarshalJSON is the custom unmarshaller for CreateFuture. 415func (future *CassandraResourcesCreateUpdateCassandraTableFuture) UnmarshalJSON(body []byte) error { 416 var azFuture azure.Future 417 if err := json.Unmarshal(body, &azFuture); err != nil { 418 return err 419 } 420 future.FutureAPI = &azFuture 421 future.Result = future.result 422 return nil 423} 424 425// result is the default implementation for CassandraResourcesCreateUpdateCassandraTableFuture.Result. 426func (future *CassandraResourcesCreateUpdateCassandraTableFuture) result(client CassandraResourcesClient) (ctgr CassandraTableGetResults, err error) { 427 var done bool 428 done, err = future.DoneWithContext(context.Background(), client) 429 if err != nil { 430 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure") 431 return 432 } 433 if !done { 434 ctgr.Response.Response = future.Response() 435 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraTableFuture") 436 return 437 } 438 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 439 if ctgr.Response.Response, err = future.GetResult(sender); err == nil && ctgr.Response.Response.StatusCode != http.StatusNoContent { 440 ctgr, err = client.CreateUpdateCassandraTableResponder(ctgr.Response.Response) 441 if err != nil { 442 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", ctgr.Response.Response, "Failure responding to request") 443 } 444 } 445 return 446} 447 448// CassandraResourcesDeleteCassandraKeyspaceFuture an abstraction for monitoring and retrieving the results 449// of a long-running operation. 450type CassandraResourcesDeleteCassandraKeyspaceFuture struct { 451 azure.FutureAPI 452 // Result returns the result of the asynchronous operation. 453 // If the operation has not completed it will return an error. 454 Result func(CassandraResourcesClient) (autorest.Response, error) 455} 456 457// UnmarshalJSON is the custom unmarshaller for CreateFuture. 458func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error { 459 var azFuture azure.Future 460 if err := json.Unmarshal(body, &azFuture); err != nil { 461 return err 462 } 463 future.FutureAPI = &azFuture 464 future.Result = future.result 465 return nil 466} 467 468// result is the default implementation for CassandraResourcesDeleteCassandraKeyspaceFuture.Result. 469func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { 470 var done bool 471 done, err = future.DoneWithContext(context.Background(), client) 472 if err != nil { 473 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") 474 return 475 } 476 if !done { 477 ar.Response = future.Response() 478 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture") 479 return 480 } 481 ar.Response = future.Response() 482 return 483} 484 485// CassandraResourcesDeleteCassandraTableFuture an abstraction for monitoring and retrieving the results of 486// a long-running operation. 487type CassandraResourcesDeleteCassandraTableFuture struct { 488 azure.FutureAPI 489 // Result returns the result of the asynchronous operation. 490 // If the operation has not completed it will return an error. 491 Result func(CassandraResourcesClient) (autorest.Response, error) 492} 493 494// UnmarshalJSON is the custom unmarshaller for CreateFuture. 495func (future *CassandraResourcesDeleteCassandraTableFuture) UnmarshalJSON(body []byte) error { 496 var azFuture azure.Future 497 if err := json.Unmarshal(body, &azFuture); err != nil { 498 return err 499 } 500 future.FutureAPI = &azFuture 501 future.Result = future.result 502 return nil 503} 504 505// result is the default implementation for CassandraResourcesDeleteCassandraTableFuture.Result. 506func (future *CassandraResourcesDeleteCassandraTableFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { 507 var done bool 508 done, err = future.DoneWithContext(context.Background(), client) 509 if err != nil { 510 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure") 511 return 512 } 513 if !done { 514 ar.Response = future.Response() 515 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraTableFuture") 516 return 517 } 518 ar.Response = future.Response() 519 return 520} 521 522// CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture an abstraction for monitoring and retrieving 523// the results of a long-running operation. 524type CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture struct { 525 azure.FutureAPI 526 // Result returns the result of the asynchronous operation. 527 // If the operation has not completed it will return an error. 528 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 529} 530 531// UnmarshalJSON is the custom unmarshaller for CreateFuture. 532func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) UnmarshalJSON(body []byte) error { 533 var azFuture azure.Future 534 if err := json.Unmarshal(body, &azFuture); err != nil { 535 return err 536 } 537 future.FutureAPI = &azFuture 538 future.Result = future.result 539 return nil 540} 541 542// result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture.Result. 543func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 544 var done bool 545 done, err = future.DoneWithContext(context.Background(), client) 546 if err != nil { 547 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", future.Response(), "Polling failure") 548 return 549 } 550 if !done { 551 tsgr.Response.Response = future.Response() 552 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture") 553 return 554 } 555 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 556 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 557 tsgr, err = client.MigrateCassandraKeyspaceToAutoscaleResponder(tsgr.Response.Response) 558 if err != nil { 559 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 560 } 561 } 562 return 563} 564 565// CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture an abstraction for monitoring and 566// retrieving the results of a long-running operation. 567type CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture struct { 568 azure.FutureAPI 569 // Result returns the result of the asynchronous operation. 570 // If the operation has not completed it will return an error. 571 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 572} 573 574// UnmarshalJSON is the custom unmarshaller for CreateFuture. 575func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) UnmarshalJSON(body []byte) error { 576 var azFuture azure.Future 577 if err := json.Unmarshal(body, &azFuture); err != nil { 578 return err 579 } 580 future.FutureAPI = &azFuture 581 future.Result = future.result 582 return nil 583} 584 585// result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture.Result. 586func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 587 var done bool 588 done, err = future.DoneWithContext(context.Background(), client) 589 if err != nil { 590 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", future.Response(), "Polling failure") 591 return 592 } 593 if !done { 594 tsgr.Response.Response = future.Response() 595 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture") 596 return 597 } 598 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 599 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 600 tsgr, err = client.MigrateCassandraKeyspaceToManualThroughputResponder(tsgr.Response.Response) 601 if err != nil { 602 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 603 } 604 } 605 return 606} 607 608// CassandraResourcesMigrateCassandraTableToAutoscaleFuture an abstraction for monitoring and retrieving 609// the results of a long-running operation. 610type CassandraResourcesMigrateCassandraTableToAutoscaleFuture struct { 611 azure.FutureAPI 612 // Result returns the result of the asynchronous operation. 613 // If the operation has not completed it will return an error. 614 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 615} 616 617// UnmarshalJSON is the custom unmarshaller for CreateFuture. 618func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) UnmarshalJSON(body []byte) error { 619 var azFuture azure.Future 620 if err := json.Unmarshal(body, &azFuture); err != nil { 621 return err 622 } 623 future.FutureAPI = &azFuture 624 future.Result = future.result 625 return nil 626} 627 628// result is the default implementation for CassandraResourcesMigrateCassandraTableToAutoscaleFuture.Result. 629func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 630 var done bool 631 done, err = future.DoneWithContext(context.Background(), client) 632 if err != nil { 633 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", future.Response(), "Polling failure") 634 return 635 } 636 if !done { 637 tsgr.Response.Response = future.Response() 638 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture") 639 return 640 } 641 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 642 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 643 tsgr, err = client.MigrateCassandraTableToAutoscaleResponder(tsgr.Response.Response) 644 if err != nil { 645 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 646 } 647 } 648 return 649} 650 651// CassandraResourcesMigrateCassandraTableToManualThroughputFuture an abstraction for monitoring and 652// retrieving the results of a long-running operation. 653type CassandraResourcesMigrateCassandraTableToManualThroughputFuture struct { 654 azure.FutureAPI 655 // Result returns the result of the asynchronous operation. 656 // If the operation has not completed it will return an error. 657 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 658} 659 660// UnmarshalJSON is the custom unmarshaller for CreateFuture. 661func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) UnmarshalJSON(body []byte) error { 662 var azFuture azure.Future 663 if err := json.Unmarshal(body, &azFuture); err != nil { 664 return err 665 } 666 future.FutureAPI = &azFuture 667 future.Result = future.result 668 return nil 669} 670 671// result is the default implementation for CassandraResourcesMigrateCassandraTableToManualThroughputFuture.Result. 672func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 673 var done bool 674 done, err = future.DoneWithContext(context.Background(), client) 675 if err != nil { 676 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", future.Response(), "Polling failure") 677 return 678 } 679 if !done { 680 tsgr.Response.Response = future.Response() 681 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture") 682 return 683 } 684 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 685 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 686 tsgr, err = client.MigrateCassandraTableToManualThroughputResponder(tsgr.Response.Response) 687 if err != nil { 688 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 689 } 690 } 691 return 692} 693 694// CassandraResourcesUpdateCassandraKeyspaceThroughputFuture an abstraction for monitoring and retrieving 695// the results of a long-running operation. 696type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture struct { 697 azure.FutureAPI 698 // Result returns the result of the asynchronous operation. 699 // If the operation has not completed it will return an error. 700 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 701} 702 703// UnmarshalJSON is the custom unmarshaller for CreateFuture. 704func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) UnmarshalJSON(body []byte) error { 705 var azFuture azure.Future 706 if err := json.Unmarshal(body, &azFuture); err != nil { 707 return err 708 } 709 future.FutureAPI = &azFuture 710 future.Result = future.result 711 return nil 712} 713 714// result is the default implementation for CassandraResourcesUpdateCassandraKeyspaceThroughputFuture.Result. 715func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 716 var done bool 717 done, err = future.DoneWithContext(context.Background(), client) 718 if err != nil { 719 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", future.Response(), "Polling failure") 720 return 721 } 722 if !done { 723 tsgr.Response.Response = future.Response() 724 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture") 725 return 726 } 727 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 728 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 729 tsgr, err = client.UpdateCassandraKeyspaceThroughputResponder(tsgr.Response.Response) 730 if err != nil { 731 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 732 } 733 } 734 return 735} 736 737// CassandraResourcesUpdateCassandraTableThroughputFuture an abstraction for monitoring and retrieving the 738// results of a long-running operation. 739type CassandraResourcesUpdateCassandraTableThroughputFuture struct { 740 azure.FutureAPI 741 // Result returns the result of the asynchronous operation. 742 // If the operation has not completed it will return an error. 743 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 744} 745 746// UnmarshalJSON is the custom unmarshaller for CreateFuture. 747func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) UnmarshalJSON(body []byte) error { 748 var azFuture azure.Future 749 if err := json.Unmarshal(body, &azFuture); err != nil { 750 return err 751 } 752 future.FutureAPI = &azFuture 753 future.Result = future.result 754 return nil 755} 756 757// result is the default implementation for CassandraResourcesUpdateCassandraTableThroughputFuture.Result. 758func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 759 var done bool 760 done, err = future.DoneWithContext(context.Background(), client) 761 if err != nil { 762 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", future.Response(), "Polling failure") 763 return 764 } 765 if !done { 766 tsgr.Response.Response = future.Response() 767 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture") 768 return 769 } 770 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 771 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 772 tsgr, err = client.UpdateCassandraTableThroughputResponder(tsgr.Response.Response) 773 if err != nil { 774 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 775 } 776 } 777 return 778} 779 780// CassandraSchema cosmos DB Cassandra table schema 781type CassandraSchema struct { 782 // Columns - List of Cassandra table columns. 783 Columns *[]Column `json:"columns,omitempty"` 784 // PartitionKeys - List of partition key. 785 PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"` 786 // ClusterKeys - List of cluster key. 787 ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"` 788} 789 790// CassandraTableCreateUpdateParameters parameters to create and update Cosmos DB Cassandra table. 791type CassandraTableCreateUpdateParameters struct { 792 // CassandraTableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra table. 793 *CassandraTableCreateUpdateProperties `json:"properties,omitempty"` 794 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 795 ID *string `json:"id,omitempty"` 796 // Name - READ-ONLY; The name of the ARM resource. 797 Name *string `json:"name,omitempty"` 798 // Type - READ-ONLY; The type of Azure resource. 799 Type *string `json:"type,omitempty"` 800 // Location - The location of the resource group to which the resource belongs. 801 Location *string `json:"location,omitempty"` 802 Tags map[string]*string `json:"tags"` 803} 804 805// MarshalJSON is the custom marshaler for CassandraTableCreateUpdateParameters. 806func (ctcup CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) { 807 objectMap := make(map[string]interface{}) 808 if ctcup.CassandraTableCreateUpdateProperties != nil { 809 objectMap["properties"] = ctcup.CassandraTableCreateUpdateProperties 810 } 811 if ctcup.Location != nil { 812 objectMap["location"] = ctcup.Location 813 } 814 if ctcup.Tags != nil { 815 objectMap["tags"] = ctcup.Tags 816 } 817 return json.Marshal(objectMap) 818} 819 820// UnmarshalJSON is the custom unmarshaler for CassandraTableCreateUpdateParameters struct. 821func (ctcup *CassandraTableCreateUpdateParameters) UnmarshalJSON(body []byte) error { 822 var m map[string]*json.RawMessage 823 err := json.Unmarshal(body, &m) 824 if err != nil { 825 return err 826 } 827 for k, v := range m { 828 switch k { 829 case "properties": 830 if v != nil { 831 var cassandraTableCreateUpdateProperties CassandraTableCreateUpdateProperties 832 err = json.Unmarshal(*v, &cassandraTableCreateUpdateProperties) 833 if err != nil { 834 return err 835 } 836 ctcup.CassandraTableCreateUpdateProperties = &cassandraTableCreateUpdateProperties 837 } 838 case "id": 839 if v != nil { 840 var ID string 841 err = json.Unmarshal(*v, &ID) 842 if err != nil { 843 return err 844 } 845 ctcup.ID = &ID 846 } 847 case "name": 848 if v != nil { 849 var name string 850 err = json.Unmarshal(*v, &name) 851 if err != nil { 852 return err 853 } 854 ctcup.Name = &name 855 } 856 case "type": 857 if v != nil { 858 var typeVar string 859 err = json.Unmarshal(*v, &typeVar) 860 if err != nil { 861 return err 862 } 863 ctcup.Type = &typeVar 864 } 865 case "location": 866 if v != nil { 867 var location string 868 err = json.Unmarshal(*v, &location) 869 if err != nil { 870 return err 871 } 872 ctcup.Location = &location 873 } 874 case "tags": 875 if v != nil { 876 var tags map[string]*string 877 err = json.Unmarshal(*v, &tags) 878 if err != nil { 879 return err 880 } 881 ctcup.Tags = tags 882 } 883 } 884 } 885 886 return nil 887} 888 889// CassandraTableCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra table. 890type CassandraTableCreateUpdateProperties struct { 891 // Resource - The standard JSON format of a Cassandra table 892 Resource *CassandraTableResource `json:"resource,omitempty"` 893 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 894 Options *CreateUpdateOptions `json:"options,omitempty"` 895} 896 897// CassandraTableGetProperties the properties of an Azure Cosmos DB Cassandra table 898type CassandraTableGetProperties struct { 899 Resource *CassandraTableGetPropertiesResource `json:"resource,omitempty"` 900 Options *CassandraTableGetPropertiesOptions `json:"options,omitempty"` 901} 902 903// CassandraTableGetPropertiesOptions ... 904type CassandraTableGetPropertiesOptions struct { 905 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 906 Throughput *int32 `json:"throughput,omitempty"` 907} 908 909// CassandraTableGetPropertiesResource ... 910type CassandraTableGetPropertiesResource struct { 911 // ID - Name of the Cosmos DB Cassandra table 912 ID *string `json:"id,omitempty"` 913 // DefaultTTL - Time to live of the Cosmos DB Cassandra table 914 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 915 // Schema - Schema of the Cosmos DB Cassandra table 916 Schema *CassandraSchema `json:"schema,omitempty"` 917 // Rid - READ-ONLY; A system generated property. A unique identifier. 918 Rid *string `json:"_rid,omitempty"` 919 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 920 Ts interface{} `json:"_ts,omitempty"` 921 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 922 Etag *string `json:"_etag,omitempty"` 923} 924 925// MarshalJSON is the custom marshaler for CassandraTableGetPropertiesResource. 926func (ctgp CassandraTableGetPropertiesResource) MarshalJSON() ([]byte, error) { 927 objectMap := make(map[string]interface{}) 928 if ctgp.ID != nil { 929 objectMap["id"] = ctgp.ID 930 } 931 if ctgp.DefaultTTL != nil { 932 objectMap["defaultTtl"] = ctgp.DefaultTTL 933 } 934 if ctgp.Schema != nil { 935 objectMap["schema"] = ctgp.Schema 936 } 937 return json.Marshal(objectMap) 938} 939 940// CassandraTableGetResults an Azure Cosmos DB Cassandra table. 941type CassandraTableGetResults struct { 942 autorest.Response `json:"-"` 943 // CassandraTableGetProperties - The properties of an Azure Cosmos DB Cassandra table 944 *CassandraTableGetProperties `json:"properties,omitempty"` 945 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 946 ID *string `json:"id,omitempty"` 947 // Name - READ-ONLY; The name of the ARM resource. 948 Name *string `json:"name,omitempty"` 949 // Type - READ-ONLY; The type of Azure resource. 950 Type *string `json:"type,omitempty"` 951 // Location - The location of the resource group to which the resource belongs. 952 Location *string `json:"location,omitempty"` 953 Tags map[string]*string `json:"tags"` 954} 955 956// MarshalJSON is the custom marshaler for CassandraTableGetResults. 957func (ctgr CassandraTableGetResults) MarshalJSON() ([]byte, error) { 958 objectMap := make(map[string]interface{}) 959 if ctgr.CassandraTableGetProperties != nil { 960 objectMap["properties"] = ctgr.CassandraTableGetProperties 961 } 962 if ctgr.Location != nil { 963 objectMap["location"] = ctgr.Location 964 } 965 if ctgr.Tags != nil { 966 objectMap["tags"] = ctgr.Tags 967 } 968 return json.Marshal(objectMap) 969} 970 971// UnmarshalJSON is the custom unmarshaler for CassandraTableGetResults struct. 972func (ctgr *CassandraTableGetResults) UnmarshalJSON(body []byte) error { 973 var m map[string]*json.RawMessage 974 err := json.Unmarshal(body, &m) 975 if err != nil { 976 return err 977 } 978 for k, v := range m { 979 switch k { 980 case "properties": 981 if v != nil { 982 var cassandraTableGetProperties CassandraTableGetProperties 983 err = json.Unmarshal(*v, &cassandraTableGetProperties) 984 if err != nil { 985 return err 986 } 987 ctgr.CassandraTableGetProperties = &cassandraTableGetProperties 988 } 989 case "id": 990 if v != nil { 991 var ID string 992 err = json.Unmarshal(*v, &ID) 993 if err != nil { 994 return err 995 } 996 ctgr.ID = &ID 997 } 998 case "name": 999 if v != nil { 1000 var name string 1001 err = json.Unmarshal(*v, &name) 1002 if err != nil { 1003 return err 1004 } 1005 ctgr.Name = &name 1006 } 1007 case "type": 1008 if v != nil { 1009 var typeVar string 1010 err = json.Unmarshal(*v, &typeVar) 1011 if err != nil { 1012 return err 1013 } 1014 ctgr.Type = &typeVar 1015 } 1016 case "location": 1017 if v != nil { 1018 var location string 1019 err = json.Unmarshal(*v, &location) 1020 if err != nil { 1021 return err 1022 } 1023 ctgr.Location = &location 1024 } 1025 case "tags": 1026 if v != nil { 1027 var tags map[string]*string 1028 err = json.Unmarshal(*v, &tags) 1029 if err != nil { 1030 return err 1031 } 1032 ctgr.Tags = tags 1033 } 1034 } 1035 } 1036 1037 return nil 1038} 1039 1040// CassandraTableListResult the List operation response, that contains the Cassandra tables and their 1041// properties. 1042type CassandraTableListResult struct { 1043 autorest.Response `json:"-"` 1044 // Value - READ-ONLY; List of Cassandra tables and their properties. 1045 Value *[]CassandraTableGetResults `json:"value,omitempty"` 1046} 1047 1048// MarshalJSON is the custom marshaler for CassandraTableListResult. 1049func (ctlr CassandraTableListResult) MarshalJSON() ([]byte, error) { 1050 objectMap := make(map[string]interface{}) 1051 return json.Marshal(objectMap) 1052} 1053 1054// CassandraTableResource cosmos DB Cassandra table resource object 1055type CassandraTableResource struct { 1056 // ID - Name of the Cosmos DB Cassandra table 1057 ID *string `json:"id,omitempty"` 1058 // DefaultTTL - Time to live of the Cosmos DB Cassandra table 1059 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 1060 // Schema - Schema of the Cosmos DB Cassandra table 1061 Schema *CassandraSchema `json:"schema,omitempty"` 1062} 1063 1064// ClusterKey cosmos DB Cassandra table cluster key 1065type ClusterKey struct { 1066 // Name - Name of the Cosmos DB Cassandra table cluster key 1067 Name *string `json:"name,omitempty"` 1068 // OrderBy - Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" 1069 OrderBy *string `json:"orderBy,omitempty"` 1070} 1071 1072// Column cosmos DB Cassandra table column 1073type Column struct { 1074 // Name - Name of the Cosmos DB Cassandra table column 1075 Name *string `json:"name,omitempty"` 1076 // Type - Type of the Cosmos DB Cassandra table column 1077 Type *string `json:"type,omitempty"` 1078} 1079 1080// CompositePath ... 1081type CompositePath struct { 1082 // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) 1083 Path *string `json:"path,omitempty"` 1084 // Order - Sort order for composite paths. Possible values include: 'Ascending', 'Descending' 1085 Order CompositePathSortOrder `json:"order,omitempty"` 1086} 1087 1088// ConflictResolutionPolicy the conflict resolution policy for the container. 1089type ConflictResolutionPolicy struct { 1090 // Mode - Indicates the conflict resolution mode. Possible values include: 'LastWriterWins', 'Custom' 1091 Mode ConflictResolutionMode `json:"mode,omitempty"` 1092 // ConflictResolutionPath - The conflict resolution path in the case of LastWriterWins mode. 1093 ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"` 1094 // ConflictResolutionProcedure - The procedure to resolve conflicts in the case of custom mode. 1095 ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"` 1096} 1097 1098// ConsistencyPolicy the consistency policy for the Cosmos DB database account. 1099type ConsistencyPolicy struct { 1100 // DefaultConsistencyLevel - The default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix' 1101 DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"` 1102 // MaxStalenessPrefix - When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. 1103 MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"` 1104 // MaxIntervalInSeconds - When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. 1105 MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"` 1106} 1107 1108// ContainerPartitionKey the configuration of the partition key to be used for partitioning data into 1109// multiple partitions 1110type ContainerPartitionKey struct { 1111 // Paths - List of paths using which data within the container can be partitioned 1112 Paths *[]string `json:"paths,omitempty"` 1113 // Kind - Indicates the kind of algorithm used for partitioning. Possible values include: 'PartitionKindHash', 'PartitionKindRange' 1114 Kind PartitionKind `json:"kind,omitempty"` 1115 // Version - Indicates the version of the partition key definition 1116 Version *int32 `json:"version,omitempty"` 1117} 1118 1119// CreateUpdateOptions createUpdateOptions are a list of key-value pairs that describe the resource. 1120// Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput" 1121type CreateUpdateOptions struct { 1122 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 1123 AdditionalProperties map[string]*string `json:""` 1124 // Throughput - Request Units per second. For example, "throughput": "10000". 1125 Throughput *string `json:"throughput,omitempty"` 1126} 1127 1128// MarshalJSON is the custom marshaler for CreateUpdateOptions. 1129func (cuo CreateUpdateOptions) MarshalJSON() ([]byte, error) { 1130 objectMap := make(map[string]interface{}) 1131 if cuo.Throughput != nil { 1132 objectMap["throughput"] = cuo.Throughput 1133 } 1134 for k, v := range cuo.AdditionalProperties { 1135 objectMap[k] = v 1136 } 1137 return json.Marshal(objectMap) 1138} 1139 1140// UnmarshalJSON is the custom unmarshaler for CreateUpdateOptions struct. 1141func (cuo *CreateUpdateOptions) UnmarshalJSON(body []byte) error { 1142 var m map[string]*json.RawMessage 1143 err := json.Unmarshal(body, &m) 1144 if err != nil { 1145 return err 1146 } 1147 for k, v := range m { 1148 switch k { 1149 default: 1150 if v != nil { 1151 var additionalProperties string 1152 err = json.Unmarshal(*v, &additionalProperties) 1153 if err != nil { 1154 return err 1155 } 1156 if cuo.AdditionalProperties == nil { 1157 cuo.AdditionalProperties = make(map[string]*string) 1158 } 1159 cuo.AdditionalProperties[k] = &additionalProperties 1160 } 1161 case "throughput": 1162 if v != nil { 1163 var throughput string 1164 err = json.Unmarshal(*v, &throughput) 1165 if err != nil { 1166 return err 1167 } 1168 cuo.Throughput = &throughput 1169 } 1170 } 1171 } 1172 1173 return nil 1174} 1175 1176// DatabaseAccountConnectionString connection string for the Cosmos DB account 1177type DatabaseAccountConnectionString struct { 1178 // ConnectionString - READ-ONLY; Value of the connection string 1179 ConnectionString *string `json:"connectionString,omitempty"` 1180 // Description - READ-ONLY; Description of the connection string 1181 Description *string `json:"description,omitempty"` 1182} 1183 1184// MarshalJSON is the custom marshaler for DatabaseAccountConnectionString. 1185func (dacs DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) { 1186 objectMap := make(map[string]interface{}) 1187 return json.Marshal(objectMap) 1188} 1189 1190// DatabaseAccountCreateUpdateParameters parameters to create and update Cosmos DB database accounts. 1191type DatabaseAccountCreateUpdateParameters struct { 1192 // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' 1193 Kind DatabaseAccountKind `json:"kind,omitempty"` 1194 *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` 1195 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 1196 ID *string `json:"id,omitempty"` 1197 // Name - READ-ONLY; The name of the ARM resource. 1198 Name *string `json:"name,omitempty"` 1199 // Type - READ-ONLY; The type of Azure resource. 1200 Type *string `json:"type,omitempty"` 1201 // Location - The location of the resource group to which the resource belongs. 1202 Location *string `json:"location,omitempty"` 1203 Tags map[string]*string `json:"tags"` 1204} 1205 1206// MarshalJSON is the custom marshaler for DatabaseAccountCreateUpdateParameters. 1207func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { 1208 objectMap := make(map[string]interface{}) 1209 if dacup.Kind != "" { 1210 objectMap["kind"] = dacup.Kind 1211 } 1212 if dacup.DatabaseAccountCreateUpdateProperties != nil { 1213 objectMap["properties"] = dacup.DatabaseAccountCreateUpdateProperties 1214 } 1215 if dacup.Location != nil { 1216 objectMap["location"] = dacup.Location 1217 } 1218 if dacup.Tags != nil { 1219 objectMap["tags"] = dacup.Tags 1220 } 1221 return json.Marshal(objectMap) 1222} 1223 1224// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateParameters struct. 1225func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error { 1226 var m map[string]*json.RawMessage 1227 err := json.Unmarshal(body, &m) 1228 if err != nil { 1229 return err 1230 } 1231 for k, v := range m { 1232 switch k { 1233 case "kind": 1234 if v != nil { 1235 var kind DatabaseAccountKind 1236 err = json.Unmarshal(*v, &kind) 1237 if err != nil { 1238 return err 1239 } 1240 dacup.Kind = kind 1241 } 1242 case "properties": 1243 if v != nil { 1244 var databaseAccountCreateUpdateProperties DatabaseAccountCreateUpdateProperties 1245 err = json.Unmarshal(*v, &databaseAccountCreateUpdateProperties) 1246 if err != nil { 1247 return err 1248 } 1249 dacup.DatabaseAccountCreateUpdateProperties = &databaseAccountCreateUpdateProperties 1250 } 1251 case "id": 1252 if v != nil { 1253 var ID string 1254 err = json.Unmarshal(*v, &ID) 1255 if err != nil { 1256 return err 1257 } 1258 dacup.ID = &ID 1259 } 1260 case "name": 1261 if v != nil { 1262 var name string 1263 err = json.Unmarshal(*v, &name) 1264 if err != nil { 1265 return err 1266 } 1267 dacup.Name = &name 1268 } 1269 case "type": 1270 if v != nil { 1271 var typeVar string 1272 err = json.Unmarshal(*v, &typeVar) 1273 if err != nil { 1274 return err 1275 } 1276 dacup.Type = &typeVar 1277 } 1278 case "location": 1279 if v != nil { 1280 var location string 1281 err = json.Unmarshal(*v, &location) 1282 if err != nil { 1283 return err 1284 } 1285 dacup.Location = &location 1286 } 1287 case "tags": 1288 if v != nil { 1289 var tags map[string]*string 1290 err = json.Unmarshal(*v, &tags) 1291 if err != nil { 1292 return err 1293 } 1294 dacup.Tags = tags 1295 } 1296 } 1297 } 1298 1299 return nil 1300} 1301 1302// DatabaseAccountCreateUpdateProperties properties to create and update Azure Cosmos DB database accounts. 1303type DatabaseAccountCreateUpdateProperties struct { 1304 // ConsistencyPolicy - The consistency policy for the Cosmos DB account. 1305 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` 1306 // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. 1307 Locations *[]Location `json:"locations,omitempty"` 1308 // DatabaseAccountOfferType - The offer type for the database 1309 DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"` 1310 // IPRangeFilter - Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. 1311 IPRangeFilter *string `json:"ipRangeFilter,omitempty"` 1312 // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. 1313 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` 1314 // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. 1315 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` 1316 // Capabilities - List of Cosmos DB capabilities for the account 1317 Capabilities *[]Capability `json:"capabilities,omitempty"` 1318 // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. 1319 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 1320 // EnableMultipleWriteLocations - Enables the account to write in multiple locations 1321 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` 1322 // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account 1323 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` 1324 // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' 1325 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` 1326 // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys 1327 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` 1328 // KeyVaultKeyURI - The URI of the key vault 1329 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` 1330 // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' 1331 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` 1332} 1333 1334// DatabaseAccountGetProperties properties for the database account. 1335type DatabaseAccountGetProperties struct { 1336 ProvisioningState *string `json:"provisioningState,omitempty"` 1337 // DocumentEndpoint - READ-ONLY; The connection endpoint for the Cosmos DB database account. 1338 DocumentEndpoint *string `json:"documentEndpoint,omitempty"` 1339 // DatabaseAccountOfferType - READ-ONLY; The offer type for the Cosmos DB database account. Default value: Standard. Possible values include: 'Standard' 1340 DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"` 1341 // IPRangeFilter - Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. 1342 IPRangeFilter *string `json:"ipRangeFilter,omitempty"` 1343 // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. 1344 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` 1345 // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. 1346 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` 1347 // ConsistencyPolicy - The consistency policy for the Cosmos DB database account. 1348 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` 1349 // Capabilities - List of Cosmos DB capabilities for the account 1350 Capabilities *[]Capability `json:"capabilities,omitempty"` 1351 // WriteLocations - READ-ONLY; An array that contains the write location for the Cosmos DB account. 1352 WriteLocations *[]Location `json:"writeLocations,omitempty"` 1353 // ReadLocations - READ-ONLY; An array that contains of the read locations enabled for the Cosmos DB account. 1354 ReadLocations *[]Location `json:"readLocations,omitempty"` 1355 // Locations - READ-ONLY; An array that contains all of the locations enabled for the Cosmos DB account. 1356 Locations *[]Location `json:"locations,omitempty"` 1357 // FailoverPolicies - READ-ONLY; An array that contains the regions ordered by their failover priorities. 1358 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` 1359 // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. 1360 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 1361 // PrivateEndpointConnections - READ-ONLY; List of Private Endpoint Connections configured for the Cosmos DB account. 1362 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` 1363 // EnableMultipleWriteLocations - Enables the account to write in multiple locations 1364 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` 1365 // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account 1366 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` 1367 // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' 1368 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` 1369 // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys 1370 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` 1371 // KeyVaultKeyURI - The URI of the key vault 1372 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` 1373 // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' 1374 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` 1375} 1376 1377// MarshalJSON is the custom marshaler for DatabaseAccountGetProperties. 1378func (dagp DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { 1379 objectMap := make(map[string]interface{}) 1380 if dagp.ProvisioningState != nil { 1381 objectMap["provisioningState"] = dagp.ProvisioningState 1382 } 1383 if dagp.IPRangeFilter != nil { 1384 objectMap["ipRangeFilter"] = dagp.IPRangeFilter 1385 } 1386 if dagp.IsVirtualNetworkFilterEnabled != nil { 1387 objectMap["isVirtualNetworkFilterEnabled"] = dagp.IsVirtualNetworkFilterEnabled 1388 } 1389 if dagp.EnableAutomaticFailover != nil { 1390 objectMap["enableAutomaticFailover"] = dagp.EnableAutomaticFailover 1391 } 1392 if dagp.ConsistencyPolicy != nil { 1393 objectMap["consistencyPolicy"] = dagp.ConsistencyPolicy 1394 } 1395 if dagp.Capabilities != nil { 1396 objectMap["capabilities"] = dagp.Capabilities 1397 } 1398 if dagp.VirtualNetworkRules != nil { 1399 objectMap["virtualNetworkRules"] = dagp.VirtualNetworkRules 1400 } 1401 if dagp.EnableMultipleWriteLocations != nil { 1402 objectMap["enableMultipleWriteLocations"] = dagp.EnableMultipleWriteLocations 1403 } 1404 if dagp.EnableCassandraConnector != nil { 1405 objectMap["enableCassandraConnector"] = dagp.EnableCassandraConnector 1406 } 1407 if dagp.ConnectorOffer != "" { 1408 objectMap["connectorOffer"] = dagp.ConnectorOffer 1409 } 1410 if dagp.DisableKeyBasedMetadataWriteAccess != nil { 1411 objectMap["disableKeyBasedMetadataWriteAccess"] = dagp.DisableKeyBasedMetadataWriteAccess 1412 } 1413 if dagp.KeyVaultKeyURI != nil { 1414 objectMap["keyVaultKeyUri"] = dagp.KeyVaultKeyURI 1415 } 1416 if dagp.PublicNetworkAccess != "" { 1417 objectMap["publicNetworkAccess"] = dagp.PublicNetworkAccess 1418 } 1419 return json.Marshal(objectMap) 1420} 1421 1422// DatabaseAccountGetResults an Azure Cosmos DB database account. 1423type DatabaseAccountGetResults struct { 1424 autorest.Response `json:"-"` 1425 // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'GlobalDocumentDB', 'MongoDB', 'Parse' 1426 Kind DatabaseAccountKind `json:"kind,omitempty"` 1427 *DatabaseAccountGetProperties `json:"properties,omitempty"` 1428 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 1429 ID *string `json:"id,omitempty"` 1430 // Name - READ-ONLY; The name of the ARM resource. 1431 Name *string `json:"name,omitempty"` 1432 // Type - READ-ONLY; The type of Azure resource. 1433 Type *string `json:"type,omitempty"` 1434 // Location - The location of the resource group to which the resource belongs. 1435 Location *string `json:"location,omitempty"` 1436 Tags map[string]*string `json:"tags"` 1437} 1438 1439// MarshalJSON is the custom marshaler for DatabaseAccountGetResults. 1440func (dagr DatabaseAccountGetResults) MarshalJSON() ([]byte, error) { 1441 objectMap := make(map[string]interface{}) 1442 if dagr.Kind != "" { 1443 objectMap["kind"] = dagr.Kind 1444 } 1445 if dagr.DatabaseAccountGetProperties != nil { 1446 objectMap["properties"] = dagr.DatabaseAccountGetProperties 1447 } 1448 if dagr.Location != nil { 1449 objectMap["location"] = dagr.Location 1450 } 1451 if dagr.Tags != nil { 1452 objectMap["tags"] = dagr.Tags 1453 } 1454 return json.Marshal(objectMap) 1455} 1456 1457// UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetResults struct. 1458func (dagr *DatabaseAccountGetResults) UnmarshalJSON(body []byte) error { 1459 var m map[string]*json.RawMessage 1460 err := json.Unmarshal(body, &m) 1461 if err != nil { 1462 return err 1463 } 1464 for k, v := range m { 1465 switch k { 1466 case "kind": 1467 if v != nil { 1468 var kind DatabaseAccountKind 1469 err = json.Unmarshal(*v, &kind) 1470 if err != nil { 1471 return err 1472 } 1473 dagr.Kind = kind 1474 } 1475 case "properties": 1476 if v != nil { 1477 var databaseAccountGetProperties DatabaseAccountGetProperties 1478 err = json.Unmarshal(*v, &databaseAccountGetProperties) 1479 if err != nil { 1480 return err 1481 } 1482 dagr.DatabaseAccountGetProperties = &databaseAccountGetProperties 1483 } 1484 case "id": 1485 if v != nil { 1486 var ID string 1487 err = json.Unmarshal(*v, &ID) 1488 if err != nil { 1489 return err 1490 } 1491 dagr.ID = &ID 1492 } 1493 case "name": 1494 if v != nil { 1495 var name string 1496 err = json.Unmarshal(*v, &name) 1497 if err != nil { 1498 return err 1499 } 1500 dagr.Name = &name 1501 } 1502 case "type": 1503 if v != nil { 1504 var typeVar string 1505 err = json.Unmarshal(*v, &typeVar) 1506 if err != nil { 1507 return err 1508 } 1509 dagr.Type = &typeVar 1510 } 1511 case "location": 1512 if v != nil { 1513 var location string 1514 err = json.Unmarshal(*v, &location) 1515 if err != nil { 1516 return err 1517 } 1518 dagr.Location = &location 1519 } 1520 case "tags": 1521 if v != nil { 1522 var tags map[string]*string 1523 err = json.Unmarshal(*v, &tags) 1524 if err != nil { 1525 return err 1526 } 1527 dagr.Tags = tags 1528 } 1529 } 1530 } 1531 1532 return nil 1533} 1534 1535// DatabaseAccountListConnectionStringsResult the connection strings for the given database account. 1536type DatabaseAccountListConnectionStringsResult struct { 1537 autorest.Response `json:"-"` 1538 // ConnectionStrings - An array that contains the connection strings for the Cosmos DB account. 1539 ConnectionStrings *[]DatabaseAccountConnectionString `json:"connectionStrings,omitempty"` 1540} 1541 1542// DatabaseAccountListKeysResult the access keys for the given database account. 1543type DatabaseAccountListKeysResult struct { 1544 autorest.Response `json:"-"` 1545 // PrimaryMasterKey - READ-ONLY; Base 64 encoded value of the primary read-write key. 1546 PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"` 1547 // SecondaryMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-write key. 1548 SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"` 1549 // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. 1550 PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` 1551 // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. 1552 SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` 1553} 1554 1555// MarshalJSON is the custom marshaler for DatabaseAccountListKeysResult. 1556func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { 1557 objectMap := make(map[string]interface{}) 1558 return json.Marshal(objectMap) 1559} 1560 1561// DatabaseAccountListReadOnlyKeysResult the read-only access keys for the given database account. 1562type DatabaseAccountListReadOnlyKeysResult struct { 1563 autorest.Response `json:"-"` 1564 // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. 1565 PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` 1566 // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. 1567 SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` 1568} 1569 1570// MarshalJSON is the custom marshaler for DatabaseAccountListReadOnlyKeysResult. 1571func (dalrokr DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) { 1572 objectMap := make(map[string]interface{}) 1573 return json.Marshal(objectMap) 1574} 1575 1576// DatabaseAccountRegenerateKeyParameters parameters to regenerate the keys within the database account. 1577type DatabaseAccountRegenerateKeyParameters struct { 1578 // KeyKind - The access key to regenerate. Possible values include: 'Primary', 'Secondary', 'PrimaryReadonly', 'SecondaryReadonly' 1579 KeyKind KeyKind `json:"keyKind,omitempty"` 1580} 1581 1582// DatabaseAccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1583// long-running operation. 1584type DatabaseAccountsCreateOrUpdateFuture struct { 1585 azure.FutureAPI 1586 // Result returns the result of the asynchronous operation. 1587 // If the operation has not completed it will return an error. 1588 Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error) 1589} 1590 1591// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1592func (future *DatabaseAccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1593 var azFuture azure.Future 1594 if err := json.Unmarshal(body, &azFuture); err != nil { 1595 return err 1596 } 1597 future.FutureAPI = &azFuture 1598 future.Result = future.result 1599 return nil 1600} 1601 1602// result is the default implementation for DatabaseAccountsCreateOrUpdateFuture.Result. 1603func (future *DatabaseAccountsCreateOrUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) { 1604 var done bool 1605 done, err = future.DoneWithContext(context.Background(), client) 1606 if err != nil { 1607 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1608 return 1609 } 1610 if !done { 1611 dagr.Response.Response = future.Response() 1612 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateOrUpdateFuture") 1613 return 1614 } 1615 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1616 if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent { 1617 dagr, err = client.CreateOrUpdateResponder(dagr.Response.Response) 1618 if err != nil { 1619 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request") 1620 } 1621 } 1622 return 1623} 1624 1625// DatabaseAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1626// operation. 1627type DatabaseAccountsDeleteFuture struct { 1628 azure.FutureAPI 1629 // Result returns the result of the asynchronous operation. 1630 // If the operation has not completed it will return an error. 1631 Result func(DatabaseAccountsClient) (autorest.Response, error) 1632} 1633 1634// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1635func (future *DatabaseAccountsDeleteFuture) UnmarshalJSON(body []byte) error { 1636 var azFuture azure.Future 1637 if err := json.Unmarshal(body, &azFuture); err != nil { 1638 return err 1639 } 1640 future.FutureAPI = &azFuture 1641 future.Result = future.result 1642 return nil 1643} 1644 1645// result is the default implementation for DatabaseAccountsDeleteFuture.Result. 1646func (future *DatabaseAccountsDeleteFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 1647 var done bool 1648 done, err = future.DoneWithContext(context.Background(), client) 1649 if err != nil { 1650 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure") 1651 return 1652 } 1653 if !done { 1654 ar.Response = future.Response() 1655 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteFuture") 1656 return 1657 } 1658 ar.Response = future.Response() 1659 return 1660} 1661 1662// DatabaseAccountsFailoverPriorityChangeFuture an abstraction for monitoring and retrieving the results of 1663// a long-running operation. 1664type DatabaseAccountsFailoverPriorityChangeFuture struct { 1665 azure.FutureAPI 1666 // Result returns the result of the asynchronous operation. 1667 // If the operation has not completed it will return an error. 1668 Result func(DatabaseAccountsClient) (autorest.Response, error) 1669} 1670 1671// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1672func (future *DatabaseAccountsFailoverPriorityChangeFuture) UnmarshalJSON(body []byte) error { 1673 var azFuture azure.Future 1674 if err := json.Unmarshal(body, &azFuture); err != nil { 1675 return err 1676 } 1677 future.FutureAPI = &azFuture 1678 future.Result = future.result 1679 return nil 1680} 1681 1682// result is the default implementation for DatabaseAccountsFailoverPriorityChangeFuture.Result. 1683func (future *DatabaseAccountsFailoverPriorityChangeFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 1684 var done bool 1685 done, err = future.DoneWithContext(context.Background(), client) 1686 if err != nil { 1687 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure") 1688 return 1689 } 1690 if !done { 1691 ar.Response = future.Response() 1692 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture") 1693 return 1694 } 1695 ar.Response = future.Response() 1696 return 1697} 1698 1699// DatabaseAccountsListResult the List operation response, that contains the database accounts and their 1700// properties. 1701type DatabaseAccountsListResult struct { 1702 autorest.Response `json:"-"` 1703 // Value - READ-ONLY; List of database account and their properties. 1704 Value *[]DatabaseAccountGetResults `json:"value,omitempty"` 1705} 1706 1707// MarshalJSON is the custom marshaler for DatabaseAccountsListResult. 1708func (dalr DatabaseAccountsListResult) MarshalJSON() ([]byte, error) { 1709 objectMap := make(map[string]interface{}) 1710 return json.Marshal(objectMap) 1711} 1712 1713// DatabaseAccountsOfflineRegionFuture an abstraction for monitoring and retrieving the results of a 1714// long-running operation. 1715type DatabaseAccountsOfflineRegionFuture struct { 1716 azure.FutureAPI 1717 // Result returns the result of the asynchronous operation. 1718 // If the operation has not completed it will return an error. 1719 Result func(DatabaseAccountsClient) (autorest.Response, error) 1720} 1721 1722// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1723func (future *DatabaseAccountsOfflineRegionFuture) UnmarshalJSON(body []byte) error { 1724 var azFuture azure.Future 1725 if err := json.Unmarshal(body, &azFuture); err != nil { 1726 return err 1727 } 1728 future.FutureAPI = &azFuture 1729 future.Result = future.result 1730 return nil 1731} 1732 1733// result is the default implementation for DatabaseAccountsOfflineRegionFuture.Result. 1734func (future *DatabaseAccountsOfflineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 1735 var done bool 1736 done, err = future.DoneWithContext(context.Background(), client) 1737 if err != nil { 1738 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOfflineRegionFuture", "Result", future.Response(), "Polling failure") 1739 return 1740 } 1741 if !done { 1742 ar.Response = future.Response() 1743 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOfflineRegionFuture") 1744 return 1745 } 1746 ar.Response = future.Response() 1747 return 1748} 1749 1750// DatabaseAccountsOnlineRegionFuture an abstraction for monitoring and retrieving the results of a 1751// long-running operation. 1752type DatabaseAccountsOnlineRegionFuture struct { 1753 azure.FutureAPI 1754 // Result returns the result of the asynchronous operation. 1755 // If the operation has not completed it will return an error. 1756 Result func(DatabaseAccountsClient) (autorest.Response, error) 1757} 1758 1759// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1760func (future *DatabaseAccountsOnlineRegionFuture) UnmarshalJSON(body []byte) error { 1761 var azFuture azure.Future 1762 if err := json.Unmarshal(body, &azFuture); err != nil { 1763 return err 1764 } 1765 future.FutureAPI = &azFuture 1766 future.Result = future.result 1767 return nil 1768} 1769 1770// result is the default implementation for DatabaseAccountsOnlineRegionFuture.Result. 1771func (future *DatabaseAccountsOnlineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 1772 var done bool 1773 done, err = future.DoneWithContext(context.Background(), client) 1774 if err != nil { 1775 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOnlineRegionFuture", "Result", future.Response(), "Polling failure") 1776 return 1777 } 1778 if !done { 1779 ar.Response = future.Response() 1780 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOnlineRegionFuture") 1781 return 1782 } 1783 ar.Response = future.Response() 1784 return 1785} 1786 1787// DatabaseAccountsRegenerateKeyFuture an abstraction for monitoring and retrieving the results of a 1788// long-running operation. 1789type DatabaseAccountsRegenerateKeyFuture struct { 1790 azure.FutureAPI 1791 // Result returns the result of the asynchronous operation. 1792 // If the operation has not completed it will return an error. 1793 Result func(DatabaseAccountsClient) (autorest.Response, error) 1794} 1795 1796// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1797func (future *DatabaseAccountsRegenerateKeyFuture) UnmarshalJSON(body []byte) error { 1798 var azFuture azure.Future 1799 if err := json.Unmarshal(body, &azFuture); err != nil { 1800 return err 1801 } 1802 future.FutureAPI = &azFuture 1803 future.Result = future.result 1804 return nil 1805} 1806 1807// result is the default implementation for DatabaseAccountsRegenerateKeyFuture.Result. 1808func (future *DatabaseAccountsRegenerateKeyFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 1809 var done bool 1810 done, err = future.DoneWithContext(context.Background(), client) 1811 if err != nil { 1812 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure") 1813 return 1814 } 1815 if !done { 1816 ar.Response = future.Response() 1817 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsRegenerateKeyFuture") 1818 return 1819 } 1820 ar.Response = future.Response() 1821 return 1822} 1823 1824// DatabaseAccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1825// operation. 1826type DatabaseAccountsUpdateFuture struct { 1827 azure.FutureAPI 1828 // Result returns the result of the asynchronous operation. 1829 // If the operation has not completed it will return an error. 1830 Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error) 1831} 1832 1833// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1834func (future *DatabaseAccountsUpdateFuture) UnmarshalJSON(body []byte) error { 1835 var azFuture azure.Future 1836 if err := json.Unmarshal(body, &azFuture); err != nil { 1837 return err 1838 } 1839 future.FutureAPI = &azFuture 1840 future.Result = future.result 1841 return nil 1842} 1843 1844// result is the default implementation for DatabaseAccountsUpdateFuture.Result. 1845func (future *DatabaseAccountsUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) { 1846 var done bool 1847 done, err = future.DoneWithContext(context.Background(), client) 1848 if err != nil { 1849 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", future.Response(), "Polling failure") 1850 return 1851 } 1852 if !done { 1853 dagr.Response.Response = future.Response() 1854 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsUpdateFuture") 1855 return 1856 } 1857 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1858 if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent { 1859 dagr, err = client.UpdateResponder(dagr.Response.Response) 1860 if err != nil { 1861 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request") 1862 } 1863 } 1864 return 1865} 1866 1867// DatabaseAccountUpdateParameters parameters for patching Azure Cosmos DB database account properties. 1868type DatabaseAccountUpdateParameters struct { 1869 Tags map[string]*string `json:"tags"` 1870 // Location - The location of the resource group to which the resource belongs. 1871 Location *string `json:"location,omitempty"` 1872 *DatabaseAccountUpdateProperties `json:"properties,omitempty"` 1873} 1874 1875// MarshalJSON is the custom marshaler for DatabaseAccountUpdateParameters. 1876func (daup DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) { 1877 objectMap := make(map[string]interface{}) 1878 if daup.Tags != nil { 1879 objectMap["tags"] = daup.Tags 1880 } 1881 if daup.Location != nil { 1882 objectMap["location"] = daup.Location 1883 } 1884 if daup.DatabaseAccountUpdateProperties != nil { 1885 objectMap["properties"] = daup.DatabaseAccountUpdateProperties 1886 } 1887 return json.Marshal(objectMap) 1888} 1889 1890// UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateParameters struct. 1891func (daup *DatabaseAccountUpdateParameters) UnmarshalJSON(body []byte) error { 1892 var m map[string]*json.RawMessage 1893 err := json.Unmarshal(body, &m) 1894 if err != nil { 1895 return err 1896 } 1897 for k, v := range m { 1898 switch k { 1899 case "tags": 1900 if v != nil { 1901 var tags map[string]*string 1902 err = json.Unmarshal(*v, &tags) 1903 if err != nil { 1904 return err 1905 } 1906 daup.Tags = tags 1907 } 1908 case "location": 1909 if v != nil { 1910 var location string 1911 err = json.Unmarshal(*v, &location) 1912 if err != nil { 1913 return err 1914 } 1915 daup.Location = &location 1916 } 1917 case "properties": 1918 if v != nil { 1919 var databaseAccountUpdateProperties DatabaseAccountUpdateProperties 1920 err = json.Unmarshal(*v, &databaseAccountUpdateProperties) 1921 if err != nil { 1922 return err 1923 } 1924 daup.DatabaseAccountUpdateProperties = &databaseAccountUpdateProperties 1925 } 1926 } 1927 } 1928 1929 return nil 1930} 1931 1932// DatabaseAccountUpdateProperties properties to update Azure Cosmos DB database accounts. 1933type DatabaseAccountUpdateProperties struct { 1934 // ConsistencyPolicy - The consistency policy for the Cosmos DB account. 1935 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` 1936 // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. 1937 Locations *[]Location `json:"locations,omitempty"` 1938 // IPRangeFilter - Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. 1939 IPRangeFilter *string `json:"ipRangeFilter,omitempty"` 1940 // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. 1941 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` 1942 // EnableAutomaticFailover - Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and is chosen based on the failover priorities configured for the account. 1943 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` 1944 // Capabilities - List of Cosmos DB capabilities for the account 1945 Capabilities *[]Capability `json:"capabilities,omitempty"` 1946 // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. 1947 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 1948 // EnableMultipleWriteLocations - Enables the account to write in multiple locations 1949 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` 1950 // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account 1951 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` 1952 // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'Small' 1953 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` 1954 // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys 1955 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` 1956 // KeyVaultKeyURI - The URI of the key vault 1957 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` 1958 // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' 1959 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` 1960} 1961 1962// ErrorResponse error Response. 1963type ErrorResponse struct { 1964 // Code - Error code. 1965 Code *string `json:"code,omitempty"` 1966 // Message - Error message indicating why the operation failed. 1967 Message *string `json:"message,omitempty"` 1968} 1969 1970// ExcludedPath ... 1971type ExcludedPath struct { 1972 // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) 1973 Path *string `json:"path,omitempty"` 1974} 1975 1976// ExtendedResourceProperties the system generated resource properties associated with SQL databases, SQL 1977// containers, Gremlin databases and Gremlin graphs. 1978type ExtendedResourceProperties struct { 1979 // Rid - READ-ONLY; A system generated property. A unique identifier. 1980 Rid *string `json:"_rid,omitempty"` 1981 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 1982 Ts interface{} `json:"_ts,omitempty"` 1983 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 1984 Etag *string `json:"_etag,omitempty"` 1985} 1986 1987// MarshalJSON is the custom marshaler for ExtendedResourceProperties. 1988func (erp ExtendedResourceProperties) MarshalJSON() ([]byte, error) { 1989 objectMap := make(map[string]interface{}) 1990 return json.Marshal(objectMap) 1991} 1992 1993// FailoverPolicies the list of new failover policies for the failover priority change. 1994type FailoverPolicies struct { 1995 // FailoverPolicies - List of failover policies. 1996 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` 1997} 1998 1999// FailoverPolicy the failover policy for a given region of a database account. 2000type FailoverPolicy struct { 2001 // ID - READ-ONLY; The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>. 2002 ID *string `json:"id,omitempty"` 2003 // LocationName - The name of the region in which the database account exists. 2004 LocationName *string `json:"locationName,omitempty"` 2005 // FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. 2006 FailoverPriority *int32 `json:"failoverPriority,omitempty"` 2007} 2008 2009// MarshalJSON is the custom marshaler for FailoverPolicy. 2010func (fp FailoverPolicy) MarshalJSON() ([]byte, error) { 2011 objectMap := make(map[string]interface{}) 2012 if fp.LocationName != nil { 2013 objectMap["locationName"] = fp.LocationName 2014 } 2015 if fp.FailoverPriority != nil { 2016 objectMap["failoverPriority"] = fp.FailoverPriority 2017 } 2018 return json.Marshal(objectMap) 2019} 2020 2021// GremlinDatabaseCreateUpdateParameters parameters to create and update Cosmos DB Gremlin database. 2022type GremlinDatabaseCreateUpdateParameters struct { 2023 // GremlinDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin database. 2024 *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"` 2025 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 2026 ID *string `json:"id,omitempty"` 2027 // Name - READ-ONLY; The name of the ARM resource. 2028 Name *string `json:"name,omitempty"` 2029 // Type - READ-ONLY; The type of Azure resource. 2030 Type *string `json:"type,omitempty"` 2031 // Location - The location of the resource group to which the resource belongs. 2032 Location *string `json:"location,omitempty"` 2033 Tags map[string]*string `json:"tags"` 2034} 2035 2036// MarshalJSON is the custom marshaler for GremlinDatabaseCreateUpdateParameters. 2037func (gdcup GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { 2038 objectMap := make(map[string]interface{}) 2039 if gdcup.GremlinDatabaseCreateUpdateProperties != nil { 2040 objectMap["properties"] = gdcup.GremlinDatabaseCreateUpdateProperties 2041 } 2042 if gdcup.Location != nil { 2043 objectMap["location"] = gdcup.Location 2044 } 2045 if gdcup.Tags != nil { 2046 objectMap["tags"] = gdcup.Tags 2047 } 2048 return json.Marshal(objectMap) 2049} 2050 2051// UnmarshalJSON is the custom unmarshaler for GremlinDatabaseCreateUpdateParameters struct. 2052func (gdcup *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { 2053 var m map[string]*json.RawMessage 2054 err := json.Unmarshal(body, &m) 2055 if err != nil { 2056 return err 2057 } 2058 for k, v := range m { 2059 switch k { 2060 case "properties": 2061 if v != nil { 2062 var gremlinDatabaseCreateUpdateProperties GremlinDatabaseCreateUpdateProperties 2063 err = json.Unmarshal(*v, &gremlinDatabaseCreateUpdateProperties) 2064 if err != nil { 2065 return err 2066 } 2067 gdcup.GremlinDatabaseCreateUpdateProperties = &gremlinDatabaseCreateUpdateProperties 2068 } 2069 case "id": 2070 if v != nil { 2071 var ID string 2072 err = json.Unmarshal(*v, &ID) 2073 if err != nil { 2074 return err 2075 } 2076 gdcup.ID = &ID 2077 } 2078 case "name": 2079 if v != nil { 2080 var name string 2081 err = json.Unmarshal(*v, &name) 2082 if err != nil { 2083 return err 2084 } 2085 gdcup.Name = &name 2086 } 2087 case "type": 2088 if v != nil { 2089 var typeVar string 2090 err = json.Unmarshal(*v, &typeVar) 2091 if err != nil { 2092 return err 2093 } 2094 gdcup.Type = &typeVar 2095 } 2096 case "location": 2097 if v != nil { 2098 var location string 2099 err = json.Unmarshal(*v, &location) 2100 if err != nil { 2101 return err 2102 } 2103 gdcup.Location = &location 2104 } 2105 case "tags": 2106 if v != nil { 2107 var tags map[string]*string 2108 err = json.Unmarshal(*v, &tags) 2109 if err != nil { 2110 return err 2111 } 2112 gdcup.Tags = tags 2113 } 2114 } 2115 } 2116 2117 return nil 2118} 2119 2120// GremlinDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin database. 2121type GremlinDatabaseCreateUpdateProperties struct { 2122 // Resource - The standard JSON format of a Gremlin database 2123 Resource *GremlinDatabaseResource `json:"resource,omitempty"` 2124 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 2125 Options *CreateUpdateOptions `json:"options,omitempty"` 2126} 2127 2128// GremlinDatabaseGetProperties the properties of an Azure Cosmos DB SQL database 2129type GremlinDatabaseGetProperties struct { 2130 Resource *GremlinDatabaseGetPropertiesResource `json:"resource,omitempty"` 2131 Options *GremlinDatabaseGetPropertiesOptions `json:"options,omitempty"` 2132} 2133 2134// GremlinDatabaseGetPropertiesOptions ... 2135type GremlinDatabaseGetPropertiesOptions struct { 2136 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 2137 Throughput *int32 `json:"throughput,omitempty"` 2138} 2139 2140// GremlinDatabaseGetPropertiesResource ... 2141type GremlinDatabaseGetPropertiesResource struct { 2142 // ID - Name of the Cosmos DB Gremlin database 2143 ID *string `json:"id,omitempty"` 2144 // Rid - READ-ONLY; A system generated property. A unique identifier. 2145 Rid *string `json:"_rid,omitempty"` 2146 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 2147 Ts interface{} `json:"_ts,omitempty"` 2148 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 2149 Etag *string `json:"_etag,omitempty"` 2150} 2151 2152// MarshalJSON is the custom marshaler for GremlinDatabaseGetPropertiesResource. 2153func (gdgp GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { 2154 objectMap := make(map[string]interface{}) 2155 if gdgp.ID != nil { 2156 objectMap["id"] = gdgp.ID 2157 } 2158 return json.Marshal(objectMap) 2159} 2160 2161// GremlinDatabaseGetResults an Azure Cosmos DB Gremlin database. 2162type GremlinDatabaseGetResults struct { 2163 autorest.Response `json:"-"` 2164 // GremlinDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database 2165 *GremlinDatabaseGetProperties `json:"properties,omitempty"` 2166 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 2167 ID *string `json:"id,omitempty"` 2168 // Name - READ-ONLY; The name of the ARM resource. 2169 Name *string `json:"name,omitempty"` 2170 // Type - READ-ONLY; The type of Azure resource. 2171 Type *string `json:"type,omitempty"` 2172 // Location - The location of the resource group to which the resource belongs. 2173 Location *string `json:"location,omitempty"` 2174 Tags map[string]*string `json:"tags"` 2175} 2176 2177// MarshalJSON is the custom marshaler for GremlinDatabaseGetResults. 2178func (gdgr GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { 2179 objectMap := make(map[string]interface{}) 2180 if gdgr.GremlinDatabaseGetProperties != nil { 2181 objectMap["properties"] = gdgr.GremlinDatabaseGetProperties 2182 } 2183 if gdgr.Location != nil { 2184 objectMap["location"] = gdgr.Location 2185 } 2186 if gdgr.Tags != nil { 2187 objectMap["tags"] = gdgr.Tags 2188 } 2189 return json.Marshal(objectMap) 2190} 2191 2192// UnmarshalJSON is the custom unmarshaler for GremlinDatabaseGetResults struct. 2193func (gdgr *GremlinDatabaseGetResults) UnmarshalJSON(body []byte) error { 2194 var m map[string]*json.RawMessage 2195 err := json.Unmarshal(body, &m) 2196 if err != nil { 2197 return err 2198 } 2199 for k, v := range m { 2200 switch k { 2201 case "properties": 2202 if v != nil { 2203 var gremlinDatabaseGetProperties GremlinDatabaseGetProperties 2204 err = json.Unmarshal(*v, &gremlinDatabaseGetProperties) 2205 if err != nil { 2206 return err 2207 } 2208 gdgr.GremlinDatabaseGetProperties = &gremlinDatabaseGetProperties 2209 } 2210 case "id": 2211 if v != nil { 2212 var ID string 2213 err = json.Unmarshal(*v, &ID) 2214 if err != nil { 2215 return err 2216 } 2217 gdgr.ID = &ID 2218 } 2219 case "name": 2220 if v != nil { 2221 var name string 2222 err = json.Unmarshal(*v, &name) 2223 if err != nil { 2224 return err 2225 } 2226 gdgr.Name = &name 2227 } 2228 case "type": 2229 if v != nil { 2230 var typeVar string 2231 err = json.Unmarshal(*v, &typeVar) 2232 if err != nil { 2233 return err 2234 } 2235 gdgr.Type = &typeVar 2236 } 2237 case "location": 2238 if v != nil { 2239 var location string 2240 err = json.Unmarshal(*v, &location) 2241 if err != nil { 2242 return err 2243 } 2244 gdgr.Location = &location 2245 } 2246 case "tags": 2247 if v != nil { 2248 var tags map[string]*string 2249 err = json.Unmarshal(*v, &tags) 2250 if err != nil { 2251 return err 2252 } 2253 gdgr.Tags = tags 2254 } 2255 } 2256 } 2257 2258 return nil 2259} 2260 2261// GremlinDatabaseListResult the List operation response, that contains the Gremlin databases and their 2262// properties. 2263type GremlinDatabaseListResult struct { 2264 autorest.Response `json:"-"` 2265 // Value - READ-ONLY; List of Gremlin databases and their properties. 2266 Value *[]GremlinDatabaseGetResults `json:"value,omitempty"` 2267} 2268 2269// MarshalJSON is the custom marshaler for GremlinDatabaseListResult. 2270func (gdlr GremlinDatabaseListResult) MarshalJSON() ([]byte, error) { 2271 objectMap := make(map[string]interface{}) 2272 return json.Marshal(objectMap) 2273} 2274 2275// GremlinDatabaseResource cosmos DB Gremlin database resource object 2276type GremlinDatabaseResource struct { 2277 // ID - Name of the Cosmos DB Gremlin database 2278 ID *string `json:"id,omitempty"` 2279} 2280 2281// GremlinGraphCreateUpdateParameters parameters to create and update Cosmos DB Gremlin graph. 2282type GremlinGraphCreateUpdateParameters struct { 2283 // GremlinGraphCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin graph. 2284 *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"` 2285 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 2286 ID *string `json:"id,omitempty"` 2287 // Name - READ-ONLY; The name of the ARM resource. 2288 Name *string `json:"name,omitempty"` 2289 // Type - READ-ONLY; The type of Azure resource. 2290 Type *string `json:"type,omitempty"` 2291 // Location - The location of the resource group to which the resource belongs. 2292 Location *string `json:"location,omitempty"` 2293 Tags map[string]*string `json:"tags"` 2294} 2295 2296// MarshalJSON is the custom marshaler for GremlinGraphCreateUpdateParameters. 2297func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { 2298 objectMap := make(map[string]interface{}) 2299 if ggcup.GremlinGraphCreateUpdateProperties != nil { 2300 objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties 2301 } 2302 if ggcup.Location != nil { 2303 objectMap["location"] = ggcup.Location 2304 } 2305 if ggcup.Tags != nil { 2306 objectMap["tags"] = ggcup.Tags 2307 } 2308 return json.Marshal(objectMap) 2309} 2310 2311// UnmarshalJSON is the custom unmarshaler for GremlinGraphCreateUpdateParameters struct. 2312func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error { 2313 var m map[string]*json.RawMessage 2314 err := json.Unmarshal(body, &m) 2315 if err != nil { 2316 return err 2317 } 2318 for k, v := range m { 2319 switch k { 2320 case "properties": 2321 if v != nil { 2322 var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties 2323 err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties) 2324 if err != nil { 2325 return err 2326 } 2327 ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties 2328 } 2329 case "id": 2330 if v != nil { 2331 var ID string 2332 err = json.Unmarshal(*v, &ID) 2333 if err != nil { 2334 return err 2335 } 2336 ggcup.ID = &ID 2337 } 2338 case "name": 2339 if v != nil { 2340 var name string 2341 err = json.Unmarshal(*v, &name) 2342 if err != nil { 2343 return err 2344 } 2345 ggcup.Name = &name 2346 } 2347 case "type": 2348 if v != nil { 2349 var typeVar string 2350 err = json.Unmarshal(*v, &typeVar) 2351 if err != nil { 2352 return err 2353 } 2354 ggcup.Type = &typeVar 2355 } 2356 case "location": 2357 if v != nil { 2358 var location string 2359 err = json.Unmarshal(*v, &location) 2360 if err != nil { 2361 return err 2362 } 2363 ggcup.Location = &location 2364 } 2365 case "tags": 2366 if v != nil { 2367 var tags map[string]*string 2368 err = json.Unmarshal(*v, &tags) 2369 if err != nil { 2370 return err 2371 } 2372 ggcup.Tags = tags 2373 } 2374 } 2375 } 2376 2377 return nil 2378} 2379 2380// GremlinGraphCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin graph. 2381type GremlinGraphCreateUpdateProperties struct { 2382 // Resource - The standard JSON format of a Gremlin graph 2383 Resource *GremlinGraphResource `json:"resource,omitempty"` 2384 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 2385 Options *CreateUpdateOptions `json:"options,omitempty"` 2386} 2387 2388// GremlinGraphGetProperties the properties of an Azure Cosmos DB Gremlin graph 2389type GremlinGraphGetProperties struct { 2390 Resource *GremlinGraphGetPropertiesResource `json:"resource,omitempty"` 2391 Options *GremlinGraphGetPropertiesOptions `json:"options,omitempty"` 2392} 2393 2394// GremlinGraphGetPropertiesOptions ... 2395type GremlinGraphGetPropertiesOptions struct { 2396 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 2397 Throughput *int32 `json:"throughput,omitempty"` 2398} 2399 2400// GremlinGraphGetPropertiesResource ... 2401type GremlinGraphGetPropertiesResource struct { 2402 // ID - Name of the Cosmos DB Gremlin graph 2403 ID *string `json:"id,omitempty"` 2404 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph 2405 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 2406 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 2407 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 2408 // DefaultTTL - Default time to live 2409 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 2410 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 2411 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 2412 // ConflictResolutionPolicy - The conflict resolution policy for the graph. 2413 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 2414 // Rid - READ-ONLY; A system generated property. A unique identifier. 2415 Rid *string `json:"_rid,omitempty"` 2416 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 2417 Ts interface{} `json:"_ts,omitempty"` 2418 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 2419 Etag *string `json:"_etag,omitempty"` 2420} 2421 2422// MarshalJSON is the custom marshaler for GremlinGraphGetPropertiesResource. 2423func (gggp GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) { 2424 objectMap := make(map[string]interface{}) 2425 if gggp.ID != nil { 2426 objectMap["id"] = gggp.ID 2427 } 2428 if gggp.IndexingPolicy != nil { 2429 objectMap["indexingPolicy"] = gggp.IndexingPolicy 2430 } 2431 if gggp.PartitionKey != nil { 2432 objectMap["partitionKey"] = gggp.PartitionKey 2433 } 2434 if gggp.DefaultTTL != nil { 2435 objectMap["defaultTtl"] = gggp.DefaultTTL 2436 } 2437 if gggp.UniqueKeyPolicy != nil { 2438 objectMap["uniqueKeyPolicy"] = gggp.UniqueKeyPolicy 2439 } 2440 if gggp.ConflictResolutionPolicy != nil { 2441 objectMap["conflictResolutionPolicy"] = gggp.ConflictResolutionPolicy 2442 } 2443 return json.Marshal(objectMap) 2444} 2445 2446// GremlinGraphGetResults an Azure Cosmos DB Gremlin graph. 2447type GremlinGraphGetResults struct { 2448 autorest.Response `json:"-"` 2449 // GremlinGraphGetProperties - The properties of an Azure Cosmos DB Gremlin graph 2450 *GremlinGraphGetProperties `json:"properties,omitempty"` 2451 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 2452 ID *string `json:"id,omitempty"` 2453 // Name - READ-ONLY; The name of the ARM resource. 2454 Name *string `json:"name,omitempty"` 2455 // Type - READ-ONLY; The type of Azure resource. 2456 Type *string `json:"type,omitempty"` 2457 // Location - The location of the resource group to which the resource belongs. 2458 Location *string `json:"location,omitempty"` 2459 Tags map[string]*string `json:"tags"` 2460} 2461 2462// MarshalJSON is the custom marshaler for GremlinGraphGetResults. 2463func (gggr GremlinGraphGetResults) MarshalJSON() ([]byte, error) { 2464 objectMap := make(map[string]interface{}) 2465 if gggr.GremlinGraphGetProperties != nil { 2466 objectMap["properties"] = gggr.GremlinGraphGetProperties 2467 } 2468 if gggr.Location != nil { 2469 objectMap["location"] = gggr.Location 2470 } 2471 if gggr.Tags != nil { 2472 objectMap["tags"] = gggr.Tags 2473 } 2474 return json.Marshal(objectMap) 2475} 2476 2477// UnmarshalJSON is the custom unmarshaler for GremlinGraphGetResults struct. 2478func (gggr *GremlinGraphGetResults) UnmarshalJSON(body []byte) error { 2479 var m map[string]*json.RawMessage 2480 err := json.Unmarshal(body, &m) 2481 if err != nil { 2482 return err 2483 } 2484 for k, v := range m { 2485 switch k { 2486 case "properties": 2487 if v != nil { 2488 var gremlinGraphGetProperties GremlinGraphGetProperties 2489 err = json.Unmarshal(*v, &gremlinGraphGetProperties) 2490 if err != nil { 2491 return err 2492 } 2493 gggr.GremlinGraphGetProperties = &gremlinGraphGetProperties 2494 } 2495 case "id": 2496 if v != nil { 2497 var ID string 2498 err = json.Unmarshal(*v, &ID) 2499 if err != nil { 2500 return err 2501 } 2502 gggr.ID = &ID 2503 } 2504 case "name": 2505 if v != nil { 2506 var name string 2507 err = json.Unmarshal(*v, &name) 2508 if err != nil { 2509 return err 2510 } 2511 gggr.Name = &name 2512 } 2513 case "type": 2514 if v != nil { 2515 var typeVar string 2516 err = json.Unmarshal(*v, &typeVar) 2517 if err != nil { 2518 return err 2519 } 2520 gggr.Type = &typeVar 2521 } 2522 case "location": 2523 if v != nil { 2524 var location string 2525 err = json.Unmarshal(*v, &location) 2526 if err != nil { 2527 return err 2528 } 2529 gggr.Location = &location 2530 } 2531 case "tags": 2532 if v != nil { 2533 var tags map[string]*string 2534 err = json.Unmarshal(*v, &tags) 2535 if err != nil { 2536 return err 2537 } 2538 gggr.Tags = tags 2539 } 2540 } 2541 } 2542 2543 return nil 2544} 2545 2546// GremlinGraphListResult the List operation response, that contains the graphs and their properties. 2547type GremlinGraphListResult struct { 2548 autorest.Response `json:"-"` 2549 // Value - READ-ONLY; List of graphs and their properties. 2550 Value *[]GremlinGraphGetResults `json:"value,omitempty"` 2551} 2552 2553// MarshalJSON is the custom marshaler for GremlinGraphListResult. 2554func (gglr GremlinGraphListResult) MarshalJSON() ([]byte, error) { 2555 objectMap := make(map[string]interface{}) 2556 return json.Marshal(objectMap) 2557} 2558 2559// GremlinGraphResource cosmos DB Gremlin graph resource object 2560type GremlinGraphResource struct { 2561 // ID - Name of the Cosmos DB Gremlin graph 2562 ID *string `json:"id,omitempty"` 2563 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph 2564 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 2565 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 2566 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 2567 // DefaultTTL - Default time to live 2568 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 2569 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 2570 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 2571 // ConflictResolutionPolicy - The conflict resolution policy for the graph. 2572 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 2573} 2574 2575// GremlinResourcesCreateUpdateGremlinDatabaseFuture an abstraction for monitoring and retrieving the 2576// results of a long-running operation. 2577type GremlinResourcesCreateUpdateGremlinDatabaseFuture struct { 2578 azure.FutureAPI 2579 // Result returns the result of the asynchronous operation. 2580 // If the operation has not completed it will return an error. 2581 Result func(GremlinResourcesClient) (GremlinDatabaseGetResults, error) 2582} 2583 2584// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2585func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) UnmarshalJSON(body []byte) error { 2586 var azFuture azure.Future 2587 if err := json.Unmarshal(body, &azFuture); err != nil { 2588 return err 2589 } 2590 future.FutureAPI = &azFuture 2591 future.Result = future.result 2592 return nil 2593} 2594 2595// result is the default implementation for GremlinResourcesCreateUpdateGremlinDatabaseFuture.Result. 2596func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) result(client GremlinResourcesClient) (gdgr GremlinDatabaseGetResults, err error) { 2597 var done bool 2598 done, err = future.DoneWithContext(context.Background(), client) 2599 if err != nil { 2600 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") 2601 return 2602 } 2603 if !done { 2604 gdgr.Response.Response = future.Response() 2605 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture") 2606 return 2607 } 2608 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2609 if gdgr.Response.Response, err = future.GetResult(sender); err == nil && gdgr.Response.Response.StatusCode != http.StatusNoContent { 2610 gdgr, err = client.CreateUpdateGremlinDatabaseResponder(gdgr.Response.Response) 2611 if err != nil { 2612 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", gdgr.Response.Response, "Failure responding to request") 2613 } 2614 } 2615 return 2616} 2617 2618// GremlinResourcesCreateUpdateGremlinGraphFuture an abstraction for monitoring and retrieving the results 2619// of a long-running operation. 2620type GremlinResourcesCreateUpdateGremlinGraphFuture struct { 2621 azure.FutureAPI 2622 // Result returns the result of the asynchronous operation. 2623 // If the operation has not completed it will return an error. 2624 Result func(GremlinResourcesClient) (GremlinGraphGetResults, error) 2625} 2626 2627// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2628func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) UnmarshalJSON(body []byte) error { 2629 var azFuture azure.Future 2630 if err := json.Unmarshal(body, &azFuture); err != nil { 2631 return err 2632 } 2633 future.FutureAPI = &azFuture 2634 future.Result = future.result 2635 return nil 2636} 2637 2638// result is the default implementation for GremlinResourcesCreateUpdateGremlinGraphFuture.Result. 2639func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) result(client GremlinResourcesClient) (gggr GremlinGraphGetResults, err error) { 2640 var done bool 2641 done, err = future.DoneWithContext(context.Background(), client) 2642 if err != nil { 2643 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure") 2644 return 2645 } 2646 if !done { 2647 gggr.Response.Response = future.Response() 2648 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture") 2649 return 2650 } 2651 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2652 if gggr.Response.Response, err = future.GetResult(sender); err == nil && gggr.Response.Response.StatusCode != http.StatusNoContent { 2653 gggr, err = client.CreateUpdateGremlinGraphResponder(gggr.Response.Response) 2654 if err != nil { 2655 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", gggr.Response.Response, "Failure responding to request") 2656 } 2657 } 2658 return 2659} 2660 2661// GremlinResourcesDeleteGremlinDatabaseFuture an abstraction for monitoring and retrieving the results of 2662// a long-running operation. 2663type GremlinResourcesDeleteGremlinDatabaseFuture struct { 2664 azure.FutureAPI 2665 // Result returns the result of the asynchronous operation. 2666 // If the operation has not completed it will return an error. 2667 Result func(GremlinResourcesClient) (autorest.Response, error) 2668} 2669 2670// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2671func (future *GremlinResourcesDeleteGremlinDatabaseFuture) UnmarshalJSON(body []byte) error { 2672 var azFuture azure.Future 2673 if err := json.Unmarshal(body, &azFuture); err != nil { 2674 return err 2675 } 2676 future.FutureAPI = &azFuture 2677 future.Result = future.result 2678 return nil 2679} 2680 2681// result is the default implementation for GremlinResourcesDeleteGremlinDatabaseFuture.Result. 2682func (future *GremlinResourcesDeleteGremlinDatabaseFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) { 2683 var done bool 2684 done, err = future.DoneWithContext(context.Background(), client) 2685 if err != nil { 2686 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") 2687 return 2688 } 2689 if !done { 2690 ar.Response = future.Response() 2691 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinDatabaseFuture") 2692 return 2693 } 2694 ar.Response = future.Response() 2695 return 2696} 2697 2698// GremlinResourcesDeleteGremlinGraphFuture an abstraction for monitoring and retrieving the results of a 2699// long-running operation. 2700type GremlinResourcesDeleteGremlinGraphFuture struct { 2701 azure.FutureAPI 2702 // Result returns the result of the asynchronous operation. 2703 // If the operation has not completed it will return an error. 2704 Result func(GremlinResourcesClient) (autorest.Response, error) 2705} 2706 2707// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2708func (future *GremlinResourcesDeleteGremlinGraphFuture) UnmarshalJSON(body []byte) error { 2709 var azFuture azure.Future 2710 if err := json.Unmarshal(body, &azFuture); err != nil { 2711 return err 2712 } 2713 future.FutureAPI = &azFuture 2714 future.Result = future.result 2715 return nil 2716} 2717 2718// result is the default implementation for GremlinResourcesDeleteGremlinGraphFuture.Result. 2719func (future *GremlinResourcesDeleteGremlinGraphFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) { 2720 var done bool 2721 done, err = future.DoneWithContext(context.Background(), client) 2722 if err != nil { 2723 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure") 2724 return 2725 } 2726 if !done { 2727 ar.Response = future.Response() 2728 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinGraphFuture") 2729 return 2730 } 2731 ar.Response = future.Response() 2732 return 2733} 2734 2735// GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the 2736// results of a long-running operation. 2737type GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture struct { 2738 azure.FutureAPI 2739 // Result returns the result of the asynchronous operation. 2740 // If the operation has not completed it will return an error. 2741 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 2742} 2743 2744// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2745func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { 2746 var azFuture azure.Future 2747 if err := json.Unmarshal(body, &azFuture); err != nil { 2748 return err 2749 } 2750 future.FutureAPI = &azFuture 2751 future.Result = future.result 2752 return nil 2753} 2754 2755// result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture.Result. 2756func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 2757 var done bool 2758 done, err = future.DoneWithContext(context.Background(), client) 2759 if err != nil { 2760 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") 2761 return 2762 } 2763 if !done { 2764 tsgr.Response.Response = future.Response() 2765 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture") 2766 return 2767 } 2768 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2769 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 2770 tsgr, err = client.MigrateGremlinDatabaseToAutoscaleResponder(tsgr.Response.Response) 2771 if err != nil { 2772 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 2773 } 2774 } 2775 return 2776} 2777 2778// GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture an abstraction for monitoring and 2779// retrieving the results of a long-running operation. 2780type GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture struct { 2781 azure.FutureAPI 2782 // Result returns the result of the asynchronous operation. 2783 // If the operation has not completed it will return an error. 2784 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 2785} 2786 2787// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2788func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { 2789 var azFuture azure.Future 2790 if err := json.Unmarshal(body, &azFuture); err != nil { 2791 return err 2792 } 2793 future.FutureAPI = &azFuture 2794 future.Result = future.result 2795 return nil 2796} 2797 2798// result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture.Result. 2799func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 2800 var done bool 2801 done, err = future.DoneWithContext(context.Background(), client) 2802 if err != nil { 2803 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") 2804 return 2805 } 2806 if !done { 2807 tsgr.Response.Response = future.Response() 2808 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture") 2809 return 2810 } 2811 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2812 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 2813 tsgr, err = client.MigrateGremlinDatabaseToManualThroughputResponder(tsgr.Response.Response) 2814 if err != nil { 2815 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 2816 } 2817 } 2818 return 2819} 2820 2821// GremlinResourcesMigrateGremlinGraphToAutoscaleFuture an abstraction for monitoring and retrieving the 2822// results of a long-running operation. 2823type GremlinResourcesMigrateGremlinGraphToAutoscaleFuture struct { 2824 azure.FutureAPI 2825 // Result returns the result of the asynchronous operation. 2826 // If the operation has not completed it will return an error. 2827 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 2828} 2829 2830// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2831func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) UnmarshalJSON(body []byte) error { 2832 var azFuture azure.Future 2833 if err := json.Unmarshal(body, &azFuture); err != nil { 2834 return err 2835 } 2836 future.FutureAPI = &azFuture 2837 future.Result = future.result 2838 return nil 2839} 2840 2841// result is the default implementation for GremlinResourcesMigrateGremlinGraphToAutoscaleFuture.Result. 2842func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 2843 var done bool 2844 done, err = future.DoneWithContext(context.Background(), client) 2845 if err != nil { 2846 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", future.Response(), "Polling failure") 2847 return 2848 } 2849 if !done { 2850 tsgr.Response.Response = future.Response() 2851 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture") 2852 return 2853 } 2854 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2855 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 2856 tsgr, err = client.MigrateGremlinGraphToAutoscaleResponder(tsgr.Response.Response) 2857 if err != nil { 2858 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 2859 } 2860 } 2861 return 2862} 2863 2864// GremlinResourcesMigrateGremlinGraphToManualThroughputFuture an abstraction for monitoring and retrieving 2865// the results of a long-running operation. 2866type GremlinResourcesMigrateGremlinGraphToManualThroughputFuture struct { 2867 azure.FutureAPI 2868 // Result returns the result of the asynchronous operation. 2869 // If the operation has not completed it will return an error. 2870 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 2871} 2872 2873// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2874func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) UnmarshalJSON(body []byte) error { 2875 var azFuture azure.Future 2876 if err := json.Unmarshal(body, &azFuture); err != nil { 2877 return err 2878 } 2879 future.FutureAPI = &azFuture 2880 future.Result = future.result 2881 return nil 2882} 2883 2884// result is the default implementation for GremlinResourcesMigrateGremlinGraphToManualThroughputFuture.Result. 2885func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 2886 var done bool 2887 done, err = future.DoneWithContext(context.Background(), client) 2888 if err != nil { 2889 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", future.Response(), "Polling failure") 2890 return 2891 } 2892 if !done { 2893 tsgr.Response.Response = future.Response() 2894 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture") 2895 return 2896 } 2897 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2898 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 2899 tsgr, err = client.MigrateGremlinGraphToManualThroughputResponder(tsgr.Response.Response) 2900 if err != nil { 2901 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 2902 } 2903 } 2904 return 2905} 2906 2907// GremlinResourcesUpdateGremlinDatabaseThroughputFuture an abstraction for monitoring and retrieving the 2908// results of a long-running operation. 2909type GremlinResourcesUpdateGremlinDatabaseThroughputFuture struct { 2910 azure.FutureAPI 2911 // Result returns the result of the asynchronous operation. 2912 // If the operation has not completed it will return an error. 2913 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 2914} 2915 2916// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2917func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { 2918 var azFuture azure.Future 2919 if err := json.Unmarshal(body, &azFuture); err != nil { 2920 return err 2921 } 2922 future.FutureAPI = &azFuture 2923 future.Result = future.result 2924 return nil 2925} 2926 2927// result is the default implementation for GremlinResourcesUpdateGremlinDatabaseThroughputFuture.Result. 2928func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 2929 var done bool 2930 done, err = future.DoneWithContext(context.Background(), client) 2931 if err != nil { 2932 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") 2933 return 2934 } 2935 if !done { 2936 tsgr.Response.Response = future.Response() 2937 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture") 2938 return 2939 } 2940 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2941 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 2942 tsgr, err = client.UpdateGremlinDatabaseThroughputResponder(tsgr.Response.Response) 2943 if err != nil { 2944 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 2945 } 2946 } 2947 return 2948} 2949 2950// GremlinResourcesUpdateGremlinGraphThroughputFuture an abstraction for monitoring and retrieving the 2951// results of a long-running operation. 2952type GremlinResourcesUpdateGremlinGraphThroughputFuture struct { 2953 azure.FutureAPI 2954 // Result returns the result of the asynchronous operation. 2955 // If the operation has not completed it will return an error. 2956 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 2957} 2958 2959// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2960func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) UnmarshalJSON(body []byte) error { 2961 var azFuture azure.Future 2962 if err := json.Unmarshal(body, &azFuture); err != nil { 2963 return err 2964 } 2965 future.FutureAPI = &azFuture 2966 future.Result = future.result 2967 return nil 2968} 2969 2970// result is the default implementation for GremlinResourcesUpdateGremlinGraphThroughputFuture.Result. 2971func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 2972 var done bool 2973 done, err = future.DoneWithContext(context.Background(), client) 2974 if err != nil { 2975 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", future.Response(), "Polling failure") 2976 return 2977 } 2978 if !done { 2979 tsgr.Response.Response = future.Response() 2980 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture") 2981 return 2982 } 2983 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2984 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 2985 tsgr, err = client.UpdateGremlinGraphThroughputResponder(tsgr.Response.Response) 2986 if err != nil { 2987 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 2988 } 2989 } 2990 return 2991} 2992 2993// IncludedPath the paths that are included in indexing 2994type IncludedPath struct { 2995 // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) 2996 Path *string `json:"path,omitempty"` 2997 // Indexes - List of indexes for this path 2998 Indexes *[]Indexes `json:"indexes,omitempty"` 2999} 3000 3001// Indexes the indexes for the path. 3002type Indexes struct { 3003 // DataType - The datatype for which the indexing behavior is applied to. Possible values include: 'String', 'Number', 'Point', 'Polygon', 'LineString', 'MultiPolygon' 3004 DataType DataType `json:"dataType,omitempty"` 3005 // Precision - The precision of the index. -1 is maximum precision. 3006 Precision *int32 `json:"precision,omitempty"` 3007 // Kind - Indicates the type of index. Possible values include: 'Hash', 'Range', 'Spatial' 3008 Kind IndexKind `json:"kind,omitempty"` 3009} 3010 3011// IndexingPolicy cosmos DB indexing policy 3012type IndexingPolicy struct { 3013 // Automatic - Indicates if the indexing policy is automatic 3014 Automatic *bool `json:"automatic,omitempty"` 3015 // IndexingMode - Indicates the indexing mode. Possible values include: 'Consistent', 'Lazy', 'None' 3016 IndexingMode IndexingMode `json:"indexingMode,omitempty"` 3017 // IncludedPaths - List of paths to include in the indexing 3018 IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"` 3019 // ExcludedPaths - List of paths to exclude from indexing 3020 ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"` 3021 // CompositeIndexes - List of composite path list 3022 CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"` 3023 // SpatialIndexes - List of spatial specifics 3024 SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"` 3025} 3026 3027// Location a region in which the Azure Cosmos DB database account is deployed. 3028type Location struct { 3029 // ID - READ-ONLY; The unique identifier of the region within the database account. Example: <accountName>-<locationName>. 3030 ID *string `json:"id,omitempty"` 3031 // LocationName - The name of the region. 3032 LocationName *string `json:"locationName,omitempty"` 3033 // DocumentEndpoint - READ-ONLY; The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/ 3034 DocumentEndpoint *string `json:"documentEndpoint,omitempty"` 3035 ProvisioningState *string `json:"provisioningState,omitempty"` 3036 // FailoverPriority - The failover priority of the region. A failover priority of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values must be unique for each of the regions in which the database account exists. 3037 FailoverPriority *int32 `json:"failoverPriority,omitempty"` 3038 // IsZoneRedundant - Flag to indicate whether or not this region is an AvailabilityZone region 3039 IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"` 3040} 3041 3042// MarshalJSON is the custom marshaler for Location. 3043func (l Location) MarshalJSON() ([]byte, error) { 3044 objectMap := make(map[string]interface{}) 3045 if l.LocationName != nil { 3046 objectMap["locationName"] = l.LocationName 3047 } 3048 if l.ProvisioningState != nil { 3049 objectMap["provisioningState"] = l.ProvisioningState 3050 } 3051 if l.FailoverPriority != nil { 3052 objectMap["failoverPriority"] = l.FailoverPriority 3053 } 3054 if l.IsZoneRedundant != nil { 3055 objectMap["isZoneRedundant"] = l.IsZoneRedundant 3056 } 3057 return json.Marshal(objectMap) 3058} 3059 3060// Metric metric data 3061type Metric struct { 3062 // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). 3063 StartTime *date.Time `json:"startTime,omitempty"` 3064 // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). 3065 EndTime *date.Time `json:"endTime,omitempty"` 3066 // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. 3067 TimeGrain *string `json:"timeGrain,omitempty"` 3068 // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' 3069 Unit UnitType `json:"unit,omitempty"` 3070 // Name - READ-ONLY; The name information for the metric. 3071 Name *MetricName `json:"name,omitempty"` 3072 // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. 3073 MetricValues *[]MetricValue `json:"metricValues,omitempty"` 3074} 3075 3076// MarshalJSON is the custom marshaler for Metric. 3077func (mVar Metric) MarshalJSON() ([]byte, error) { 3078 objectMap := make(map[string]interface{}) 3079 if mVar.Unit != "" { 3080 objectMap["unit"] = mVar.Unit 3081 } 3082 return json.Marshal(objectMap) 3083} 3084 3085// MetricAvailability the availability of the metric. 3086type MetricAvailability struct { 3087 // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. 3088 TimeGrain *string `json:"timeGrain,omitempty"` 3089 // Retention - READ-ONLY; The retention for the metric values. 3090 Retention *string `json:"retention,omitempty"` 3091} 3092 3093// MarshalJSON is the custom marshaler for MetricAvailability. 3094func (ma MetricAvailability) MarshalJSON() ([]byte, error) { 3095 objectMap := make(map[string]interface{}) 3096 return json.Marshal(objectMap) 3097} 3098 3099// MetricDefinition the definition of a metric. 3100type MetricDefinition struct { 3101 // MetricAvailabilities - READ-ONLY; The list of metric availabilities for the account. 3102 MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` 3103 // PrimaryAggregationType - READ-ONLY; The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast' 3104 PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` 3105 // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' 3106 Unit UnitType `json:"unit,omitempty"` 3107 // ResourceURI - READ-ONLY; The resource uri of the database. 3108 ResourceURI *string `json:"resourceUri,omitempty"` 3109 // Name - READ-ONLY; The name information for the metric. 3110 Name *MetricName `json:"name,omitempty"` 3111} 3112 3113// MarshalJSON is the custom marshaler for MetricDefinition. 3114func (md MetricDefinition) MarshalJSON() ([]byte, error) { 3115 objectMap := make(map[string]interface{}) 3116 if md.Unit != "" { 3117 objectMap["unit"] = md.Unit 3118 } 3119 return json.Marshal(objectMap) 3120} 3121 3122// MetricDefinitionsListResult the response to a list metric definitions request. 3123type MetricDefinitionsListResult struct { 3124 autorest.Response `json:"-"` 3125 // Value - READ-ONLY; The list of metric definitions for the account. 3126 Value *[]MetricDefinition `json:"value,omitempty"` 3127} 3128 3129// MarshalJSON is the custom marshaler for MetricDefinitionsListResult. 3130func (mdlr MetricDefinitionsListResult) MarshalJSON() ([]byte, error) { 3131 objectMap := make(map[string]interface{}) 3132 return json.Marshal(objectMap) 3133} 3134 3135// MetricListResult the response to a list metrics request. 3136type MetricListResult struct { 3137 autorest.Response `json:"-"` 3138 // Value - READ-ONLY; The list of metrics for the account. 3139 Value *[]Metric `json:"value,omitempty"` 3140} 3141 3142// MarshalJSON is the custom marshaler for MetricListResult. 3143func (mlr MetricListResult) MarshalJSON() ([]byte, error) { 3144 objectMap := make(map[string]interface{}) 3145 return json.Marshal(objectMap) 3146} 3147 3148// MetricName a metric name. 3149type MetricName struct { 3150 // Value - READ-ONLY; The name of the metric. 3151 Value *string `json:"value,omitempty"` 3152 // LocalizedValue - READ-ONLY; The friendly name of the metric. 3153 LocalizedValue *string `json:"localizedValue,omitempty"` 3154} 3155 3156// MarshalJSON is the custom marshaler for MetricName. 3157func (mn MetricName) MarshalJSON() ([]byte, error) { 3158 objectMap := make(map[string]interface{}) 3159 return json.Marshal(objectMap) 3160} 3161 3162// MetricValue represents metrics values. 3163type MetricValue struct { 3164 // Count - READ-ONLY; The number of values for the metric. 3165 Count *float64 `json:"_count,omitempty"` 3166 // Average - READ-ONLY; The average value of the metric. 3167 Average *float64 `json:"average,omitempty"` 3168 // Maximum - READ-ONLY; The max value of the metric. 3169 Maximum *float64 `json:"maximum,omitempty"` 3170 // Minimum - READ-ONLY; The min value of the metric. 3171 Minimum *float64 `json:"minimum,omitempty"` 3172 // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). 3173 Timestamp *date.Time `json:"timestamp,omitempty"` 3174 // Total - READ-ONLY; The total value of the metric. 3175 Total *float64 `json:"total,omitempty"` 3176} 3177 3178// MarshalJSON is the custom marshaler for MetricValue. 3179func (mv MetricValue) MarshalJSON() ([]byte, error) { 3180 objectMap := make(map[string]interface{}) 3181 return json.Marshal(objectMap) 3182} 3183 3184// MongoDBCollectionCreateUpdateParameters parameters to create and update Cosmos DB MongoDB collection. 3185type MongoDBCollectionCreateUpdateParameters struct { 3186 // MongoDBCollectionCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB collection. 3187 *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"` 3188 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 3189 ID *string `json:"id,omitempty"` 3190 // Name - READ-ONLY; The name of the ARM resource. 3191 Name *string `json:"name,omitempty"` 3192 // Type - READ-ONLY; The type of Azure resource. 3193 Type *string `json:"type,omitempty"` 3194 // Location - The location of the resource group to which the resource belongs. 3195 Location *string `json:"location,omitempty"` 3196 Tags map[string]*string `json:"tags"` 3197} 3198 3199// MarshalJSON is the custom marshaler for MongoDBCollectionCreateUpdateParameters. 3200func (mdccup MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) { 3201 objectMap := make(map[string]interface{}) 3202 if mdccup.MongoDBCollectionCreateUpdateProperties != nil { 3203 objectMap["properties"] = mdccup.MongoDBCollectionCreateUpdateProperties 3204 } 3205 if mdccup.Location != nil { 3206 objectMap["location"] = mdccup.Location 3207 } 3208 if mdccup.Tags != nil { 3209 objectMap["tags"] = mdccup.Tags 3210 } 3211 return json.Marshal(objectMap) 3212} 3213 3214// UnmarshalJSON is the custom unmarshaler for MongoDBCollectionCreateUpdateParameters struct. 3215func (mdccup *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(body []byte) error { 3216 var m map[string]*json.RawMessage 3217 err := json.Unmarshal(body, &m) 3218 if err != nil { 3219 return err 3220 } 3221 for k, v := range m { 3222 switch k { 3223 case "properties": 3224 if v != nil { 3225 var mongoDBCollectionCreateUpdateProperties MongoDBCollectionCreateUpdateProperties 3226 err = json.Unmarshal(*v, &mongoDBCollectionCreateUpdateProperties) 3227 if err != nil { 3228 return err 3229 } 3230 mdccup.MongoDBCollectionCreateUpdateProperties = &mongoDBCollectionCreateUpdateProperties 3231 } 3232 case "id": 3233 if v != nil { 3234 var ID string 3235 err = json.Unmarshal(*v, &ID) 3236 if err != nil { 3237 return err 3238 } 3239 mdccup.ID = &ID 3240 } 3241 case "name": 3242 if v != nil { 3243 var name string 3244 err = json.Unmarshal(*v, &name) 3245 if err != nil { 3246 return err 3247 } 3248 mdccup.Name = &name 3249 } 3250 case "type": 3251 if v != nil { 3252 var typeVar string 3253 err = json.Unmarshal(*v, &typeVar) 3254 if err != nil { 3255 return err 3256 } 3257 mdccup.Type = &typeVar 3258 } 3259 case "location": 3260 if v != nil { 3261 var location string 3262 err = json.Unmarshal(*v, &location) 3263 if err != nil { 3264 return err 3265 } 3266 mdccup.Location = &location 3267 } 3268 case "tags": 3269 if v != nil { 3270 var tags map[string]*string 3271 err = json.Unmarshal(*v, &tags) 3272 if err != nil { 3273 return err 3274 } 3275 mdccup.Tags = tags 3276 } 3277 } 3278 } 3279 3280 return nil 3281} 3282 3283// MongoDBCollectionCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB 3284// collection. 3285type MongoDBCollectionCreateUpdateProperties struct { 3286 // Resource - The standard JSON format of a MongoDB collection 3287 Resource *MongoDBCollectionResource `json:"resource,omitempty"` 3288 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 3289 Options *CreateUpdateOptions `json:"options,omitempty"` 3290} 3291 3292// MongoDBCollectionGetProperties the properties of an Azure Cosmos DB MongoDB collection 3293type MongoDBCollectionGetProperties struct { 3294 Resource *MongoDBCollectionGetPropertiesResource `json:"resource,omitempty"` 3295 Options *MongoDBCollectionGetPropertiesOptions `json:"options,omitempty"` 3296} 3297 3298// MongoDBCollectionGetPropertiesOptions ... 3299type MongoDBCollectionGetPropertiesOptions struct { 3300 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 3301 Throughput *int32 `json:"throughput,omitempty"` 3302} 3303 3304// MongoDBCollectionGetPropertiesResource ... 3305type MongoDBCollectionGetPropertiesResource struct { 3306 // ID - Name of the Cosmos DB MongoDB collection 3307 ID *string `json:"id,omitempty"` 3308 // ShardKey - A key-value pair of shard keys to be applied for the request. 3309 ShardKey map[string]*string `json:"shardKey"` 3310 // Indexes - List of index keys 3311 Indexes *[]MongoIndex `json:"indexes,omitempty"` 3312 // Rid - READ-ONLY; A system generated property. A unique identifier. 3313 Rid *string `json:"_rid,omitempty"` 3314 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 3315 Ts interface{} `json:"_ts,omitempty"` 3316 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 3317 Etag *string `json:"_etag,omitempty"` 3318} 3319 3320// MarshalJSON is the custom marshaler for MongoDBCollectionGetPropertiesResource. 3321func (mdcgp MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) { 3322 objectMap := make(map[string]interface{}) 3323 if mdcgp.ID != nil { 3324 objectMap["id"] = mdcgp.ID 3325 } 3326 if mdcgp.ShardKey != nil { 3327 objectMap["shardKey"] = mdcgp.ShardKey 3328 } 3329 if mdcgp.Indexes != nil { 3330 objectMap["indexes"] = mdcgp.Indexes 3331 } 3332 return json.Marshal(objectMap) 3333} 3334 3335// MongoDBCollectionGetResults an Azure Cosmos DB MongoDB collection. 3336type MongoDBCollectionGetResults struct { 3337 autorest.Response `json:"-"` 3338 // MongoDBCollectionGetProperties - The properties of an Azure Cosmos DB MongoDB collection 3339 *MongoDBCollectionGetProperties `json:"properties,omitempty"` 3340 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 3341 ID *string `json:"id,omitempty"` 3342 // Name - READ-ONLY; The name of the ARM resource. 3343 Name *string `json:"name,omitempty"` 3344 // Type - READ-ONLY; The type of Azure resource. 3345 Type *string `json:"type,omitempty"` 3346 // Location - The location of the resource group to which the resource belongs. 3347 Location *string `json:"location,omitempty"` 3348 Tags map[string]*string `json:"tags"` 3349} 3350 3351// MarshalJSON is the custom marshaler for MongoDBCollectionGetResults. 3352func (mdcgr MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) { 3353 objectMap := make(map[string]interface{}) 3354 if mdcgr.MongoDBCollectionGetProperties != nil { 3355 objectMap["properties"] = mdcgr.MongoDBCollectionGetProperties 3356 } 3357 if mdcgr.Location != nil { 3358 objectMap["location"] = mdcgr.Location 3359 } 3360 if mdcgr.Tags != nil { 3361 objectMap["tags"] = mdcgr.Tags 3362 } 3363 return json.Marshal(objectMap) 3364} 3365 3366// UnmarshalJSON is the custom unmarshaler for MongoDBCollectionGetResults struct. 3367func (mdcgr *MongoDBCollectionGetResults) UnmarshalJSON(body []byte) error { 3368 var m map[string]*json.RawMessage 3369 err := json.Unmarshal(body, &m) 3370 if err != nil { 3371 return err 3372 } 3373 for k, v := range m { 3374 switch k { 3375 case "properties": 3376 if v != nil { 3377 var mongoDBCollectionGetProperties MongoDBCollectionGetProperties 3378 err = json.Unmarshal(*v, &mongoDBCollectionGetProperties) 3379 if err != nil { 3380 return err 3381 } 3382 mdcgr.MongoDBCollectionGetProperties = &mongoDBCollectionGetProperties 3383 } 3384 case "id": 3385 if v != nil { 3386 var ID string 3387 err = json.Unmarshal(*v, &ID) 3388 if err != nil { 3389 return err 3390 } 3391 mdcgr.ID = &ID 3392 } 3393 case "name": 3394 if v != nil { 3395 var name string 3396 err = json.Unmarshal(*v, &name) 3397 if err != nil { 3398 return err 3399 } 3400 mdcgr.Name = &name 3401 } 3402 case "type": 3403 if v != nil { 3404 var typeVar string 3405 err = json.Unmarshal(*v, &typeVar) 3406 if err != nil { 3407 return err 3408 } 3409 mdcgr.Type = &typeVar 3410 } 3411 case "location": 3412 if v != nil { 3413 var location string 3414 err = json.Unmarshal(*v, &location) 3415 if err != nil { 3416 return err 3417 } 3418 mdcgr.Location = &location 3419 } 3420 case "tags": 3421 if v != nil { 3422 var tags map[string]*string 3423 err = json.Unmarshal(*v, &tags) 3424 if err != nil { 3425 return err 3426 } 3427 mdcgr.Tags = tags 3428 } 3429 } 3430 } 3431 3432 return nil 3433} 3434 3435// MongoDBCollectionListResult the List operation response, that contains the MongoDB collections and their 3436// properties. 3437type MongoDBCollectionListResult struct { 3438 autorest.Response `json:"-"` 3439 // Value - READ-ONLY; List of MongoDB collections and their properties. 3440 Value *[]MongoDBCollectionGetResults `json:"value,omitempty"` 3441} 3442 3443// MarshalJSON is the custom marshaler for MongoDBCollectionListResult. 3444func (mdclr MongoDBCollectionListResult) MarshalJSON() ([]byte, error) { 3445 objectMap := make(map[string]interface{}) 3446 return json.Marshal(objectMap) 3447} 3448 3449// MongoDBCollectionResource cosmos DB MongoDB collection resource object 3450type MongoDBCollectionResource struct { 3451 // ID - Name of the Cosmos DB MongoDB collection 3452 ID *string `json:"id,omitempty"` 3453 // ShardKey - A key-value pair of shard keys to be applied for the request. 3454 ShardKey map[string]*string `json:"shardKey"` 3455 // Indexes - List of index keys 3456 Indexes *[]MongoIndex `json:"indexes,omitempty"` 3457} 3458 3459// MarshalJSON is the custom marshaler for MongoDBCollectionResource. 3460func (mdcr MongoDBCollectionResource) MarshalJSON() ([]byte, error) { 3461 objectMap := make(map[string]interface{}) 3462 if mdcr.ID != nil { 3463 objectMap["id"] = mdcr.ID 3464 } 3465 if mdcr.ShardKey != nil { 3466 objectMap["shardKey"] = mdcr.ShardKey 3467 } 3468 if mdcr.Indexes != nil { 3469 objectMap["indexes"] = mdcr.Indexes 3470 } 3471 return json.Marshal(objectMap) 3472} 3473 3474// MongoDBDatabaseCreateUpdateParameters parameters to create and update Cosmos DB MongoDB database. 3475type MongoDBDatabaseCreateUpdateParameters struct { 3476 // MongoDBDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB database. 3477 *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"` 3478 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 3479 ID *string `json:"id,omitempty"` 3480 // Name - READ-ONLY; The name of the ARM resource. 3481 Name *string `json:"name,omitempty"` 3482 // Type - READ-ONLY; The type of Azure resource. 3483 Type *string `json:"type,omitempty"` 3484 // Location - The location of the resource group to which the resource belongs. 3485 Location *string `json:"location,omitempty"` 3486 Tags map[string]*string `json:"tags"` 3487} 3488 3489// MarshalJSON is the custom marshaler for MongoDBDatabaseCreateUpdateParameters. 3490func (mddcup MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { 3491 objectMap := make(map[string]interface{}) 3492 if mddcup.MongoDBDatabaseCreateUpdateProperties != nil { 3493 objectMap["properties"] = mddcup.MongoDBDatabaseCreateUpdateProperties 3494 } 3495 if mddcup.Location != nil { 3496 objectMap["location"] = mddcup.Location 3497 } 3498 if mddcup.Tags != nil { 3499 objectMap["tags"] = mddcup.Tags 3500 } 3501 return json.Marshal(objectMap) 3502} 3503 3504// UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseCreateUpdateParameters struct. 3505func (mddcup *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { 3506 var m map[string]*json.RawMessage 3507 err := json.Unmarshal(body, &m) 3508 if err != nil { 3509 return err 3510 } 3511 for k, v := range m { 3512 switch k { 3513 case "properties": 3514 if v != nil { 3515 var mongoDBDatabaseCreateUpdateProperties MongoDBDatabaseCreateUpdateProperties 3516 err = json.Unmarshal(*v, &mongoDBDatabaseCreateUpdateProperties) 3517 if err != nil { 3518 return err 3519 } 3520 mddcup.MongoDBDatabaseCreateUpdateProperties = &mongoDBDatabaseCreateUpdateProperties 3521 } 3522 case "id": 3523 if v != nil { 3524 var ID string 3525 err = json.Unmarshal(*v, &ID) 3526 if err != nil { 3527 return err 3528 } 3529 mddcup.ID = &ID 3530 } 3531 case "name": 3532 if v != nil { 3533 var name string 3534 err = json.Unmarshal(*v, &name) 3535 if err != nil { 3536 return err 3537 } 3538 mddcup.Name = &name 3539 } 3540 case "type": 3541 if v != nil { 3542 var typeVar string 3543 err = json.Unmarshal(*v, &typeVar) 3544 if err != nil { 3545 return err 3546 } 3547 mddcup.Type = &typeVar 3548 } 3549 case "location": 3550 if v != nil { 3551 var location string 3552 err = json.Unmarshal(*v, &location) 3553 if err != nil { 3554 return err 3555 } 3556 mddcup.Location = &location 3557 } 3558 case "tags": 3559 if v != nil { 3560 var tags map[string]*string 3561 err = json.Unmarshal(*v, &tags) 3562 if err != nil { 3563 return err 3564 } 3565 mddcup.Tags = tags 3566 } 3567 } 3568 } 3569 3570 return nil 3571} 3572 3573// MongoDBDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB database. 3574type MongoDBDatabaseCreateUpdateProperties struct { 3575 // Resource - The standard JSON format of a MongoDB database 3576 Resource *MongoDBDatabaseResource `json:"resource,omitempty"` 3577 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 3578 Options *CreateUpdateOptions `json:"options,omitempty"` 3579} 3580 3581// MongoDBDatabaseGetProperties the properties of an Azure Cosmos DB MongoDB database 3582type MongoDBDatabaseGetProperties struct { 3583 Resource *MongoDBDatabaseGetPropertiesResource `json:"resource,omitempty"` 3584 Options *MongoDBDatabaseGetPropertiesOptions `json:"options,omitempty"` 3585} 3586 3587// MongoDBDatabaseGetPropertiesOptions ... 3588type MongoDBDatabaseGetPropertiesOptions struct { 3589 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 3590 Throughput *int32 `json:"throughput,omitempty"` 3591} 3592 3593// MongoDBDatabaseGetPropertiesResource ... 3594type MongoDBDatabaseGetPropertiesResource struct { 3595 // ID - Name of the Cosmos DB MongoDB database 3596 ID *string `json:"id,omitempty"` 3597 // Rid - READ-ONLY; A system generated property. A unique identifier. 3598 Rid *string `json:"_rid,omitempty"` 3599 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 3600 Ts interface{} `json:"_ts,omitempty"` 3601 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 3602 Etag *string `json:"_etag,omitempty"` 3603} 3604 3605// MarshalJSON is the custom marshaler for MongoDBDatabaseGetPropertiesResource. 3606func (mddgp MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { 3607 objectMap := make(map[string]interface{}) 3608 if mddgp.ID != nil { 3609 objectMap["id"] = mddgp.ID 3610 } 3611 return json.Marshal(objectMap) 3612} 3613 3614// MongoDBDatabaseGetResults an Azure Cosmos DB MongoDB database. 3615type MongoDBDatabaseGetResults struct { 3616 autorest.Response `json:"-"` 3617 // MongoDBDatabaseGetProperties - The properties of an Azure Cosmos DB MongoDB database 3618 *MongoDBDatabaseGetProperties `json:"properties,omitempty"` 3619 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 3620 ID *string `json:"id,omitempty"` 3621 // Name - READ-ONLY; The name of the ARM resource. 3622 Name *string `json:"name,omitempty"` 3623 // Type - READ-ONLY; The type of Azure resource. 3624 Type *string `json:"type,omitempty"` 3625 // Location - The location of the resource group to which the resource belongs. 3626 Location *string `json:"location,omitempty"` 3627 Tags map[string]*string `json:"tags"` 3628} 3629 3630// MarshalJSON is the custom marshaler for MongoDBDatabaseGetResults. 3631func (mddgr MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { 3632 objectMap := make(map[string]interface{}) 3633 if mddgr.MongoDBDatabaseGetProperties != nil { 3634 objectMap["properties"] = mddgr.MongoDBDatabaseGetProperties 3635 } 3636 if mddgr.Location != nil { 3637 objectMap["location"] = mddgr.Location 3638 } 3639 if mddgr.Tags != nil { 3640 objectMap["tags"] = mddgr.Tags 3641 } 3642 return json.Marshal(objectMap) 3643} 3644 3645// UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseGetResults struct. 3646func (mddgr *MongoDBDatabaseGetResults) UnmarshalJSON(body []byte) error { 3647 var m map[string]*json.RawMessage 3648 err := json.Unmarshal(body, &m) 3649 if err != nil { 3650 return err 3651 } 3652 for k, v := range m { 3653 switch k { 3654 case "properties": 3655 if v != nil { 3656 var mongoDBDatabaseGetProperties MongoDBDatabaseGetProperties 3657 err = json.Unmarshal(*v, &mongoDBDatabaseGetProperties) 3658 if err != nil { 3659 return err 3660 } 3661 mddgr.MongoDBDatabaseGetProperties = &mongoDBDatabaseGetProperties 3662 } 3663 case "id": 3664 if v != nil { 3665 var ID string 3666 err = json.Unmarshal(*v, &ID) 3667 if err != nil { 3668 return err 3669 } 3670 mddgr.ID = &ID 3671 } 3672 case "name": 3673 if v != nil { 3674 var name string 3675 err = json.Unmarshal(*v, &name) 3676 if err != nil { 3677 return err 3678 } 3679 mddgr.Name = &name 3680 } 3681 case "type": 3682 if v != nil { 3683 var typeVar string 3684 err = json.Unmarshal(*v, &typeVar) 3685 if err != nil { 3686 return err 3687 } 3688 mddgr.Type = &typeVar 3689 } 3690 case "location": 3691 if v != nil { 3692 var location string 3693 err = json.Unmarshal(*v, &location) 3694 if err != nil { 3695 return err 3696 } 3697 mddgr.Location = &location 3698 } 3699 case "tags": 3700 if v != nil { 3701 var tags map[string]*string 3702 err = json.Unmarshal(*v, &tags) 3703 if err != nil { 3704 return err 3705 } 3706 mddgr.Tags = tags 3707 } 3708 } 3709 } 3710 3711 return nil 3712} 3713 3714// MongoDBDatabaseListResult the List operation response, that contains the MongoDB databases and their 3715// properties. 3716type MongoDBDatabaseListResult struct { 3717 autorest.Response `json:"-"` 3718 // Value - READ-ONLY; List of MongoDB databases and their properties. 3719 Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"` 3720} 3721 3722// MarshalJSON is the custom marshaler for MongoDBDatabaseListResult. 3723func (mddlr MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) { 3724 objectMap := make(map[string]interface{}) 3725 return json.Marshal(objectMap) 3726} 3727 3728// MongoDBDatabaseResource cosmos DB MongoDB database resource object 3729type MongoDBDatabaseResource struct { 3730 // ID - Name of the Cosmos DB MongoDB database 3731 ID *string `json:"id,omitempty"` 3732} 3733 3734// MongoDBResourcesCreateUpdateMongoDBCollectionFuture an abstraction for monitoring and retrieving the 3735// results of a long-running operation. 3736type MongoDBResourcesCreateUpdateMongoDBCollectionFuture struct { 3737 azure.FutureAPI 3738 // Result returns the result of the asynchronous operation. 3739 // If the operation has not completed it will return an error. 3740 Result func(MongoDBResourcesClient) (MongoDBCollectionGetResults, error) 3741} 3742 3743// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3744func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) UnmarshalJSON(body []byte) error { 3745 var azFuture azure.Future 3746 if err := json.Unmarshal(body, &azFuture); err != nil { 3747 return err 3748 } 3749 future.FutureAPI = &azFuture 3750 future.Result = future.result 3751 return nil 3752} 3753 3754// result is the default implementation for MongoDBResourcesCreateUpdateMongoDBCollectionFuture.Result. 3755func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) result(client MongoDBResourcesClient) (mdcgr MongoDBCollectionGetResults, err error) { 3756 var done bool 3757 done, err = future.DoneWithContext(context.Background(), client) 3758 if err != nil { 3759 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", future.Response(), "Polling failure") 3760 return 3761 } 3762 if !done { 3763 mdcgr.Response.Response = future.Response() 3764 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture") 3765 return 3766 } 3767 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3768 if mdcgr.Response.Response, err = future.GetResult(sender); err == nil && mdcgr.Response.Response.StatusCode != http.StatusNoContent { 3769 mdcgr, err = client.CreateUpdateMongoDBCollectionResponder(mdcgr.Response.Response) 3770 if err != nil { 3771 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", mdcgr.Response.Response, "Failure responding to request") 3772 } 3773 } 3774 return 3775} 3776 3777// MongoDBResourcesCreateUpdateMongoDBDatabaseFuture an abstraction for monitoring and retrieving the 3778// results of a long-running operation. 3779type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture struct { 3780 azure.FutureAPI 3781 // Result returns the result of the asynchronous operation. 3782 // If the operation has not completed it will return an error. 3783 Result func(MongoDBResourcesClient) (MongoDBDatabaseGetResults, error) 3784} 3785 3786// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3787func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error { 3788 var azFuture azure.Future 3789 if err := json.Unmarshal(body, &azFuture); err != nil { 3790 return err 3791 } 3792 future.FutureAPI = &azFuture 3793 future.Result = future.result 3794 return nil 3795} 3796 3797// result is the default implementation for MongoDBResourcesCreateUpdateMongoDBDatabaseFuture.Result. 3798func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (mddgr MongoDBDatabaseGetResults, err error) { 3799 var done bool 3800 done, err = future.DoneWithContext(context.Background(), client) 3801 if err != nil { 3802 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure") 3803 return 3804 } 3805 if !done { 3806 mddgr.Response.Response = future.Response() 3807 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture") 3808 return 3809 } 3810 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3811 if mddgr.Response.Response, err = future.GetResult(sender); err == nil && mddgr.Response.Response.StatusCode != http.StatusNoContent { 3812 mddgr, err = client.CreateUpdateMongoDBDatabaseResponder(mddgr.Response.Response) 3813 if err != nil { 3814 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", mddgr.Response.Response, "Failure responding to request") 3815 } 3816 } 3817 return 3818} 3819 3820// MongoDBResourcesDeleteMongoDBCollectionFuture an abstraction for monitoring and retrieving the results 3821// of a long-running operation. 3822type MongoDBResourcesDeleteMongoDBCollectionFuture struct { 3823 azure.FutureAPI 3824 // Result returns the result of the asynchronous operation. 3825 // If the operation has not completed it will return an error. 3826 Result func(MongoDBResourcesClient) (autorest.Response, error) 3827} 3828 3829// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3830func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) UnmarshalJSON(body []byte) error { 3831 var azFuture azure.Future 3832 if err := json.Unmarshal(body, &azFuture); err != nil { 3833 return err 3834 } 3835 future.FutureAPI = &azFuture 3836 future.Result = future.result 3837 return nil 3838} 3839 3840// result is the default implementation for MongoDBResourcesDeleteMongoDBCollectionFuture.Result. 3841func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) { 3842 var done bool 3843 done, err = future.DoneWithContext(context.Background(), client) 3844 if err != nil { 3845 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture", "Result", future.Response(), "Polling failure") 3846 return 3847 } 3848 if !done { 3849 ar.Response = future.Response() 3850 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture") 3851 return 3852 } 3853 ar.Response = future.Response() 3854 return 3855} 3856 3857// MongoDBResourcesDeleteMongoDBDatabaseFuture an abstraction for monitoring and retrieving the results of 3858// a long-running operation. 3859type MongoDBResourcesDeleteMongoDBDatabaseFuture struct { 3860 azure.FutureAPI 3861 // Result returns the result of the asynchronous operation. 3862 // If the operation has not completed it will return an error. 3863 Result func(MongoDBResourcesClient) (autorest.Response, error) 3864} 3865 3866// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3867func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error { 3868 var azFuture azure.Future 3869 if err := json.Unmarshal(body, &azFuture); err != nil { 3870 return err 3871 } 3872 future.FutureAPI = &azFuture 3873 future.Result = future.result 3874 return nil 3875} 3876 3877// result is the default implementation for MongoDBResourcesDeleteMongoDBDatabaseFuture.Result. 3878func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) { 3879 var done bool 3880 done, err = future.DoneWithContext(context.Background(), client) 3881 if err != nil { 3882 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure") 3883 return 3884 } 3885 if !done { 3886 ar.Response = future.Response() 3887 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture") 3888 return 3889 } 3890 ar.Response = future.Response() 3891 return 3892} 3893 3894// MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture an abstraction for monitoring and retrieving 3895// the results of a long-running operation. 3896type MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture struct { 3897 azure.FutureAPI 3898 // Result returns the result of the asynchronous operation. 3899 // If the operation has not completed it will return an error. 3900 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 3901} 3902 3903// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3904func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) UnmarshalJSON(body []byte) error { 3905 var azFuture azure.Future 3906 if err := json.Unmarshal(body, &azFuture); err != nil { 3907 return err 3908 } 3909 future.FutureAPI = &azFuture 3910 future.Result = future.result 3911 return nil 3912} 3913 3914// result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture.Result. 3915func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 3916 var done bool 3917 done, err = future.DoneWithContext(context.Background(), client) 3918 if err != nil { 3919 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", future.Response(), "Polling failure") 3920 return 3921 } 3922 if !done { 3923 tsgr.Response.Response = future.Response() 3924 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture") 3925 return 3926 } 3927 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3928 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 3929 tsgr, err = client.MigrateMongoDBCollectionToAutoscaleResponder(tsgr.Response.Response) 3930 if err != nil { 3931 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 3932 } 3933 } 3934 return 3935} 3936 3937// MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture an abstraction for monitoring and 3938// retrieving the results of a long-running operation. 3939type MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture struct { 3940 azure.FutureAPI 3941 // Result returns the result of the asynchronous operation. 3942 // If the operation has not completed it will return an error. 3943 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 3944} 3945 3946// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3947func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) UnmarshalJSON(body []byte) error { 3948 var azFuture azure.Future 3949 if err := json.Unmarshal(body, &azFuture); err != nil { 3950 return err 3951 } 3952 future.FutureAPI = &azFuture 3953 future.Result = future.result 3954 return nil 3955} 3956 3957// result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture.Result. 3958func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 3959 var done bool 3960 done, err = future.DoneWithContext(context.Background(), client) 3961 if err != nil { 3962 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", future.Response(), "Polling failure") 3963 return 3964 } 3965 if !done { 3966 tsgr.Response.Response = future.Response() 3967 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture") 3968 return 3969 } 3970 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3971 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 3972 tsgr, err = client.MigrateMongoDBCollectionToManualThroughputResponder(tsgr.Response.Response) 3973 if err != nil { 3974 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 3975 } 3976 } 3977 return 3978} 3979 3980// MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the 3981// results of a long-running operation. 3982type MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture struct { 3983 azure.FutureAPI 3984 // Result returns the result of the asynchronous operation. 3985 // If the operation has not completed it will return an error. 3986 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 3987} 3988 3989// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3990func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { 3991 var azFuture azure.Future 3992 if err := json.Unmarshal(body, &azFuture); err != nil { 3993 return err 3994 } 3995 future.FutureAPI = &azFuture 3996 future.Result = future.result 3997 return nil 3998} 3999 4000// result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture.Result. 4001func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 4002 var done bool 4003 done, err = future.DoneWithContext(context.Background(), client) 4004 if err != nil { 4005 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") 4006 return 4007 } 4008 if !done { 4009 tsgr.Response.Response = future.Response() 4010 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture") 4011 return 4012 } 4013 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4014 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 4015 tsgr, err = client.MigrateMongoDBDatabaseToAutoscaleResponder(tsgr.Response.Response) 4016 if err != nil { 4017 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 4018 } 4019 } 4020 return 4021} 4022 4023// MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture an abstraction for monitoring and 4024// retrieving the results of a long-running operation. 4025type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture struct { 4026 azure.FutureAPI 4027 // Result returns the result of the asynchronous operation. 4028 // If the operation has not completed it will return an error. 4029 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 4030} 4031 4032// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4033func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { 4034 var azFuture azure.Future 4035 if err := json.Unmarshal(body, &azFuture); err != nil { 4036 return err 4037 } 4038 future.FutureAPI = &azFuture 4039 future.Result = future.result 4040 return nil 4041} 4042 4043// result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture.Result. 4044func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 4045 var done bool 4046 done, err = future.DoneWithContext(context.Background(), client) 4047 if err != nil { 4048 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") 4049 return 4050 } 4051 if !done { 4052 tsgr.Response.Response = future.Response() 4053 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture") 4054 return 4055 } 4056 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4057 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 4058 tsgr, err = client.MigrateMongoDBDatabaseToManualThroughputResponder(tsgr.Response.Response) 4059 if err != nil { 4060 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 4061 } 4062 } 4063 return 4064} 4065 4066// MongoDBResourcesUpdateMongoDBCollectionThroughputFuture an abstraction for monitoring and retrieving the 4067// results of a long-running operation. 4068type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture struct { 4069 azure.FutureAPI 4070 // Result returns the result of the asynchronous operation. 4071 // If the operation has not completed it will return an error. 4072 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 4073} 4074 4075// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4076func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) UnmarshalJSON(body []byte) error { 4077 var azFuture azure.Future 4078 if err := json.Unmarshal(body, &azFuture); err != nil { 4079 return err 4080 } 4081 future.FutureAPI = &azFuture 4082 future.Result = future.result 4083 return nil 4084} 4085 4086// result is the default implementation for MongoDBResourcesUpdateMongoDBCollectionThroughputFuture.Result. 4087func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 4088 var done bool 4089 done, err = future.DoneWithContext(context.Background(), client) 4090 if err != nil { 4091 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", future.Response(), "Polling failure") 4092 return 4093 } 4094 if !done { 4095 tsgr.Response.Response = future.Response() 4096 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture") 4097 return 4098 } 4099 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4100 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 4101 tsgr, err = client.UpdateMongoDBCollectionThroughputResponder(tsgr.Response.Response) 4102 if err != nil { 4103 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 4104 } 4105 } 4106 return 4107} 4108 4109// MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture an abstraction for monitoring and retrieving the 4110// results of a long-running operation. 4111type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture struct { 4112 azure.FutureAPI 4113 // Result returns the result of the asynchronous operation. 4114 // If the operation has not completed it will return an error. 4115 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 4116} 4117 4118// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4119func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { 4120 var azFuture azure.Future 4121 if err := json.Unmarshal(body, &azFuture); err != nil { 4122 return err 4123 } 4124 future.FutureAPI = &azFuture 4125 future.Result = future.result 4126 return nil 4127} 4128 4129// result is the default implementation for MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture.Result. 4130func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 4131 var done bool 4132 done, err = future.DoneWithContext(context.Background(), client) 4133 if err != nil { 4134 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") 4135 return 4136 } 4137 if !done { 4138 tsgr.Response.Response = future.Response() 4139 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture") 4140 return 4141 } 4142 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4143 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 4144 tsgr, err = client.UpdateMongoDBDatabaseThroughputResponder(tsgr.Response.Response) 4145 if err != nil { 4146 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 4147 } 4148 } 4149 return 4150} 4151 4152// MongoIndex cosmos DB MongoDB collection index key 4153type MongoIndex struct { 4154 // Key - Cosmos DB MongoDB collection index keys 4155 Key *MongoIndexKeys `json:"key,omitempty"` 4156 // Options - Cosmos DB MongoDB collection index key options 4157 Options *MongoIndexOptions `json:"options,omitempty"` 4158} 4159 4160// MongoIndexKeys cosmos DB MongoDB collection resource object 4161type MongoIndexKeys struct { 4162 // Keys - List of keys for each MongoDB collection in the Azure Cosmos DB service 4163 Keys *[]string `json:"keys,omitempty"` 4164} 4165 4166// MongoIndexOptions cosmos DB MongoDB collection index options 4167type MongoIndexOptions struct { 4168 // ExpireAfterSeconds - Expire after seconds 4169 ExpireAfterSeconds *int32 `json:"expireAfterSeconds,omitempty"` 4170 // Unique - Is unique or not 4171 Unique *bool `json:"unique,omitempty"` 4172} 4173 4174// NotebookWorkspace a notebook workspace resource 4175type NotebookWorkspace struct { 4176 autorest.Response `json:"-"` 4177 // NotebookWorkspaceProperties - Resource properties. 4178 *NotebookWorkspaceProperties `json:"properties,omitempty"` 4179 // ID - READ-ONLY; The unique resource identifier of the database account. 4180 ID *string `json:"id,omitempty"` 4181 // Name - READ-ONLY; The name of the database account. 4182 Name *string `json:"name,omitempty"` 4183 // Type - READ-ONLY; The type of Azure resource. 4184 Type *string `json:"type,omitempty"` 4185} 4186 4187// MarshalJSON is the custom marshaler for NotebookWorkspace. 4188func (nw NotebookWorkspace) MarshalJSON() ([]byte, error) { 4189 objectMap := make(map[string]interface{}) 4190 if nw.NotebookWorkspaceProperties != nil { 4191 objectMap["properties"] = nw.NotebookWorkspaceProperties 4192 } 4193 return json.Marshal(objectMap) 4194} 4195 4196// UnmarshalJSON is the custom unmarshaler for NotebookWorkspace struct. 4197func (nw *NotebookWorkspace) UnmarshalJSON(body []byte) error { 4198 var m map[string]*json.RawMessage 4199 err := json.Unmarshal(body, &m) 4200 if err != nil { 4201 return err 4202 } 4203 for k, v := range m { 4204 switch k { 4205 case "properties": 4206 if v != nil { 4207 var notebookWorkspaceProperties NotebookWorkspaceProperties 4208 err = json.Unmarshal(*v, ¬ebookWorkspaceProperties) 4209 if err != nil { 4210 return err 4211 } 4212 nw.NotebookWorkspaceProperties = ¬ebookWorkspaceProperties 4213 } 4214 case "id": 4215 if v != nil { 4216 var ID string 4217 err = json.Unmarshal(*v, &ID) 4218 if err != nil { 4219 return err 4220 } 4221 nw.ID = &ID 4222 } 4223 case "name": 4224 if v != nil { 4225 var name string 4226 err = json.Unmarshal(*v, &name) 4227 if err != nil { 4228 return err 4229 } 4230 nw.Name = &name 4231 } 4232 case "type": 4233 if v != nil { 4234 var typeVar string 4235 err = json.Unmarshal(*v, &typeVar) 4236 if err != nil { 4237 return err 4238 } 4239 nw.Type = &typeVar 4240 } 4241 } 4242 } 4243 4244 return nil 4245} 4246 4247// NotebookWorkspaceConnectionInfoResult the connection info for the given notebook workspace 4248type NotebookWorkspaceConnectionInfoResult struct { 4249 autorest.Response `json:"-"` 4250 // AuthToken - READ-ONLY; Specifies auth token used for connecting to Notebook server (uses token-based auth). 4251 AuthToken *string `json:"authToken,omitempty"` 4252 // NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server. 4253 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"` 4254} 4255 4256// MarshalJSON is the custom marshaler for NotebookWorkspaceConnectionInfoResult. 4257func (nwcir NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) { 4258 objectMap := make(map[string]interface{}) 4259 return json.Marshal(objectMap) 4260} 4261 4262// NotebookWorkspaceCreateUpdateParameters parameters to create a notebook workspace resource 4263type NotebookWorkspaceCreateUpdateParameters struct { 4264 // ID - READ-ONLY; The unique resource identifier of the database account. 4265 ID *string `json:"id,omitempty"` 4266 // Name - READ-ONLY; The name of the database account. 4267 Name *string `json:"name,omitempty"` 4268 // Type - READ-ONLY; The type of Azure resource. 4269 Type *string `json:"type,omitempty"` 4270} 4271 4272// MarshalJSON is the custom marshaler for NotebookWorkspaceCreateUpdateParameters. 4273func (nwcup NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { 4274 objectMap := make(map[string]interface{}) 4275 return json.Marshal(objectMap) 4276} 4277 4278// NotebookWorkspaceListResult a list of notebook workspace resources 4279type NotebookWorkspaceListResult struct { 4280 autorest.Response `json:"-"` 4281 // Value - Array of notebook workspace resources 4282 Value *[]NotebookWorkspace `json:"value,omitempty"` 4283} 4284 4285// NotebookWorkspaceProperties properties of a notebook workspace resource. 4286type NotebookWorkspaceProperties struct { 4287 // NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server. 4288 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"` 4289 // Status - READ-ONLY; Status of the notebook workspace. Possible values are: Creating, Online, Deleting, Failed, Updating. 4290 Status *string `json:"status,omitempty"` 4291} 4292 4293// MarshalJSON is the custom marshaler for NotebookWorkspaceProperties. 4294func (nwp NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) { 4295 objectMap := make(map[string]interface{}) 4296 return json.Marshal(objectMap) 4297} 4298 4299// NotebookWorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 4300// long-running operation. 4301type NotebookWorkspacesCreateOrUpdateFuture struct { 4302 azure.FutureAPI 4303 // Result returns the result of the asynchronous operation. 4304 // If the operation has not completed it will return an error. 4305 Result func(NotebookWorkspacesClient) (NotebookWorkspace, error) 4306} 4307 4308// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4309func (future *NotebookWorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4310 var azFuture azure.Future 4311 if err := json.Unmarshal(body, &azFuture); err != nil { 4312 return err 4313 } 4314 future.FutureAPI = &azFuture 4315 future.Result = future.result 4316 return nil 4317} 4318 4319// result is the default implementation for NotebookWorkspacesCreateOrUpdateFuture.Result. 4320func (future *NotebookWorkspacesCreateOrUpdateFuture) result(client NotebookWorkspacesClient) (nw NotebookWorkspace, err error) { 4321 var done bool 4322 done, err = future.DoneWithContext(context.Background(), client) 4323 if err != nil { 4324 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4325 return 4326 } 4327 if !done { 4328 nw.Response.Response = future.Response() 4329 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesCreateOrUpdateFuture") 4330 return 4331 } 4332 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4333 if nw.Response.Response, err = future.GetResult(sender); err == nil && nw.Response.Response.StatusCode != http.StatusNoContent { 4334 nw, err = client.CreateOrUpdateResponder(nw.Response.Response) 4335 if err != nil { 4336 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", nw.Response.Response, "Failure responding to request") 4337 } 4338 } 4339 return 4340} 4341 4342// NotebookWorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a 4343// long-running operation. 4344type NotebookWorkspacesDeleteFuture struct { 4345 azure.FutureAPI 4346 // Result returns the result of the asynchronous operation. 4347 // If the operation has not completed it will return an error. 4348 Result func(NotebookWorkspacesClient) (autorest.Response, error) 4349} 4350 4351// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4352func (future *NotebookWorkspacesDeleteFuture) UnmarshalJSON(body []byte) error { 4353 var azFuture azure.Future 4354 if err := json.Unmarshal(body, &azFuture); err != nil { 4355 return err 4356 } 4357 future.FutureAPI = &azFuture 4358 future.Result = future.result 4359 return nil 4360} 4361 4362// result is the default implementation for NotebookWorkspacesDeleteFuture.Result. 4363func (future *NotebookWorkspacesDeleteFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { 4364 var done bool 4365 done, err = future.DoneWithContext(context.Background(), client) 4366 if err != nil { 4367 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") 4368 return 4369 } 4370 if !done { 4371 ar.Response = future.Response() 4372 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesDeleteFuture") 4373 return 4374 } 4375 ar.Response = future.Response() 4376 return 4377} 4378 4379// NotebookWorkspacesRegenerateAuthTokenFuture an abstraction for monitoring and retrieving the results of 4380// a long-running operation. 4381type NotebookWorkspacesRegenerateAuthTokenFuture struct { 4382 azure.FutureAPI 4383 // Result returns the result of the asynchronous operation. 4384 // If the operation has not completed it will return an error. 4385 Result func(NotebookWorkspacesClient) (autorest.Response, error) 4386} 4387 4388// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4389func (future *NotebookWorkspacesRegenerateAuthTokenFuture) UnmarshalJSON(body []byte) error { 4390 var azFuture azure.Future 4391 if err := json.Unmarshal(body, &azFuture); err != nil { 4392 return err 4393 } 4394 future.FutureAPI = &azFuture 4395 future.Result = future.result 4396 return nil 4397} 4398 4399// result is the default implementation for NotebookWorkspacesRegenerateAuthTokenFuture.Result. 4400func (future *NotebookWorkspacesRegenerateAuthTokenFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { 4401 var done bool 4402 done, err = future.DoneWithContext(context.Background(), client) 4403 if err != nil { 4404 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesRegenerateAuthTokenFuture", "Result", future.Response(), "Polling failure") 4405 return 4406 } 4407 if !done { 4408 ar.Response = future.Response() 4409 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesRegenerateAuthTokenFuture") 4410 return 4411 } 4412 ar.Response = future.Response() 4413 return 4414} 4415 4416// NotebookWorkspacesStartFuture an abstraction for monitoring and retrieving the results of a long-running 4417// operation. 4418type NotebookWorkspacesStartFuture struct { 4419 azure.FutureAPI 4420 // Result returns the result of the asynchronous operation. 4421 // If the operation has not completed it will return an error. 4422 Result func(NotebookWorkspacesClient) (autorest.Response, error) 4423} 4424 4425// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4426func (future *NotebookWorkspacesStartFuture) UnmarshalJSON(body []byte) error { 4427 var azFuture azure.Future 4428 if err := json.Unmarshal(body, &azFuture); err != nil { 4429 return err 4430 } 4431 future.FutureAPI = &azFuture 4432 future.Result = future.result 4433 return nil 4434} 4435 4436// result is the default implementation for NotebookWorkspacesStartFuture.Result. 4437func (future *NotebookWorkspacesStartFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { 4438 var done bool 4439 done, err = future.DoneWithContext(context.Background(), client) 4440 if err != nil { 4441 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesStartFuture", "Result", future.Response(), "Polling failure") 4442 return 4443 } 4444 if !done { 4445 ar.Response = future.Response() 4446 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesStartFuture") 4447 return 4448 } 4449 ar.Response = future.Response() 4450 return 4451} 4452 4453// Operation REST API operation 4454type Operation struct { 4455 // Name - Operation name: {provider}/{resource}/{operation} 4456 Name *string `json:"name,omitempty"` 4457 // Display - The object that represents the operation. 4458 Display *OperationDisplay `json:"display,omitempty"` 4459} 4460 4461// OperationDisplay the object that represents the operation. 4462type OperationDisplay struct { 4463 // Provider - Service provider: Microsoft.ResourceProvider 4464 Provider *string `json:"Provider,omitempty"` 4465 // Resource - Resource on which the operation is performed: Profile, endpoint, etc. 4466 Resource *string `json:"Resource,omitempty"` 4467 // Operation - Operation type: Read, write, delete, etc. 4468 Operation *string `json:"Operation,omitempty"` 4469 // Description - Description of operation 4470 Description *string `json:"Description,omitempty"` 4471} 4472 4473// OperationListResult result of the request to list Resource Provider operations. It contains a list of 4474// operations and a URL link to get the next set of results. 4475type OperationListResult struct { 4476 autorest.Response `json:"-"` 4477 // Value - List of operations supported by the Resource Provider. 4478 Value *[]Operation `json:"value,omitempty"` 4479 // NextLink - URL to get the next set of operation list results if there are any. 4480 NextLink *string `json:"nextLink,omitempty"` 4481} 4482 4483// OperationListResultIterator provides access to a complete listing of Operation values. 4484type OperationListResultIterator struct { 4485 i int 4486 page OperationListResultPage 4487} 4488 4489// NextWithContext advances to the next value. If there was an error making 4490// the request the iterator does not advance and the error is returned. 4491func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 4492 if tracing.IsEnabled() { 4493 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 4494 defer func() { 4495 sc := -1 4496 if iter.Response().Response.Response != nil { 4497 sc = iter.Response().Response.Response.StatusCode 4498 } 4499 tracing.EndSpan(ctx, sc, err) 4500 }() 4501 } 4502 iter.i++ 4503 if iter.i < len(iter.page.Values()) { 4504 return nil 4505 } 4506 err = iter.page.NextWithContext(ctx) 4507 if err != nil { 4508 iter.i-- 4509 return err 4510 } 4511 iter.i = 0 4512 return nil 4513} 4514 4515// Next advances to the next value. If there was an error making 4516// the request the iterator does not advance and the error is returned. 4517// Deprecated: Use NextWithContext() instead. 4518func (iter *OperationListResultIterator) Next() error { 4519 return iter.NextWithContext(context.Background()) 4520} 4521 4522// NotDone returns true if the enumeration should be started or is not yet complete. 4523func (iter OperationListResultIterator) NotDone() bool { 4524 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4525} 4526 4527// Response returns the raw server response from the last page request. 4528func (iter OperationListResultIterator) Response() OperationListResult { 4529 return iter.page.Response() 4530} 4531 4532// Value returns the current value or a zero-initialized value if the 4533// iterator has advanced beyond the end of the collection. 4534func (iter OperationListResultIterator) Value() Operation { 4535 if !iter.page.NotDone() { 4536 return Operation{} 4537 } 4538 return iter.page.Values()[iter.i] 4539} 4540 4541// Creates a new instance of the OperationListResultIterator type. 4542func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 4543 return OperationListResultIterator{page: page} 4544} 4545 4546// IsEmpty returns true if the ListResult contains no values. 4547func (olr OperationListResult) IsEmpty() bool { 4548 return olr.Value == nil || len(*olr.Value) == 0 4549} 4550 4551// hasNextLink returns true if the NextLink is not empty. 4552func (olr OperationListResult) hasNextLink() bool { 4553 return olr.NextLink != nil && len(*olr.NextLink) != 0 4554} 4555 4556// operationListResultPreparer prepares a request to retrieve the next set of results. 4557// It returns nil if no more results exist. 4558func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 4559 if !olr.hasNextLink() { 4560 return nil, nil 4561 } 4562 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4563 autorest.AsJSON(), 4564 autorest.AsGet(), 4565 autorest.WithBaseURL(to.String(olr.NextLink))) 4566} 4567 4568// OperationListResultPage contains a page of Operation values. 4569type OperationListResultPage struct { 4570 fn func(context.Context, OperationListResult) (OperationListResult, error) 4571 olr OperationListResult 4572} 4573 4574// NextWithContext advances to the next page of values. If there was an error making 4575// the request the page does not advance and the error is returned. 4576func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 4577 if tracing.IsEnabled() { 4578 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 4579 defer func() { 4580 sc := -1 4581 if page.Response().Response.Response != nil { 4582 sc = page.Response().Response.Response.StatusCode 4583 } 4584 tracing.EndSpan(ctx, sc, err) 4585 }() 4586 } 4587 for { 4588 next, err := page.fn(ctx, page.olr) 4589 if err != nil { 4590 return err 4591 } 4592 page.olr = next 4593 if !next.hasNextLink() || !next.IsEmpty() { 4594 break 4595 } 4596 } 4597 return nil 4598} 4599 4600// Next advances to the next page of values. If there was an error making 4601// the request the page does not advance and the error is returned. 4602// Deprecated: Use NextWithContext() instead. 4603func (page *OperationListResultPage) Next() error { 4604 return page.NextWithContext(context.Background()) 4605} 4606 4607// NotDone returns true if the page enumeration should be started or is not yet complete. 4608func (page OperationListResultPage) NotDone() bool { 4609 return !page.olr.IsEmpty() 4610} 4611 4612// Response returns the raw server response from the last page request. 4613func (page OperationListResultPage) Response() OperationListResult { 4614 return page.olr 4615} 4616 4617// Values returns the slice of values for the current page or nil if there are no values. 4618func (page OperationListResultPage) Values() []Operation { 4619 if page.olr.IsEmpty() { 4620 return nil 4621 } 4622 return *page.olr.Value 4623} 4624 4625// Creates a new instance of the OperationListResultPage type. 4626func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 4627 return OperationListResultPage{ 4628 fn: getNextPage, 4629 olr: cur, 4630 } 4631} 4632 4633// OptionsResource cosmos DB options resource object 4634type OptionsResource struct { 4635 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 4636 Throughput *int32 `json:"throughput,omitempty"` 4637} 4638 4639// PartitionMetric the metric values for a single partition. 4640type PartitionMetric struct { 4641 // PartitionID - READ-ONLY; The partition id (GUID identifier) of the metric values. 4642 PartitionID *string `json:"partitionId,omitempty"` 4643 // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the metric values. 4644 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` 4645 // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). 4646 StartTime *date.Time `json:"startTime,omitempty"` 4647 // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). 4648 EndTime *date.Time `json:"endTime,omitempty"` 4649 // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. 4650 TimeGrain *string `json:"timeGrain,omitempty"` 4651 // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' 4652 Unit UnitType `json:"unit,omitempty"` 4653 // Name - READ-ONLY; The name information for the metric. 4654 Name *MetricName `json:"name,omitempty"` 4655 // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. 4656 MetricValues *[]MetricValue `json:"metricValues,omitempty"` 4657} 4658 4659// MarshalJSON is the custom marshaler for PartitionMetric. 4660func (pm PartitionMetric) MarshalJSON() ([]byte, error) { 4661 objectMap := make(map[string]interface{}) 4662 if pm.Unit != "" { 4663 objectMap["unit"] = pm.Unit 4664 } 4665 return json.Marshal(objectMap) 4666} 4667 4668// PartitionMetricListResult the response to a list partition metrics request. 4669type PartitionMetricListResult struct { 4670 autorest.Response `json:"-"` 4671 // Value - READ-ONLY; The list of partition-level metrics for the account. 4672 Value *[]PartitionMetric `json:"value,omitempty"` 4673} 4674 4675// MarshalJSON is the custom marshaler for PartitionMetricListResult. 4676func (pmlr PartitionMetricListResult) MarshalJSON() ([]byte, error) { 4677 objectMap := make(map[string]interface{}) 4678 return json.Marshal(objectMap) 4679} 4680 4681// PartitionUsage the partition level usage data for a usage request. 4682type PartitionUsage struct { 4683 // PartitionID - READ-ONLY; The partition id (GUID identifier) of the usages. 4684 PartitionID *string `json:"partitionId,omitempty"` 4685 // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the usages. 4686 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` 4687 // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' 4688 Unit UnitType `json:"unit,omitempty"` 4689 // Name - READ-ONLY; The name information for the metric. 4690 Name *MetricName `json:"name,omitempty"` 4691 // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. 4692 QuotaPeriod *string `json:"quotaPeriod,omitempty"` 4693 // Limit - READ-ONLY; Maximum value for this metric 4694 Limit *int64 `json:"limit,omitempty"` 4695 // CurrentValue - READ-ONLY; Current value for this metric 4696 CurrentValue *int64 `json:"currentValue,omitempty"` 4697} 4698 4699// MarshalJSON is the custom marshaler for PartitionUsage. 4700func (pu PartitionUsage) MarshalJSON() ([]byte, error) { 4701 objectMap := make(map[string]interface{}) 4702 if pu.Unit != "" { 4703 objectMap["unit"] = pu.Unit 4704 } 4705 return json.Marshal(objectMap) 4706} 4707 4708// PartitionUsagesResult the response to a list partition level usage request. 4709type PartitionUsagesResult struct { 4710 autorest.Response `json:"-"` 4711 // Value - READ-ONLY; The list of partition-level usages for the database. A usage is a point in time metric 4712 Value *[]PartitionUsage `json:"value,omitempty"` 4713} 4714 4715// MarshalJSON is the custom marshaler for PartitionUsagesResult. 4716func (pur PartitionUsagesResult) MarshalJSON() ([]byte, error) { 4717 objectMap := make(map[string]interface{}) 4718 return json.Marshal(objectMap) 4719} 4720 4721// PercentileMetric percentile Metric data 4722type PercentileMetric struct { 4723 // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). 4724 StartTime *date.Time `json:"startTime,omitempty"` 4725 // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). 4726 EndTime *date.Time `json:"endTime,omitempty"` 4727 // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. 4728 TimeGrain *string `json:"timeGrain,omitempty"` 4729 // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' 4730 Unit UnitType `json:"unit,omitempty"` 4731 // Name - READ-ONLY; The name information for the metric. 4732 Name *MetricName `json:"name,omitempty"` 4733 // MetricValues - READ-ONLY; The percentile metric values for the specified time window and timestep. 4734 MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"` 4735} 4736 4737// MarshalJSON is the custom marshaler for PercentileMetric. 4738func (pm PercentileMetric) MarshalJSON() ([]byte, error) { 4739 objectMap := make(map[string]interface{}) 4740 if pm.Unit != "" { 4741 objectMap["unit"] = pm.Unit 4742 } 4743 return json.Marshal(objectMap) 4744} 4745 4746// PercentileMetricListResult the response to a list percentile metrics request. 4747type PercentileMetricListResult struct { 4748 autorest.Response `json:"-"` 4749 // Value - READ-ONLY; The list of percentile metrics for the account. 4750 Value *[]PercentileMetric `json:"value,omitempty"` 4751} 4752 4753// MarshalJSON is the custom marshaler for PercentileMetricListResult. 4754func (pmlr PercentileMetricListResult) MarshalJSON() ([]byte, error) { 4755 objectMap := make(map[string]interface{}) 4756 return json.Marshal(objectMap) 4757} 4758 4759// PercentileMetricValue represents percentile metrics values. 4760type PercentileMetricValue struct { 4761 // P10 - READ-ONLY; The 10th percentile value for the metric. 4762 P10 *float64 `json:"P10,omitempty"` 4763 // P25 - READ-ONLY; The 25th percentile value for the metric. 4764 P25 *float64 `json:"P25,omitempty"` 4765 // P50 - READ-ONLY; The 50th percentile value for the metric. 4766 P50 *float64 `json:"P50,omitempty"` 4767 // P75 - READ-ONLY; The 75th percentile value for the metric. 4768 P75 *float64 `json:"P75,omitempty"` 4769 // P90 - READ-ONLY; The 90th percentile value for the metric. 4770 P90 *float64 `json:"P90,omitempty"` 4771 // P95 - READ-ONLY; The 95th percentile value for the metric. 4772 P95 *float64 `json:"P95,omitempty"` 4773 // P99 - READ-ONLY; The 99th percentile value for the metric. 4774 P99 *float64 `json:"P99,omitempty"` 4775 // Count - READ-ONLY; The number of values for the metric. 4776 Count *float64 `json:"_count,omitempty"` 4777 // Average - READ-ONLY; The average value of the metric. 4778 Average *float64 `json:"average,omitempty"` 4779 // Maximum - READ-ONLY; The max value of the metric. 4780 Maximum *float64 `json:"maximum,omitempty"` 4781 // Minimum - READ-ONLY; The min value of the metric. 4782 Minimum *float64 `json:"minimum,omitempty"` 4783 // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). 4784 Timestamp *date.Time `json:"timestamp,omitempty"` 4785 // Total - READ-ONLY; The total value of the metric. 4786 Total *float64 `json:"total,omitempty"` 4787} 4788 4789// MarshalJSON is the custom marshaler for PercentileMetricValue. 4790func (pmv PercentileMetricValue) MarshalJSON() ([]byte, error) { 4791 objectMap := make(map[string]interface{}) 4792 return json.Marshal(objectMap) 4793} 4794 4795// PrivateEndpointConnection a private endpoint connection 4796type PrivateEndpointConnection struct { 4797 autorest.Response `json:"-"` 4798 // PrivateEndpointConnectionProperties - Resource properties. 4799 *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 4800 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 4801 ID *string `json:"id,omitempty"` 4802 // Name - READ-ONLY; The name of the resource 4803 Name *string `json:"name,omitempty"` 4804 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 4805 Type *string `json:"type,omitempty"` 4806} 4807 4808// MarshalJSON is the custom marshaler for PrivateEndpointConnection. 4809func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { 4810 objectMap := make(map[string]interface{}) 4811 if pec.PrivateEndpointConnectionProperties != nil { 4812 objectMap["properties"] = pec.PrivateEndpointConnectionProperties 4813 } 4814 return json.Marshal(objectMap) 4815} 4816 4817// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. 4818func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { 4819 var m map[string]*json.RawMessage 4820 err := json.Unmarshal(body, &m) 4821 if err != nil { 4822 return err 4823 } 4824 for k, v := range m { 4825 switch k { 4826 case "properties": 4827 if v != nil { 4828 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties 4829 err = json.Unmarshal(*v, &privateEndpointConnectionProperties) 4830 if err != nil { 4831 return err 4832 } 4833 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties 4834 } 4835 case "id": 4836 if v != nil { 4837 var ID string 4838 err = json.Unmarshal(*v, &ID) 4839 if err != nil { 4840 return err 4841 } 4842 pec.ID = &ID 4843 } 4844 case "name": 4845 if v != nil { 4846 var name string 4847 err = json.Unmarshal(*v, &name) 4848 if err != nil { 4849 return err 4850 } 4851 pec.Name = &name 4852 } 4853 case "type": 4854 if v != nil { 4855 var typeVar string 4856 err = json.Unmarshal(*v, &typeVar) 4857 if err != nil { 4858 return err 4859 } 4860 pec.Type = &typeVar 4861 } 4862 } 4863 } 4864 4865 return nil 4866} 4867 4868// PrivateEndpointConnectionListResult a list of private endpoint connections 4869type PrivateEndpointConnectionListResult struct { 4870 autorest.Response `json:"-"` 4871 // Value - Array of private endpoint connections 4872 Value *[]PrivateEndpointConnection `json:"value,omitempty"` 4873} 4874 4875// PrivateEndpointConnectionProperties properties of a private endpoint connection. 4876type PrivateEndpointConnectionProperties struct { 4877 // PrivateEndpoint - Private endpoint which the connection belongs to. 4878 PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` 4879 // PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection. 4880 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` 4881 // GroupID - Group id of the private endpoint. 4882 GroupID *string `json:"groupId,omitempty"` 4883 // ProvisioningState - Provisioning state of the private endpoint. 4884 ProvisioningState *string `json:"provisioningState,omitempty"` 4885} 4886 4887// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 4888// of a long-running operation. 4889type PrivateEndpointConnectionsCreateOrUpdateFuture struct { 4890 azure.FutureAPI 4891 // Result returns the result of the asynchronous operation. 4892 // If the operation has not completed it will return an error. 4893 Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) 4894} 4895 4896// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4897func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 4898 var azFuture azure.Future 4899 if err := json.Unmarshal(body, &azFuture); err != nil { 4900 return err 4901 } 4902 future.FutureAPI = &azFuture 4903 future.Result = future.result 4904 return nil 4905} 4906 4907// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. 4908func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { 4909 var done bool 4910 done, err = future.DoneWithContext(context.Background(), client) 4911 if err != nil { 4912 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 4913 return 4914 } 4915 if !done { 4916 pec.Response.Response = future.Response() 4917 err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture") 4918 return 4919 } 4920 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4921 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { 4922 pec, err = client.CreateOrUpdateResponder(pec.Response.Response) 4923 if err != nil { 4924 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") 4925 } 4926 } 4927 return 4928} 4929 4930// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a 4931// long-running operation. 4932type PrivateEndpointConnectionsDeleteFuture struct { 4933 azure.FutureAPI 4934 // Result returns the result of the asynchronous operation. 4935 // If the operation has not completed it will return an error. 4936 Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) 4937} 4938 4939// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4940func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 4941 var azFuture azure.Future 4942 if err := json.Unmarshal(body, &azFuture); err != nil { 4943 return err 4944 } 4945 future.FutureAPI = &azFuture 4946 future.Result = future.result 4947 return nil 4948} 4949 4950// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. 4951func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { 4952 var done bool 4953 done, err = future.DoneWithContext(context.Background(), client) 4954 if err != nil { 4955 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 4956 return 4957 } 4958 if !done { 4959 ar.Response = future.Response() 4960 err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsDeleteFuture") 4961 return 4962 } 4963 ar.Response = future.Response() 4964 return 4965} 4966 4967// PrivateEndpointProperty private endpoint which the connection belongs to. 4968type PrivateEndpointProperty struct { 4969 // ID - Resource id of the private endpoint. 4970 ID *string `json:"id,omitempty"` 4971} 4972 4973// PrivateLinkResource a private link resource 4974type PrivateLinkResource struct { 4975 autorest.Response `json:"-"` 4976 // PrivateLinkResourceProperties - Resource properties. 4977 *PrivateLinkResourceProperties `json:"properties,omitempty"` 4978 // ID - READ-ONLY; The unique resource identifier of the database account. 4979 ID *string `json:"id,omitempty"` 4980 // Name - READ-ONLY; The name of the database account. 4981 Name *string `json:"name,omitempty"` 4982 // Type - READ-ONLY; The type of Azure resource. 4983 Type *string `json:"type,omitempty"` 4984} 4985 4986// MarshalJSON is the custom marshaler for PrivateLinkResource. 4987func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { 4988 objectMap := make(map[string]interface{}) 4989 if plr.PrivateLinkResourceProperties != nil { 4990 objectMap["properties"] = plr.PrivateLinkResourceProperties 4991 } 4992 return json.Marshal(objectMap) 4993} 4994 4995// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. 4996func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { 4997 var m map[string]*json.RawMessage 4998 err := json.Unmarshal(body, &m) 4999 if err != nil { 5000 return err 5001 } 5002 for k, v := range m { 5003 switch k { 5004 case "properties": 5005 if v != nil { 5006 var privateLinkResourceProperties PrivateLinkResourceProperties 5007 err = json.Unmarshal(*v, &privateLinkResourceProperties) 5008 if err != nil { 5009 return err 5010 } 5011 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties 5012 } 5013 case "id": 5014 if v != nil { 5015 var ID string 5016 err = json.Unmarshal(*v, &ID) 5017 if err != nil { 5018 return err 5019 } 5020 plr.ID = &ID 5021 } 5022 case "name": 5023 if v != nil { 5024 var name string 5025 err = json.Unmarshal(*v, &name) 5026 if err != nil { 5027 return err 5028 } 5029 plr.Name = &name 5030 } 5031 case "type": 5032 if v != nil { 5033 var typeVar string 5034 err = json.Unmarshal(*v, &typeVar) 5035 if err != nil { 5036 return err 5037 } 5038 plr.Type = &typeVar 5039 } 5040 } 5041 } 5042 5043 return nil 5044} 5045 5046// PrivateLinkResourceListResult a list of private link resources 5047type PrivateLinkResourceListResult struct { 5048 autorest.Response `json:"-"` 5049 // Value - Array of private link resources 5050 Value *[]PrivateLinkResource `json:"value,omitempty"` 5051} 5052 5053// PrivateLinkResourceProperties properties of a private link resource. 5054type PrivateLinkResourceProperties struct { 5055 // GroupID - READ-ONLY; The private link resource group id. 5056 GroupID *string `json:"groupId,omitempty"` 5057 // RequiredMembers - READ-ONLY; The private link resource required member names. 5058 RequiredMembers *[]string `json:"requiredMembers,omitempty"` 5059 // RequiredZoneNames - READ-ONLY; The private link resource required zone names. 5060 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` 5061} 5062 5063// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. 5064func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 5065 objectMap := make(map[string]interface{}) 5066 return json.Marshal(objectMap) 5067} 5068 5069// PrivateLinkServiceConnectionStateProperty connection State of the Private Endpoint Connection. 5070type PrivateLinkServiceConnectionStateProperty struct { 5071 // Status - The private link service connection status. 5072 Status *string `json:"status,omitempty"` 5073 // ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect) 5074 ActionsRequired *string `json:"actionsRequired,omitempty"` 5075 // Description - The private link service connection description. 5076 Description *string `json:"description,omitempty"` 5077} 5078 5079// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. 5080func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { 5081 objectMap := make(map[string]interface{}) 5082 if plscsp.Status != nil { 5083 objectMap["status"] = plscsp.Status 5084 } 5085 if plscsp.Description != nil { 5086 objectMap["description"] = plscsp.Description 5087 } 5088 return json.Marshal(objectMap) 5089} 5090 5091// ProvisionedThroughputSettingsResource cosmos DB provisioned throughput settings object 5092type ProvisionedThroughputSettingsResource struct { 5093 // MaxThroughput - Represents maximum throughput container can scale up to. 5094 MaxThroughput *int32 `json:"maxThroughput,omitempty"` 5095 // AutoUpgradePolicy - Cosmos DB resource auto-upgrade policy 5096 AutoUpgradePolicy *AutoUpgradePolicyResource `json:"autoUpgradePolicy,omitempty"` 5097 // TargetMaxThroughput - READ-ONLY; Represents target maximum throughput container can scale up to once offer is no longer in pending state. 5098 TargetMaxThroughput *int32 `json:"targetMaxThroughput,omitempty"` 5099} 5100 5101// MarshalJSON is the custom marshaler for ProvisionedThroughputSettingsResource. 5102func (ptsr ProvisionedThroughputSettingsResource) MarshalJSON() ([]byte, error) { 5103 objectMap := make(map[string]interface{}) 5104 if ptsr.MaxThroughput != nil { 5105 objectMap["maxThroughput"] = ptsr.MaxThroughput 5106 } 5107 if ptsr.AutoUpgradePolicy != nil { 5108 objectMap["autoUpgradePolicy"] = ptsr.AutoUpgradePolicy 5109 } 5110 return json.Marshal(objectMap) 5111} 5112 5113// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not 5114// have tags and a location 5115type ProxyResource struct { 5116 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 5117 ID *string `json:"id,omitempty"` 5118 // Name - READ-ONLY; The name of the resource 5119 Name *string `json:"name,omitempty"` 5120 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 5121 Type *string `json:"type,omitempty"` 5122} 5123 5124// MarshalJSON is the custom marshaler for ProxyResource. 5125func (pr ProxyResource) MarshalJSON() ([]byte, error) { 5126 objectMap := make(map[string]interface{}) 5127 return json.Marshal(objectMap) 5128} 5129 5130// RegionForOnlineOffline cosmos DB region to online or offline. 5131type RegionForOnlineOffline struct { 5132 // Region - Cosmos DB region, with spaces between words and each word capitalized. 5133 Region *string `json:"region,omitempty"` 5134} 5135 5136// Resource common fields that are returned in the response for all Azure Resource Manager resources 5137type Resource struct { 5138 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 5139 ID *string `json:"id,omitempty"` 5140 // Name - READ-ONLY; The name of the resource 5141 Name *string `json:"name,omitempty"` 5142 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 5143 Type *string `json:"type,omitempty"` 5144} 5145 5146// MarshalJSON is the custom marshaler for Resource. 5147func (r Resource) MarshalJSON() ([]byte, error) { 5148 objectMap := make(map[string]interface{}) 5149 return json.Marshal(objectMap) 5150} 5151 5152// SpatialSpec ... 5153type SpatialSpec struct { 5154 // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) 5155 Path *string `json:"path,omitempty"` 5156 // Types - List of path's spatial type 5157 Types *[]SpatialType `json:"types,omitempty"` 5158} 5159 5160// SQLContainerCreateUpdateParameters parameters to create and update Cosmos DB container. 5161type SQLContainerCreateUpdateParameters struct { 5162 // SQLContainerCreateUpdateProperties - Properties to create and update Azure Cosmos DB container. 5163 *SQLContainerCreateUpdateProperties `json:"properties,omitempty"` 5164 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 5165 ID *string `json:"id,omitempty"` 5166 // Name - READ-ONLY; The name of the ARM resource. 5167 Name *string `json:"name,omitempty"` 5168 // Type - READ-ONLY; The type of Azure resource. 5169 Type *string `json:"type,omitempty"` 5170 // Location - The location of the resource group to which the resource belongs. 5171 Location *string `json:"location,omitempty"` 5172 Tags map[string]*string `json:"tags"` 5173} 5174 5175// MarshalJSON is the custom marshaler for SQLContainerCreateUpdateParameters. 5176func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { 5177 objectMap := make(map[string]interface{}) 5178 if sccup.SQLContainerCreateUpdateProperties != nil { 5179 objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties 5180 } 5181 if sccup.Location != nil { 5182 objectMap["location"] = sccup.Location 5183 } 5184 if sccup.Tags != nil { 5185 objectMap["tags"] = sccup.Tags 5186 } 5187 return json.Marshal(objectMap) 5188} 5189 5190// UnmarshalJSON is the custom unmarshaler for SQLContainerCreateUpdateParameters struct. 5191func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error { 5192 var m map[string]*json.RawMessage 5193 err := json.Unmarshal(body, &m) 5194 if err != nil { 5195 return err 5196 } 5197 for k, v := range m { 5198 switch k { 5199 case "properties": 5200 if v != nil { 5201 var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties 5202 err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties) 5203 if err != nil { 5204 return err 5205 } 5206 sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties 5207 } 5208 case "id": 5209 if v != nil { 5210 var ID string 5211 err = json.Unmarshal(*v, &ID) 5212 if err != nil { 5213 return err 5214 } 5215 sccup.ID = &ID 5216 } 5217 case "name": 5218 if v != nil { 5219 var name string 5220 err = json.Unmarshal(*v, &name) 5221 if err != nil { 5222 return err 5223 } 5224 sccup.Name = &name 5225 } 5226 case "type": 5227 if v != nil { 5228 var typeVar string 5229 err = json.Unmarshal(*v, &typeVar) 5230 if err != nil { 5231 return err 5232 } 5233 sccup.Type = &typeVar 5234 } 5235 case "location": 5236 if v != nil { 5237 var location string 5238 err = json.Unmarshal(*v, &location) 5239 if err != nil { 5240 return err 5241 } 5242 sccup.Location = &location 5243 } 5244 case "tags": 5245 if v != nil { 5246 var tags map[string]*string 5247 err = json.Unmarshal(*v, &tags) 5248 if err != nil { 5249 return err 5250 } 5251 sccup.Tags = tags 5252 } 5253 } 5254 } 5255 5256 return nil 5257} 5258 5259// SQLContainerCreateUpdateProperties properties to create and update Azure Cosmos DB container. 5260type SQLContainerCreateUpdateProperties struct { 5261 // Resource - The standard JSON format of a container 5262 Resource *SQLContainerResource `json:"resource,omitempty"` 5263 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 5264 Options *CreateUpdateOptions `json:"options,omitempty"` 5265} 5266 5267// SQLContainerGetProperties the properties of an Azure Cosmos DB container 5268type SQLContainerGetProperties struct { 5269 Resource *SQLContainerGetPropertiesResource `json:"resource,omitempty"` 5270 Options *SQLContainerGetPropertiesOptions `json:"options,omitempty"` 5271} 5272 5273// SQLContainerGetPropertiesOptions ... 5274type SQLContainerGetPropertiesOptions struct { 5275 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 5276 Throughput *int32 `json:"throughput,omitempty"` 5277} 5278 5279// SQLContainerGetPropertiesResource ... 5280type SQLContainerGetPropertiesResource struct { 5281 // ID - Name of the Cosmos DB SQL container 5282 ID *string `json:"id,omitempty"` 5283 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container 5284 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 5285 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 5286 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 5287 // DefaultTTL - Default time to live 5288 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 5289 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 5290 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 5291 // ConflictResolutionPolicy - The conflict resolution policy for the container. 5292 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 5293 // Rid - READ-ONLY; A system generated property. A unique identifier. 5294 Rid *string `json:"_rid,omitempty"` 5295 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 5296 Ts interface{} `json:"_ts,omitempty"` 5297 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 5298 Etag *string `json:"_etag,omitempty"` 5299} 5300 5301// MarshalJSON is the custom marshaler for SQLContainerGetPropertiesResource. 5302func (scgp SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) { 5303 objectMap := make(map[string]interface{}) 5304 if scgp.ID != nil { 5305 objectMap["id"] = scgp.ID 5306 } 5307 if scgp.IndexingPolicy != nil { 5308 objectMap["indexingPolicy"] = scgp.IndexingPolicy 5309 } 5310 if scgp.PartitionKey != nil { 5311 objectMap["partitionKey"] = scgp.PartitionKey 5312 } 5313 if scgp.DefaultTTL != nil { 5314 objectMap["defaultTtl"] = scgp.DefaultTTL 5315 } 5316 if scgp.UniqueKeyPolicy != nil { 5317 objectMap["uniqueKeyPolicy"] = scgp.UniqueKeyPolicy 5318 } 5319 if scgp.ConflictResolutionPolicy != nil { 5320 objectMap["conflictResolutionPolicy"] = scgp.ConflictResolutionPolicy 5321 } 5322 return json.Marshal(objectMap) 5323} 5324 5325// SQLContainerGetResults an Azure Cosmos DB container. 5326type SQLContainerGetResults struct { 5327 autorest.Response `json:"-"` 5328 // SQLContainerGetProperties - The properties of an Azure Cosmos DB container 5329 *SQLContainerGetProperties `json:"properties,omitempty"` 5330 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 5331 ID *string `json:"id,omitempty"` 5332 // Name - READ-ONLY; The name of the ARM resource. 5333 Name *string `json:"name,omitempty"` 5334 // Type - READ-ONLY; The type of Azure resource. 5335 Type *string `json:"type,omitempty"` 5336 // Location - The location of the resource group to which the resource belongs. 5337 Location *string `json:"location,omitempty"` 5338 Tags map[string]*string `json:"tags"` 5339} 5340 5341// MarshalJSON is the custom marshaler for SQLContainerGetResults. 5342func (scgr SQLContainerGetResults) MarshalJSON() ([]byte, error) { 5343 objectMap := make(map[string]interface{}) 5344 if scgr.SQLContainerGetProperties != nil { 5345 objectMap["properties"] = scgr.SQLContainerGetProperties 5346 } 5347 if scgr.Location != nil { 5348 objectMap["location"] = scgr.Location 5349 } 5350 if scgr.Tags != nil { 5351 objectMap["tags"] = scgr.Tags 5352 } 5353 return json.Marshal(objectMap) 5354} 5355 5356// UnmarshalJSON is the custom unmarshaler for SQLContainerGetResults struct. 5357func (scgr *SQLContainerGetResults) UnmarshalJSON(body []byte) error { 5358 var m map[string]*json.RawMessage 5359 err := json.Unmarshal(body, &m) 5360 if err != nil { 5361 return err 5362 } 5363 for k, v := range m { 5364 switch k { 5365 case "properties": 5366 if v != nil { 5367 var SQLContainerGetProperties SQLContainerGetProperties 5368 err = json.Unmarshal(*v, &SQLContainerGetProperties) 5369 if err != nil { 5370 return err 5371 } 5372 scgr.SQLContainerGetProperties = &SQLContainerGetProperties 5373 } 5374 case "id": 5375 if v != nil { 5376 var ID string 5377 err = json.Unmarshal(*v, &ID) 5378 if err != nil { 5379 return err 5380 } 5381 scgr.ID = &ID 5382 } 5383 case "name": 5384 if v != nil { 5385 var name string 5386 err = json.Unmarshal(*v, &name) 5387 if err != nil { 5388 return err 5389 } 5390 scgr.Name = &name 5391 } 5392 case "type": 5393 if v != nil { 5394 var typeVar string 5395 err = json.Unmarshal(*v, &typeVar) 5396 if err != nil { 5397 return err 5398 } 5399 scgr.Type = &typeVar 5400 } 5401 case "location": 5402 if v != nil { 5403 var location string 5404 err = json.Unmarshal(*v, &location) 5405 if err != nil { 5406 return err 5407 } 5408 scgr.Location = &location 5409 } 5410 case "tags": 5411 if v != nil { 5412 var tags map[string]*string 5413 err = json.Unmarshal(*v, &tags) 5414 if err != nil { 5415 return err 5416 } 5417 scgr.Tags = tags 5418 } 5419 } 5420 } 5421 5422 return nil 5423} 5424 5425// SQLContainerListResult the List operation response, that contains the containers and their properties. 5426type SQLContainerListResult struct { 5427 autorest.Response `json:"-"` 5428 // Value - READ-ONLY; List of containers and their properties. 5429 Value *[]SQLContainerGetResults `json:"value,omitempty"` 5430} 5431 5432// MarshalJSON is the custom marshaler for SQLContainerListResult. 5433func (sclr SQLContainerListResult) MarshalJSON() ([]byte, error) { 5434 objectMap := make(map[string]interface{}) 5435 return json.Marshal(objectMap) 5436} 5437 5438// SQLContainerResource cosmos DB SQL container resource object 5439type SQLContainerResource struct { 5440 // ID - Name of the Cosmos DB SQL container 5441 ID *string `json:"id,omitempty"` 5442 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container 5443 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 5444 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 5445 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 5446 // DefaultTTL - Default time to live 5447 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 5448 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 5449 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 5450 // ConflictResolutionPolicy - The conflict resolution policy for the container. 5451 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 5452} 5453 5454// SQLDatabaseCreateUpdateParameters parameters to create and update Cosmos DB SQL database. 5455type SQLDatabaseCreateUpdateParameters struct { 5456 // SQLDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB SQL database. 5457 *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"` 5458 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 5459 ID *string `json:"id,omitempty"` 5460 // Name - READ-ONLY; The name of the ARM resource. 5461 Name *string `json:"name,omitempty"` 5462 // Type - READ-ONLY; The type of Azure resource. 5463 Type *string `json:"type,omitempty"` 5464 // Location - The location of the resource group to which the resource belongs. 5465 Location *string `json:"location,omitempty"` 5466 Tags map[string]*string `json:"tags"` 5467} 5468 5469// MarshalJSON is the custom marshaler for SQLDatabaseCreateUpdateParameters. 5470func (sdcup SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { 5471 objectMap := make(map[string]interface{}) 5472 if sdcup.SQLDatabaseCreateUpdateProperties != nil { 5473 objectMap["properties"] = sdcup.SQLDatabaseCreateUpdateProperties 5474 } 5475 if sdcup.Location != nil { 5476 objectMap["location"] = sdcup.Location 5477 } 5478 if sdcup.Tags != nil { 5479 objectMap["tags"] = sdcup.Tags 5480 } 5481 return json.Marshal(objectMap) 5482} 5483 5484// UnmarshalJSON is the custom unmarshaler for SQLDatabaseCreateUpdateParameters struct. 5485func (sdcup *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { 5486 var m map[string]*json.RawMessage 5487 err := json.Unmarshal(body, &m) 5488 if err != nil { 5489 return err 5490 } 5491 for k, v := range m { 5492 switch k { 5493 case "properties": 5494 if v != nil { 5495 var SQLDatabaseCreateUpdateProperties SQLDatabaseCreateUpdateProperties 5496 err = json.Unmarshal(*v, &SQLDatabaseCreateUpdateProperties) 5497 if err != nil { 5498 return err 5499 } 5500 sdcup.SQLDatabaseCreateUpdateProperties = &SQLDatabaseCreateUpdateProperties 5501 } 5502 case "id": 5503 if v != nil { 5504 var ID string 5505 err = json.Unmarshal(*v, &ID) 5506 if err != nil { 5507 return err 5508 } 5509 sdcup.ID = &ID 5510 } 5511 case "name": 5512 if v != nil { 5513 var name string 5514 err = json.Unmarshal(*v, &name) 5515 if err != nil { 5516 return err 5517 } 5518 sdcup.Name = &name 5519 } 5520 case "type": 5521 if v != nil { 5522 var typeVar string 5523 err = json.Unmarshal(*v, &typeVar) 5524 if err != nil { 5525 return err 5526 } 5527 sdcup.Type = &typeVar 5528 } 5529 case "location": 5530 if v != nil { 5531 var location string 5532 err = json.Unmarshal(*v, &location) 5533 if err != nil { 5534 return err 5535 } 5536 sdcup.Location = &location 5537 } 5538 case "tags": 5539 if v != nil { 5540 var tags map[string]*string 5541 err = json.Unmarshal(*v, &tags) 5542 if err != nil { 5543 return err 5544 } 5545 sdcup.Tags = tags 5546 } 5547 } 5548 } 5549 5550 return nil 5551} 5552 5553// SQLDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB SQL database. 5554type SQLDatabaseCreateUpdateProperties struct { 5555 // Resource - The standard JSON format of a SQL database 5556 Resource *SQLDatabaseResource `json:"resource,omitempty"` 5557 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 5558 Options *CreateUpdateOptions `json:"options,omitempty"` 5559} 5560 5561// SQLDatabaseGetProperties the properties of an Azure Cosmos DB SQL database 5562type SQLDatabaseGetProperties struct { 5563 Resource *SQLDatabaseGetPropertiesResource `json:"resource,omitempty"` 5564 Options *SQLDatabaseGetPropertiesOptions `json:"options,omitempty"` 5565} 5566 5567// SQLDatabaseGetPropertiesOptions ... 5568type SQLDatabaseGetPropertiesOptions struct { 5569 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 5570 Throughput *int32 `json:"throughput,omitempty"` 5571} 5572 5573// SQLDatabaseGetPropertiesResource ... 5574type SQLDatabaseGetPropertiesResource struct { 5575 // ID - Name of the Cosmos DB SQL database 5576 ID *string `json:"id,omitempty"` 5577 // Rid - READ-ONLY; A system generated property. A unique identifier. 5578 Rid *string `json:"_rid,omitempty"` 5579 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 5580 Ts interface{} `json:"_ts,omitempty"` 5581 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 5582 Etag *string `json:"_etag,omitempty"` 5583 // Colls - A system generated property that specified the addressable path of the collections resource. 5584 Colls *string `json:"_colls,omitempty"` 5585 // Users - A system generated property that specifies the addressable path of the users resource. 5586 Users *string `json:"_users,omitempty"` 5587} 5588 5589// MarshalJSON is the custom marshaler for SQLDatabaseGetPropertiesResource. 5590func (sdgp SQLDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { 5591 objectMap := make(map[string]interface{}) 5592 if sdgp.ID != nil { 5593 objectMap["id"] = sdgp.ID 5594 } 5595 if sdgp.Colls != nil { 5596 objectMap["_colls"] = sdgp.Colls 5597 } 5598 if sdgp.Users != nil { 5599 objectMap["_users"] = sdgp.Users 5600 } 5601 return json.Marshal(objectMap) 5602} 5603 5604// SQLDatabaseGetResults an Azure Cosmos DB SQL database. 5605type SQLDatabaseGetResults struct { 5606 autorest.Response `json:"-"` 5607 // SQLDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database 5608 *SQLDatabaseGetProperties `json:"properties,omitempty"` 5609 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 5610 ID *string `json:"id,omitempty"` 5611 // Name - READ-ONLY; The name of the ARM resource. 5612 Name *string `json:"name,omitempty"` 5613 // Type - READ-ONLY; The type of Azure resource. 5614 Type *string `json:"type,omitempty"` 5615 // Location - The location of the resource group to which the resource belongs. 5616 Location *string `json:"location,omitempty"` 5617 Tags map[string]*string `json:"tags"` 5618} 5619 5620// MarshalJSON is the custom marshaler for SQLDatabaseGetResults. 5621func (sdgr SQLDatabaseGetResults) MarshalJSON() ([]byte, error) { 5622 objectMap := make(map[string]interface{}) 5623 if sdgr.SQLDatabaseGetProperties != nil { 5624 objectMap["properties"] = sdgr.SQLDatabaseGetProperties 5625 } 5626 if sdgr.Location != nil { 5627 objectMap["location"] = sdgr.Location 5628 } 5629 if sdgr.Tags != nil { 5630 objectMap["tags"] = sdgr.Tags 5631 } 5632 return json.Marshal(objectMap) 5633} 5634 5635// UnmarshalJSON is the custom unmarshaler for SQLDatabaseGetResults struct. 5636func (sdgr *SQLDatabaseGetResults) UnmarshalJSON(body []byte) error { 5637 var m map[string]*json.RawMessage 5638 err := json.Unmarshal(body, &m) 5639 if err != nil { 5640 return err 5641 } 5642 for k, v := range m { 5643 switch k { 5644 case "properties": 5645 if v != nil { 5646 var SQLDatabaseGetProperties SQLDatabaseGetProperties 5647 err = json.Unmarshal(*v, &SQLDatabaseGetProperties) 5648 if err != nil { 5649 return err 5650 } 5651 sdgr.SQLDatabaseGetProperties = &SQLDatabaseGetProperties 5652 } 5653 case "id": 5654 if v != nil { 5655 var ID string 5656 err = json.Unmarshal(*v, &ID) 5657 if err != nil { 5658 return err 5659 } 5660 sdgr.ID = &ID 5661 } 5662 case "name": 5663 if v != nil { 5664 var name string 5665 err = json.Unmarshal(*v, &name) 5666 if err != nil { 5667 return err 5668 } 5669 sdgr.Name = &name 5670 } 5671 case "type": 5672 if v != nil { 5673 var typeVar string 5674 err = json.Unmarshal(*v, &typeVar) 5675 if err != nil { 5676 return err 5677 } 5678 sdgr.Type = &typeVar 5679 } 5680 case "location": 5681 if v != nil { 5682 var location string 5683 err = json.Unmarshal(*v, &location) 5684 if err != nil { 5685 return err 5686 } 5687 sdgr.Location = &location 5688 } 5689 case "tags": 5690 if v != nil { 5691 var tags map[string]*string 5692 err = json.Unmarshal(*v, &tags) 5693 if err != nil { 5694 return err 5695 } 5696 sdgr.Tags = tags 5697 } 5698 } 5699 } 5700 5701 return nil 5702} 5703 5704// SQLDatabaseListResult the List operation response, that contains the SQL databases and their properties. 5705type SQLDatabaseListResult struct { 5706 autorest.Response `json:"-"` 5707 // Value - READ-ONLY; List of SQL databases and their properties. 5708 Value *[]SQLDatabaseGetResults `json:"value,omitempty"` 5709} 5710 5711// MarshalJSON is the custom marshaler for SQLDatabaseListResult. 5712func (sdlr SQLDatabaseListResult) MarshalJSON() ([]byte, error) { 5713 objectMap := make(map[string]interface{}) 5714 return json.Marshal(objectMap) 5715} 5716 5717// SQLDatabaseResource cosmos DB SQL database resource object 5718type SQLDatabaseResource struct { 5719 // ID - Name of the Cosmos DB SQL database 5720 ID *string `json:"id,omitempty"` 5721} 5722 5723// SQLResourcesCreateUpdateSQLContainerFuture an abstraction for monitoring and retrieving the results of a 5724// long-running operation. 5725type SQLResourcesCreateUpdateSQLContainerFuture struct { 5726 azure.FutureAPI 5727 // Result returns the result of the asynchronous operation. 5728 // If the operation has not completed it will return an error. 5729 Result func(SQLResourcesClient) (SQLContainerGetResults, error) 5730} 5731 5732// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5733func (future *SQLResourcesCreateUpdateSQLContainerFuture) UnmarshalJSON(body []byte) error { 5734 var azFuture azure.Future 5735 if err := json.Unmarshal(body, &azFuture); err != nil { 5736 return err 5737 } 5738 future.FutureAPI = &azFuture 5739 future.Result = future.result 5740 return nil 5741} 5742 5743// result is the default implementation for SQLResourcesCreateUpdateSQLContainerFuture.Result. 5744func (future *SQLResourcesCreateUpdateSQLContainerFuture) result(client SQLResourcesClient) (scgr SQLContainerGetResults, err error) { 5745 var done bool 5746 done, err = future.DoneWithContext(context.Background(), client) 5747 if err != nil { 5748 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure") 5749 return 5750 } 5751 if !done { 5752 scgr.Response.Response = future.Response() 5753 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLContainerFuture") 5754 return 5755 } 5756 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5757 if scgr.Response.Response, err = future.GetResult(sender); err == nil && scgr.Response.Response.StatusCode != http.StatusNoContent { 5758 scgr, err = client.CreateUpdateSQLContainerResponder(scgr.Response.Response) 5759 if err != nil { 5760 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", scgr.Response.Response, "Failure responding to request") 5761 } 5762 } 5763 return 5764} 5765 5766// SQLResourcesCreateUpdateSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a 5767// long-running operation. 5768type SQLResourcesCreateUpdateSQLDatabaseFuture struct { 5769 azure.FutureAPI 5770 // Result returns the result of the asynchronous operation. 5771 // If the operation has not completed it will return an error. 5772 Result func(SQLResourcesClient) (SQLDatabaseGetResults, error) 5773} 5774 5775// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5776func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) UnmarshalJSON(body []byte) error { 5777 var azFuture azure.Future 5778 if err := json.Unmarshal(body, &azFuture); err != nil { 5779 return err 5780 } 5781 future.FutureAPI = &azFuture 5782 future.Result = future.result 5783 return nil 5784} 5785 5786// result is the default implementation for SQLResourcesCreateUpdateSQLDatabaseFuture.Result. 5787func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) result(client SQLResourcesClient) (sdgr SQLDatabaseGetResults, err error) { 5788 var done bool 5789 done, err = future.DoneWithContext(context.Background(), client) 5790 if err != nil { 5791 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure") 5792 return 5793 } 5794 if !done { 5795 sdgr.Response.Response = future.Response() 5796 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture") 5797 return 5798 } 5799 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5800 if sdgr.Response.Response, err = future.GetResult(sender); err == nil && sdgr.Response.Response.StatusCode != http.StatusNoContent { 5801 sdgr, err = client.CreateUpdateSQLDatabaseResponder(sdgr.Response.Response) 5802 if err != nil { 5803 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", sdgr.Response.Response, "Failure responding to request") 5804 } 5805 } 5806 return 5807} 5808 5809// SQLResourcesCreateUpdateSQLStoredProcedureFuture an abstraction for monitoring and retrieving the 5810// results of a long-running operation. 5811type SQLResourcesCreateUpdateSQLStoredProcedureFuture struct { 5812 azure.FutureAPI 5813 // Result returns the result of the asynchronous operation. 5814 // If the operation has not completed it will return an error. 5815 Result func(SQLResourcesClient) (SQLStoredProcedureGetResults, error) 5816} 5817 5818// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5819func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error { 5820 var azFuture azure.Future 5821 if err := json.Unmarshal(body, &azFuture); err != nil { 5822 return err 5823 } 5824 future.FutureAPI = &azFuture 5825 future.Result = future.result 5826 return nil 5827} 5828 5829// result is the default implementation for SQLResourcesCreateUpdateSQLStoredProcedureFuture.Result. 5830func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) result(client SQLResourcesClient) (sspgr SQLStoredProcedureGetResults, err error) { 5831 var done bool 5832 done, err = future.DoneWithContext(context.Background(), client) 5833 if err != nil { 5834 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure") 5835 return 5836 } 5837 if !done { 5838 sspgr.Response.Response = future.Response() 5839 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture") 5840 return 5841 } 5842 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5843 if sspgr.Response.Response, err = future.GetResult(sender); err == nil && sspgr.Response.Response.StatusCode != http.StatusNoContent { 5844 sspgr, err = client.CreateUpdateSQLStoredProcedureResponder(sspgr.Response.Response) 5845 if err != nil { 5846 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", sspgr.Response.Response, "Failure responding to request") 5847 } 5848 } 5849 return 5850} 5851 5852// SQLResourcesCreateUpdateSQLTriggerFuture an abstraction for monitoring and retrieving the results of a 5853// long-running operation. 5854type SQLResourcesCreateUpdateSQLTriggerFuture struct { 5855 azure.FutureAPI 5856 // Result returns the result of the asynchronous operation. 5857 // If the operation has not completed it will return an error. 5858 Result func(SQLResourcesClient) (SQLTriggerGetResults, error) 5859} 5860 5861// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5862func (future *SQLResourcesCreateUpdateSQLTriggerFuture) UnmarshalJSON(body []byte) error { 5863 var azFuture azure.Future 5864 if err := json.Unmarshal(body, &azFuture); err != nil { 5865 return err 5866 } 5867 future.FutureAPI = &azFuture 5868 future.Result = future.result 5869 return nil 5870} 5871 5872// result is the default implementation for SQLResourcesCreateUpdateSQLTriggerFuture.Result. 5873func (future *SQLResourcesCreateUpdateSQLTriggerFuture) result(client SQLResourcesClient) (stgr SQLTriggerGetResults, err error) { 5874 var done bool 5875 done, err = future.DoneWithContext(context.Background(), client) 5876 if err != nil { 5877 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", future.Response(), "Polling failure") 5878 return 5879 } 5880 if !done { 5881 stgr.Response.Response = future.Response() 5882 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLTriggerFuture") 5883 return 5884 } 5885 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5886 if stgr.Response.Response, err = future.GetResult(sender); err == nil && stgr.Response.Response.StatusCode != http.StatusNoContent { 5887 stgr, err = client.CreateUpdateSQLTriggerResponder(stgr.Response.Response) 5888 if err != nil { 5889 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", stgr.Response.Response, "Failure responding to request") 5890 } 5891 } 5892 return 5893} 5894 5895// SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the 5896// results of a long-running operation. 5897type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture struct { 5898 azure.FutureAPI 5899 // Result returns the result of the asynchronous operation. 5900 // If the operation has not completed it will return an error. 5901 Result func(SQLResourcesClient) (SQLUserDefinedFunctionGetResults, error) 5902} 5903 5904// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5905func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error { 5906 var azFuture azure.Future 5907 if err := json.Unmarshal(body, &azFuture); err != nil { 5908 return err 5909 } 5910 future.FutureAPI = &azFuture 5911 future.Result = future.result 5912 return nil 5913} 5914 5915// result is the default implementation for SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture.Result. 5916func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (sudfgr SQLUserDefinedFunctionGetResults, err error) { 5917 var done bool 5918 done, err = future.DoneWithContext(context.Background(), client) 5919 if err != nil { 5920 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure") 5921 return 5922 } 5923 if !done { 5924 sudfgr.Response.Response = future.Response() 5925 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture") 5926 return 5927 } 5928 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5929 if sudfgr.Response.Response, err = future.GetResult(sender); err == nil && sudfgr.Response.Response.StatusCode != http.StatusNoContent { 5930 sudfgr, err = client.CreateUpdateSQLUserDefinedFunctionResponder(sudfgr.Response.Response) 5931 if err != nil { 5932 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", sudfgr.Response.Response, "Failure responding to request") 5933 } 5934 } 5935 return 5936} 5937 5938// SQLResourcesDeleteSQLContainerFuture an abstraction for monitoring and retrieving the results of a 5939// long-running operation. 5940type SQLResourcesDeleteSQLContainerFuture struct { 5941 azure.FutureAPI 5942 // Result returns the result of the asynchronous operation. 5943 // If the operation has not completed it will return an error. 5944 Result func(SQLResourcesClient) (autorest.Response, error) 5945} 5946 5947// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5948func (future *SQLResourcesDeleteSQLContainerFuture) UnmarshalJSON(body []byte) error { 5949 var azFuture azure.Future 5950 if err := json.Unmarshal(body, &azFuture); err != nil { 5951 return err 5952 } 5953 future.FutureAPI = &azFuture 5954 future.Result = future.result 5955 return nil 5956} 5957 5958// result is the default implementation for SQLResourcesDeleteSQLContainerFuture.Result. 5959func (future *SQLResourcesDeleteSQLContainerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 5960 var done bool 5961 done, err = future.DoneWithContext(context.Background(), client) 5962 if err != nil { 5963 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure") 5964 return 5965 } 5966 if !done { 5967 ar.Response = future.Response() 5968 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLContainerFuture") 5969 return 5970 } 5971 ar.Response = future.Response() 5972 return 5973} 5974 5975// SQLResourcesDeleteSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a 5976// long-running operation. 5977type SQLResourcesDeleteSQLDatabaseFuture struct { 5978 azure.FutureAPI 5979 // Result returns the result of the asynchronous operation. 5980 // If the operation has not completed it will return an error. 5981 Result func(SQLResourcesClient) (autorest.Response, error) 5982} 5983 5984// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5985func (future *SQLResourcesDeleteSQLDatabaseFuture) UnmarshalJSON(body []byte) error { 5986 var azFuture azure.Future 5987 if err := json.Unmarshal(body, &azFuture); err != nil { 5988 return err 5989 } 5990 future.FutureAPI = &azFuture 5991 future.Result = future.result 5992 return nil 5993} 5994 5995// result is the default implementation for SQLResourcesDeleteSQLDatabaseFuture.Result. 5996func (future *SQLResourcesDeleteSQLDatabaseFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 5997 var done bool 5998 done, err = future.DoneWithContext(context.Background(), client) 5999 if err != nil { 6000 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure") 6001 return 6002 } 6003 if !done { 6004 ar.Response = future.Response() 6005 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLDatabaseFuture") 6006 return 6007 } 6008 ar.Response = future.Response() 6009 return 6010} 6011 6012// SQLResourcesDeleteSQLStoredProcedureFuture an abstraction for monitoring and retrieving the results of a 6013// long-running operation. 6014type SQLResourcesDeleteSQLStoredProcedureFuture struct { 6015 azure.FutureAPI 6016 // Result returns the result of the asynchronous operation. 6017 // If the operation has not completed it will return an error. 6018 Result func(SQLResourcesClient) (autorest.Response, error) 6019} 6020 6021// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6022func (future *SQLResourcesDeleteSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error { 6023 var azFuture azure.Future 6024 if err := json.Unmarshal(body, &azFuture); err != nil { 6025 return err 6026 } 6027 future.FutureAPI = &azFuture 6028 future.Result = future.result 6029 return nil 6030} 6031 6032// result is the default implementation for SQLResourcesDeleteSQLStoredProcedureFuture.Result. 6033func (future *SQLResourcesDeleteSQLStoredProcedureFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 6034 var done bool 6035 done, err = future.DoneWithContext(context.Background(), client) 6036 if err != nil { 6037 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure") 6038 return 6039 } 6040 if !done { 6041 ar.Response = future.Response() 6042 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLStoredProcedureFuture") 6043 return 6044 } 6045 ar.Response = future.Response() 6046 return 6047} 6048 6049// SQLResourcesDeleteSQLTriggerFuture an abstraction for monitoring and retrieving the results of a 6050// long-running operation. 6051type SQLResourcesDeleteSQLTriggerFuture struct { 6052 azure.FutureAPI 6053 // Result returns the result of the asynchronous operation. 6054 // If the operation has not completed it will return an error. 6055 Result func(SQLResourcesClient) (autorest.Response, error) 6056} 6057 6058// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6059func (future *SQLResourcesDeleteSQLTriggerFuture) UnmarshalJSON(body []byte) error { 6060 var azFuture azure.Future 6061 if err := json.Unmarshal(body, &azFuture); err != nil { 6062 return err 6063 } 6064 future.FutureAPI = &azFuture 6065 future.Result = future.result 6066 return nil 6067} 6068 6069// result is the default implementation for SQLResourcesDeleteSQLTriggerFuture.Result. 6070func (future *SQLResourcesDeleteSQLTriggerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 6071 var done bool 6072 done, err = future.DoneWithContext(context.Background(), client) 6073 if err != nil { 6074 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLTriggerFuture", "Result", future.Response(), "Polling failure") 6075 return 6076 } 6077 if !done { 6078 ar.Response = future.Response() 6079 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLTriggerFuture") 6080 return 6081 } 6082 ar.Response = future.Response() 6083 return 6084} 6085 6086// SQLResourcesDeleteSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the results 6087// of a long-running operation. 6088type SQLResourcesDeleteSQLUserDefinedFunctionFuture struct { 6089 azure.FutureAPI 6090 // Result returns the result of the asynchronous operation. 6091 // If the operation has not completed it will return an error. 6092 Result func(SQLResourcesClient) (autorest.Response, error) 6093} 6094 6095// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6096func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error { 6097 var azFuture azure.Future 6098 if err := json.Unmarshal(body, &azFuture); err != nil { 6099 return err 6100 } 6101 future.FutureAPI = &azFuture 6102 future.Result = future.result 6103 return nil 6104} 6105 6106// result is the default implementation for SQLResourcesDeleteSQLUserDefinedFunctionFuture.Result. 6107func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 6108 var done bool 6109 done, err = future.DoneWithContext(context.Background(), client) 6110 if err != nil { 6111 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure") 6112 return 6113 } 6114 if !done { 6115 ar.Response = future.Response() 6116 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture") 6117 return 6118 } 6119 ar.Response = future.Response() 6120 return 6121} 6122 6123// SQLResourcesMigrateSQLContainerToAutoscaleFuture an abstraction for monitoring and retrieving the 6124// results of a long-running operation. 6125type SQLResourcesMigrateSQLContainerToAutoscaleFuture struct { 6126 azure.FutureAPI 6127 // Result returns the result of the asynchronous operation. 6128 // If the operation has not completed it will return an error. 6129 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 6130} 6131 6132// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6133func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) UnmarshalJSON(body []byte) error { 6134 var azFuture azure.Future 6135 if err := json.Unmarshal(body, &azFuture); err != nil { 6136 return err 6137 } 6138 future.FutureAPI = &azFuture 6139 future.Result = future.result 6140 return nil 6141} 6142 6143// result is the default implementation for SQLResourcesMigrateSQLContainerToAutoscaleFuture.Result. 6144func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6145 var done bool 6146 done, err = future.DoneWithContext(context.Background(), client) 6147 if err != nil { 6148 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", future.Response(), "Polling failure") 6149 return 6150 } 6151 if !done { 6152 tsgr.Response.Response = future.Response() 6153 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture") 6154 return 6155 } 6156 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6157 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6158 tsgr, err = client.MigrateSQLContainerToAutoscaleResponder(tsgr.Response.Response) 6159 if err != nil { 6160 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6161 } 6162 } 6163 return 6164} 6165 6166// SQLResourcesMigrateSQLContainerToManualThroughputFuture an abstraction for monitoring and retrieving the 6167// results of a long-running operation. 6168type SQLResourcesMigrateSQLContainerToManualThroughputFuture struct { 6169 azure.FutureAPI 6170 // Result returns the result of the asynchronous operation. 6171 // If the operation has not completed it will return an error. 6172 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 6173} 6174 6175// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6176func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) UnmarshalJSON(body []byte) error { 6177 var azFuture azure.Future 6178 if err := json.Unmarshal(body, &azFuture); err != nil { 6179 return err 6180 } 6181 future.FutureAPI = &azFuture 6182 future.Result = future.result 6183 return nil 6184} 6185 6186// result is the default implementation for SQLResourcesMigrateSQLContainerToManualThroughputFuture.Result. 6187func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6188 var done bool 6189 done, err = future.DoneWithContext(context.Background(), client) 6190 if err != nil { 6191 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", future.Response(), "Polling failure") 6192 return 6193 } 6194 if !done { 6195 tsgr.Response.Response = future.Response() 6196 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture") 6197 return 6198 } 6199 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6200 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6201 tsgr, err = client.MigrateSQLContainerToManualThroughputResponder(tsgr.Response.Response) 6202 if err != nil { 6203 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6204 } 6205 } 6206 return 6207} 6208 6209// SQLResourcesMigrateSQLDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the results 6210// of a long-running operation. 6211type SQLResourcesMigrateSQLDatabaseToAutoscaleFuture struct { 6212 azure.FutureAPI 6213 // Result returns the result of the asynchronous operation. 6214 // If the operation has not completed it will return an error. 6215 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 6216} 6217 6218// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6219func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { 6220 var azFuture azure.Future 6221 if err := json.Unmarshal(body, &azFuture); err != nil { 6222 return err 6223 } 6224 future.FutureAPI = &azFuture 6225 future.Result = future.result 6226 return nil 6227} 6228 6229// result is the default implementation for SQLResourcesMigrateSQLDatabaseToAutoscaleFuture.Result. 6230func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6231 var done bool 6232 done, err = future.DoneWithContext(context.Background(), client) 6233 if err != nil { 6234 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") 6235 return 6236 } 6237 if !done { 6238 tsgr.Response.Response = future.Response() 6239 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture") 6240 return 6241 } 6242 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6243 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6244 tsgr, err = client.MigrateSQLDatabaseToAutoscaleResponder(tsgr.Response.Response) 6245 if err != nil { 6246 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6247 } 6248 } 6249 return 6250} 6251 6252// SQLResourcesMigrateSQLDatabaseToManualThroughputFuture an abstraction for monitoring and retrieving the 6253// results of a long-running operation. 6254type SQLResourcesMigrateSQLDatabaseToManualThroughputFuture struct { 6255 azure.FutureAPI 6256 // Result returns the result of the asynchronous operation. 6257 // If the operation has not completed it will return an error. 6258 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 6259} 6260 6261// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6262func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { 6263 var azFuture azure.Future 6264 if err := json.Unmarshal(body, &azFuture); err != nil { 6265 return err 6266 } 6267 future.FutureAPI = &azFuture 6268 future.Result = future.result 6269 return nil 6270} 6271 6272// result is the default implementation for SQLResourcesMigrateSQLDatabaseToManualThroughputFuture.Result. 6273func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6274 var done bool 6275 done, err = future.DoneWithContext(context.Background(), client) 6276 if err != nil { 6277 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") 6278 return 6279 } 6280 if !done { 6281 tsgr.Response.Response = future.Response() 6282 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture") 6283 return 6284 } 6285 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6286 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6287 tsgr, err = client.MigrateSQLDatabaseToManualThroughputResponder(tsgr.Response.Response) 6288 if err != nil { 6289 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6290 } 6291 } 6292 return 6293} 6294 6295// SQLResourcesUpdateSQLContainerThroughputFuture an abstraction for monitoring and retrieving the results 6296// of a long-running operation. 6297type SQLResourcesUpdateSQLContainerThroughputFuture struct { 6298 azure.FutureAPI 6299 // Result returns the result of the asynchronous operation. 6300 // If the operation has not completed it will return an error. 6301 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 6302} 6303 6304// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6305func (future *SQLResourcesUpdateSQLContainerThroughputFuture) UnmarshalJSON(body []byte) error { 6306 var azFuture azure.Future 6307 if err := json.Unmarshal(body, &azFuture); err != nil { 6308 return err 6309 } 6310 future.FutureAPI = &azFuture 6311 future.Result = future.result 6312 return nil 6313} 6314 6315// result is the default implementation for SQLResourcesUpdateSQLContainerThroughputFuture.Result. 6316func (future *SQLResourcesUpdateSQLContainerThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6317 var done bool 6318 done, err = future.DoneWithContext(context.Background(), client) 6319 if err != nil { 6320 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", future.Response(), "Polling failure") 6321 return 6322 } 6323 if !done { 6324 tsgr.Response.Response = future.Response() 6325 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLContainerThroughputFuture") 6326 return 6327 } 6328 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6329 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6330 tsgr, err = client.UpdateSQLContainerThroughputResponder(tsgr.Response.Response) 6331 if err != nil { 6332 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6333 } 6334 } 6335 return 6336} 6337 6338// SQLResourcesUpdateSQLDatabaseThroughputFuture an abstraction for monitoring and retrieving the results 6339// of a long-running operation. 6340type SQLResourcesUpdateSQLDatabaseThroughputFuture struct { 6341 azure.FutureAPI 6342 // Result returns the result of the asynchronous operation. 6343 // If the operation has not completed it will return an error. 6344 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 6345} 6346 6347// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6348func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { 6349 var azFuture azure.Future 6350 if err := json.Unmarshal(body, &azFuture); err != nil { 6351 return err 6352 } 6353 future.FutureAPI = &azFuture 6354 future.Result = future.result 6355 return nil 6356} 6357 6358// result is the default implementation for SQLResourcesUpdateSQLDatabaseThroughputFuture.Result. 6359func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6360 var done bool 6361 done, err = future.DoneWithContext(context.Background(), client) 6362 if err != nil { 6363 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") 6364 return 6365 } 6366 if !done { 6367 tsgr.Response.Response = future.Response() 6368 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture") 6369 return 6370 } 6371 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6372 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6373 tsgr, err = client.UpdateSQLDatabaseThroughputResponder(tsgr.Response.Response) 6374 if err != nil { 6375 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6376 } 6377 } 6378 return 6379} 6380 6381// SQLStoredProcedureCreateUpdateParameters parameters to create and update Cosmos DB storedProcedure. 6382type SQLStoredProcedureCreateUpdateParameters struct { 6383 // SQLStoredProcedureCreateUpdateProperties - Properties to create and update Azure Cosmos DB storedProcedure. 6384 *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"` 6385 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 6386 ID *string `json:"id,omitempty"` 6387 // Name - READ-ONLY; The name of the ARM resource. 6388 Name *string `json:"name,omitempty"` 6389 // Type - READ-ONLY; The type of Azure resource. 6390 Type *string `json:"type,omitempty"` 6391 // Location - The location of the resource group to which the resource belongs. 6392 Location *string `json:"location,omitempty"` 6393 Tags map[string]*string `json:"tags"` 6394} 6395 6396// MarshalJSON is the custom marshaler for SQLStoredProcedureCreateUpdateParameters. 6397func (sspcup SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) { 6398 objectMap := make(map[string]interface{}) 6399 if sspcup.SQLStoredProcedureCreateUpdateProperties != nil { 6400 objectMap["properties"] = sspcup.SQLStoredProcedureCreateUpdateProperties 6401 } 6402 if sspcup.Location != nil { 6403 objectMap["location"] = sspcup.Location 6404 } 6405 if sspcup.Tags != nil { 6406 objectMap["tags"] = sspcup.Tags 6407 } 6408 return json.Marshal(objectMap) 6409} 6410 6411// UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureCreateUpdateParameters struct. 6412func (sspcup *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(body []byte) error { 6413 var m map[string]*json.RawMessage 6414 err := json.Unmarshal(body, &m) 6415 if err != nil { 6416 return err 6417 } 6418 for k, v := range m { 6419 switch k { 6420 case "properties": 6421 if v != nil { 6422 var SQLStoredProcedureCreateUpdateProperties SQLStoredProcedureCreateUpdateProperties 6423 err = json.Unmarshal(*v, &SQLStoredProcedureCreateUpdateProperties) 6424 if err != nil { 6425 return err 6426 } 6427 sspcup.SQLStoredProcedureCreateUpdateProperties = &SQLStoredProcedureCreateUpdateProperties 6428 } 6429 case "id": 6430 if v != nil { 6431 var ID string 6432 err = json.Unmarshal(*v, &ID) 6433 if err != nil { 6434 return err 6435 } 6436 sspcup.ID = &ID 6437 } 6438 case "name": 6439 if v != nil { 6440 var name string 6441 err = json.Unmarshal(*v, &name) 6442 if err != nil { 6443 return err 6444 } 6445 sspcup.Name = &name 6446 } 6447 case "type": 6448 if v != nil { 6449 var typeVar string 6450 err = json.Unmarshal(*v, &typeVar) 6451 if err != nil { 6452 return err 6453 } 6454 sspcup.Type = &typeVar 6455 } 6456 case "location": 6457 if v != nil { 6458 var location string 6459 err = json.Unmarshal(*v, &location) 6460 if err != nil { 6461 return err 6462 } 6463 sspcup.Location = &location 6464 } 6465 case "tags": 6466 if v != nil { 6467 var tags map[string]*string 6468 err = json.Unmarshal(*v, &tags) 6469 if err != nil { 6470 return err 6471 } 6472 sspcup.Tags = tags 6473 } 6474 } 6475 } 6476 6477 return nil 6478} 6479 6480// SQLStoredProcedureCreateUpdateProperties properties to create and update Azure Cosmos DB 6481// storedProcedure. 6482type SQLStoredProcedureCreateUpdateProperties struct { 6483 // Resource - The standard JSON format of a storedProcedure 6484 Resource *SQLStoredProcedureResource `json:"resource,omitempty"` 6485 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 6486 Options *CreateUpdateOptions `json:"options,omitempty"` 6487} 6488 6489// SQLStoredProcedureGetProperties the properties of an Azure Cosmos DB StoredProcedure 6490type SQLStoredProcedureGetProperties struct { 6491 Resource *SQLStoredProcedureGetPropertiesResource `json:"resource,omitempty"` 6492} 6493 6494// SQLStoredProcedureGetPropertiesResource ... 6495type SQLStoredProcedureGetPropertiesResource struct { 6496 // ID - Name of the Cosmos DB SQL storedProcedure 6497 ID *string `json:"id,omitempty"` 6498 // Body - Body of the Stored Procedure 6499 Body *string `json:"body,omitempty"` 6500 // Rid - READ-ONLY; A system generated property. A unique identifier. 6501 Rid *string `json:"_rid,omitempty"` 6502 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 6503 Ts interface{} `json:"_ts,omitempty"` 6504 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 6505 Etag *string `json:"_etag,omitempty"` 6506} 6507 6508// MarshalJSON is the custom marshaler for SQLStoredProcedureGetPropertiesResource. 6509func (sspgp SQLStoredProcedureGetPropertiesResource) MarshalJSON() ([]byte, error) { 6510 objectMap := make(map[string]interface{}) 6511 if sspgp.ID != nil { 6512 objectMap["id"] = sspgp.ID 6513 } 6514 if sspgp.Body != nil { 6515 objectMap["body"] = sspgp.Body 6516 } 6517 return json.Marshal(objectMap) 6518} 6519 6520// SQLStoredProcedureGetResults an Azure Cosmos DB storedProcedure. 6521type SQLStoredProcedureGetResults struct { 6522 autorest.Response `json:"-"` 6523 // SQLStoredProcedureGetProperties - The properties of an Azure Cosmos DB storedProcedure 6524 *SQLStoredProcedureGetProperties `json:"properties,omitempty"` 6525 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 6526 ID *string `json:"id,omitempty"` 6527 // Name - READ-ONLY; The name of the ARM resource. 6528 Name *string `json:"name,omitempty"` 6529 // Type - READ-ONLY; The type of Azure resource. 6530 Type *string `json:"type,omitempty"` 6531 // Location - The location of the resource group to which the resource belongs. 6532 Location *string `json:"location,omitempty"` 6533 Tags map[string]*string `json:"tags"` 6534} 6535 6536// MarshalJSON is the custom marshaler for SQLStoredProcedureGetResults. 6537func (sspgr SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) { 6538 objectMap := make(map[string]interface{}) 6539 if sspgr.SQLStoredProcedureGetProperties != nil { 6540 objectMap["properties"] = sspgr.SQLStoredProcedureGetProperties 6541 } 6542 if sspgr.Location != nil { 6543 objectMap["location"] = sspgr.Location 6544 } 6545 if sspgr.Tags != nil { 6546 objectMap["tags"] = sspgr.Tags 6547 } 6548 return json.Marshal(objectMap) 6549} 6550 6551// UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureGetResults struct. 6552func (sspgr *SQLStoredProcedureGetResults) UnmarshalJSON(body []byte) error { 6553 var m map[string]*json.RawMessage 6554 err := json.Unmarshal(body, &m) 6555 if err != nil { 6556 return err 6557 } 6558 for k, v := range m { 6559 switch k { 6560 case "properties": 6561 if v != nil { 6562 var SQLStoredProcedureGetProperties SQLStoredProcedureGetProperties 6563 err = json.Unmarshal(*v, &SQLStoredProcedureGetProperties) 6564 if err != nil { 6565 return err 6566 } 6567 sspgr.SQLStoredProcedureGetProperties = &SQLStoredProcedureGetProperties 6568 } 6569 case "id": 6570 if v != nil { 6571 var ID string 6572 err = json.Unmarshal(*v, &ID) 6573 if err != nil { 6574 return err 6575 } 6576 sspgr.ID = &ID 6577 } 6578 case "name": 6579 if v != nil { 6580 var name string 6581 err = json.Unmarshal(*v, &name) 6582 if err != nil { 6583 return err 6584 } 6585 sspgr.Name = &name 6586 } 6587 case "type": 6588 if v != nil { 6589 var typeVar string 6590 err = json.Unmarshal(*v, &typeVar) 6591 if err != nil { 6592 return err 6593 } 6594 sspgr.Type = &typeVar 6595 } 6596 case "location": 6597 if v != nil { 6598 var location string 6599 err = json.Unmarshal(*v, &location) 6600 if err != nil { 6601 return err 6602 } 6603 sspgr.Location = &location 6604 } 6605 case "tags": 6606 if v != nil { 6607 var tags map[string]*string 6608 err = json.Unmarshal(*v, &tags) 6609 if err != nil { 6610 return err 6611 } 6612 sspgr.Tags = tags 6613 } 6614 } 6615 } 6616 6617 return nil 6618} 6619 6620// SQLStoredProcedureListResult the List operation response, that contains the storedProcedures and their 6621// properties. 6622type SQLStoredProcedureListResult struct { 6623 autorest.Response `json:"-"` 6624 // Value - READ-ONLY; List of storedProcedures and their properties. 6625 Value *[]SQLStoredProcedureGetResults `json:"value,omitempty"` 6626} 6627 6628// MarshalJSON is the custom marshaler for SQLStoredProcedureListResult. 6629func (ssplr SQLStoredProcedureListResult) MarshalJSON() ([]byte, error) { 6630 objectMap := make(map[string]interface{}) 6631 return json.Marshal(objectMap) 6632} 6633 6634// SQLStoredProcedureResource cosmos DB SQL storedProcedure resource object 6635type SQLStoredProcedureResource struct { 6636 // ID - Name of the Cosmos DB SQL storedProcedure 6637 ID *string `json:"id,omitempty"` 6638 // Body - Body of the Stored Procedure 6639 Body *string `json:"body,omitempty"` 6640} 6641 6642// SQLTriggerCreateUpdateParameters parameters to create and update Cosmos DB trigger. 6643type SQLTriggerCreateUpdateParameters struct { 6644 // SQLTriggerCreateUpdateProperties - Properties to create and update Azure Cosmos DB trigger. 6645 *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"` 6646 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 6647 ID *string `json:"id,omitempty"` 6648 // Name - READ-ONLY; The name of the ARM resource. 6649 Name *string `json:"name,omitempty"` 6650 // Type - READ-ONLY; The type of Azure resource. 6651 Type *string `json:"type,omitempty"` 6652 // Location - The location of the resource group to which the resource belongs. 6653 Location *string `json:"location,omitempty"` 6654 Tags map[string]*string `json:"tags"` 6655} 6656 6657// MarshalJSON is the custom marshaler for SQLTriggerCreateUpdateParameters. 6658func (stcup SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) { 6659 objectMap := make(map[string]interface{}) 6660 if stcup.SQLTriggerCreateUpdateProperties != nil { 6661 objectMap["properties"] = stcup.SQLTriggerCreateUpdateProperties 6662 } 6663 if stcup.Location != nil { 6664 objectMap["location"] = stcup.Location 6665 } 6666 if stcup.Tags != nil { 6667 objectMap["tags"] = stcup.Tags 6668 } 6669 return json.Marshal(objectMap) 6670} 6671 6672// UnmarshalJSON is the custom unmarshaler for SQLTriggerCreateUpdateParameters struct. 6673func (stcup *SQLTriggerCreateUpdateParameters) UnmarshalJSON(body []byte) error { 6674 var m map[string]*json.RawMessage 6675 err := json.Unmarshal(body, &m) 6676 if err != nil { 6677 return err 6678 } 6679 for k, v := range m { 6680 switch k { 6681 case "properties": 6682 if v != nil { 6683 var SQLTriggerCreateUpdateProperties SQLTriggerCreateUpdateProperties 6684 err = json.Unmarshal(*v, &SQLTriggerCreateUpdateProperties) 6685 if err != nil { 6686 return err 6687 } 6688 stcup.SQLTriggerCreateUpdateProperties = &SQLTriggerCreateUpdateProperties 6689 } 6690 case "id": 6691 if v != nil { 6692 var ID string 6693 err = json.Unmarshal(*v, &ID) 6694 if err != nil { 6695 return err 6696 } 6697 stcup.ID = &ID 6698 } 6699 case "name": 6700 if v != nil { 6701 var name string 6702 err = json.Unmarshal(*v, &name) 6703 if err != nil { 6704 return err 6705 } 6706 stcup.Name = &name 6707 } 6708 case "type": 6709 if v != nil { 6710 var typeVar string 6711 err = json.Unmarshal(*v, &typeVar) 6712 if err != nil { 6713 return err 6714 } 6715 stcup.Type = &typeVar 6716 } 6717 case "location": 6718 if v != nil { 6719 var location string 6720 err = json.Unmarshal(*v, &location) 6721 if err != nil { 6722 return err 6723 } 6724 stcup.Location = &location 6725 } 6726 case "tags": 6727 if v != nil { 6728 var tags map[string]*string 6729 err = json.Unmarshal(*v, &tags) 6730 if err != nil { 6731 return err 6732 } 6733 stcup.Tags = tags 6734 } 6735 } 6736 } 6737 6738 return nil 6739} 6740 6741// SQLTriggerCreateUpdateProperties properties to create and update Azure Cosmos DB trigger. 6742type SQLTriggerCreateUpdateProperties struct { 6743 // Resource - The standard JSON format of a trigger 6744 Resource *SQLTriggerResource `json:"resource,omitempty"` 6745 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 6746 Options *CreateUpdateOptions `json:"options,omitempty"` 6747} 6748 6749// SQLTriggerGetProperties the properties of an Azure Cosmos DB trigger 6750type SQLTriggerGetProperties struct { 6751 Resource *SQLTriggerGetPropertiesResource `json:"resource,omitempty"` 6752} 6753 6754// SQLTriggerGetPropertiesResource ... 6755type SQLTriggerGetPropertiesResource struct { 6756 // ID - Name of the Cosmos DB SQL trigger 6757 ID *string `json:"id,omitempty"` 6758 // Body - Body of the Trigger 6759 Body *string `json:"body,omitempty"` 6760 // TriggerType - Type of the Trigger. Possible values include: 'Pre', 'Post' 6761 TriggerType TriggerType `json:"triggerType,omitempty"` 6762 // TriggerOperation - The operation the trigger is associated with. Possible values include: 'All', 'Create', 'Update', 'Delete', 'Replace' 6763 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"` 6764 // Rid - READ-ONLY; A system generated property. A unique identifier. 6765 Rid *string `json:"_rid,omitempty"` 6766 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 6767 Ts interface{} `json:"_ts,omitempty"` 6768 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 6769 Etag *string `json:"_etag,omitempty"` 6770} 6771 6772// MarshalJSON is the custom marshaler for SQLTriggerGetPropertiesResource. 6773func (stgp SQLTriggerGetPropertiesResource) MarshalJSON() ([]byte, error) { 6774 objectMap := make(map[string]interface{}) 6775 if stgp.ID != nil { 6776 objectMap["id"] = stgp.ID 6777 } 6778 if stgp.Body != nil { 6779 objectMap["body"] = stgp.Body 6780 } 6781 if stgp.TriggerType != "" { 6782 objectMap["triggerType"] = stgp.TriggerType 6783 } 6784 if stgp.TriggerOperation != "" { 6785 objectMap["triggerOperation"] = stgp.TriggerOperation 6786 } 6787 return json.Marshal(objectMap) 6788} 6789 6790// SQLTriggerGetResults an Azure Cosmos DB trigger. 6791type SQLTriggerGetResults struct { 6792 autorest.Response `json:"-"` 6793 // SQLTriggerGetProperties - The properties of an Azure Cosmos DB trigger 6794 *SQLTriggerGetProperties `json:"properties,omitempty"` 6795 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 6796 ID *string `json:"id,omitempty"` 6797 // Name - READ-ONLY; The name of the ARM resource. 6798 Name *string `json:"name,omitempty"` 6799 // Type - READ-ONLY; The type of Azure resource. 6800 Type *string `json:"type,omitempty"` 6801 // Location - The location of the resource group to which the resource belongs. 6802 Location *string `json:"location,omitempty"` 6803 Tags map[string]*string `json:"tags"` 6804} 6805 6806// MarshalJSON is the custom marshaler for SQLTriggerGetResults. 6807func (stgr SQLTriggerGetResults) MarshalJSON() ([]byte, error) { 6808 objectMap := make(map[string]interface{}) 6809 if stgr.SQLTriggerGetProperties != nil { 6810 objectMap["properties"] = stgr.SQLTriggerGetProperties 6811 } 6812 if stgr.Location != nil { 6813 objectMap["location"] = stgr.Location 6814 } 6815 if stgr.Tags != nil { 6816 objectMap["tags"] = stgr.Tags 6817 } 6818 return json.Marshal(objectMap) 6819} 6820 6821// UnmarshalJSON is the custom unmarshaler for SQLTriggerGetResults struct. 6822func (stgr *SQLTriggerGetResults) UnmarshalJSON(body []byte) error { 6823 var m map[string]*json.RawMessage 6824 err := json.Unmarshal(body, &m) 6825 if err != nil { 6826 return err 6827 } 6828 for k, v := range m { 6829 switch k { 6830 case "properties": 6831 if v != nil { 6832 var SQLTriggerGetProperties SQLTriggerGetProperties 6833 err = json.Unmarshal(*v, &SQLTriggerGetProperties) 6834 if err != nil { 6835 return err 6836 } 6837 stgr.SQLTriggerGetProperties = &SQLTriggerGetProperties 6838 } 6839 case "id": 6840 if v != nil { 6841 var ID string 6842 err = json.Unmarshal(*v, &ID) 6843 if err != nil { 6844 return err 6845 } 6846 stgr.ID = &ID 6847 } 6848 case "name": 6849 if v != nil { 6850 var name string 6851 err = json.Unmarshal(*v, &name) 6852 if err != nil { 6853 return err 6854 } 6855 stgr.Name = &name 6856 } 6857 case "type": 6858 if v != nil { 6859 var typeVar string 6860 err = json.Unmarshal(*v, &typeVar) 6861 if err != nil { 6862 return err 6863 } 6864 stgr.Type = &typeVar 6865 } 6866 case "location": 6867 if v != nil { 6868 var location string 6869 err = json.Unmarshal(*v, &location) 6870 if err != nil { 6871 return err 6872 } 6873 stgr.Location = &location 6874 } 6875 case "tags": 6876 if v != nil { 6877 var tags map[string]*string 6878 err = json.Unmarshal(*v, &tags) 6879 if err != nil { 6880 return err 6881 } 6882 stgr.Tags = tags 6883 } 6884 } 6885 } 6886 6887 return nil 6888} 6889 6890// SQLTriggerListResult the List operation response, that contains the triggers and their properties. 6891type SQLTriggerListResult struct { 6892 autorest.Response `json:"-"` 6893 // Value - READ-ONLY; List of triggers and their properties. 6894 Value *[]SQLTriggerGetResults `json:"value,omitempty"` 6895} 6896 6897// MarshalJSON is the custom marshaler for SQLTriggerListResult. 6898func (stlr SQLTriggerListResult) MarshalJSON() ([]byte, error) { 6899 objectMap := make(map[string]interface{}) 6900 return json.Marshal(objectMap) 6901} 6902 6903// SQLTriggerResource cosmos DB SQL trigger resource object 6904type SQLTriggerResource struct { 6905 // ID - Name of the Cosmos DB SQL trigger 6906 ID *string `json:"id,omitempty"` 6907 // Body - Body of the Trigger 6908 Body *string `json:"body,omitempty"` 6909 // TriggerType - Type of the Trigger. Possible values include: 'Pre', 'Post' 6910 TriggerType TriggerType `json:"triggerType,omitempty"` 6911 // TriggerOperation - The operation the trigger is associated with. Possible values include: 'All', 'Create', 'Update', 'Delete', 'Replace' 6912 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"` 6913} 6914 6915// SQLUserDefinedFunctionCreateUpdateParameters parameters to create and update Cosmos DB 6916// userDefinedFunction. 6917type SQLUserDefinedFunctionCreateUpdateParameters struct { 6918 // SQLUserDefinedFunctionCreateUpdateProperties - Properties to create and update Azure Cosmos DB userDefinedFunction. 6919 *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"` 6920 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 6921 ID *string `json:"id,omitempty"` 6922 // Name - READ-ONLY; The name of the ARM resource. 6923 Name *string `json:"name,omitempty"` 6924 // Type - READ-ONLY; The type of Azure resource. 6925 Type *string `json:"type,omitempty"` 6926 // Location - The location of the resource group to which the resource belongs. 6927 Location *string `json:"location,omitempty"` 6928 Tags map[string]*string `json:"tags"` 6929} 6930 6931// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionCreateUpdateParameters. 6932func (sudfcup SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) { 6933 objectMap := make(map[string]interface{}) 6934 if sudfcup.SQLUserDefinedFunctionCreateUpdateProperties != nil { 6935 objectMap["properties"] = sudfcup.SQLUserDefinedFunctionCreateUpdateProperties 6936 } 6937 if sudfcup.Location != nil { 6938 objectMap["location"] = sudfcup.Location 6939 } 6940 if sudfcup.Tags != nil { 6941 objectMap["tags"] = sudfcup.Tags 6942 } 6943 return json.Marshal(objectMap) 6944} 6945 6946// UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionCreateUpdateParameters struct. 6947func (sudfcup *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(body []byte) error { 6948 var m map[string]*json.RawMessage 6949 err := json.Unmarshal(body, &m) 6950 if err != nil { 6951 return err 6952 } 6953 for k, v := range m { 6954 switch k { 6955 case "properties": 6956 if v != nil { 6957 var SQLUserDefinedFunctionCreateUpdateProperties SQLUserDefinedFunctionCreateUpdateProperties 6958 err = json.Unmarshal(*v, &SQLUserDefinedFunctionCreateUpdateProperties) 6959 if err != nil { 6960 return err 6961 } 6962 sudfcup.SQLUserDefinedFunctionCreateUpdateProperties = &SQLUserDefinedFunctionCreateUpdateProperties 6963 } 6964 case "id": 6965 if v != nil { 6966 var ID string 6967 err = json.Unmarshal(*v, &ID) 6968 if err != nil { 6969 return err 6970 } 6971 sudfcup.ID = &ID 6972 } 6973 case "name": 6974 if v != nil { 6975 var name string 6976 err = json.Unmarshal(*v, &name) 6977 if err != nil { 6978 return err 6979 } 6980 sudfcup.Name = &name 6981 } 6982 case "type": 6983 if v != nil { 6984 var typeVar string 6985 err = json.Unmarshal(*v, &typeVar) 6986 if err != nil { 6987 return err 6988 } 6989 sudfcup.Type = &typeVar 6990 } 6991 case "location": 6992 if v != nil { 6993 var location string 6994 err = json.Unmarshal(*v, &location) 6995 if err != nil { 6996 return err 6997 } 6998 sudfcup.Location = &location 6999 } 7000 case "tags": 7001 if v != nil { 7002 var tags map[string]*string 7003 err = json.Unmarshal(*v, &tags) 7004 if err != nil { 7005 return err 7006 } 7007 sudfcup.Tags = tags 7008 } 7009 } 7010 } 7011 7012 return nil 7013} 7014 7015// SQLUserDefinedFunctionCreateUpdateProperties properties to create and update Azure Cosmos DB 7016// userDefinedFunction. 7017type SQLUserDefinedFunctionCreateUpdateProperties struct { 7018 // Resource - The standard JSON format of a userDefinedFunction 7019 Resource *SQLUserDefinedFunctionResource `json:"resource,omitempty"` 7020 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 7021 Options *CreateUpdateOptions `json:"options,omitempty"` 7022} 7023 7024// SQLUserDefinedFunctionGetProperties the properties of an Azure Cosmos DB userDefinedFunction 7025type SQLUserDefinedFunctionGetProperties struct { 7026 Resource *SQLUserDefinedFunctionGetPropertiesResource `json:"resource,omitempty"` 7027} 7028 7029// SQLUserDefinedFunctionGetPropertiesResource ... 7030type SQLUserDefinedFunctionGetPropertiesResource struct { 7031 // ID - Name of the Cosmos DB SQL userDefinedFunction 7032 ID *string `json:"id,omitempty"` 7033 // Body - Body of the User Defined Function 7034 Body *string `json:"body,omitempty"` 7035 // Rid - READ-ONLY; A system generated property. A unique identifier. 7036 Rid *string `json:"_rid,omitempty"` 7037 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 7038 Ts interface{} `json:"_ts,omitempty"` 7039 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 7040 Etag *string `json:"_etag,omitempty"` 7041} 7042 7043// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetPropertiesResource. 7044func (sudfgp SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON() ([]byte, error) { 7045 objectMap := make(map[string]interface{}) 7046 if sudfgp.ID != nil { 7047 objectMap["id"] = sudfgp.ID 7048 } 7049 if sudfgp.Body != nil { 7050 objectMap["body"] = sudfgp.Body 7051 } 7052 return json.Marshal(objectMap) 7053} 7054 7055// SQLUserDefinedFunctionGetResults an Azure Cosmos DB userDefinedFunction. 7056type SQLUserDefinedFunctionGetResults struct { 7057 autorest.Response `json:"-"` 7058 // SQLUserDefinedFunctionGetProperties - The properties of an Azure Cosmos DB userDefinedFunction 7059 *SQLUserDefinedFunctionGetProperties `json:"properties,omitempty"` 7060 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 7061 ID *string `json:"id,omitempty"` 7062 // Name - READ-ONLY; The name of the ARM resource. 7063 Name *string `json:"name,omitempty"` 7064 // Type - READ-ONLY; The type of Azure resource. 7065 Type *string `json:"type,omitempty"` 7066 // Location - The location of the resource group to which the resource belongs. 7067 Location *string `json:"location,omitempty"` 7068 Tags map[string]*string `json:"tags"` 7069} 7070 7071// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetResults. 7072func (sudfgr SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) { 7073 objectMap := make(map[string]interface{}) 7074 if sudfgr.SQLUserDefinedFunctionGetProperties != nil { 7075 objectMap["properties"] = sudfgr.SQLUserDefinedFunctionGetProperties 7076 } 7077 if sudfgr.Location != nil { 7078 objectMap["location"] = sudfgr.Location 7079 } 7080 if sudfgr.Tags != nil { 7081 objectMap["tags"] = sudfgr.Tags 7082 } 7083 return json.Marshal(objectMap) 7084} 7085 7086// UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionGetResults struct. 7087func (sudfgr *SQLUserDefinedFunctionGetResults) UnmarshalJSON(body []byte) error { 7088 var m map[string]*json.RawMessage 7089 err := json.Unmarshal(body, &m) 7090 if err != nil { 7091 return err 7092 } 7093 for k, v := range m { 7094 switch k { 7095 case "properties": 7096 if v != nil { 7097 var SQLUserDefinedFunctionGetProperties SQLUserDefinedFunctionGetProperties 7098 err = json.Unmarshal(*v, &SQLUserDefinedFunctionGetProperties) 7099 if err != nil { 7100 return err 7101 } 7102 sudfgr.SQLUserDefinedFunctionGetProperties = &SQLUserDefinedFunctionGetProperties 7103 } 7104 case "id": 7105 if v != nil { 7106 var ID string 7107 err = json.Unmarshal(*v, &ID) 7108 if err != nil { 7109 return err 7110 } 7111 sudfgr.ID = &ID 7112 } 7113 case "name": 7114 if v != nil { 7115 var name string 7116 err = json.Unmarshal(*v, &name) 7117 if err != nil { 7118 return err 7119 } 7120 sudfgr.Name = &name 7121 } 7122 case "type": 7123 if v != nil { 7124 var typeVar string 7125 err = json.Unmarshal(*v, &typeVar) 7126 if err != nil { 7127 return err 7128 } 7129 sudfgr.Type = &typeVar 7130 } 7131 case "location": 7132 if v != nil { 7133 var location string 7134 err = json.Unmarshal(*v, &location) 7135 if err != nil { 7136 return err 7137 } 7138 sudfgr.Location = &location 7139 } 7140 case "tags": 7141 if v != nil { 7142 var tags map[string]*string 7143 err = json.Unmarshal(*v, &tags) 7144 if err != nil { 7145 return err 7146 } 7147 sudfgr.Tags = tags 7148 } 7149 } 7150 } 7151 7152 return nil 7153} 7154 7155// SQLUserDefinedFunctionListResult the List operation response, that contains the userDefinedFunctions and 7156// their properties. 7157type SQLUserDefinedFunctionListResult struct { 7158 autorest.Response `json:"-"` 7159 // Value - READ-ONLY; List of userDefinedFunctions and their properties. 7160 Value *[]SQLUserDefinedFunctionGetResults `json:"value,omitempty"` 7161} 7162 7163// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionListResult. 7164func (sudflr SQLUserDefinedFunctionListResult) MarshalJSON() ([]byte, error) { 7165 objectMap := make(map[string]interface{}) 7166 return json.Marshal(objectMap) 7167} 7168 7169// SQLUserDefinedFunctionResource cosmos DB SQL userDefinedFunction resource object 7170type SQLUserDefinedFunctionResource struct { 7171 // ID - Name of the Cosmos DB SQL userDefinedFunction 7172 ID *string `json:"id,omitempty"` 7173 // Body - Body of the User Defined Function 7174 Body *string `json:"body,omitempty"` 7175} 7176 7177// TableCreateUpdateParameters parameters to create and update Cosmos DB Table. 7178type TableCreateUpdateParameters struct { 7179 // TableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Table. 7180 *TableCreateUpdateProperties `json:"properties,omitempty"` 7181 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 7182 ID *string `json:"id,omitempty"` 7183 // Name - READ-ONLY; The name of the ARM resource. 7184 Name *string `json:"name,omitempty"` 7185 // Type - READ-ONLY; The type of Azure resource. 7186 Type *string `json:"type,omitempty"` 7187 // Location - The location of the resource group to which the resource belongs. 7188 Location *string `json:"location,omitempty"` 7189 Tags map[string]*string `json:"tags"` 7190} 7191 7192// MarshalJSON is the custom marshaler for TableCreateUpdateParameters. 7193func (tcup TableCreateUpdateParameters) MarshalJSON() ([]byte, error) { 7194 objectMap := make(map[string]interface{}) 7195 if tcup.TableCreateUpdateProperties != nil { 7196 objectMap["properties"] = tcup.TableCreateUpdateProperties 7197 } 7198 if tcup.Location != nil { 7199 objectMap["location"] = tcup.Location 7200 } 7201 if tcup.Tags != nil { 7202 objectMap["tags"] = tcup.Tags 7203 } 7204 return json.Marshal(objectMap) 7205} 7206 7207// UnmarshalJSON is the custom unmarshaler for TableCreateUpdateParameters struct. 7208func (tcup *TableCreateUpdateParameters) UnmarshalJSON(body []byte) error { 7209 var m map[string]*json.RawMessage 7210 err := json.Unmarshal(body, &m) 7211 if err != nil { 7212 return err 7213 } 7214 for k, v := range m { 7215 switch k { 7216 case "properties": 7217 if v != nil { 7218 var tableCreateUpdateProperties TableCreateUpdateProperties 7219 err = json.Unmarshal(*v, &tableCreateUpdateProperties) 7220 if err != nil { 7221 return err 7222 } 7223 tcup.TableCreateUpdateProperties = &tableCreateUpdateProperties 7224 } 7225 case "id": 7226 if v != nil { 7227 var ID string 7228 err = json.Unmarshal(*v, &ID) 7229 if err != nil { 7230 return err 7231 } 7232 tcup.ID = &ID 7233 } 7234 case "name": 7235 if v != nil { 7236 var name string 7237 err = json.Unmarshal(*v, &name) 7238 if err != nil { 7239 return err 7240 } 7241 tcup.Name = &name 7242 } 7243 case "type": 7244 if v != nil { 7245 var typeVar string 7246 err = json.Unmarshal(*v, &typeVar) 7247 if err != nil { 7248 return err 7249 } 7250 tcup.Type = &typeVar 7251 } 7252 case "location": 7253 if v != nil { 7254 var location string 7255 err = json.Unmarshal(*v, &location) 7256 if err != nil { 7257 return err 7258 } 7259 tcup.Location = &location 7260 } 7261 case "tags": 7262 if v != nil { 7263 var tags map[string]*string 7264 err = json.Unmarshal(*v, &tags) 7265 if err != nil { 7266 return err 7267 } 7268 tcup.Tags = tags 7269 } 7270 } 7271 } 7272 7273 return nil 7274} 7275 7276// TableCreateUpdateProperties properties to create and update Azure Cosmos DB Table. 7277type TableCreateUpdateProperties struct { 7278 // Resource - The standard JSON format of a Table 7279 Resource *TableResource `json:"resource,omitempty"` 7280 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 7281 Options *CreateUpdateOptions `json:"options,omitempty"` 7282} 7283 7284// TableGetProperties the properties of an Azure Cosmos Table 7285type TableGetProperties struct { 7286 Resource *TableGetPropertiesResource `json:"resource,omitempty"` 7287 Options *TableGetPropertiesOptions `json:"options,omitempty"` 7288} 7289 7290// TableGetPropertiesOptions ... 7291type TableGetPropertiesOptions struct { 7292 // Throughput - Value of the Cosmos DB resource throughput. Use the ThroughputSetting resource when retrieving offer details. 7293 Throughput *int32 `json:"throughput,omitempty"` 7294} 7295 7296// TableGetPropertiesResource ... 7297type TableGetPropertiesResource struct { 7298 // ID - Name of the Cosmos DB table 7299 ID *string `json:"id,omitempty"` 7300 // Rid - READ-ONLY; A system generated property. A unique identifier. 7301 Rid *string `json:"_rid,omitempty"` 7302 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 7303 Ts interface{} `json:"_ts,omitempty"` 7304 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 7305 Etag *string `json:"_etag,omitempty"` 7306} 7307 7308// MarshalJSON is the custom marshaler for TableGetPropertiesResource. 7309func (tgp TableGetPropertiesResource) MarshalJSON() ([]byte, error) { 7310 objectMap := make(map[string]interface{}) 7311 if tgp.ID != nil { 7312 objectMap["id"] = tgp.ID 7313 } 7314 return json.Marshal(objectMap) 7315} 7316 7317// TableGetResults an Azure Cosmos DB Table. 7318type TableGetResults struct { 7319 autorest.Response `json:"-"` 7320 // TableGetProperties - The properties of an Azure Cosmos DB Table 7321 *TableGetProperties `json:"properties,omitempty"` 7322 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 7323 ID *string `json:"id,omitempty"` 7324 // Name - READ-ONLY; The name of the ARM resource. 7325 Name *string `json:"name,omitempty"` 7326 // Type - READ-ONLY; The type of Azure resource. 7327 Type *string `json:"type,omitempty"` 7328 // Location - The location of the resource group to which the resource belongs. 7329 Location *string `json:"location,omitempty"` 7330 Tags map[string]*string `json:"tags"` 7331} 7332 7333// MarshalJSON is the custom marshaler for TableGetResults. 7334func (tgr TableGetResults) MarshalJSON() ([]byte, error) { 7335 objectMap := make(map[string]interface{}) 7336 if tgr.TableGetProperties != nil { 7337 objectMap["properties"] = tgr.TableGetProperties 7338 } 7339 if tgr.Location != nil { 7340 objectMap["location"] = tgr.Location 7341 } 7342 if tgr.Tags != nil { 7343 objectMap["tags"] = tgr.Tags 7344 } 7345 return json.Marshal(objectMap) 7346} 7347 7348// UnmarshalJSON is the custom unmarshaler for TableGetResults struct. 7349func (tgr *TableGetResults) UnmarshalJSON(body []byte) error { 7350 var m map[string]*json.RawMessage 7351 err := json.Unmarshal(body, &m) 7352 if err != nil { 7353 return err 7354 } 7355 for k, v := range m { 7356 switch k { 7357 case "properties": 7358 if v != nil { 7359 var tableGetProperties TableGetProperties 7360 err = json.Unmarshal(*v, &tableGetProperties) 7361 if err != nil { 7362 return err 7363 } 7364 tgr.TableGetProperties = &tableGetProperties 7365 } 7366 case "id": 7367 if v != nil { 7368 var ID string 7369 err = json.Unmarshal(*v, &ID) 7370 if err != nil { 7371 return err 7372 } 7373 tgr.ID = &ID 7374 } 7375 case "name": 7376 if v != nil { 7377 var name string 7378 err = json.Unmarshal(*v, &name) 7379 if err != nil { 7380 return err 7381 } 7382 tgr.Name = &name 7383 } 7384 case "type": 7385 if v != nil { 7386 var typeVar string 7387 err = json.Unmarshal(*v, &typeVar) 7388 if err != nil { 7389 return err 7390 } 7391 tgr.Type = &typeVar 7392 } 7393 case "location": 7394 if v != nil { 7395 var location string 7396 err = json.Unmarshal(*v, &location) 7397 if err != nil { 7398 return err 7399 } 7400 tgr.Location = &location 7401 } 7402 case "tags": 7403 if v != nil { 7404 var tags map[string]*string 7405 err = json.Unmarshal(*v, &tags) 7406 if err != nil { 7407 return err 7408 } 7409 tgr.Tags = tags 7410 } 7411 } 7412 } 7413 7414 return nil 7415} 7416 7417// TableListResult the List operation response, that contains the Table and their properties. 7418type TableListResult struct { 7419 autorest.Response `json:"-"` 7420 // Value - READ-ONLY; List of Table and their properties. 7421 Value *[]TableGetResults `json:"value,omitempty"` 7422} 7423 7424// MarshalJSON is the custom marshaler for TableListResult. 7425func (tlr TableListResult) MarshalJSON() ([]byte, error) { 7426 objectMap := make(map[string]interface{}) 7427 return json.Marshal(objectMap) 7428} 7429 7430// TableResource cosmos DB table resource object 7431type TableResource struct { 7432 // ID - Name of the Cosmos DB table 7433 ID *string `json:"id,omitempty"` 7434} 7435 7436// TableResourcesCreateUpdateTableFuture an abstraction for monitoring and retrieving the results of a 7437// long-running operation. 7438type TableResourcesCreateUpdateTableFuture struct { 7439 azure.FutureAPI 7440 // Result returns the result of the asynchronous operation. 7441 // If the operation has not completed it will return an error. 7442 Result func(TableResourcesClient) (TableGetResults, error) 7443} 7444 7445// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7446func (future *TableResourcesCreateUpdateTableFuture) UnmarshalJSON(body []byte) error { 7447 var azFuture azure.Future 7448 if err := json.Unmarshal(body, &azFuture); err != nil { 7449 return err 7450 } 7451 future.FutureAPI = &azFuture 7452 future.Result = future.result 7453 return nil 7454} 7455 7456// result is the default implementation for TableResourcesCreateUpdateTableFuture.Result. 7457func (future *TableResourcesCreateUpdateTableFuture) result(client TableResourcesClient) (tgr TableGetResults, err error) { 7458 var done bool 7459 done, err = future.DoneWithContext(context.Background(), client) 7460 if err != nil { 7461 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", future.Response(), "Polling failure") 7462 return 7463 } 7464 if !done { 7465 tgr.Response.Response = future.Response() 7466 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesCreateUpdateTableFuture") 7467 return 7468 } 7469 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7470 if tgr.Response.Response, err = future.GetResult(sender); err == nil && tgr.Response.Response.StatusCode != http.StatusNoContent { 7471 tgr, err = client.CreateUpdateTableResponder(tgr.Response.Response) 7472 if err != nil { 7473 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", tgr.Response.Response, "Failure responding to request") 7474 } 7475 } 7476 return 7477} 7478 7479// TableResourcesDeleteTableFuture an abstraction for monitoring and retrieving the results of a 7480// long-running operation. 7481type TableResourcesDeleteTableFuture struct { 7482 azure.FutureAPI 7483 // Result returns the result of the asynchronous operation. 7484 // If the operation has not completed it will return an error. 7485 Result func(TableResourcesClient) (autorest.Response, error) 7486} 7487 7488// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7489func (future *TableResourcesDeleteTableFuture) UnmarshalJSON(body []byte) error { 7490 var azFuture azure.Future 7491 if err := json.Unmarshal(body, &azFuture); err != nil { 7492 return err 7493 } 7494 future.FutureAPI = &azFuture 7495 future.Result = future.result 7496 return nil 7497} 7498 7499// result is the default implementation for TableResourcesDeleteTableFuture.Result. 7500func (future *TableResourcesDeleteTableFuture) result(client TableResourcesClient) (ar autorest.Response, err error) { 7501 var done bool 7502 done, err = future.DoneWithContext(context.Background(), client) 7503 if err != nil { 7504 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesDeleteTableFuture", "Result", future.Response(), "Polling failure") 7505 return 7506 } 7507 if !done { 7508 ar.Response = future.Response() 7509 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesDeleteTableFuture") 7510 return 7511 } 7512 ar.Response = future.Response() 7513 return 7514} 7515 7516// TableResourcesMigrateTableToAutoscaleFuture an abstraction for monitoring and retrieving the results of 7517// a long-running operation. 7518type TableResourcesMigrateTableToAutoscaleFuture struct { 7519 azure.FutureAPI 7520 // Result returns the result of the asynchronous operation. 7521 // If the operation has not completed it will return an error. 7522 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) 7523} 7524 7525// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7526func (future *TableResourcesMigrateTableToAutoscaleFuture) UnmarshalJSON(body []byte) error { 7527 var azFuture azure.Future 7528 if err := json.Unmarshal(body, &azFuture); err != nil { 7529 return err 7530 } 7531 future.FutureAPI = &azFuture 7532 future.Result = future.result 7533 return nil 7534} 7535 7536// result is the default implementation for TableResourcesMigrateTableToAutoscaleFuture.Result. 7537func (future *TableResourcesMigrateTableToAutoscaleFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 7538 var done bool 7539 done, err = future.DoneWithContext(context.Background(), client) 7540 if err != nil { 7541 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", future.Response(), "Polling failure") 7542 return 7543 } 7544 if !done { 7545 tsgr.Response.Response = future.Response() 7546 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToAutoscaleFuture") 7547 return 7548 } 7549 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7550 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 7551 tsgr, err = client.MigrateTableToAutoscaleResponder(tsgr.Response.Response) 7552 if err != nil { 7553 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 7554 } 7555 } 7556 return 7557} 7558 7559// TableResourcesMigrateTableToManualThroughputFuture an abstraction for monitoring and retrieving the 7560// results of a long-running operation. 7561type TableResourcesMigrateTableToManualThroughputFuture struct { 7562 azure.FutureAPI 7563 // Result returns the result of the asynchronous operation. 7564 // If the operation has not completed it will return an error. 7565 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) 7566} 7567 7568// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7569func (future *TableResourcesMigrateTableToManualThroughputFuture) UnmarshalJSON(body []byte) error { 7570 var azFuture azure.Future 7571 if err := json.Unmarshal(body, &azFuture); err != nil { 7572 return err 7573 } 7574 future.FutureAPI = &azFuture 7575 future.Result = future.result 7576 return nil 7577} 7578 7579// result is the default implementation for TableResourcesMigrateTableToManualThroughputFuture.Result. 7580func (future *TableResourcesMigrateTableToManualThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 7581 var done bool 7582 done, err = future.DoneWithContext(context.Background(), client) 7583 if err != nil { 7584 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", future.Response(), "Polling failure") 7585 return 7586 } 7587 if !done { 7588 tsgr.Response.Response = future.Response() 7589 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToManualThroughputFuture") 7590 return 7591 } 7592 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7593 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 7594 tsgr, err = client.MigrateTableToManualThroughputResponder(tsgr.Response.Response) 7595 if err != nil { 7596 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 7597 } 7598 } 7599 return 7600} 7601 7602// TableResourcesUpdateTableThroughputFuture an abstraction for monitoring and retrieving the results of a 7603// long-running operation. 7604type TableResourcesUpdateTableThroughputFuture struct { 7605 azure.FutureAPI 7606 // Result returns the result of the asynchronous operation. 7607 // If the operation has not completed it will return an error. 7608 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) 7609} 7610 7611// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7612func (future *TableResourcesUpdateTableThroughputFuture) UnmarshalJSON(body []byte) error { 7613 var azFuture azure.Future 7614 if err := json.Unmarshal(body, &azFuture); err != nil { 7615 return err 7616 } 7617 future.FutureAPI = &azFuture 7618 future.Result = future.result 7619 return nil 7620} 7621 7622// result is the default implementation for TableResourcesUpdateTableThroughputFuture.Result. 7623func (future *TableResourcesUpdateTableThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 7624 var done bool 7625 done, err = future.DoneWithContext(context.Background(), client) 7626 if err != nil { 7627 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", future.Response(), "Polling failure") 7628 return 7629 } 7630 if !done { 7631 tsgr.Response.Response = future.Response() 7632 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesUpdateTableThroughputFuture") 7633 return 7634 } 7635 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7636 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 7637 tsgr, err = client.UpdateTableThroughputResponder(tsgr.Response.Response) 7638 if err != nil { 7639 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 7640 } 7641 } 7642 return 7643} 7644 7645// ThroughputPolicyResource cosmos DB resource throughput policy 7646type ThroughputPolicyResource struct { 7647 // IsEnabled - Determines whether the ThroughputPolicy is active or not 7648 IsEnabled *bool `json:"isEnabled,omitempty"` 7649 // IncrementPercent - Represents the percentage by which throughput can increase every time throughput policy kicks in. 7650 IncrementPercent *int32 `json:"incrementPercent,omitempty"` 7651} 7652 7653// ThroughputSettingsGetProperties the properties of an Azure Cosmos DB resource throughput 7654type ThroughputSettingsGetProperties struct { 7655 Resource *ThroughputSettingsGetPropertiesResource `json:"resource,omitempty"` 7656} 7657 7658// ThroughputSettingsGetPropertiesResource ... 7659type ThroughputSettingsGetPropertiesResource struct { 7660 // Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or provisionedThroughputSettings is required, but not both. 7661 Throughput *int32 `json:"throughput,omitempty"` 7662 // ProvisionedThroughputSettings - Cosmos DB resource for provisioned throughput settings. Either throughput is required or provisionedThroughputSettings is required, but not both. 7663 ProvisionedThroughputSettings *ProvisionedThroughputSettingsResource `json:"provisionedThroughputSettings,omitempty"` 7664 // MinimumThroughput - READ-ONLY; The minimum throughput of the resource 7665 MinimumThroughput *string `json:"minimumThroughput,omitempty"` 7666 // OfferReplacePending - READ-ONLY; The throughput replace is pending 7667 OfferReplacePending *string `json:"offerReplacePending,omitempty"` 7668 // Rid - READ-ONLY; A system generated property. A unique identifier. 7669 Rid *string `json:"_rid,omitempty"` 7670 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 7671 Ts interface{} `json:"_ts,omitempty"` 7672 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 7673 Etag *string `json:"_etag,omitempty"` 7674} 7675 7676// MarshalJSON is the custom marshaler for ThroughputSettingsGetPropertiesResource. 7677func (tsgp ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) { 7678 objectMap := make(map[string]interface{}) 7679 if tsgp.Throughput != nil { 7680 objectMap["throughput"] = tsgp.Throughput 7681 } 7682 if tsgp.ProvisionedThroughputSettings != nil { 7683 objectMap["provisionedThroughputSettings"] = tsgp.ProvisionedThroughputSettings 7684 } 7685 return json.Marshal(objectMap) 7686} 7687 7688// ThroughputSettingsGetResults an Azure Cosmos DB resource throughput. 7689type ThroughputSettingsGetResults struct { 7690 autorest.Response `json:"-"` 7691 // ThroughputSettingsGetProperties - The properties of an Azure Cosmos DB resource throughput 7692 *ThroughputSettingsGetProperties `json:"properties,omitempty"` 7693 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 7694 ID *string `json:"id,omitempty"` 7695 // Name - READ-ONLY; The name of the ARM resource. 7696 Name *string `json:"name,omitempty"` 7697 // Type - READ-ONLY; The type of Azure resource. 7698 Type *string `json:"type,omitempty"` 7699 // Location - The location of the resource group to which the resource belongs. 7700 Location *string `json:"location,omitempty"` 7701 Tags map[string]*string `json:"tags"` 7702} 7703 7704// MarshalJSON is the custom marshaler for ThroughputSettingsGetResults. 7705func (tsgr ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) { 7706 objectMap := make(map[string]interface{}) 7707 if tsgr.ThroughputSettingsGetProperties != nil { 7708 objectMap["properties"] = tsgr.ThroughputSettingsGetProperties 7709 } 7710 if tsgr.Location != nil { 7711 objectMap["location"] = tsgr.Location 7712 } 7713 if tsgr.Tags != nil { 7714 objectMap["tags"] = tsgr.Tags 7715 } 7716 return json.Marshal(objectMap) 7717} 7718 7719// UnmarshalJSON is the custom unmarshaler for ThroughputSettingsGetResults struct. 7720func (tsgr *ThroughputSettingsGetResults) UnmarshalJSON(body []byte) error { 7721 var m map[string]*json.RawMessage 7722 err := json.Unmarshal(body, &m) 7723 if err != nil { 7724 return err 7725 } 7726 for k, v := range m { 7727 switch k { 7728 case "properties": 7729 if v != nil { 7730 var throughputSettingsGetProperties ThroughputSettingsGetProperties 7731 err = json.Unmarshal(*v, &throughputSettingsGetProperties) 7732 if err != nil { 7733 return err 7734 } 7735 tsgr.ThroughputSettingsGetProperties = &throughputSettingsGetProperties 7736 } 7737 case "id": 7738 if v != nil { 7739 var ID string 7740 err = json.Unmarshal(*v, &ID) 7741 if err != nil { 7742 return err 7743 } 7744 tsgr.ID = &ID 7745 } 7746 case "name": 7747 if v != nil { 7748 var name string 7749 err = json.Unmarshal(*v, &name) 7750 if err != nil { 7751 return err 7752 } 7753 tsgr.Name = &name 7754 } 7755 case "type": 7756 if v != nil { 7757 var typeVar string 7758 err = json.Unmarshal(*v, &typeVar) 7759 if err != nil { 7760 return err 7761 } 7762 tsgr.Type = &typeVar 7763 } 7764 case "location": 7765 if v != nil { 7766 var location string 7767 err = json.Unmarshal(*v, &location) 7768 if err != nil { 7769 return err 7770 } 7771 tsgr.Location = &location 7772 } 7773 case "tags": 7774 if v != nil { 7775 var tags map[string]*string 7776 err = json.Unmarshal(*v, &tags) 7777 if err != nil { 7778 return err 7779 } 7780 tsgr.Tags = tags 7781 } 7782 } 7783 } 7784 7785 return nil 7786} 7787 7788// ThroughputSettingsResource cosmos DB resource throughput object. Either throughput is required or 7789// provisionedThroughputSettings is required, but not both. 7790type ThroughputSettingsResource struct { 7791 // Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or provisionedThroughputSettings is required, but not both. 7792 Throughput *int32 `json:"throughput,omitempty"` 7793 // ProvisionedThroughputSettings - Cosmos DB resource for provisioned throughput settings. Either throughput is required or provisionedThroughputSettings is required, but not both. 7794 ProvisionedThroughputSettings *ProvisionedThroughputSettingsResource `json:"provisionedThroughputSettings,omitempty"` 7795 // MinimumThroughput - READ-ONLY; The minimum throughput of the resource 7796 MinimumThroughput *string `json:"minimumThroughput,omitempty"` 7797 // OfferReplacePending - READ-ONLY; The throughput replace is pending 7798 OfferReplacePending *string `json:"offerReplacePending,omitempty"` 7799} 7800 7801// MarshalJSON is the custom marshaler for ThroughputSettingsResource. 7802func (tsr ThroughputSettingsResource) MarshalJSON() ([]byte, error) { 7803 objectMap := make(map[string]interface{}) 7804 if tsr.Throughput != nil { 7805 objectMap["throughput"] = tsr.Throughput 7806 } 7807 if tsr.ProvisionedThroughputSettings != nil { 7808 objectMap["provisionedThroughputSettings"] = tsr.ProvisionedThroughputSettings 7809 } 7810 return json.Marshal(objectMap) 7811} 7812 7813// ThroughputSettingsUpdateParameters parameters to update Cosmos DB resource throughput. 7814type ThroughputSettingsUpdateParameters struct { 7815 // ThroughputSettingsUpdateProperties - Properties to update Azure Cosmos DB resource throughput. 7816 *ThroughputSettingsUpdateProperties `json:"properties,omitempty"` 7817 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 7818 ID *string `json:"id,omitempty"` 7819 // Name - READ-ONLY; The name of the ARM resource. 7820 Name *string `json:"name,omitempty"` 7821 // Type - READ-ONLY; The type of Azure resource. 7822 Type *string `json:"type,omitempty"` 7823 // Location - The location of the resource group to which the resource belongs. 7824 Location *string `json:"location,omitempty"` 7825 Tags map[string]*string `json:"tags"` 7826} 7827 7828// MarshalJSON is the custom marshaler for ThroughputSettingsUpdateParameters. 7829func (tsup ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) { 7830 objectMap := make(map[string]interface{}) 7831 if tsup.ThroughputSettingsUpdateProperties != nil { 7832 objectMap["properties"] = tsup.ThroughputSettingsUpdateProperties 7833 } 7834 if tsup.Location != nil { 7835 objectMap["location"] = tsup.Location 7836 } 7837 if tsup.Tags != nil { 7838 objectMap["tags"] = tsup.Tags 7839 } 7840 return json.Marshal(objectMap) 7841} 7842 7843// UnmarshalJSON is the custom unmarshaler for ThroughputSettingsUpdateParameters struct. 7844func (tsup *ThroughputSettingsUpdateParameters) UnmarshalJSON(body []byte) error { 7845 var m map[string]*json.RawMessage 7846 err := json.Unmarshal(body, &m) 7847 if err != nil { 7848 return err 7849 } 7850 for k, v := range m { 7851 switch k { 7852 case "properties": 7853 if v != nil { 7854 var throughputSettingsUpdateProperties ThroughputSettingsUpdateProperties 7855 err = json.Unmarshal(*v, &throughputSettingsUpdateProperties) 7856 if err != nil { 7857 return err 7858 } 7859 tsup.ThroughputSettingsUpdateProperties = &throughputSettingsUpdateProperties 7860 } 7861 case "id": 7862 if v != nil { 7863 var ID string 7864 err = json.Unmarshal(*v, &ID) 7865 if err != nil { 7866 return err 7867 } 7868 tsup.ID = &ID 7869 } 7870 case "name": 7871 if v != nil { 7872 var name string 7873 err = json.Unmarshal(*v, &name) 7874 if err != nil { 7875 return err 7876 } 7877 tsup.Name = &name 7878 } 7879 case "type": 7880 if v != nil { 7881 var typeVar string 7882 err = json.Unmarshal(*v, &typeVar) 7883 if err != nil { 7884 return err 7885 } 7886 tsup.Type = &typeVar 7887 } 7888 case "location": 7889 if v != nil { 7890 var location string 7891 err = json.Unmarshal(*v, &location) 7892 if err != nil { 7893 return err 7894 } 7895 tsup.Location = &location 7896 } 7897 case "tags": 7898 if v != nil { 7899 var tags map[string]*string 7900 err = json.Unmarshal(*v, &tags) 7901 if err != nil { 7902 return err 7903 } 7904 tsup.Tags = tags 7905 } 7906 } 7907 } 7908 7909 return nil 7910} 7911 7912// ThroughputSettingsUpdateProperties properties to update Azure Cosmos DB resource throughput. 7913type ThroughputSettingsUpdateProperties struct { 7914 // Resource - The standard JSON format of a resource throughput 7915 Resource *ThroughputSettingsResource `json:"resource,omitempty"` 7916} 7917 7918// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource 7919// which has 'tags' and a 'location' 7920type TrackedResource struct { 7921 // Tags - Resource tags. 7922 Tags map[string]*string `json:"tags"` 7923 // Location - The geo-location where the resource lives 7924 Location *string `json:"location,omitempty"` 7925 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 7926 ID *string `json:"id,omitempty"` 7927 // Name - READ-ONLY; The name of the resource 7928 Name *string `json:"name,omitempty"` 7929 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 7930 Type *string `json:"type,omitempty"` 7931} 7932 7933// MarshalJSON is the custom marshaler for TrackedResource. 7934func (tr TrackedResource) MarshalJSON() ([]byte, error) { 7935 objectMap := make(map[string]interface{}) 7936 if tr.Tags != nil { 7937 objectMap["tags"] = tr.Tags 7938 } 7939 if tr.Location != nil { 7940 objectMap["location"] = tr.Location 7941 } 7942 return json.Marshal(objectMap) 7943} 7944 7945// UniqueKey the unique key on that enforces uniqueness constraint on documents in the collection in the 7946// Azure Cosmos DB service. 7947type UniqueKey struct { 7948 // Paths - List of paths must be unique for each document in the Azure Cosmos DB service 7949 Paths *[]string `json:"paths,omitempty"` 7950} 7951 7952// UniqueKeyPolicy the unique key policy configuration for specifying uniqueness constraints on documents 7953// in the collection in the Azure Cosmos DB service. 7954type UniqueKeyPolicy struct { 7955 // UniqueKeys - List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. 7956 UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"` 7957} 7958 7959// Usage the usage data for a usage request. 7960type Usage struct { 7961 // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' 7962 Unit UnitType `json:"unit,omitempty"` 7963 // Name - READ-ONLY; The name information for the metric. 7964 Name *MetricName `json:"name,omitempty"` 7965 // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. 7966 QuotaPeriod *string `json:"quotaPeriod,omitempty"` 7967 // Limit - READ-ONLY; Maximum value for this metric 7968 Limit *int64 `json:"limit,omitempty"` 7969 // CurrentValue - READ-ONLY; Current value for this metric 7970 CurrentValue *int64 `json:"currentValue,omitempty"` 7971} 7972 7973// MarshalJSON is the custom marshaler for Usage. 7974func (u Usage) MarshalJSON() ([]byte, error) { 7975 objectMap := make(map[string]interface{}) 7976 if u.Unit != "" { 7977 objectMap["unit"] = u.Unit 7978 } 7979 return json.Marshal(objectMap) 7980} 7981 7982// UsagesResult the response to a list usage request. 7983type UsagesResult struct { 7984 autorest.Response `json:"-"` 7985 // Value - READ-ONLY; The list of usages for the database. A usage is a point in time metric 7986 Value *[]Usage `json:"value,omitempty"` 7987} 7988 7989// MarshalJSON is the custom marshaler for UsagesResult. 7990func (ur UsagesResult) MarshalJSON() ([]byte, error) { 7991 objectMap := make(map[string]interface{}) 7992 return json.Marshal(objectMap) 7993} 7994 7995// VirtualNetworkRule virtual Network ACL Rule object 7996type VirtualNetworkRule struct { 7997 // ID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. 7998 ID *string `json:"id,omitempty"` 7999 // IgnoreMissingVNetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. 8000 IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"` 8001} 8002