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